/**
 * Games Page Styles
 */

/* ============================================
   This Day in History Card
   ============================================ */
.this-day-card {
  border-left: 4px solid var(--ttd-gold);
}

.this-day-date {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ttd-burgundy);
  margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .this-day-date {
  color: var(--ttd-gold);
}

.this-day-subtitle {
  font-size: 0.85rem;
  color: var(--ttd-muted);
  margin-bottom: 1.5rem;
}

.this-day-meals {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.this-day-meal {
  padding: 1rem;
  background: var(--ttd-cream);
  border-radius: 0.5rem;
}

[data-bs-theme="dark"] .this-day-meal {
  background: rgba(201, 162, 39, 0.1);
}

.this-day-meal h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .this-day-meal h4 {
  color: var(--ttd-gold);
}

.this-day-dishes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.this-day-dish {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  background: var(--ttd-card-bg);
  border: 1px solid var(--ttd-card-border);
  border-radius: 0.25rem;
}

.this-day-no-data {
  text-align: center;
  padding: 2rem;
  color: var(--ttd-muted);
}

.this-day-no-data p {
  margin-bottom: 0.5rem;
}

.this-day-volume-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.volume-kew {
  background: rgba(114, 47, 55, 0.15);
  color: var(--ttd-burgundy);
}

.volume-carlton {
  background: rgba(201, 162, 39, 0.2);
  color: #8b6914;
}

[data-bs-theme="dark"] .volume-kew {
  background: rgba(114, 47, 55, 0.3);
  color: #e8a0a8;
}

[data-bs-theme="dark"] .volume-carlton {
  background: rgba(201, 162, 39, 0.3);
  color: var(--ttd-gold);
}

/* ============================================
   Game Cards
   ============================================ */
.game-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.game-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
}

.game-card.coming-soon:hover {
  transform: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.game-icon {
  color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .game-icon {
  color: var(--ttd-gold);
}

.game-title {
  color: var(--ttd-burgundy);
  margin-bottom: 0.75rem;
}

[data-bs-theme="dark"] .game-title {
  color: var(--ttd-gold);
}

.game-description {
  font-size: 0.9rem;
  color: var(--ttd-muted);
  margin-bottom: 1rem;
}

/* ============================================
   Game Modal
   ============================================ */
#gameModal .modal-content {
  background: var(--ttd-card-bg);
  border: 1px solid var(--ttd-card-border);
}

#gameModal .modal-header {
  border-bottom-color: var(--ttd-card-border);
}

#gameModal .modal-footer {
  border-top-color: var(--ttd-card-border);
}

/* ============================================
   Guess the Household Game
   ============================================ */
.household-game {
  text-align: center;
}

.household-score {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--ttd-cream);
  border-radius: 0.5rem;
}

[data-bs-theme="dark"] .household-score {
  background: rgba(0,0,0,0.2);
}

.household-score-item {
  text-align: center;
}

.household-score-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ttd-burgundy);
  line-height: 1;
}

[data-bs-theme="dark"] .household-score-value {
  color: var(--ttd-gold);
}

