/* Mahjong Trainer - You & AI Brand Styles */

:root {
  /* YAI Brand Colors */
  --navy: #0B132B;
  --dark-navy: #1F4068;
  --blue: #3A7CA5;
  --light-blue: #A9C6D9;
  --light-bg: #F4F5F7;
  --gold: #E6A850;
  --white: #FFFFFF;
  --teal: #3D7573;
  --coral: #E8845F;
  --warm-gray: #A89B8E;

  /* Tile colors (keep distinct for readability) */
  --tile-bg: #f5f0e6;
  --tile-border: #8b7355;
  --tile-shadow: rgba(0, 0, 0, 0.3);
  --dots-color: #2563eb;
  --bams-color: #16a34a;
  --cracks-color: #dc2626;
  --dragon-red: #dc2626;
  --dragon-green: #16a34a;
  --wind-color: #1e3a5f;
  --flower-color: #9333ea;
  --joker-color: #ea580c;

  /* Semantic mappings */
  --bg-color: var(--navy);
  --text-color: var(--white);
  --card-bg: var(--dark-navy);
  --accent: var(--blue);
  --accent-hover: #4A8CB5;
  --success: var(--teal);
  --error: var(--coral);
  --muted: var(--light-blue);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  padding: 20px;
}

h1, h2, h3 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-weight: 700;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

header p {
  color: var(--light-blue);
  font-size: 0.95rem;
}

.clear-progress-btn {
  margin-top: 12px;
  background: transparent;
  border: 1px solid var(--light-blue);
  color: var(--light-blue);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.clear-progress-btn:hover {
  background: var(--dark-navy);
  border-color: var(--coral);
  color: var(--coral);
}

/* Navigation */
nav {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

nav button {
  background: var(--card-bg);
  border: 1px solid var(--blue);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

nav button:hover {
  background: var(--blue);
}

nav button.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* Four Nav Tiles Container */
.nav-tiles {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .nav-tiles {
    flex-wrap: nowrap;
  }
}

/* Collapsible Nav - Ornamental Tile Style */
.collapsible-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.collapsible-toggle {
  background: linear-gradient(135deg, var(--light-bg) 0%, var(--light-blue) 100%);
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    2px 2px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.5);
  transition: all 0.2s;
}

.collapsible-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    3px 3px 6px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

.collapsible-toggle.active {
  background: linear-gradient(135deg, var(--light-blue) 0%, #8AB5CC 100%);
}

.collapsible-icon {
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.start-nav .collapsible-icon {
  color: var(--teal);
}

.build-nav .collapsible-icon {
  color: var(--gold);
}

.read-hand-nav .collapsible-icon {
  color: var(--coral);
}

.move-nav .collapsible-icon {
  color: var(--blue);
}

.board-nav .collapsible-icon {
  color: var(--dark-navy);
}

.host-nav .collapsible-icon {
  color: var(--blue);
}

.mandarin-nav .collapsible-icon {
  color: var(--coral);
}

.collapsible-label {
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 500;
}

.collapsible-arrow {
  font-size: 0.7rem;
  color: var(--dark-navy);
  transition: transform 0.3s;
}

.collapsible-toggle.active .collapsible-arrow {
  transform: rotate(180deg);
}

.collapsible-buttons {
  display: none;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(31, 64, 104, 0.9);
  border-radius: 8px;
  border: 1px solid var(--blue);
}

.collapsible-buttons.open {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  animation: slideDown 0.2s ease-out;
}

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

.collapsible-buttons button {
  background: var(--navy);
  border: 1px solid var(--light-blue);
  color: var(--light-blue);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.collapsible-buttons button:hover {
  background: var(--blue);
  color: var(--white);
}

.start-nav .collapsible-buttons button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.build-nav .collapsible-buttons button.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.read-hand-nav .collapsible-buttons button.active {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
}

.move-nav .collapsible-buttons button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.board-nav .collapsible-buttons button.active {
  background: var(--dark-navy);
  border-color: var(--dark-navy);
  color: white;
}

.host-nav .collapsible-buttons button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.mandarin-nav .collapsible-buttons button.active {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
}

.collapsible-optional {
  display: block;
  font-size: 0.65rem;
  color: var(--light-blue);
  font-style: italic;
  font-weight: 400;
  margin-top: 4px;
  text-align: center;
  max-width: 150px;
  line-height: 1.3;
}

/* Objective Section */
.objective-hero {
  background: var(--dark-navy);
  border: 1px solid var(--blue);
  border-radius: 12px;
  padding: 28px;
  margin: 20px 0;
}

.objective-main {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--white);
  margin-bottom: 20px;
  text-align: center;
}

.objective-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.objective-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--light-blue);
  font-size: 0.95rem;
}

.objective-icon {
  flex-shrink: 0;
}

.objective-next-link {
  display: block;
  text-align: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--dark-navy));
  padding: 16px 24px;
  border-radius: 8px;
  margin-top: 24px;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(58, 124, 165, 0.3);
}

.objective-next-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 124, 165, 0.4);
}

.section-next-link {
  display: block;
  text-align: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--dark-navy));
  padding: 16px 24px;
  border-radius: 8px;
  margin-top: 32px;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(58, 124, 165, 0.3);
}

.section-next-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 124, 165, 0.4);
}

/* Rules Link Box */
.rules-link-box {
  background: var(--dark-navy);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
  text-align: center;
}

.rules-link-box p {
  color: var(--light-blue);
  margin: 0;
}

.rules-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.rules-link:hover {
  text-decoration: underline;
}

/* Mandarin Note */
.mandarin-note {
  background: rgba(220, 38, 38, 0.1);
  border-left: 3px solid #dc2626;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
  color: #fca5a5;
  font-style: italic;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--dark-navy);
  color: var(--light-blue);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 6px 0;
  line-height: 1.5;
}

.site-footer a {
  color: var(--light-blue);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
}

.footer-logo {
  height: 36px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.2s;
  vertical-align: middle;
}

.footer-logo:hover {
  opacity: 1;
}

/* Scoring Section */
.scoring-note {
  background: rgba(120, 113, 108, 0.2);
  border: 1px solid #57534e;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 24px;
}

.scoring-note p {
  color: var(--light-blue);
  margin: 0;
  line-height: 1.5;
}

.scoring-group {
  margin-bottom: 28px;
}

.scoring-group h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--white);
  font-weight: 600;
  border-bottom: 1px solid var(--dark-navy);
  padding-bottom: 8px;
}

.scoring-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.scoring-card {
  background: rgba(68, 64, 60, 0.3);
  border: 1px solid var(--dark-navy);
  border-radius: 8px;
  overflow: hidden;
}

.scoring-card-header {
  background: var(--dark-navy);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--white);
}

.scoring-card-body {
  padding: 14px;
  color: var(--light-blue);
  line-height: 1.5;
}

