/* Desktop-specific styles */

/* Title screen styling */
#title-screen {
  background: linear-gradient(135deg, var(--primary-light) 10%, var(--primary-dark) 66%);
  color: white;
  text-align: center;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

.title-layout {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  width: 33%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#logo-static,
#logo-glow {
  max-width: 90%;
  height: auto;
  max-height: 90%;
  position: absolute;
}

@media (min-width: 1200px) {
  #logo-static,
  #logo-glow {
    max-height: 550px; /* Fixed height for large screens */
  }
}

@media (min-width: 1600px) {
  #logo-static,
  #logo-glow {
    max-height: 550px; /* Increased fixed height for very large screens */
  }
}

#logo-glow {
  animation: pulseLogo 6s infinite;
}

.title-content {
  width: 67%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#title-screen h1 {
  font-size: 52px;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-style: italic;
  text-align: center;
  width: 100%;
}

#title-screen h2 {
  font-size: 28px;
  margin-bottom: 60px;
  text-align: center;
  width: 100%;
  color: var(--accent-main);
}

#title-screen .button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 33%;
  min-width: 180px;
}

#title-screen button {
  width: 100%;
  padding: 10px 20px;
  font-size: 15px;
  border: none;
  border-radius: 5px;
  background-color: var(--primary-light);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  margin: 3px 0;
  text-align: center;
}

#title-screen button:hover {
  background-color: var(--primary-medium);
  transform: translateY(-2px);
}

#title-screen button.large {
  font-size: 18px;
  padding: 15px 30px;
}

#title-screen button.secondary {
  background-color: var(--primary-lighter);
}

#title-screen button.secondary:hover {
  background-color: var(--primary-light);
}

/* Disabled button styling */
#title-screen button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--primary-lighter);
}

#title-screen button.disabled:hover {
  transform: none;
  background-color: var(--primary-lighter);
}

/* Backstory screen styling */
#backstory-screen {
  background-color: var(--neutral-dark);
  color: var(--warm-medium);
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

#backstory-screen .story-container {
  max-width: 700px;
  margin: 0 auto;
  background-color: var(--neutral-medium);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  border-left: 4px solid var(--accent-main); /* Amber accent border */
}

#backstory-screen h2 {
  font-size: 32px;
  margin-bottom: 20px;
  color: var(--warm-medium);
}

#backstory-screen p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: left;
}

/* Book of Passage screen styling */
#book-of-passage-screen {
  background-color: var(--neutral-dark);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

.book-container {
  width: 70%;
  max-width: 800px;
  aspect-ratio: 4/3;
  background-color: var(--warm-medium);
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  padding: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  color: #2c2240;
  overflow: hidden; /* Ensures content doesn't spill out */
  margin-bottom: 20px; /* Add space between container and button */
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background-color: var(--primary-medium);
  border-radius: 10px 0 0 10px;
  z-index: 1; /* Ensure spine appears above content */
}

.book-pages {
  width: 100%;
  height: 100%;
  overflow-y: auto; /* Enable vertical scrolling */
  padding-left: 50px; /* Space for spine */
  position: relative;
  z-index: 0;
  box-sizing: border-box; /* Include padding in width/height calculations */
}

/* Ensure scrollbars appear correctly across browsers */
.book-pages::-webkit-scrollbar {
  width: 8px;
  background-color: var(--warm-light);
}

.book-pages::-webkit-scrollbar-thumb {
  background-color: var(--primary-light);
  border-radius: 4px;
}

.book-pages::-webkit-scrollbar-track {
  background-color: var(--warm-light);
  border-radius: 4px;
}

.book-pages h2 {
  font-size: 28px;
  color: var(--primary-medium);
  margin-bottom: 20px;
  text-align: center;
}

.book-pages p {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
  line-height: 1.5;
  text-align: left;
  max-width: 100%;
}

.progress-section {
  margin-top: 30px;
  padding: 20px;
  background-color: var(--warm-light);
  border-radius: 10px;
}

.progress-section h3 {
  color: var(--primary-medium);
  margin-bottom: 15px;
}

/* Book progress styling */
.book-progress-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.book-progress-list li {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--warm-light);
}

.book-progress-list li.book-complete {
  background-color: var(--warm-light); /* Changed to match incomplete books */
  border-left: 4px solid var(--accent-main); /* Amber accent for completed books */
}

.book-progress-list li.book-in-progress {
  border-left: 4px solid var(--primary-light);
}

.book-progress-list li.has-uncompleted-puzzle {
  /* Subtle indicator that this book has an uncompleted puzzle */
  border-bottom: 2px dashed var(--accent-light);
}

.book-parts-progress {
  display: flex;
  margin-top: 8px;
  gap: 5px;
}