.household-score-label {
  font-size: 0.75rem;
  color: var(--ttd-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.household-question {
  margin-bottom: 1.5rem;
}

.household-question-number {
  font-size: 0.8rem;
  color: var(--ttd-muted);
  margin-bottom: 0.5rem;
}

.household-menu {
  background: var(--ttd-cream);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .household-menu {
  background: rgba(0,0,0,0.2);
}

.household-menu h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .household-menu h4 {
  color: var(--ttd-gold);
}

.household-menu-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.household-menu-item {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  background: var(--ttd-card-bg);
  border: 1px solid var(--ttd-card-border);
  border-radius: 0.25rem;
}

.household-menu-item.dish-both-places {
  background: rgba(201, 162, 39, 0.15);
  border-color: var(--ttd-gold);
  font-style: italic;
}

.household-choices {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.household-choice {
  flex: 1;
  min-width: 150px;
  max-width: 200px;
  padding: 1.5rem 1rem;
  border: 2px solid var(--ttd-card-border);
  border-radius: 0.5rem;
  background: var(--ttd-card-bg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.household-choice:hover {
  border-color: var(--ttd-burgundy);
  background: rgba(114, 47, 55, 0.05);
}

[data-bs-theme="dark"] .household-choice:hover {
  border-color: var(--ttd-gold);
  background: rgba(201, 162, 39, 0.1);
}

.household-choice.correct {
  border-color: #198754;
  background: rgba(25, 135, 84, 0.1);
}

.household-choice.incorrect {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.household-choice.disabled {
  pointer-events: none;
}

.household-choice h5 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.household-choice p {
  font-size: 0.75rem;
  color: var(--ttd-muted);
  margin: 0;
}

.household-feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  display: none;
}

.household-feedback.show {
  display: block;
}

.household-feedback.correct {
  background: rgba(25, 135, 84, 0.1);
  border: 1px solid rgba(25, 135, 84, 0.3);
}

.household-feedback.incorrect {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.household-feedback h5 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.household-feedback p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.household-next {
  margin-top: 1rem;
  display: none;
}

.household-next.show {
  display: inline-block;
}

/* ============================================
   Trivia Game
   ============================================ */
.trivia-game {
  text-align: center;
}

.trivia-progress {
  margin-bottom: 1.5rem;
}

.trivia-progress-bar {
  height: 8px;
  background: var(--ttd-card-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.trivia-progress-fill {
  height: 100%;
  background: var(--ttd-burgundy);
  transition: width 0.3s ease;
}

[data-bs-theme="dark"] .trivia-progress-fill {
  background: var(--ttd-gold);
}

.trivia-progress-text {
  font-size: 0.8rem;
  color: var(--ttd-muted);
}

.trivia-question {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.trivia-answers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.trivia-answer {
  padding: 1rem;
  border: 2px solid var(--ttd-card-border);
  border-radius: 0.5rem;
  background: var(--ttd-card-bg);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.trivia-answer:hover {
  border-color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .trivia-answer:hover {
  border-color: var(--ttd-gold);
}

.trivia-answer.correct {
  border-color: #198754;
  background: rgba(25, 135, 84, 0.1);
}

.trivia-answer.incorrect {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.trivia-answer.disabled {
  pointer-events: none;
}

.trivia-result {
  padding: 2rem;
}

.trivia-result h3 {
  margin-bottom: 1rem;
}

.trivia-final-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--ttd-burgundy);
  margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .trivia-final-score {
  color: var(--ttd-gold);
}

/* ============================================
   Memory Game
   ============================================ */
.memory-game {
  text-align: center;
}

.memory-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.memory-stat {
  text-align: center;
}

.memory-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .memory-stat-value {
  color: var(--ttd-gold);
}

.memory-stat-label {
  font-size: 0.7rem;
  color: var(--ttd-muted);
  text-transform: uppercase;
}

.memory-difficulty {
  margin-bottom: 1.5rem;
}

.memory-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 600px;
  margin: 0 auto;
}

.memory-grid.size-8 {
  grid-template-columns: repeat(4, 1fr);
}

.memory-grid.size-12 {
  grid-template-columns: repeat(4, 1fr);
}

.memory-grid.size-16 {
  grid-template-columns: repeat(4, 1fr);
}

.memory-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
}

.memory-card-front {
  background: var(--ttd-burgundy);
  color: #fff;
}

[data-bs-theme="dark"] .memory-card-front {
  background: var(--ttd-gold);
  color: #1a1410;
}

.memory-card-back {
  background: var(--ttd-cream);
  border: 2px solid var(--ttd-card-border);
  transform: rotateY(180deg);
  color: var(--ttd-brown);
}

[data-bs-theme="dark"] .memory-card-back {
  background: rgba(201, 162, 39, 0.15);
  color: var(--ttd-gold);
}

.memory-card.matched .memory-card-back {
  background: rgba(25, 135, 84, 0.15);
  border-color: #198754;
}

.memory-win-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  background: var(--ttd-cream);
  border-radius: 0.5rem;
  border: 2px solid var(--ttd-gold);
}

[data-bs-theme="dark"] .memory-win-message {
  background: rgba(201, 162, 39, 0.15);
}

.memory-win-message h3 {
  color: var(--ttd-burgundy);
  margin-bottom: 1rem;
}

[data-bs-theme="dark"] .memory-win-message h3 {
  color: var(--ttd-gold);
}

.memory-win-score {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.memory-win-rating {
  color: var(--ttd-muted);
  font-style: italic;
}

/* ============================================
   Build a Feast Game
   ============================================ */
.feast-game {
  text-align: center;
}

.feast-scenario {
  background: var(--ttd-cream);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .feast-scenario {
  background: rgba(0,0,0,0.2);
}

.feast-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.feast-requirement {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  background: var(--ttd-card-bg);
  border: 1px solid var(--ttd-card-border);
  border-radius: 1rem;
}

.feast-requirement.met {
  background: rgba(25, 135, 84, 0.1);
  border-color: #198754;
  color: #198754;
}

.feast-menu-builder {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.feast-available,
.feast-selected {
  flex: 1;
  min-width: 280px;
}

.feast-section-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ttd-gold);
}

.feast-dishes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.feast-dish {
  padding: 0.75rem;
  background: var(--ttd-card-bg);
  border: 1px solid var(--ttd-card-border);
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.feast-dish:hover {
  border-color: var(--ttd-burgundy);
}

.feast-dish .dish-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.feast-dish .dish-meta {
  font-size: 0.75rem;
  color: var(--ttd-muted);
}

.feast-submit {
  margin-top: 1.5rem;
}

.feast-message {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.feast-message-warning {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: #856404;
}

[data-bs-theme="dark"] .feast-message-warning {
  color: #ffc107;
}

.feast-result {
  text-align: center;
  padding: 1rem;
}

.feast-result h3 {
  margin-bottom: 1rem;
  color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .feast-result h3 {
  color: var(--ttd-gold);
}

.feast-result-score {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.feast-result-score.perfect {
  color: #198754;
}

.feast-result-score.good {
  color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .feast-result-score.good {
  color: var(--ttd-gold);
}

.feast-result-score.poor {
  color: #dc3545;
}

.feast-result-percentage {
  font-size: 1.25rem;
  color: var(--ttd-muted);
  margin-bottom: 1rem;
}

.feast-result-message {
  margin-bottom: 1.5rem;
}

.feast-result h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.feast-result-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.feast-result-dish {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  background: var(--ttd-cream);
  border: 1px solid var(--ttd-card-border);
  border-radius: 0.25rem;
}

[data-bs-theme="dark"] .feast-result-dish {
  background: rgba(201, 162, 39, 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Timeline Game
   ============================================ */
.timeline-game {
  text-align: center;
}

.timeline-clue {
  background: var(--ttd-cream);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .timeline-clue {
  background: rgba(0,0,0,0.2);
}

.timeline-clue h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.timeline-slider-container {
  max-width: 500px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.timeline-slider {
  width: 100%;
  margin-bottom: 0.5rem;
}

.timeline-year-display {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ttd-burgundy);
  margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .timeline-year-display {
  color: var(--ttd-gold);
}

.timeline-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ttd-muted);
}

/* ============================================
   Detective Game
   ============================================ */
.detective-game {
  text-align: center;
}

.detective-intro {
  padding: 2rem;
}

.detective-badge {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ttd-burgundy);
  margin-bottom: 1rem;
  padding: 0.5rem 1.5rem;
  border: 3px solid var(--ttd-gold);
  border-radius: 0.5rem;
}

[data-bs-theme="dark"] .detective-badge {
  color: var(--ttd-gold);
}

.detective-case {
  text-align: left;
}

.detective-case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.detective-case-number {
  font-size: 0.85rem;
  color: var(--ttd-muted);
  font-weight: 600;
}

.detective-case-title {
  color: var(--ttd-burgundy);
  margin-bottom: 1rem;
}

[data-bs-theme="dark"] .detective-case-title {
  color: var(--ttd-gold);
}

.detective-briefing {
  background: var(--ttd-cream);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--ttd-burgundy);
}

[data-bs-theme="dark"] .detective-briefing {
  background: rgba(0,0,0,0.2);
  border-left-color: var(--ttd-gold);
}

.detective-briefing p {
  margin-bottom: 0;
}

.detective-fictional-tag {
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0.7;
  font-weight: normal;
}

.detective-disclaimer {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  text-align: left;
}

[data-bs-theme="dark"] .detective-disclaimer {
  background: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.5);
}

.detective-search {
  margin-bottom: 1.5rem;
}

.detective-search h5 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.detective-filters {
  background: var(--ttd-card-bg);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ttd-card-border);
}

.detective-results {
  margin-bottom: 1rem;
  max-height: 250px;
  overflow-y: auto;
}

.detective-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detective-result-item {
  padding: 0.75rem;
  background: var(--ttd-card-bg);
  border: 2px solid var(--ttd-card-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.detective-result-item:hover {
  border-color: var(--ttd-burgundy);
}

[data-bs-theme="dark"] .detective-result-item:hover {
  border-color: var(--ttd-gold);
}

.detective-result-item.selected {
  border-color: var(--ttd-burgundy);
  background: rgba(114, 47, 55, 0.1);
}

[data-bs-theme="dark"] .detective-result-item.selected {
  border-color: var(--ttd-gold);
  background: rgba(201, 162, 39, 0.1);
}

.detective-result-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.detective-result-dishes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detective-dish {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--ttd-cream);
  border-radius: 0.25rem;
}

[data-bs-theme="dark"] .detective-dish {
  background: rgba(201, 162, 39, 0.15);
}

.detective-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.detective-feedback {
  display: none;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  text-align: center;
}

.detective-hint {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.5);
  padding: 1rem;
  border-radius: 0.5rem;
}

.detective-success {
  background: rgba(25, 135, 84, 0.1);
  border: 1px solid rgba(25, 135, 84, 0.3);
  padding: 1rem;
  border-radius: 0.5rem;
}

.detective-success h5 {
  color: #198754;
}

.detective-incorrect {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  padding: 1rem;
  border-radius: 0.5rem;
}

.detective-incorrect h5 {
  color: #dc3545;
}

.detective-complete {
  text-align: center;
  padding: 1rem;
}

.detective-complete h3 {
  margin-bottom: 1rem;
}

.detective-final-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--ttd-burgundy);
  margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .detective-final-score {
  color: var(--ttd-gold);
}

.detective-rank {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.detective-case-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.detective-case-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--ttd-card-bg);
  border-radius: 0.375rem;
  border: 1px solid var(--ttd-card-border);
}

.detective-case-item.solved {
  border-color: #198754;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .household-choices {
    flex-direction: column;
    align-items: center;
  }

  .household-choice {
    max-width: 100%;
    width: 100%;
  }

  .memory-grid {
    gap: 0.5rem;
  }

  .memory-card-back {
    font-size: 0.65rem;
  }

  .feast-menu-builder {
    flex-direction: column;
  }
}