.payment-table {
  background: rgba(68, 64, 60, 0.3);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.payment-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dark-navy);
  color: var(--light-blue);
  font-size: 0.9rem;
}

.payment-row:last-child {
  border-bottom: none;
}

.payment-row.header {
  background: var(--dark-navy);
  font-weight: 600;
  color: var(--white);
}

.payment-row span strong {
  color: var(--white);
}

.scoring-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scoring-item {
  background: rgba(68, 64, 60, 0.3);
  border-left: 3px solid #3b82f6;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

.scoring-item-name {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.scoring-item-desc {
  color: var(--light-blue);
  font-size: 0.9rem;
  line-height: 1.5;
}

.scoring-bullets {
  color: var(--light-blue);
  margin: 12px 0;
  padding-left: 24px;
  line-height: 1.8;
}

.scoring-bullets li {
  margin-bottom: 6px;
}

/* The Deal Section */
.deal-group {
  margin-bottom: 28px;
}

.deal-group h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--white);
  font-weight: 600;
  border-bottom: 1px solid var(--dark-navy);
  padding-bottom: 8px;
}

.deal-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deal-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(68, 64, 60, 0.3);
  padding: 14px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--blue);
}

.deal-step-num {
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.deal-step-content {
  color: var(--light-blue);
  line-height: 1.5;
}

.deal-step-content strong {
  color: var(--white);
}

/* Charleston Diagram */
.charleston-diagram {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.charleston-round {
  background: rgba(68, 64, 60, 0.3);
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid #16a34a;
}

.charleston-round.optional {
  border-left-color: var(--light-blue);
  opacity: 0.85;
}

.charleston-title {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 12px;
}

.charleston-passes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.charleston-pass {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  padding: 8px 14px;
  border-radius: 6px;
}

.pass-direction {
  font-size: 1.2rem;
  color: #fbbf24;
}

.pass-label {
  color: var(--light-blue);
  font-size: 0.9rem;
}

/* Sections */
section {
  display: none;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
}

section.active {
  display: block;
}

section h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  font-weight: 600;
}

section p {
  color: var(--light-blue);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Tile Base Styles */
.tile {
  background: var(--tile-bg);
  border: 2px solid var(--tile-border);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    2px 2px 4px var(--tile-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: default;
  user-select: none;
  position: relative;
}

/* Tile Sizes */
.tile-small {
  width: 36px;
  height: 48px;
  font-size: 0.7rem;
}

.tile-medium {
  width: 52px;
  height: 70px;
  font-size: 1rem;
}

.tile-large {
  width: 72px;
  height: 96px;
  font-size: 1.3rem;
}

.tile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
}

/* Dots (Circles) */
.dots-grid {
  display: grid;
  gap: 2px;
  padding: 4px;
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--dots-color);
  border-radius: 50%;
  border: 1px solid #1e40af;
}

.tile-large .dot {
  width: 14px;
  height: 14px;
}

.tile-small .dot {
  width: 6px;
  height: 6px;
}

/* Dot layouts */
.dots-1 { grid-template-columns: 1fr; }
.dots-2 { grid-template-columns: repeat(2, 1fr); }
.dots-3 { grid-template-columns: repeat(3, 1fr); }
.dots-4 { grid-template-columns: repeat(2, 1fr); }
.dots-5 { grid-template-columns: repeat(3, 1fr); }
.dots-6 { grid-template-columns: repeat(3, 1fr); }
.dots-7 { grid-template-columns: repeat(3, 1fr); }
.dots-8 { grid-template-columns: repeat(3, 1fr); }
.dots-9 { grid-template-columns: repeat(3, 1fr); }

/* Bams (Bamboo) */
.bams-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  justify-content: center;
  align-items: center;
  padding: 2px;
}

.bam-stick {
  width: 6px;
  height: 20px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--teal));
  border-radius: 2px;
}

.tile-large .bam-stick {
  width: 8px;
  height: 28px;
}

.tile-small .bam-stick {
  width: 4px;
  height: 14px;
}

.bam-bird {
  font-size: 1.5em;
}

.tile-large .bam-bird {
  font-size: 2em;
}

/* Cracks (Characters) */
.cracks {
  color: var(--cracks-color);
  font-weight: bold;
}

.crack-num {
  font-size: 1.2em;
  line-height: 1;
}

.crack-wan {
  font-size: 0.8em;
  line-height: 1;
}

.tile-large .crack-num {
  font-size: 1.6em;
}

.tile-large .crack-wan {
  font-size: 1em;
}

/* Winds */
.wind {
  color: var(--wind-color);
}

.wind-char {
  font-size: 1.4em;
  font-weight: bold;
  line-height: 1;
}

.wind-letter {
  font-size: 0.6em;
  color: #64748b;
  margin-top: 2px;
}

.tile-large .wind-char {
  font-size: 2em;
}

/* Dragons */
.dragon-red .dragon-char {
  color: var(--dragon-red);
  font-size: 1.8em;
  font-weight: bold;
}

.dragon-green .dragon-char {
  color: var(--dragon-green);
  font-size: 1.8em;
  font-weight: bold;
}

.dragon-white .soap-frame {
  width: 70%;
  height: 70%;
  border: 3px solid #94a3b8;
  border-radius: 4px;
}

.tile-large .dragon-char {
  font-size: 2.4em;
}

/* Flowers */
.flower {
  color: var(--flower-color);
}

.flower-icon {
  font-size: 1.4em;
}

.flower-label {
  font-size: 0.6em;
  font-weight: bold;
  color: var(--flower-color);
}

.tile-large .flower-icon {
  font-size: 2em;
}

/* Jokers */
.joker {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 4px;
  margin: 2px;
  padding: 2px;
}

.joker-icon {
  font-size: 1.2em;
}

.joker-label {
  font-size: 0.45em;
  font-weight: bold;
  color: var(--joker-color);
  letter-spacing: 0.5px;
}

.tile-large .joker-icon {
  font-size: 1.6em;
}

.tile-large .joker-label {
  font-size: 0.55em;
}

/* Tile Grid Display */
.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.tile-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tile-group {
  margin-bottom: 24px;
}

.tile-group h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--light-blue);
  font-weight: 500;
}

.tile-hint {
  font-size: 0.85rem;
  color: var(--light-blue);
  margin-bottom: 12px;
  font-style: italic;
}

