/* ============================================
   PLAYIQ — Master Stylesheet
   ============================================ */

:root {
  --team-primary: #003087;
  --team-secondary: #FFFFFF;
  --bg-dark: #0a0e17;
  --bg-card: #141a28;
  --bg-card-hover: #1c2438;
  --text-primary: #f0f2f5;
  --text-secondary: #8b92a5;
  --text-muted: #555d73;
  --accent: #f5a623;
  --accent-glow: rgba(245, 166, 35, 0.3);
  --great: #22c55e;
  --good: #3b82f6;
  --okay: #eab308;
  --bad: #ef4444;
  --fenway-green: #2d5f2d;
  --scoreboard-text: #e8deb5;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(245, 166, 35, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(255,255,255,0.02) 0%, transparent 40%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ---- SCREENS ---- */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Force the transition to play on activation via a tiny reflow trick */
.screen.active {
  animation: screenFadeIn 0.35s ease forwards;
}

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

/* ---- LOGO ---- */
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-align: center;
}

.logo-accent {
  color: var(--accent);
}

.logo-sm {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
}

.logo-header {
  padding: 3rem 0 1rem;
}

.logo-header.small {
  padding: 2rem 0 0.5rem;
}

.logo-header.small .logo {
  font-size: 2.5rem;
}

.tagline {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ---- SELECT SCREENS ---- */
.select-screen-inner {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.select-heading {
  text-align: center;
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin: 2rem 0 1.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ---- TEAM PICKER ---- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease, transform 0.15s ease;
  text-align: center;
  min-height: 80px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.team-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 20px var(--team-glow, rgba(255,255,255,0.1));
}

.team-card:active {
  transform: scale(1.08);
  transition: transform 0.1s ease;
}

.team-card .team-abbr {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

.team-card .team-name {
  font-size: 0.65rem;
  margin-top: 4px;
  opacity: 0.85;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- SPORT PICKER ---- */
.sport-cards {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.sport-card {
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 260px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  color: var(--text-primary);
  font-family: inherit;
}

.sport-card:hover {
  border-color: var(--team-primary);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.sport-icon {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sport-icon svg {
  width: 56px;
  height: 56px;
}

.sport-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

.sport-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ---- DIFFICULTY PICKER ---- */
.difficulty-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.difficulty-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.difficulty-card:hover {
  border-color: var(--team-primary);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.difficulty-card .tier-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--team-primary);
  color: var(--team-secondary);
  flex-shrink: 0;
}

.difficulty-card .tier-info {
  flex: 1;
}

.difficulty-card .tier-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.difficulty-card .tier-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 2px;
  line-height: 1.3;
}

/* ---- GAME SCREEN ---- */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.game-header-left,
.game-header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tier-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--team-primary);
  color: var(--team-secondary);
}

.iq-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.scenario-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-end-session {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-end-session:hover {
  border-color: var(--bad);
  color: var(--bad);
}

/* ---- MENU ---- */
.menu-wrapper {
  position: relative;
}

.btn-menu {
  font-size: 1.2rem;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-menu:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.game-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  min-width: 180px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.menu-item:hover {
  background: var(--bg-card-hover);
}

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

.menu-item-danger {
  color: var(--bad);
}

.menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

#screen-game {
  flex-direction: column;
}

.game-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}

.game-left {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
  min-height: 0;
}

.game-right {
  display: flex;
  flex-direction: column;
  background: #0d1117;
  min-height: 0;
  overflow: hidden;
}

#field-canvas {
  width: 100%;
  aspect-ratio: 650 / 500;
  max-height: 55vh;
  object-fit: contain;
}

.scoreboard-container {
  flex-shrink: 0;
}

/* ---- SCENARIO PANEL ---- */
.scenario-panel {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.narration-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.narration-text .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

.situation-bar {
  display: flex;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.situation-bar .sit-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.situation-bar .sit-icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.situation-bar .sit-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.situation-bar .sit-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  width: 100%;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.08);
  border-left: 4px solid var(--team-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
  min-height: 48px;
}

.choice-btn:hover {
  border-color: var(--team-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.choice-btn:active {
  transform: translateY(0);
}

.choice-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.choice-btn .choice-letter {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  color: var(--team-secondary);
  background: var(--team-primary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}

.choice-btn .choice-text {
  flex: 1;
}

/* ---- OUTCOME DISPLAY ---- */
.outcome-display {
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.outcome-headline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.8rem;
}

.outcome-headline.great { color: var(--great); text-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }
.outcome-headline.good { color: var(--good); text-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
.outcome-headline.okay { color: var(--okay); text-shadow: 0 0 20px rgba(234, 179, 8, 0.3); }
.outcome-headline.bad { color: var(--bad); text-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }

.outcome-explanation {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.outcome-terms {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-left: 4px solid var(--good);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.outcome-terms-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--good);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.outcome-term {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.outcome-term:last-child {
  margin-bottom: 0;
}

.outcome-remember {
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.15);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.outcome-remember-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.outcome-remember-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.outcome-iq {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  animation: iqPop 0.5s ease;
}

@keyframes iqPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.iq-display.iq-bump {
  animation: iqHeaderBump 0.4s ease;
}

@keyframes iqHeaderBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: #fff; }
  100% { transform: scale(1); }
}

.btn-next-scenario {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--team-primary);
  color: var(--team-secondary);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.btn-next-scenario:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* ---- SCOREBOARD (Fenway Style) ---- */
.scoreboard {
  background: var(--fenway-green);
  border-top: 3px solid #1a3d1a;
  padding: 0.8rem 1rem;
  font-family: 'Special Elite', 'Courier New', monospace;
  color: var(--scoreboard-text);
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: 60px repeat(9, 1fr) 6px 1fr 1fr 1fr;
  gap: 0;
  font-size: 0.75rem;
  text-align: center;
}

.sb-cell {
  padding: 3px 2px;
}

.sb-header {
  color: rgba(232, 222, 181, 0.5);
  font-size: 0.6rem;
}

.sb-team-name {
  text-align: left;
  font-weight: bold;
  font-size: 0.8rem;
}

.sb-separator {
  border-left: 1px solid rgba(232, 222, 181, 0.2);
}

.sb-active-inning {
  color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.5);
}

.scoreboard-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(232, 222, 181, 0.15);
  font-size: 0.75rem;
}

.outs-display {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.out-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--scoreboard-text);
  background: transparent;
}

.out-dot.active {
  background: var(--scoreboard-text);
  box-shadow: 0 0 4px rgba(232, 222, 181, 0.5);
}

.count-display {
  display: flex;
  gap: 0.8rem;
}

/* ---- REVIEW SCREEN ---- */
.review-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  overflow-y: auto;
  height: 100%;
}

.review-header {
  text-align: center;
  margin-bottom: 2rem;
}

.review-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 0.04em;
}

.review-score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 1rem auto;
}

.review-score-ring svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.review-score-ring .ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 8;
}

.review-score-ring .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.review-score-ring .ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.review-score-ring .ring-grade {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  line-height: 1;
}

.review-score-ring .ring-pct {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.review-iq-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  color: var(--accent);
  margin: 0.5rem 0;
}

.review-grade {
  font-size: 1rem;
  color: var(--text-secondary);
}

.review-grade-letter {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  margin-right: 0.3rem;
}

.review-grade-letter.grade-a { color: var(--great); }
.review-grade-letter.grade-b { color: var(--good); }
.review-grade-letter.grade-c { color: var(--okay); }
.review-grade-letter.grade-d, .review-grade-letter.grade-f { color: var(--bad); }

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.2rem 1.4rem;
  border-left: 4px solid;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}