.story-part {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.story-part.complete {
  background-color: var(--accent-main); /* Main amber for completed parts */
}

.story-part.incomplete {
  background-color: #ccc; /* Grey for never attempted parts */
  color: #666;
}

.story-part.in-progress {
  background-color: var(--accent-light); /* Lighter amber for in-progress part */
  box-shadow: 0 0 5px var(--accent-light); /* Glow effect */
  position: relative;
}

.story-part.in-progress::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border: 2px solid var(--accent-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.progress-section h4 {
  margin-top: 20px;
  color: var(--primary-medium);
  font-size: 18px;
}

/* Puzzle screen layout */
#puzzle-screen {
  background-color: var(--neutral-dark);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Making sure puzzle content takes appropriate width */
#puzzle-screen .book-title,
#puzzle-screen .timer-container,
#puzzle-screen .game-area,
#puzzle-screen .controls {
  width: 100%;
  max-width: 1000px;
}

/* Header */
.book-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 20px;
  color: var(--warm-medium);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Game sections */
.game-area {
  display: flex;
  margin-bottom: 20px;
}

.story-container {
  flex: 1;
  padding: 15px;
  margin-right: 20px;
  border-right: 1px solid var(--warm-dark);
  max-height: 500px;
  overflow-y: auto;
  background-color: var(--warm-medium);
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}

.story-content {
  line-height: 1.6;
  font-size: 16px;
  color: #333;
}

.grid-container {
  flex: 2;
  margin-right: 20px;
}

.words-container {
  flex: 1;
  background-color: var(--warm-medium);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}

/* Word list styling */
.word-list {
  list-style-type: none;
  padding: 0;
}

.word-list li {
  padding: 8px;
  border-bottom: 1px solid var(--warm-dark);
  color: #333;
}

.word-list li.found {
  text-decoration: line-through;
  color: var(--accent-dark); /* Amber accent for found words */
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* Library Screen styling */
#library-screen {
  background-color: var(--neutral-dark);
  color: var(--warm-light);
  text-align: center;
  flex-direction: column;
  justify-content: center; /* Center content vertically */
  align-items: center;
  height: 100vh;
  padding: 20px;
}

#library-screen.active {
  display: flex;
}

/* Screen title styling */
.screen-title {
  font-size: 36px;
  color: var(--accent-main);
  margin-bottom: 20px;
  text-shadow: 0 0 15px rgba(230, 168, 23, 0.3);
}

/* Library container */
.library-container {
  box-sizing: border-box; /* Force consistent box model */
  width: 100%;
  max-width: 900px;
  padding-left: 0;
  padding-right: 0;
  margin-left: auto;
  margin-right: auto; 
  height: 65%;
  background: rgba(77, 35, 97, 0.5); /* Temporary to see container */
  border-radius: 10px;
  position: relative;
}

/* Main library navigation panel */
.main-library-nav-panel {
  width: 100%;
  max-width: 900px;
  padding: 0px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(77, 35, 97, 0.95);
  border-radius: 10px;
  border-top: 3px solid var(--accent-main);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  row-gap: 0px;
  column-gap: 15px;
}

.nav-button {
  background: rgba(230, 168, 23, 0.2);
  color: var(--accent-main);
  border: 2px solid var(--accent-main);
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-family: serif;
}

.nav-button:hover {
  background: var(--accent-main);
  color: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(230, 168, 23, 0.4);
}

/* Make active buttons stand out */
.nav-button.active {
  background: var(--accent-main);
  color: var(--primary-dark);
}

/* Genre panel overlay */
.panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(35, 31, 32, 0.7);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 100;
}

/* Panel content container */
.panel-content {
  background: rgba(77, 35, 97, 0.95);
  border: 3px solid var(--accent-main);
  border-radius: 15px;
  padding: 30px;
  max-width: 800px;
  width: 90%;
}

/* Panel title */
.panel-title {
  color: var(--accent-main);
  font-size: 28px;
  margin-bottom: 30px;
  text-align: center;
  font-family: serif;
}

/* Generic genre container - empty for now */
.genre-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* Genre container close button */
.panel-close {
  background: rgba(230, 168, 23, 0.2);
  color: var(--accent-main);
  border: 2px solid var(--accent-main);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-family: serif;
  display: block;
  margin: 20px auto 0;
}

.panel-close:hover {
  background: var(--accent-main);
  color: var(--primary-dark);
  transform: scale(1.05);
}

/* Genre Card Styling */
.genre-card {
  position: relative;
  width: 180px;
  height: 240px;
  background: rgba(35, 31, 32, 0.7);
  border: 2px solid var(--accent-main);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}

.genre-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 30px rgba(230, 168, 23, 0.4);
}

.card-content {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}