.hint-red { color: #dc2626; font-style: normal; font-weight: 500; }
.hint-green { color: var(--teal); font-style: normal; font-weight: 500; }
.hint-blue { color: #3b82f6; font-style: normal; font-weight: 500; }

/* Quiz Styles */
.quiz-area {
  text-align: center;
  padding: 20px;
}

.quiz-tile {
  display: inline-block;
  margin: 20px;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.quiz-option {
  background: var(--dark-navy);
  border: 2px solid #57534e;
  color: var(--text-color);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  min-width: 120px;
}

.quiz-option:hover {
  background: #57534e;
  border-color: var(--light-blue);
}

.quiz-option.correct {
  background: var(--teal);
  border-color: var(--teal);
}

.quiz-option.incorrect {
  background: var(--coral);
  border-color: var(--coral);
}

.quiz-feedback {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  font-size: 1.1rem;
}

.quiz-feedback.correct {
  background: rgba(22, 163, 74, 0.2);
  color: var(--teal);
}

.quiz-feedback.incorrect {
  background: rgba(220, 38, 38, 0.2);
  color: var(--coral);
}

/* Learning facts display */
.feedback-result {
  font-weight: 600;
  margin-bottom: 12px;
}

.feedback-value {
  font-size: 0.85rem;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.4;
}

.feedback-value-best {
  background: rgba(22, 163, 74, 0.2);
  color: var(--teal);
}

.feedback-value-good {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.feedback-value-neutral {
  background: rgba(120, 113, 108, 0.2);
  color: var(--light-blue);
}

.feedback-fact {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
  text-align: left;
}

.fact-char-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.fact-char {
  font-size: 2rem;
  text-align: center;
  color: var(--white);
}

.speak-btn {
  background: var(--dark-navy);
  border: 1px solid #57534e;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speak-btn:hover {
  background: #57534e;
  transform: scale(1.1);
}

.speak-btn:active {
  transform: scale(0.95);
}

.fact-pinyin {
  font-size: 1.1rem;
  color: #a78bfa;
  text-align: center;
  margin-bottom: 8px;
  font-style: italic;
}

.fact-meaning {
  color: var(--light-blue);
  font-size: 0.95rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.fact-mnemonic {
  color: #fcd34d;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.4;
}

/* Rules quiz */
.rules-question {
  font-size: 1.3rem;
  color: var(--white);
  margin: 24px 0;
  line-height: 1.5;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.rules-explanation {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  text-align: left;
  color: var(--light-blue);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Strategy section */
.strategy-group {
  margin-bottom: 32px;
}

.strategy-group h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--white);
  border-bottom: 1px solid var(--dark-navy);
  padding-bottom: 8px;
}

.strategy-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid #57534e;
}

.strategy-card.best {
  border-left-color: var(--teal);
}

.strategy-card.good {
  border-left-color: #3b82f6;
}

.strategy-card.neutral {
  border-left-color: #a78bfa;
}

.strategy-header {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--white);
}

.strategy-body {
  color: var(--light-blue);
  font-size: 0.9rem;
  line-height: 1.5;
}

.strategy-body ul {
  margin: 0;
  padding-left: 20px;
}

.strategy-body li {
  margin-bottom: 4px;
}

.strategy-list {
  color: var(--light-blue);
  padding-left: 20px;
  line-height: 1.8;
}

.strategy-list li {
  margin-bottom: 8px;
}

/* Mistake cards */
.mistake-card {
  background: rgba(220, 38, 38, 0.1);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid #dc2626;
}

.mistake-header {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  color: #fca5a5;
}

.mistake-body {
  color: var(--light-blue);
  font-size: 0.9rem;
  line-height: 1.6;
}

.beginner-note {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: #93c5fd;
  font-style: italic;
}

/* Setup steps */
.setup-step {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.step-number {
  background: #7c3aed;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content {
  color: var(--light-blue);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}

.step-content strong {
  color: var(--white);
}

.step-content em {
  color: #a78bfa;
  display: block;
  margin-top: 4px;
}

.wall-diagram {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.wall-label {
  background: var(--dark-navy);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--white);
}

.example-box {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid #7c3aed;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  color: var(--light-blue);
  font-size: 0.9rem;
  line-height: 1.7;
}

.example-box strong {
  color: #a78bfa;
}

.tip-box {
  background: var(--dark-navy);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.6;
}

.tip-box strong {
  color: var(--gold);
}

/* Wall Breaking Visualization */
.wall-viz-container {
  background: rgba(26, 71, 42, 0.5);
  border: 2px solid var(--dark-navy);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.wall-viz {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.wall-table {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  grid-template-rows: 50px 1fr 50px;
  gap: 4px;
  width: 340px;
  height: 340px;
}

.wall-side {
  background: #8b7355;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.wall-side.highlight {
  background: #fbbf24;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.wall-side.counting {
  background: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.wall-side.selected {
  background: var(--teal);
  box-shadow: 0 0 15px rgba(61, 117, 115, 0.6);
}

.wall-north {
  grid-column: 2;
  grid-row: 1;
}

.wall-south {
  grid-column: 2;
  grid-row: 3;
}

.wall-west {
  grid-column: 1;
  grid-row: 2;
}

.wall-east {
  grid-column: 3;
  grid-row: 2;
}

.wall-center {
  grid-column: 2;
  grid-row: 2;
  background: #1a472a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-positions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: 100%;
  height: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--light-blue);
}

.player-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.player-north { grid-column: 2; grid-row: 1; }
.player-west { grid-column: 1; grid-row: 2; }
.player-east { grid-column: 3; grid-row: 2; color: #fbbf24; }
.player-south { grid-column: 2; grid-row: 3; }

.dealer-mark {
  font-size: 0.65rem;
  color: #fbbf24;
}

.dice-area {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.dice {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #1a472a;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.1s;
}

.dice.rolling {
  animation: diceRoll 0.1s infinite;
}

@keyframes diceRoll {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

.wall-label-corner {
  position: absolute;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.wall-north .wall-label-corner,
.wall-south .wall-label-corner {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.wall-west .wall-label-corner,
.wall-east .wall-label-corner {
  writing-mode: vertical-rl;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.wall-stacks {
  display: flex;
  gap: 1px;
  position: absolute;
}

.wall-north .wall-stacks,
.wall-south .wall-stacks {
  flex-direction: row;
  top: 100%;
  left: 0;
  right: 0;
  height: 20px;
  padding: 2px;
}

.wall-south .wall-stacks {
  top: auto;
  bottom: 100%;
}

.wall-west .wall-stacks,
.wall-east .wall-stacks {
  flex-direction: column;
  left: 100%;
  top: 0;
  bottom: 0;
  width: 20px;
  padding: 2px;
}

.wall-east .wall-stacks {
  left: auto;
  right: 100%;
}

.stack {
  background: #d4c4a8;
  border: 1px solid #8b7355;
  border-radius: 2px;
  flex: 1;
  min-width: 12px;
  min-height: 12px;
  transition: all 0.2s;
  position: relative;
}

.stack.counting {
  background: #3b82f6;
  border-color: #2563eb;
}

.stack.break-point {
  background: #dc2626;
  border-color: #b91c1c;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.8);
}

.stack.deal-start {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.8);
}

.stack.end-pile {
  opacity: 0.35;
  background: #6b7280;
  border-color: #4b5563;
}

.wall-side.draw-path {
  animation: pulse-path 1.5s ease-in-out infinite;
}

@keyframes pulse-path {
  0%, 100% { box-shadow: 0 0 5px rgba(22, 163, 74, 0.4); }
  50% { box-shadow: 0 0 15px rgba(22, 163, 74, 0.8); }
}

.stack-number {
  position: absolute;
  font-size: 0.5rem;
  color: #fff;
  text-shadow: 0 0 2px #000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.wall-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.wall-narration {
  background: rgba(68, 64, 60, 0.5);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  min-height: 60px;
}

.wall-narration p {
  color: var(--white);
  line-height: 1.6;
  margin: 0;
}

.wall-narration .highlight-text {
  color: #fbbf24;
  font-weight: 600;
}

.wall-narration .count-text {
  color: #3b82f6;
  font-weight: 600;
}

.wall-narration .break-text {
  color: #dc2626;
  font-weight: 600;
}

.wall-narration .deal-text {
  color: var(--teal);
  font-weight: 600;
}

.wall-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.wall-step-indicator {
  background: var(--dark-navy);
  color: var(--light-blue);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  transition: all 0.3s;
}

.wall-step-indicator.active {
  background: var(--accent);
  color: var(--white);
}

.wall-step-indicator.complete {
  background: #166534;
  color: #86efac;
}

/* Pinyin Quiz */
.pinyin-input-area {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.pinyin-input {
  background: var(--dark-navy);
  border: 2px solid #57534e;
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1.2rem;
  width: 200px;
  text-align: center;
}

.pinyin-input:focus {
  outline: none;
  border-color: #7c3aed;
}

.pinyin-input::placeholder {
  color: var(--light-blue);
}

.hint-btn {
  background: transparent;
  border: 1px solid #57534e;
  color: var(--light-blue);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  margin: 10px 0;
  transition: all 0.2s;
}

.hint-btn:hover {
  background: var(--dark-navy);
  color: var(--white);
}

.hint-btn.used {
  color: #fcd34d;
  border-color: #fcd34d;
}

/* Listening Quiz */
.listening-prompt {
  margin: 20px 0;
}

.play-btn {
  background: #7c3aed;
  border: none;
  color: white;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
}

.play-btn:hover {
  background: #6d28d9;
  transform: scale(1.05);
}

.play-btn:active {
  transform: scale(0.98);
}

.hint-char {
  font-size: 3rem;
  color: #fcd34d;
  margin: 16px 0;
  padding: 16px;
  background: rgba(252, 211, 77, 0.1);
  border-radius: 8px;
  display: inline-block;
}

.listening-inputs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.listening-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.listening-input-group label {
  color: var(--light-blue);
  font-size: 0.9rem;
  width: 70px;
  text-align: right;
}

.listening-input-group .pinyin-input {
  width: 180px;
}

.correct-hint {
  color: var(--teal);
  font-weight: 600;
}

.correction-area .listening-input-group {
  margin-bottom: 10px;
}

.correction-area .listening-input-group label {
  width: 80px;
}

.correction-area {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid #dc2626;
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  max-width: 400px;
}

.correction-area p {
  color: #fca5a5;
  margin-bottom: 12px;
}

.correction-area .pinyin-input {
  width: 100%;
  margin-bottom: 10px;
}

.correct-answer-display {
  font-size: 1.5rem;
  color: var(--teal);
  margin: 10px 0;
  font-weight: 600;
}

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

/* Number Quiz */
.number-instruction {
  color: var(--light-blue);
  margin-bottom: 16px;
}

.number-tiles {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.number-tiles .tile {
  cursor: pointer;
  transition: all 0.2s;
}

.number-tiles .tile:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.number-tiles .tile.selected {
  opacity: 0.3;
  transform: scale(0.95);
  cursor: default;
}

.number-selected {
  margin-top: 20px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  min-height: 80px;
}

.selected-label {
  color: var(--light-blue);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 10px;
}

.selected-tiles {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 50px;
}

.selected-tiles .tile {
  cursor: pointer;
}

.selected-tiles .tile:hover {
  opacity: 0.7;
}

/* Math mode */
.math-problem {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.math-operator {
  font-size: 2rem;
  color: var(--white);
  font-weight: bold;
}

.math-equals {
  font-size: 2rem;
  color: var(--white);
}

.math-question-mark {
  font-size: 2.5rem;
  color: #a78bfa;
  font-weight: bold;
  background: rgba(124, 58, 237, 0.2);
  border: 2px dashed #7c3aed;
  border-radius: 8px;
  width: 60px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.math-answer-section {
  margin-top: 20px;
}

.math-options {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.math-options .tile {
  cursor: pointer;
  transition: all 0.2s;
}

.math-options .tile:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.math-options .tile.correct {
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.8);
}

.math-options .tile.incorrect {
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.8);
  opacity: 0.5;
}

/* History section */
/* Rules - Objective */
.rules-objective {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.15) 0%, rgba(22, 163, 74, 0.05) 100%);
  border: 2px solid #16a34a;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  text-align: center;
}

.rules-objective h3 {
  font-size: 1.2rem;
  color: var(--teal);
  margin-bottom: 12px;
}

.objective-text {
  font-size: 1.1rem;
  color: var(--white);
  line-height: 1.6;
}

/* Rules - Essentials */
.rules-essentials {
  margin-bottom: 32px;
}

.rules-essentials h3 {
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 16px;
  font-weight: 600;
}

.essential-rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.essential-rule {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(68, 64, 60, 0.4);
  padding: 14px 16px;
  border-radius: 8px;
  border-left: 3px solid #eab308;
}

.essential-num {
  width: 28px;
  height: 28px;
  background: #eab308;
  color: #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.essential-content {
  color: var(--light-blue);
  line-height: 1.5;
}

.essential-content strong {
  color: var(--white);
}

/* Flow of Play */
.flow-of-play {
  margin-bottom: 28px;
}

.flow-of-play h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* Key Rules */
.key-rules {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--dark-navy);
}

.key-rules h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flow-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--light-blue);
  line-height: 1.5;
}

.flow-num {
  width: 24px;
  height: 24px;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.flow-step strong {
  color: var(--white);
}

.flow-content {
  flex: 1;
}

.flow-content strong {
  display: block;
  color: var(--white);
  margin-bottom: 2px;
}

.flow-step-note {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  padding: 10px 14px;
  margin: 8px 0 8px 36px;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  color: var(--light-blue);
}

.flow-step-note strong {
  color: #93c5fd;
}

/* Goal & Joker Callouts */
.goal-callout {
  background: var(--dark-navy);
  border: 1px solid var(--teal);
  border-left: 4px solid var(--teal);
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  color: var(--white);
  line-height: 1.6;
}

.goal-callout strong {
  color: var(--gold);
}

.joker-callout {
  background: var(--dark-navy);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  color: var(--white);
  line-height: 1.6;
}

.joker-callout strong {
  color: var(--gold);
}

.joker-callout em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

.hold-callout {
  background: var(--dark-navy);
  border: 1px solid var(--blue);
  border-left: 4px solid var(--blue);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  color: var(--white);
  line-height: 1.6;
}

.hold-callout strong {
  color: var(--light-blue);
}

/* Card Intro */
/* Hand Diagram */
.hand-diagram {
  background: var(--card-bg);
  border: 1px solid var(--dark-navy);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 28px;
}

.hand-diagram h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 4px;
  text-align: center;
}

.diagram-subtitle {
  color: var(--light-blue);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 20px;
}

.diagram-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.diagram-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 80px;
}

.diagram-notation {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.diagram-tiles-preview {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  min-height: 45px;
  align-items: center;
}

.diagram-tiles-preview .tile {
  transform: scale(0.7);
  margin: -5px -3px;
}

.diagram-label {
  font-weight: 600;
  color: #93c5fd;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.diagram-detail {
  color: var(--light-blue);
  font-size: 0.75rem;
  line-height: 1.3;
  max-width: 100px;
}

.diagram-notes {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.diagram-note {
  color: var(--light-blue);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.diagram-note:last-child {
  margin-bottom: 0;
}

.diagram-note-label {
  color: var(--white);
  font-weight: 600;
}

.diagram-disclaimer {
  color: var(--light-blue);
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
  margin: 0;
}

@media (max-width: 500px) {
  .diagram-row {
    gap: 12px;
  }

  .diagram-part {
    min-width: 70px;
  }

  .diagram-notation {
    font-size: 1.1rem;
  }

  .diagram-tiles-preview .tile {
    transform: scale(0.6);
    margin: -6px -4px;
  }
}

.card-intro {
  background: var(--card-bg);
  border: 1px solid var(--dark-navy);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.card-intro p {
  color: var(--light-blue);
  line-height: 1.6;
  margin-bottom: 12px;
}

.card-intro p:last-child {
  margin-bottom: 0;
}

.card-intro strong {
  color: var(--white);
}

.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.card-category {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Detailed Category Examples */
.card-categories-detailed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.category-example {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(41, 37, 36, 0.6);
  border-radius: 6px;
  border: 1px solid #3a3836;
}

.category-name {
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.9rem;
}

.category-hand {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.category-note {
  color: var(--light-blue);
  font-size: 0.75rem;
  font-style: italic;
}

.category-disclaimer {
  color: var(--light-blue);
  font-size: 0.8rem;
  font-style: italic;
  margin: 12px 0 16px;
}

/* Suit colors for card examples (matches NMJL card) */
.suit-c { color: #ef4444; } /* Cracks = Red */
.suit-b { color: var(--teal); } /* Bams = Green */
.suit-d { color: #3b82f6; } /* Dots = Blue */

@media (max-width: 600px) {
  .category-example {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .category-hand {
    font-size: 0.8rem;
  }
}

/* Rules Divider */
.rules-divider {
  display: flex;
  align-items: center;
  margin: 32px 0 24px;
  gap: 16px;
}

.rules-divider::before,
.rules-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--dark-navy);
}

.rules-divider span {
  color: var(--light-blue);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Rules Reference */
.rules-ref-group {
  margin-bottom: 28px;
}

.rules-ref-group h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--white);
  font-weight: 600;
  border-bottom: 1px solid var(--dark-navy);
  padding-bottom: 8px;
}

.rules-ref-table {
  background: rgba(68, 64, 60, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
}

.rules-ref-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--dark-navy);
}

.rules-ref-row:last-child {
  border-bottom: none;
}

.rules-ref-label {
  color: var(--light-blue);
}

.rules-ref-value {
  color: var(--white);
  font-weight: 500;
}

.rules-ref-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.rules-ref-card {
  background: rgba(68, 64, 60, 0.3);
  border: 1px solid var(--dark-navy);
  border-radius: 8px;
  overflow: hidden;
}

.rules-ref-card-header {
  background: var(--dark-navy);
  padding: 8px 12px;
  font-weight: 600;
  color: var(--white);
}

.rules-ref-card-body {
  padding: 12px;
  color: var(--light-blue);
  line-height: 1.5;
  font-size: 0.9rem;
}

.rules-ref-list {
  background: rgba(68, 64, 60, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
}

.rules-ref-item {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  color: var(--light-blue);
  line-height: 1.5;
  border-bottom: 1px solid #3a3632;
}

.rules-ref-item:last-child {
  border-bottom: none;
}

.rules-ref-item::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #16a34a;
}

/* History CFU (Check for Understanding) */
.history-cfu {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--dark-navy);
}

.history-cfu h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--white);
}

.cfu-question {
  background: rgba(68, 64, 60, 0.3);
  border: 1px solid var(--dark-navy);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.cfu-prompt {
  color: var(--white);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.cfu-reveal-btn {
  background: var(--dark-navy);
  border: 1px solid #57534e;
  color: var(--light-blue);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.cfu-reveal-btn:hover {
  background: #57534e;
  color: var(--white);
}

.cfu-reveal-btn.revealed {
  display: none;
}

.cfu-answer {
  display: none;
  color: var(--teal);
  background: rgba(22, 163, 74, 0.1);
  border-left: 3px solid #16a34a;
  padding: 12px 16px;
  margin-top: 12px;
  border-radius: 0 6px 6px 0;
  line-height: 1.6;
  animation: fadeIn 0.3s ease-out;
}

.cfu-answer.visible {
  display: block;
}

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

/* History Section */
.history-group {
  margin-bottom: 28px;
}

.history-group h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--white);
  border-bottom: 1px solid var(--dark-navy);
  padding-bottom: 8px;
}

.history-group p {
  color: var(--light-blue);
  line-height: 1.7;
  margin-bottom: 12px;
}

.history-card {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid #7c3aed;
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
  color: var(--light-blue);
  line-height: 1.6;
}

.history-card strong {
  color: #a78bfa;
}

.history-list {
  color: var(--light-blue);
  padding-left: 24px;
  line-height: 1.8;
  margin: 12px 0;
}

.history-list li {
  margin-bottom: 8px;
}

.history-list strong {
  color: var(--white);
}

/* Luck vs Skill */
.luck-skill-group {
  margin-bottom: 32px;
}

.luck-skill-group h3 {
  color: var(--white);
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.luck-skill-cards {
  display: grid;
  gap: 12px;
}

.luck-card, .skill-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid transparent;
}

.luck-card {
  border-left-color: #f97316;
}

.skill-card {
  border-left-color: var(--teal);
}

.luck-card-header, .skill-card-header {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.luck-card-body, .skill-card-body {
  color: var(--light-blue);
  line-height: 1.5;
}

.luck-skill-insight {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 20px;
}

.luck-skill-insight p {
  color: var(--light-blue);
  line-height: 1.6;
  margin-bottom: 12px;
}

.luck-skill-insight p:last-child {
  margin-bottom: 0;
}

.luck-skill-insight strong {
  color: var(--white);
}

.luck-skill-quote {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(139, 92, 246, 0.1));
  border-left: 3px solid #a78bfa;
  padding: 20px;
  border-radius: 0 8px 8px 0;
  margin-top: 24px;
}

.luck-skill-quote p {
  color: var(--light-blue);
  font-style: italic;
  line-height: 1.6;
  margin: 0;
}

/* Mandarin Reference */
.reference-group {
  margin-bottom: 32px;
}

.reference-group h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--white);
  border-bottom: 1px solid var(--dark-navy);
  padding-bottom: 8px;
}

.reference-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reference-row {
  display: grid;
  grid-template-columns: 60px 60px 100px 1fr 50px;
  gap: 12px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  border-radius: 8px;
}

.reference-row:hover {
  background: rgba(0, 0, 0, 0.3);
}

.ref-char {
  font-size: 1.8rem;
  color: var(--white);
  text-align: center;
}

.ref-english {
  font-size: 0.9rem;
  color: var(--light-blue);
}

.ref-pinyin {
  font-size: 1.1rem;
  color: #a78bfa;
  font-style: italic;
}

.ref-meaning {
  font-size: 0.9rem;
  color: var(--light-blue);
  line-height: 1.4;
}

.ref-speak {
  background: var(--dark-navy);
  border: 1px solid #57534e;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-speak:hover {
  background: #57534e;
  transform: scale(1.1);
}

/* Responsive reference table */
@media (max-width: 700px) {
  .reference-row {
    grid-template-columns: 50px 1fr 40px;
    grid-template-rows: auto auto;
  }

  .ref-char {
    grid-row: span 2;
  }

  .ref-english {
    display: none;
  }

  .ref-pinyin {
    grid-column: 2;
  }

  .ref-meaning {
    grid-column: 2;
    font-size: 0.85rem;
  }

  .ref-speak {
    grid-row: span 2;
  }
}

/* Quiz mode selection */
.quiz-modes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mode-btn {
  background: var(--dark-navy);
  border: 2px solid #57534e;
  color: var(--light-blue);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.mode-btn:hover:not(:disabled) {
  background: #57534e;
  color: var(--white);
}

.mode-btn.active {
  background: #7c3aed;
  border-color: #8b5cf6;
  color: white;
}

.mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-btn#review-btn:not(:disabled) {
  background: #b45309;
  border-color: #d97706;
  color: white;
}

/* Response Format Toggle */
.response-format-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.format-btn {
  background: var(--dark-navy);
  border: 2px solid #57534e;
  color: var(--light-blue);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.format-btn:hover:not(:disabled) {
  background: #57534e;
  color: var(--white);
}

.format-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.format-btn:disabled {
  cursor: not-allowed;
}

.format-btn:disabled .format-label {
  opacity: 0.5;
}

/* Quiz Toggles Container */
.quiz-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-toggles .response-format-toggle {
  margin-bottom: 0;
  align-items: center;
}

.toggle-label {
  color: var(--light-blue);
  font-size: 0.85rem;
  min-width: 70px;
  text-align: right;
}

/* Pinyin Prompt (for Pinyin → Meaning mode) */
.pinyin-prompt {
  font-size: 2.5rem;
  color: var(--white);
  padding: 30px 50px;
  background: linear-gradient(145deg, var(--dark-navy), #3a3632);
  border-radius: 12px;
  border: 2px solid #57534e;
  margin-bottom: 20px;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pinyin-prompt .pinyin-char {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.pinyin-prompt .pinyin-text {
  font-size: 1.8rem;
  color: #fcd34d;
}

/* Quiz Free Input */
.quiz-free-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.answer-input {
  width: 100%;
  max-width: 350px;
  padding: 14px 18px;
  font-size: 1.1rem;
  border: 2px solid #57534e;
  border-radius: 8px;
  background: var(--dark-navy);
  color: var(--white);
  text-align: center;
}

.answer-input:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.accepted-formats {
  font-size: 0.8rem;
  color: var(--light-blue);
  text-align: center;
  margin-top: 8px;
  width: 100%;
}

.formats-label {
  margin-right: 6px;
}

#accepted-formats-text {
  color: var(--light-blue);
}

.quiz-score {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--white);
}

.quiz-controls {
  margin-top: 24px;
}

.btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn:hover {
  background: #15803d;
}

.btn-secondary {
  background: var(--dark-navy);
}

.btn-secondary:hover {
  background: #57534e;
}

/* Reset buttons - muted and small */
.btn-reset {
  background: transparent;
  border: 1px solid #57534e;
  color: var(--light-blue);
  font-size: 0.75rem;
  padding: 6px 12px;
  margin-top: 20px;
}

.btn-reset:hover {
  background: var(--dark-navy);
  color: var(--light-blue);
}

.btn.next-mode {
  background: var(--teal);
}

.btn.next-mode:hover {
  background: #15803d;
}

/* Stats */
.stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--white);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--light-blue);
}

/* Which Hand? Game */
.hand-pattern-display {
  background: var(--card-bg);
  border: 2px solid var(--dark-navy);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.hand-pattern {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* Pattern color classes */
.pat-flower { color: #c084fc; }
.pat-dragon { color: #fbbf24; }
.pat-wind { color: #a78bfa; }
.pat-suit1 { color: #ef4444; }
.pat-suit2 { color: var(--teal); }
.pat-suit3 { color: #3b82f6; }

.hand-pattern .suit-d {
  color: var(--dots-color);
}

.hand-pattern .suit-b {
  color: var(--bams-color);
}

.hand-pattern .suit-c {
  color: var(--cracks-color);
}

.hand-description {
  color: var(--light-blue);
  font-size: 0.9rem;
  font-style: italic;
}

.which-hand-prompt {
  color: var(--light-blue);
  margin-bottom: 16px;
  font-size: 1rem;
}

.category-explanation {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--light-blue);
  font-style: italic;
}

.confusion-tip {
  margin-top: 10px;
  padding: 10px;
  background: #3f3f46;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #fbbf24;
}

/* Category hierarchy reference */
.category-hierarchy {
  background: var(--dark-navy);
  border: 1px solid var(--dark-navy);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.category-hierarchy summary {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--light-blue);
  font-weight: 500;
}

.category-hierarchy summary:hover {
  color: var(--light-blue);
}

.hierarchy-content {
  padding: 0 16px 16px;
  color: var(--light-blue);
}

.hierarchy-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.hierarchy-content li {
  margin-bottom: 6px;
}

.hierarchy-tip {
  margin-top: 12px;
  padding: 10px;
  background: #3f3f46;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #fbbf24;
}

.why-not-tip {
  margin-top: 10px;
  padding: 10px;
  background: #1e3a5f;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #93c5fd;
}

/* Hand display (shared) */
.starting-hand {
  background: var(--card-bg);
  border: 2px solid var(--dark-navy);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.hand-label {
  color: var(--light-blue);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.tile-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.tile-display .tile {
  width: 36px;
  height: 48px;
  font-size: 0.7rem;
}

.strategy-explanation {
  margin-top: 12px;
  padding: 12px;
  background: var(--dark-navy);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--light-blue);
  line-height: 1.5;
}

.strategy-explanation strong {
  color: var(--teal);
}

.hand-info {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--dark-navy);
  font-size: 0.85rem;
  color: var(--light-blue);
}

.hand-info span {
  margin: 0 12px;
}

.hand-info .points {
  color: #fbbf24;
  font-weight: 600;
}

.hand-info .concealed {
  color: var(--coral);
}

.hand-info .exposed {
  color: var(--teal);
}

/* What to Discard Game */
.discard-context {
  margin-bottom: 16px;
}

.discard-context strong {
  color: var(--teal);
}

.discard-hand {
  background: #1c1917;
  border: 1px solid var(--dark-navy);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.discard-prompt {
  color: var(--light-blue);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.clickable-tiles .tile {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.clickable-tiles .tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clickable-tiles .tile.selected {
  transform: translateY(-8px);
  box-shadow: 0 0 0 3px #f59e0b, 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clickable-tiles .tile.correct-choice {
  box-shadow: 0 0 0 3px var(--teal);
}

.clickable-tiles .tile.wrong-choice {
  box-shadow: 0 0 0 3px var(--coral);
  opacity: 0.7;
}

.clickable-tiles .tile.best-choice {
  box-shadow: 0 0 0 3px var(--teal);
  transform: translateY(-4px);
}

.clickable-tiles .tile.disabled {
  cursor: default;
  pointer-events: none;
}

/* Read the Hand Game */
.read-hand-display {
  background: #1c1917;
  border: 1px solid var(--dark-navy);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.read-hand-prompt {
  color: var(--light-blue);
  margin-bottom: 16px;
  font-size: 1rem;
}

.read-hand-prompt .hint {
  color: var(--light-blue);
  font-size: 0.9rem;
}

/* Multi-select options */
.quiz-options.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.quiz-options.multi-select .quiz-option {
  position: relative;
}

.quiz-options.multi-select .quiz-option.selected {
  background: #365314;
  border-color: var(--teal);
  color: var(--teal);
}

.quiz-options.multi-select .quiz-option.selected::before {
  content: '✓ ';
}

.quiz-options.multi-select .quiz-option.correct-answer {
  background: #14532d;
  border-color: var(--teal);
}

.quiz-options.multi-select .quiz-option.missed-answer {
  background: #1c1917;
  border-color: #fbbf24;
  color: #fbbf24;
}

.quiz-options.multi-select .quiz-option.wrong-answer {
  background: #450a0a;
  border-color: var(--coral);
  color: var(--coral);
}

#read-hand-submit {
  margin-bottom: 16px;
}

/* Keep or Toss game */
.viable-directions {
  margin: 20px 0;
}

.direction-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.direction-tag {
  background: #365314;
  border: 1px solid var(--teal);
  color: var(--teal);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tile-question {
  margin: 24px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.target-tile-display {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.target-tile-display .tile-medium {
  transform: scale(1.3);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.keep-toss-prompt {
  color: var(--light-blue);
  font-style: italic;
  margin-top: 12px;
}

.quiz-options.binary-choice {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0;
}

.quiz-options.binary-choice .quiz-option {
  min-width: 120px;
  padding: 14px 28px;
  font-size: 1.1rem;
  font-weight: 600;
}

.quiz-options.binary-choice .keep-option {
  border-color: var(--teal);
}

.quiz-options.binary-choice .keep-option:hover {
  background: #365314;
  border-color: var(--teal);
}

.quiz-options.binary-choice .toss-option {
  border-color: var(--coral);
}

.quiz-options.binary-choice .toss-option:hover {
  background: #450a0a;
  border-color: var(--coral);
}

.quiz-options.binary-choice .quiz-option.correct-answer.keep-option {
  background: #365314;
  border-color: var(--teal);
  color: var(--teal);
}

.quiz-options.binary-choice .quiz-option.correct-answer.toss-option {
  background: #450a0a;
  border-color: var(--coral);
  color: var(--coral);
}

.quiz-options.binary-choice .quiz-option.wrong-answer {
  background: #1c1917;
  border-color: var(--light-blue);
  color: var(--light-blue);
  opacity: 0.6;
}

/* Commit Check game */
.game-context {
  margin: 16px 0;
  text-align: center;
}

.wall-info {
  display: inline-block;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--light-blue);
}

.commit-prompt {
  color: var(--light-blue);
  font-size: 1.1rem;
  margin: 20px 0 16px;
  text-align: center;
}

.quiz-options.binary-choice .commit-option {
  border-color: #f59e0b;
}

.quiz-options.binary-choice .commit-option:hover {
  background: #451a03;
  border-color: #f59e0b;
}

.quiz-options.binary-choice .flexible-option {
  border-color: #60a5fa;
}

.quiz-options.binary-choice .flexible-option:hover {
  background: #1e3a5f;
  border-color: #60a5fa;
}

.quiz-options.binary-choice .quiz-option.correct-answer.commit-option {
  background: #451a03;
  border-color: #f59e0b;
  color: #f59e0b;
}

.quiz-options.binary-choice .quiz-option.correct-answer.flexible-option {
  background: #1e3a5f;
  border-color: #60a5fa;
  color: #60a5fa;
}

/* Draw & Discard game */
.draw-context {
  margin: 20px 0;
  padding: 16px;
  background: rgba(249, 115, 22, 0.1);
  border: 2px dashed #f97316;
  border-radius: 8px;
  text-align: center;
}

.draw-label {
  color: #f97316 !important;
  font-weight: 600;
}

.drawn-tile-display {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.drawn-tile-display .tile-medium {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.5);
}

.clickable-tiles .tile-medium {
  cursor: pointer;
  transition: all 0.2s;
}

.clickable-tiles .tile-medium:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clickable-tiles .tile-medium.selected-discard {
  opacity: 0.5;
  transform: translateY(4px);
}

/* ============================================
   READ THE BOARD GAMES
   ============================================ */

/* Discard Display */
.discard-display {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

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

.discard-row:last-child {
  margin-bottom: 0;
}

.discard-row-label {
  font-size: 0.75rem;
  color: var(--light-blue);
  width: 70px;
  flex-shrink: 0;
}

.discard-row .tile-small {
  transform: scale(0.85);
}

.discard-row .tile-small.highlighted {
  box-shadow: 0 0 8px 2px #f97316;
}

.discard-row .tile-medium.highlighted {
  box-shadow: 0 0 8px 2px #f97316;
}

/* Tile Counting Game */
.tile-counting-question {
  text-align: center;
  margin: 20px 0;
}

.tile-counting-question p {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.target-tile-display {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.target-tile-display .tile-medium {
  transform: scale(1.2);
}

.counting-options {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.counting-option {
  background: var(--dark-navy);
  border: 2px solid var(--light-blue);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
}

.counting-option:hover {
  background: #57534e;
  border-color: var(--light-blue);
}

.counting-option.correct {
  background: var(--teal);
  border-color: var(--teal);
}

.counting-option.incorrect {
  background: #dc2626;
  border-color: #dc2626;
}

.counting-option.was-correct {
  background: var(--teal);
  border-color: var(--teal);
  opacity: 0.7;
}

/* Dead Hand Check Game */
.dead-hand-needs {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  text-align: center;
}

.needs-text {
  font-size: 1.1rem;
  color: #fcd34d;
  font-weight: 500;
  margin-top: 8px;
}

.dead-hand-prompt {
  text-align: center;
  font-size: 1.1rem;
  margin: 20px 0 15px;
}

.binary-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.binary-option {
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid;
}

.alive-option {
  background: rgba(22, 163, 74, 0.2);
  border-color: #16a34a;
  color: var(--teal);
}

.alive-option:hover {
  background: rgba(22, 163, 74, 0.4);
}

.dead-option {
  background: rgba(220, 38, 38, 0.2);
  border-color: #dc2626;
  color: var(--coral);
}

.dead-option:hover {
  background: rgba(220, 38, 38, 0.4);
}

.binary-option.correct {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: white !important;
}

.binary-option.incorrect {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: white !important;
}

.binary-option.was-correct {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: white !important;
  opacity: 0.7;
}

.binary-option:disabled {
  cursor: default;
  opacity: 0.8;
}

/* Safe Discard Game */
.safe-discard-situation {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  text-align: center;
}

.safe-discard-situation.dead-hand-mode {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
}

.safe-discard-dead-tiles {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin: 15px 0;
  text-align: center;
}

.safe-discard-dead-tiles .context-label {
  margin-bottom: 10px;
}

.opponent-clues {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.opponent-clue {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.opponent-clue:last-child {
  margin-bottom: 0;
}

.clue-label {
  font-size: 0.85rem;
  color: var(--light-blue);
  min-width: 80px;
}

.clue-tiles {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.clue-text {
  font-size: 0.85rem;
  color: #fcd34d;
  font-style: italic;
}

.safe-discard-choices .tile-medium.safest {
  box-shadow: 0 0 12px 3px var(--teal);
}

/* Read Discards */
.discard-pile {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.discard-pile-display {
  margin-bottom: 20px;
}

.read-discards-question {
  margin-top: 20px;
}

.safe-discard-choices .tile-medium.dangerous {
  box-shadow: 0 0 12px 3px #dc2626;
}

.safe-discard-choices .tile-medium.medium-safe {
  box-shadow: 0 0 12px 3px #eab308;
}

.clickable-tiles .tile-medium.correct-discard {
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
}

.clickable-tiles .tile-medium.wrong-discard {
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
}

.clickable-tiles .tile-medium.best-discard {
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
  outline: 2px solid var(--teal);
}

.draw-discard-prompt {
  color: var(--light-blue);
  font-style: italic;
  text-align: center;
  margin: 16px 0;
}

/* Call or Wait Game */
.call-wait-situation {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin: 15px 0;
}

.situation-context {
  font-size: 0.95rem;
  color: var(--light-blue);
  line-height: 1.5;
}

.situation-context strong {
  color: #fcd34d;
}

.call-wait-opportunity {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
}

.would-make-text {
  font-size: 0.9rem;
  color: var(--light-blue);
  margin-top: 10px;
  font-style: italic;
}

.call-wait-prompt {
  text-align: center;
  font-size: 1.1rem;
  margin: 20px 0 15px;
}

.call-option {
  background: rgba(249, 115, 22, 0.2);
  border-color: #f97316;
  color: #fdba74;
}

.call-option:hover {
  background: rgba(249, 115, 22, 0.4);
}

.wait-option {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.wait-option:hover {
  background: rgba(59, 130, 246, 0.4);
}

/* Responsive */
@media (max-width: 600px) {
  .tile-medium {
    width: 44px;
    height: 60px;
  }

  .quiz-option {
    min-width: 100px;
    padding: 10px 16px;
  }

  nav {
    gap: 6px;
  }

  nav button {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

/* ============================================
   ADAPTIVE DIFFICULTY (rung indicator + nudges)
   ============================================ */
.adaptive-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  max-width: 780px;
}

.adaptive-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: var(--light-blue);
}

.adaptive-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.adaptive-dot.filled {
  background: var(--accent);
}

.adaptive-label {
  margin-left: 4px;
}

.adaptive-nudge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(74, 140, 181, 0.15);
  border: 1px solid var(--accent);
  color: var(--white);
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease;
}

.adaptive-nudge .btn {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ============================================
   ONE-SCREEN QUIZ LAYOUT
   ============================================ */
/* Tighter vertical rhythm so question + feedback fit a laptop screen */
#quiz > p, #pinyin > p, #listening > p, #rules > p {
  margin-bottom: 10px;
}

#quiz .quiz-modes, #quiz .response-format-toggle,
#pinyin .quiz-modes, #pinyin .response-format-toggle,
#listening .quiz-modes, #listening .response-format-toggle,
#rules .quiz-modes {
  margin-bottom: 10px;
}

#quiz .stats, #pinyin .stats, #listening .stats, #rules .stats {
  margin-bottom: 8px;
}

#quiz .stat-value, #pinyin .stat-value, #listening .stat-value, #rules .stat-value {
  font-size: 1.25rem;
}

#quiz .quiz-tile, #pinyin .quiz-tile, #listening .quiz-tile {
  margin: 10px;
}

/* Wide screens: the question owns the CENTER track and never moves;
   feedback appears in the right track without displacing anything —
   so buttons stay under your cursor from one tile to the next */
@media (min-width: 1200px) {
  #quiz .quiz-area, #pinyin .quiz-area, #listening .quiz-area, #rules .quiz-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 560px minmax(0, 1fr);
    align-items: start;
  }

  .quiz-question-col {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .quiz-feedback-col {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    padding-left: 24px;
  }

  .quiz-feedback-col .quiz-feedback {
    margin-top: 0;
  }
}

/* Feedback header contrast (was teal-on-green, too dim) */
.quiz-feedback.correct .feedback-result {
  color: #4ade80;
  font-size: 1.15rem;
}

.quiz-feedback.incorrect .feedback-result {
  font-size: 1.15rem;
}

/* Level pill vertical alignment inside any stats row */
.stats .adaptive-pill {
  align-self: center;
}

/* Reserve scrollbar space so the page never shifts when content grows */
html {
  scrollbar-gutter: stable;
}

/* "Check" and "Next Tile" render at the same width so the button never shifts */
#quiz-submit-btn {
  min-width: 116px;
}