.review-item:hover {
  transform: translateX(3px);
}

.review-item.great { border-left-color: var(--great); }
.review-item.good { border-left-color: var(--good); }
.review-item.okay { border-left-color: var(--okay); }
.review-item.bad { border-left-color: var(--bad); }

.review-item-situation {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-item-choice {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.review-item-why {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-play-again {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 2rem auto 0;
  padding: 1rem 2rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg-dark);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-play-again:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* ---- RESPONSIVE ---- */

/* Tablet */
@media (max-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }

  .game-right {
    order: -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-height: 200px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #field-canvas {
    width: 50%;
    max-height: 200px;
    flex-shrink: 0;
  }

  .scoreboard-container {
    width: 50%;
    overflow: hidden;
  }

  .game-left {
    border-right: none;
    overflow-y: auto;
  }

  .logo {
    font-size: 3rem;
  }

  .sport-cards {
    flex-direction: column;
    align-items: center;
  }

  .sport-card {
    width: 100%;
    max-width: 300px;
  }
}

/* Phone */
@media (max-width: 480px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .team-card {
    padding: 10px 6px;
    min-height: 65px;
  }

  .team-card .team-abbr {
    font-size: 1.3rem;
  }

  .game-header {
    padding: 0.4rem 0.8rem;
  }

  .logo-sm {
    font-size: 1.1rem;
  }

  .iq-display {
    font-size: 1.1rem;
  }

  .game-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }

  .game-right {
    order: -1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-height: 160px;
    min-height: 160px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #field-canvas {
    width: 55%;
    max-height: 160px;
    flex-shrink: 0;
  }

  .scoreboard-container {
    width: 45%;
    overflow: hidden;
    font-size: 0.7rem;
  }

  .game-left {
    border-right: none;
    overflow-y: auto;
  }

  .scenario-panel {
    padding: 0.8rem;
  }

  .situation-bar {
    padding: 0.5rem 0.7rem;
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
  }

  .narration-text {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .choice-btn {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    min-height: 48px;
  }

  .outcome-headline {
    font-size: 1.4rem;
  }

  .outcome-explanation {
    font-size: 0.85rem;
  }

  .outcome-terms {
    padding: 0.6rem 0.8rem;
  }

  .outcome-remember {
    padding: 0.8rem 1rem;
  }

  .btn-next-scenario {
    padding: 0.7rem 1.5rem;
    font-size: 0.85rem;
  }

  .difficulty-card {
    padding: 1rem 1.2rem;
  }

  .difficulty-card .tier-number {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
  }

  .difficulty-card .tier-name {
    font-size: 1.2rem;
  }

  .select-heading {
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem;
  }

  .logo-header {
    padding: 2rem 0 0.5rem;
  }

  .logo {
    font-size: 2.5rem;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .review-container {
    padding: 1.5rem 1rem 3rem;
  }

  .review-iq-score {
    font-size: 2.5rem;
  }

  .review-title {
    font-size: 2rem;
  }
}

/* ---- LOADING / TRANSITION STATES ---- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading-spinner::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.8rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- PLAYER AUTH ---- */
#screen-auth {
  overflow-y: auto;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(245, 166, 35, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  align-items: center;
  justify-content: center;
}

.auth-screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  width: 100%;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin: 2rem 0 1.5rem;
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 0.65rem 0.8rem;
  background: transparent;
  border: none;
  border-radius: 50px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

.auth-form-container {
  margin-bottom: 1.5rem;
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.auth-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.auth-field input::placeholder {
  color: var(--text-muted);
}

.auth-btn {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #e8941a 100%);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(245, 166, 35, 0.25);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.4);
  filter: brightness(1.08);
}

.auth-error {
  color: var(--bad);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.auth-guest-btn {
  display: block;
  width: 100%;
  padding: 0.7rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.auth-guest-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.auth-home-link {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 1rem;
  text-decoration: none;
  transition: color var(--transition);
}

.auth-home-link:hover {
  color: var(--accent);
}

/* ---- Avatar Picker ---- */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.avatar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.avatar-btn:hover {
  border-color: rgba(255,255,255,0.2);
}

.avatar-btn.selected {
  border-color: var(--accent);
  background: rgba(245, 166, 35, 0.08);
}

.avatar-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.avatar-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Player Profile Button ---- */
.player-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 3px 10px 3px 6px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.player-profile-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.player-profile-btn .profile-avatar {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-profile-btn .profile-avatar svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.player-profile-btn .profile-iq {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ---- Awards Toast ---- */
.awards-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  z-index: 100;
  animation: slideUpToast 0.4s ease, fadeOutToast 0.4s ease 3.6s forwards;
  text-align: center;
  max-width: 90%;
}

.awards-toast-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.awards-toast-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOutToast {
  to { opacity: 0; transform: translate(-50%, -10px); }
}

/* ---- UTILITY ---- */
.hidden { display: none !important; }
