/* Page */
body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #e0e0e0;
}

.container {
  max-width: 960px;
  padding: 0 24px;
}

/* Header */
.header-row {
  margin-top: 3%;
  text-align: center;
  position: relative;
}

.header-nav {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 16px;
}

.nav-link {
  color: #a0b0c0;
  font-size: 1.4rem;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover {
  color: #f5c842;
}

.header-row h4 {
  margin-bottom: 0;
  color: #f5c842;
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.tagline {
  color: #a0b0c0;
  font-size: 1.8rem;
  margin-top: 0.4rem;
}

/* Audio player */
#bird-song-section {
  text-align: center;
  margin-top: 2.5rem;
}

#bird-song-section audio {
  width: 100%;
  max-width: 500px;
  border-radius: 30px;
}

#bird-song-section p {
  color: #c0c8d4;
  margin-top: 1rem;
  font-size: 1.8rem;
}

.sound-credit {
  font-size: 1.2rem !important;
  color: #7a8a9a !important;
  margin-top: 0.3rem !important;
}

/* Guess indicator dots */
.guess-indicator {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0 0.5rem;
}

.guess-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #5a6a7a;
  background: transparent;
  display: inline-block;
  transition: all 0.3s ease;
}

.guess-dot.used {
  background: #e74c3c;
  border-color: #e74c3c;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

.guess-dot.correct {
  background: #27ae60;
  border-color: #27ae60;
  box-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
}

.guesses-remaining-text {
  text-align: center;
  font-size: 1.6rem;
  color: #8090a0;
  margin-bottom: 1.5rem;
}

/* Multiple choice buttons */
.choices-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 1.5rem;
}

.choice-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #e8ecf0;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: auto;
  line-height: normal;
  letter-spacing: normal;
  text-transform: none;
}

.choice-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.choice-label {
  padding: 12px 8px 4px;
  font-size: 2rem;
  font-weight: 600;
  display: block;
  width: 100%;
  color: #e8ecf0;
}

.choice-credit {
  font-size: 1.1rem;
  color: #7a8a9a;
  padding: 0 8px 10px;
  display: block;
  width: 100%;
}

.choice-btn:hover:not(:disabled) {
  background: rgba(245, 200, 66, 0.15);
  border-color: #f5c842;
  color: #f5c842;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.choice-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.choice-btn.correct {
  background: rgba(39, 174, 96, 0.3);
  border-color: #27ae60;
  color: #2ecc71;
  opacity: 1;
}

.choice-btn.wrong {
  background: rgba(231, 76, 60, 0.15);
  border-color: #e74c3c;
  color: #e74c3c;
  animation: shake 0.4s ease;
  opacity: 0.4;
  pointer-events: none;
}

.choice-btn.wrong .choice-img {
  filter: grayscale(100%) brightness(0.5);
}

.choice-btn.wrong .choice-label {
  text-decoration: line-through;
  color: #e74c3c;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Incorrect guess */
.incorrect-guess {
  color: #e74c3c;
  font-weight: bold;
  text-align: center;
  font-size: 1.8rem;
}

.incorrect-guess.flash {
  animation: flash-red 0.5s ease;
}

@keyframes flash-red {
  0% { color: #e74c3c; transform: scale(1); }
  50% { color: #ff6b6b; transform: scale(1.05); }
  100% { color: #e74c3c; transform: scale(1); }
}

/* Guess section */
#guess-section {
  text-align: center;
}

/* Results (correct and game over) */
.bird-image {
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.result-section {
  text-align: center;
}

.image-credit {
  font-size: 1.3rem;
  color: #7a8a9a;
  margin-bottom: 1rem;
}

.result-message {
  font-size: 2.2rem;
  margin: 1rem 0;
}

.success-message {
  color: #2ecc71;
  font-weight: bold;
}

.fail-message {
  color: #e74c3c;
}

/* Bird fact */
.bird-fact {
  font-style: italic;
  color: #c0c8d4;
  font-size: 1.8rem;
  margin: 0.5rem 0 1rem;
}

/* Share / stats buttons */
.share-btn {
  margin-top: 1rem;
  background: #f5c842;
  border-color: #f5c842;
  color: #1a1a2e;
  font-weight: 600;
  border-radius: 8px;
  font-size: 1.6rem;
  padding: 10px 30px;
  height: auto;
  cursor: pointer;
}

.share-btn:hover {
  background: #f0b820;
  border-color: #f0b820;
}

.stats-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #c0c8d4;
  margin-left: 8px;
}

.stats-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #e8ecf0;
}

/* "Come back tomorrow" text */
.result-section p {
  color: #a0b0c0;
  font-size: 1.6rem;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  position: relative;
  color: #e0e0e0;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  background: none;
  border: none;
  color: #8090a0;
  font-size: 2.4rem;
  cursor: pointer;
  height: auto;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #e0e0e0;
}

.modal-content h5 {
  color: #f5c842;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  color: #8090a0;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}

/* Auth modal */
.code-input {
  text-align: center;
  font-size: 2.4rem !important;
  letter-spacing: 8px;
}

.auth-error {
  color: #e74c3c;
  font-size: 1.3rem;
  margin-top: 1rem;
}

.modal-content input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}

.modal-content input:focus {
  border-color: #f5c842;
}

.modal-content .button-primary {
  background: #f5c842;
  border-color: #f5c842;
  color: #1a1a2e;
  height: auto;
  padding: 10px;
  font-size: 1.6rem;
}

.modal-content .button-primary:hover {
  background: #f0b820;
}

/* Stats modal */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 2rem;
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 2.8rem;
  font-weight: 700;
  color: #f5c842;
}

.stat-label {
  font-size: 1.2rem;
  color: #8090a0;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.dist-num {
  font-size: 1.4rem;
  width: 16px;
  text-align: right;
  color: #a0b0c0;
}

.dist-bar {
  background: #f5c842;
  color: #1a1a2e;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 24px;
  text-align: right;
}

.modal-content h6 {
  color: #c0c8d4;
  margin-bottom: 0.5rem;
}

.modal-wide {
  max-width: 640px;
}

/* Donation banner */
.donation-section {
  text-align: center;
  margin-top: 2rem;
}

.donation-total {
  color: #2ecc71;
  font-size: 2rem;
  font-weight: 700;
}

/* Help birds CTA */
.help-birds-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.help-birds-cta {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.help-birds-cta h6 {
  color: #f5c842;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.help-birds-cta p {
  color: #a0b0c0;
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.help-birds-cta a {
  color: #f5c842;
}

.help-birds-note {
  font-size: 1.2rem !important;
  color: #7a8a9a !important;
  font-style: italic;
}

/* Past puzzles list */
.past-puzzles-list {
  max-height: 400px;
  overflow-y: auto;
}

.past-puzzle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.past-date {
  color: #a0b0c0;
  font-size: 1.3rem;
  min-width: 100px;
}

.past-result {
  color: #e0e0e0;
  font-size: 1.3rem;
  flex: 1;
  text-align: center;
}

.past-result.unplayed {
  color: #7a8a9a;
  font-style: italic;
}

.past-action-btn {
  background: rgba(245, 200, 66, 0.15);
  border: 1px solid #f5c842;
  color: #f5c842;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  height: auto;
  line-height: normal;
}

.past-action-btn:hover {
  background: rgba(245, 200, 66, 0.3);
}

/* Replay */
.replay-grid {
  pointer-events: none;
}

.replay-status {
  text-align: center;
  margin-top: 1rem;
  font-size: 1.6rem;
  color: #c0c8d4;
  min-height: 40px;
}

.replay-choice {
  transition: all 0.3s ease;
}

/* Hide utility */
.hide {
  display: none;
}

/* Responsive */
@media (max-width: 550px) {
  .header-row {
    margin-top: 10%;
  }

  .header-row h4 {
    font-size: 3.2rem;
  }

  .header-nav {
    position: relative;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
  }

  .result-message {
    font-size: 1.8rem;
  }

  .choices-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
