/* ── WiseUp Design System v2 ───────────────────────────────────────────────── */
:root {
  --ink:        #1a1510;
  --parchment:  #f5f0e8;
  --cream:      #faf7f2;
  --gold:       #2a6b2a;   /* WiseUp forest green */
  --gold-light: #4a9e4a;
  --gold-pale:  #e8f5e8;
  --rust:       #8b1a1a;
  --sage:       #1a4a6b;   /* WiseUp navy */
  --slate:      #1e3a5c;
  --mist:       #e8e4dc;
  --shadow:     rgba(26,21,16,0.12);

  --font-display: 'Cormorant Garamond', serif;
  --font-ui:      'Outfit', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius:    8px;
  --radius-lg: 16px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-ui); background: var(--cream);
             color: var(--ink); -webkit-font-smoothing: antialiased; }
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Typography ──────────────────────────────────────────────────────────────*/
h1,h2,h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; }
h1 { font-size: clamp(2rem,5vw,3.5rem); }
h2 { font-size: clamp(1.4rem,3vw,2rem); }
h3 { font-size: 1.2rem; }
p  { line-height: 1.7; }
.mono { font-family: var(--font-mono); }

/* ── Buttons ─────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap:.5rem;
  padding:.75rem 1.75rem; border:none; border-radius:var(--radius);
  font-family:var(--font-ui); font-size:.9rem; font-weight:500;
  cursor:pointer; transition:all var(--transition);
  text-decoration:none; white-space:nowrap; position:relative;
}
.btn-primary { background:var(--ink); color:var(--cream); }
.btn-primary:hover { background:var(--slate); transform:translateY(-1px);
                     box-shadow:0 4px 16px var(--shadow); }
.btn-gold    { background:var(--gold); color:var(--cream); }
.btn-gold:hover { background:#b5841f; transform:translateY(-1px);
                  box-shadow:0 4px 16px rgba(201,149,42,.3); }
.btn-outline { background:transparent; color:var(--ink);
               border:1.5px solid var(--mist); }
.btn-outline:hover { border-color:var(--gold); color:var(--gold); }
.btn-ghost   { background:transparent; color:var(--slate); padding:.5rem 1rem; }
.btn-ghost:hover { color:var(--ink); background:var(--mist); }
.btn-danger  { background:var(--rust); color:white; }
.btn:disabled { opacity:.4; pointer-events:none; }
.btn-sm  { padding:.5rem 1rem; font-size:.82rem; }
.btn-lg  { padding:1rem 2.5rem; font-size:1rem; }
.btn-loading::after {
  content:''; width:14px; height:14px; border:2px solid rgba(255,255,255,.4);
  border-top-color:white; border-radius:50%; animation:spin .6s linear infinite;
  margin-left:.5rem;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Inputs ──────────────────────────────────────────────────────────────────*/
.input-field {
  width:100%; padding:.75rem 1rem; border:1.5px solid var(--mist);
  border-radius:var(--radius); font-family:var(--font-ui); font-size:.95rem;
  background:var(--cream); color:var(--ink);
  transition:border-color var(--transition), box-shadow var(--transition); outline:none;
}
.input-field:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,149,42,.12); }
.input-field::placeholder { color:#aaa; }
textarea.input-field { resize:vertical; min-height:90px; }
label.field-label { display:block; font-size:.82rem; font-weight:500;
  letter-spacing:.04em; text-transform:uppercase; color:var(--slate); margin-bottom:.4rem; }
.field-group { margin-bottom:1.25rem; }

/* ── Cards ───────────────────────────────────────────────────────────────────*/
.card { background:white; border:1px solid var(--mist);
        border-radius:var(--radius-lg); padding:1.5rem;
        box-shadow:0 2px 8px var(--shadow); }
.card-game {
  background:white; border:2px solid var(--gold-light);
  border-radius:var(--radius-lg); padding:2rem;
  box-shadow:0 4px 24px rgba(201,149,42,.1); position:relative;
}
.card-game::before { content:''; position:absolute; inset:6px;
  border:1px solid rgba(201,149,42,.2); border-radius:calc(var(--radius-lg) - 4px);
  pointer-events:none; }

/* ── Layout ──────────────────────────────────────────────────────────────────*/
.screen { display:none; min-height:100vh; flex-direction:column; position:relative;
          align-items:center; padding:2rem 1rem; }
.screen.active { display:flex; }
.container    { width:100%; max-width:900px;  margin:0 auto; }
.container-sm { width:100%; max-width:480px;  margin:0 auto; }
.container-lg { width:100%; max-width:1140px; margin:0 auto; }
.row { display:flex; gap:1rem; flex-wrap:wrap; }
.col { flex:1; min-width:0; }
.text-center { text-align:center; }
.text-gold   { color:var(--gold); }
.text-muted  { color:var(--slate); font-size:.88rem; }
.text-sm     { font-size:.88rem; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.gap-sm{gap:.5rem}.gap-md{gap:1rem}.gap-lg{gap:2rem}
.divider { width:100%; height:1px; background:var(--mist); margin:1.5rem 0; }

/* ── Toasts ──────────────────────────────────────────────────────────────────*/
#toast-container { position:fixed; bottom:1.5rem; right:1.5rem;
  display:flex; flex-direction:column; gap:.5rem; z-index:9999; }
.toast { padding:.85rem 1.25rem; border-radius:var(--radius);
  font-size:.9rem; font-weight:500; animation:slideIn .3s ease; max-width:320px; }
.toast-success { background:var(--sage);  color:white; }
.toast-error   { background:var(--rust);  color:white; }
.toast-info    { background:var(--slate); color:white; }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:none;opacity:1} }

/* ── Phase labels ────────────────────────────────────────────────────────────*/
.phase-label { display:inline-flex; align-items:center; gap:.5rem;
  font-size:.75rem; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color:var(--gold); padding:.3rem .75rem; background:var(--gold-pale);
  border-radius:20px; margin-bottom:1rem; }

/* ── Auth screen ─────────────────────────────────────────────────────────────*/
#screen-auth { background:var(--ink); color:var(--cream); justify-content:center; }
.auth-bg { position:fixed; inset:0;
  background:radial-gradient(ellipse 80% 60% at 20% 80%,rgba(201,149,42,.08) 0%,transparent 60%),
             radial-gradient(ellipse 60% 80% at 80% 20%,rgba(74,103,65,.06) 0%,transparent 60%),
             var(--ink); }
.auth-panel { position:relative; z-index:1; width:100%; max-width:440px;
  background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.1);
  border-radius:var(--radius-lg); padding:3rem 2.5rem; backdrop-filter:blur(12px); }
.auth-logo { text-align:center; margin-bottom:2.5rem; }
.auth-logo h1 { font-family:var(--font-display); font-size:3rem; font-weight:500;
  color:var(--cream); letter-spacing:-.01em; }
.auth-logo h1 span { color:var(--gold-light); font-style:italic; }
.auth-logo p { color:rgba(245,240,232,.55); font-size:.9rem; margin-top:.5rem;
  font-style:italic; font-family:var(--font-display); }
.auth-panel .input-field { background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.15); color:var(--cream); }
.auth-panel .input-field:focus { border-color:var(--gold-light);
  box-shadow:0 0 0 3px rgba(232,201,122,.1); }
.auth-panel .input-field::placeholder { color:rgba(245,240,232,.35); }
.auth-panel label.field-label { color:rgba(245,240,232,.6); }
.auth-tabs { display:flex; margin-bottom:2rem; border-bottom:1px solid rgba(255,255,255,.1); }
.auth-tab { flex:1; padding:.75rem; background:none;
  border:none; border-bottom:2px solid transparent; margin-bottom:-1px;
  font-family:var(--font-ui); font-size:.9rem; font-weight:500;
  color:rgba(245,240,232,.45); cursor:pointer; transition:all var(--transition); }
.auth-tab.active { color:var(--gold-light); border-bottom-color:var(--gold-light); }
.consent-box { background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.1);
  border-radius:var(--radius); padding:1rem 1.25rem; font-size:.82rem; line-height:1.6;
  color:rgba(245,240,232,.65); margin-bottom:1.25rem; }
.consent-box strong { color:var(--gold-light); }

/* ── Navigation header ───────────────────────────────────────────────────────*/
.app-nav { width:100%; padding:.9rem 2rem; display:flex; align-items:center;
  justify-content:space-between; border-bottom:1px solid var(--mist); background:white;
  position:sticky; top:0; z-index:100; }
.logo-mark { font-family:var(--font-display); font-size:1.4rem; font-weight:600;
  color:var(--ink); text-decoration:none; }
.logo-mark span { color:var(--gold); }

/* ── Player seats ────────────────────────────────────────────────────────────*/
.player-seat { display:flex; align-items:center; gap:1rem; padding:1rem 1.25rem;
  border:1px solid var(--mist); border-radius:var(--radius); background:var(--cream);
  transition:all var(--transition); }
.player-seat.active-turn { border-color:var(--gold); background:var(--gold-pale); }
.seat-avatar { width:40px; height:40px; border-radius:50%; background:var(--ink);
  color:var(--cream); display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:1.1rem; font-weight:500; flex-shrink:0; }
.seat-name  { font-weight:500; }
.seat-score { margin-left:auto; font-family:var(--font-mono); font-size:.9rem; color:var(--slate); }

/* ── Room code badge ─────────────────────────────────────────────────────────*/
.room-code-badge { font-family:var(--font-mono); font-size:1.5rem; font-weight:500;
  color:var(--gold); background:var(--gold-pale); padding:.4rem 1rem;
  border-radius:var(--radius); letter-spacing:.15em; cursor:pointer;
  transition:all var(--transition); user-select:all; }
.room-code-badge:hover { background:var(--gold); color:white; }

/* ── Game header ─────────────────────────────────────────────────────────────*/
#screen-game,#screen-lobby { padding-top:0; }
.game-header { width:100%; padding:.75rem 1.5rem; display:flex; align-items:center;
  gap:1.25rem; border-bottom:1px solid var(--mist); background:white;
  flex-wrap:wrap; position:sticky; top:0; z-index:100; }
.game-stat { display:flex; flex-direction:column; font-size:.72rem;
  text-transform:uppercase; letter-spacing:.05em; color:var(--slate); }
.game-stat strong { font-family:var(--font-display); font-size:1.15rem;
  color:var(--ink); font-weight:600; text-transform:none; letter-spacing:0; }
.game-divider { width:1px; height:32px; background:var(--mist); flex-shrink:0; }
.connection-dot { width:8px; height:8px; border-radius:50%;
  background:var(--sage); flex-shrink:0; }
.connection-dot.disconnected { background:var(--rust); animation:pulse-dot 1s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Timer ───────────────────────────────────────────────────────────────────*/
.timer-ring { width:60px; height:60px; flex-shrink:0; position:relative; }
.timer-ring svg { transform:rotate(-90deg); }
.timer-ring .track    { stroke:var(--mist); fill:none; stroke-width:4; }
.timer-ring .progress { fill:none; stroke-width:4; stroke-linecap:round;
  stroke:var(--gold); transition:stroke-dashoffset 1s linear, stroke .5s; }
.timer-ring .label { position:absolute; inset:0; display:flex; align-items:center;
  justify-content:center; font-family:var(--font-mono); font-size:.82rem; font-weight:500; }
.timer-ring.urgent .progress { stroke:var(--rust); }
.timer-ring.urgent .label    { color:var(--rust); }

/* ── Game phases ─────────────────────────────────────────────────────────────*/
.game-phase { display:none; animation:fadeIn .3s ease; }
.game-phase.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

/* ── Card displays ───────────────────────────────────────────────────────────*/
.card-type-label { font-size:.72rem; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:var(--gold); margin-bottom:.75rem; display:block; }
.scenario-card { background:linear-gradient(135deg,#fff 0%,var(--gold-pale) 100%);
  border:2px solid var(--gold-light); border-radius:var(--radius-lg);
  padding:1.75rem 2rem; position:relative; overflow:hidden; }
.scenario-card::after { content:''; position:absolute; top:-40px; right:-40px;
  width:120px; height:120px; border-radius:50%; background:rgba(201,149,42,.08); }
.scenario-text { font-family:var(--font-display); font-size:1.1rem;
  font-style:italic; line-height:1.7; color:var(--ink); }
.consequence-card { background:linear-gradient(135deg,var(--ink) 0%,var(--slate) 100%);
  border-radius:var(--radius-lg); padding:1.75rem 2rem; color:var(--cream); }
.consequence-card .card-type-label { color:var(--gold-light); }
.consequence-card .scenario-text   { color:rgba(245,240,232,.9); }

/* ── Context grid ────────────────────────────────────────────────────────────*/
.context-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.6rem; }
.context-item { background:white; border:1px solid var(--mist);
  border-radius:var(--radius); padding:.65rem; text-align:center; }
.ctx-label { font-size:.68rem; text-transform:uppercase; letter-spacing:.06em;
  color:var(--slate); margin-bottom:.3rem; }
.ctx-value { font-weight:600; font-size:.88rem; }
.ctx-high   { color:var(--rust); }
.ctx-medium { color:var(--gold); }
.ctx-low    { color:var(--sage); }

/* ── Cube display ────────────────────────────────────────────────────────────*/
/* FIX: white background, dark-blue text — no more ink/black background */
.cube-display { display:flex; align-items:center; gap:1.25rem;
  background:white; border:1px solid var(--mist);
  border-radius:var(--radius-lg); padding:1.25rem 1.5rem;
  color:var(--ink); }
.cube-face-icon { width:52px; height:52px; flex-shrink:0; background:var(--gold);
  border-radius:var(--radius); display:flex; align-items:center; justify-content:center;
  font-size:1.4rem; color:var(--ink); animation:rollIn .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes rollIn { 0%{transform:rotate(-90deg) scale(.5);opacity:0}
                    100%{transform:none;opacity:1} }
.cube-face-name { font-family:var(--font-display); font-size:1.2rem;
  font-style:italic; color:var(--slate); }
.cube-face-desc { font-size:.85rem; color:var(--slate); margin-top:.25rem; }

/* ── Learning questions ──────────────────────────────────────────────────────*/
.learning-questions { list-style:none; }
.learning-questions li { padding:.65rem 0; border-bottom:1px solid var(--mist);
  font-family:var(--font-display); font-style:italic; font-size:.95rem; color:var(--slate);
  display:flex; gap:.75rem; align-items:flex-start; }
.learning-questions li:last-child { border-bottom:none; }
.learning-questions li::before { content:'—'; color:var(--gold); flex-shrink:0; margin-top:1px; }

/* ── Scoring ─────────────────────────────────────────────────────────────────*/
.wisdom-score-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.75rem; }
.wisdom-score-option { border:2px solid var(--mist); border-radius:var(--radius-lg);
  padding:1.1rem; cursor:pointer; transition:all var(--transition); text-align:center; }
.wisdom-score-option:hover   { border-color:var(--gold); }
.wisdom-score-option.selected{ border-color:var(--gold); background:var(--gold-pale); }
.score-number { font-family:var(--font-display); font-size:2.2rem;
  font-weight:600; color:var(--gold); line-height:1; }
.score-label  { font-size:.75rem; color:var(--slate); margin-top:.3rem; }
.wisdom-cards-list { display:flex; flex-direction:column; gap:.4rem;
  max-height:240px; overflow-y:auto; padding-right:.25rem; }
.wisdom-card-option { display:flex; align-items:center; gap:.75rem; padding:.65rem 1rem;
  border:1px solid var(--mist); border-radius:var(--radius); cursor:pointer;
  transition:all var(--transition); font-family:var(--font-display);
  font-style:italic; font-size:.9rem; }
.wisdom-card-option:hover    { border-color:var(--gold-light); background:var(--gold-pale); }
.wisdom-card-option.disabled { opacity:.35; pointer-events:none; }
.wisdom-card-option input[type=checkbox] { flex-shrink:0; accent-color:var(--gold);
  width:16px; height:16px; }

/* ── Score strip ─────────────────────────────────────────────────────────────*/
.score-strip { display:flex; gap:.5rem; overflow-x:auto; padding-bottom:.5rem;
  -webkit-overflow-scrolling:touch; }
.score-strip .player-seat { min-width:140px; flex:0 0 auto; padding:.75rem 1rem; }

/* ── Observer banner ─────────────────────────────────────────────────────────*/
.observer-banner { background:var(--slate); color:white; padding:.6rem 1.5rem;
  text-align:center; font-size:.85rem; font-style:italic; }

/* ── Chat ────────────────────────────────────────────────────────────────────*/
.chat-panel { display:flex; flex-direction:column; height:260px;
  border:1px solid var(--mist); border-radius:var(--radius-lg); overflow:hidden; }
.chat-messages { flex:1; overflow-y:auto; padding:1rem; display:flex;
  flex-direction:column; gap:.5rem; background:var(--cream); }
.chat-msg { font-size:.85rem; line-height:1.5; }
.chat-msg .sender { font-weight:600; color:var(--gold); margin-right:.35rem; }
.chat-msg.system  { color:var(--slate); font-style:italic; font-size:.8rem; }
.chat-input-row   { display:flex; gap:.5rem; padding:.75rem; background:white;
  border-top:1px solid var(--mist); }
.chat-input-row input { flex:1; }

/* ── Survey ──────────────────────────────────────────────────────────────────*/
#screen-survey { background:var(--cream); }
.survey-progress { width:100%; height:3px; background:var(--mist);
  border-radius:2px; overflow:hidden; margin-bottom:2rem; }
.survey-progress-bar { height:100%; background:var(--gold);
  transition:width .4s cubic-bezier(.4,0,.2,1); }
.survey-question { display:none; }
.survey-question.active { display:block; animation:fadeIn .3s ease; }
.question-text { font-family:var(--font-display); font-size:1.15rem;
  font-style:italic; color:var(--ink); margin-bottom:1.5rem; line-height:1.65; }
.scale-track  { display:flex; gap:.4rem; align-items:center; }
.scale-btn { flex:1; aspect-ratio:1; border:1.5px solid var(--mist); border-radius:var(--radius);
  background:white; cursor:pointer; font-family:var(--font-mono); font-size:.88rem;
  color:var(--slate); transition:all var(--transition); }
.scale-btn:hover   { border-color:var(--gold); color:var(--gold); }
.scale-btn.selected{ background:var(--gold); border-color:var(--gold); color:white; }
.scale-labels { display:flex; justify-content:space-between; font-size:.72rem;
  color:var(--slate); margin-top:.5rem; }

/* ── Debrief ─────────────────────────────────────────────────────────────────*/
#screen-debrief { background:var(--cream); padding-top:0; }
.debrief-prompt { background:var(--gold-pale); border:1px solid var(--gold-light);
  border-radius:var(--radius-lg); padding:1.25rem 1.5rem; margin-bottom:1rem; }
.debrief-prompt p { font-family:var(--font-display); font-style:italic; font-size:1.05rem; }

/* ── Scoreboard ──────────────────────────────────────────────────────────────*/
.scoreboard     { display:flex; flex-direction:column; gap:.5rem; }
.score-row      { display:flex; align-items:center; gap:1rem; padding:.75rem 1rem;
  border-radius:var(--radius); background:var(--cream); border:1px solid var(--mist); }
.score-row.winner { background:var(--gold-pale); border-color:var(--gold); }
.score-rank     { font-family:var(--font-mono); font-size:.85rem; width:24px; color:var(--slate); }
.score-name     { font-weight:500; flex:1; }
.score-cards    { font-family:var(--font-mono); font-size:.95rem; color:var(--gold); font-weight:500; }

/* ── End screen ──────────────────────────────────────────────────────────────*/
/* FIX: more celebratory, richer background, confetti stars */
#screen-end     { justify-content:center; background:var(--ink); color:var(--cream); overflow:hidden; }
.end-bg         { position:fixed; inset:0;
  background:
    radial-gradient(ellipse 50% 35% at 30% 20%, rgba(201,149,42,.18) 0%, transparent 55%),
    radial-gradient(ellipse 40% 50% at 70% 80%, rgba(74,103,65,.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 55%, rgba(201,149,42,.10) 0%, transparent 60%),
    var(--ink); }
.end-panel      { position:relative; z-index:1; width:100%; max-width:600px; text-align:center;
  padding:2rem 1.5rem; }
.trophy-icon    { font-size:5rem; margin-bottom:.75rem;
  animation:pulseTrophy 1.8s ease-in-out infinite, floatUp .6s ease both; }
@keyframes pulseTrophy { 0%,100%{transform:scale(1) rotate(-3deg)} 50%{transform:scale(1.1) rotate(3deg)} }
@keyframes floatUp     { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }
.end-stars { position:fixed; inset:0; pointer-events:none; overflow:hidden; z-index:0; }
.end-star  { position:absolute; font-size:1.2rem; opacity:0;
  animation: starFall linear infinite; }
@keyframes starFall {
  0%   { opacity:0; transform:translateY(-20px) rotate(0deg); }
  10%  { opacity:.7; }
  90%  { opacity:.5; }
  100% { opacity:0; transform:translateY(100vh) rotate(720deg); }
}
.end-download-btn {
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.75rem 1.75rem; border-radius:var(--radius);
  background:rgba(255,255,255,.1); color:var(--gold-light);
  border:1px solid rgba(201,149,42,.4); font-size:.9rem; font-weight:500;
  cursor:pointer; transition:all var(--transition); text-decoration:none;
  margin-top:.75rem;
}
.end-download-btn:hover { background:rgba(201,149,42,.2); border-color:var(--gold-light); }

/* ── Observer waiting message in decision phase ──────────────────────────── */
.observer-decision-wait {
  text-align:center; padding:3rem 1.5rem; color:var(--slate);
  font-style:italic; font-family:var(--font-display); font-size:1.1rem;
}

/* ── Dashboard ───────────────────────────────────────────────────────────────*/
/* FIX: sidebar white with dark-blue text, not black */
#screen-dashboard { flex-direction:row; padding:0; align-items:stretch;
  min-height:100vh; }
.dashboard-sidebar { width:220px; flex-shrink:0; background:white;
  border-right:1px solid var(--mist);
  padding:1.5rem; color:var(--slate); min-height:100vh;
  display:flex; flex-direction:column; gap:.25rem; }
.dash-logo { font-family:var(--font-display); font-size:1.3rem; color:var(--slate);
  margin-bottom:2rem; padding:.5rem 0; }
.dash-nav-item { display:flex; align-items:center; gap:.75rem; padding:.65rem .75rem;
  border-radius:var(--radius); color:var(--slate); cursor:pointer;
  transition:all var(--transition); font-size:.9rem; }
.dash-nav-item:hover,.dash-nav-item.active { background:var(--gold-pale); color:var(--ink); }
.dash-nav-item.active { color:var(--gold); font-weight:600; }
.dash-content { flex:1; padding:2rem; overflow-y:auto; }
.dash-panel   { display:none; }
.dash-panel.active { display:block; animation:fadeIn .2s ease; }
.stat-cards   { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:1rem; margin-bottom:2rem; }
.stat-card    { background:white; border:1px solid var(--mist);
  border-radius:var(--radius-lg); padding:1.25rem 1.5rem; }
.stat-value   { font-family:var(--font-display); font-size:2rem; font-weight:600; color:var(--gold); }
.stat-label   { font-size:.8rem; color:var(--slate); margin-top:.25rem; }
.data-table   { width:100%; border-collapse:collapse; font-size:.88rem; }
.data-table th { text-align:left; padding:.65rem 1rem; background:var(--cream);
  border-bottom:2px solid var(--mist); font-size:.72rem; text-transform:uppercase;
  letter-spacing:.06em; color:var(--slate); }
.data-table td { padding:.7rem 1rem; border-bottom:1px solid var(--mist); vertical-align:top; }
.data-table tr:last-child td { border-bottom:none; }
.data-table tr:hover td      { background:var(--cream); }
.status-badge { display:inline-block; padding:.2rem .6rem; border-radius:20px;
  font-size:.72rem; font-weight:600; }
.status-active    { background:rgba(74,103,65,.15);  color:var(--sage); }
.status-lobby     { background:rgba(201,149,42,.15); color:var(--gold); }
.status-debrief   { background:rgba(61,74,92,.15);   color:var(--slate); }
.status-completed { background:var(--mist); color:var(--slate); }

/* ── Responsive ──────────────────────────────────────────────────────────────*/
@media (max-width:768px) {
  .game-header { gap:.75rem; padding:.75rem 1rem; }
  .game-divider { display:none; }
  .row { flex-direction:column; }
  .col  { min-width:100%; }
  .context-grid { grid-template-columns:repeat(2,1fr); }
  .wisdom-score-grid { grid-template-columns:repeat(3,1fr); }
  .auth-panel { padding:2rem 1.5rem; }
  .dashboard-sidebar { display:none; }
  .screen { padding:1rem .75rem; }
  .scenario-card,.consequence-card { padding:1.25rem 1.5rem; }
}
@media (max-width:480px) {
  .wisdom-score-grid { grid-template-columns:repeat(3,1fr); gap:.4rem; }
  .score-number { font-size:1.8rem; }
  .score-label  { font-size:.68rem; }
  .context-grid { grid-template-columns:repeat(2,1fr); }
}

/* ── Survey textarea (Track 2 — all open text questions) ─────────────────── */
.survey-textarea { min-height: 130px; font-size: .95rem; line-height: 1.7; }

/* ── Logo nav ────────────────────────────────────────────────────────────── */
.logo-mark img { border-radius: 4px; }

/* ── "YOU" seat highlight ────────────────────────────────────────────────── */
.seat-avatar-me {
  background: var(--gold) !important;
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--gold);
}

/* ── Consent gate card ───────────────────────────────────────────────────── */
#screen-consent-gate { justify-content: center; }

/* ── Context radar chart ─────────────────────────────────────────────────── */
.context-grid { padding:.5rem 0; }
/* FIX: larger radar labels — match learning-question prose size */
.context-grid svg text { font-size:13px; }

/* ── Cube face coloured badge ────────────────────────────────────────────── */
.cube-face-icon {
  width:3rem; height:3rem; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:1.4rem; font-weight:700; color:#fff;
  background: #4a5568;   /* default — overridden by JS */
  flex-shrink:0;
  transition: background .3s ease;
}
.cube-face-name { font-size:1.05rem; font-weight:600; margin-bottom:.25rem; }

/* ── Wisdom card options with owl ────────────────────────────────────────── */
.wisdom-card-option {
  display:flex; align-items:center; gap:.75rem;
  padding:.6rem .75rem; border-radius:var(--radius);
  border:1.5px solid var(--mist); margin-bottom:.4rem;
  cursor:pointer; transition:border-color .15s, background .15s;
}
.wisdom-card-option:hover    { border-color:var(--gold-light); background:var(--gold-pale); }
.wisdom-card-option:has(input:checked) {
  border-color:var(--gold); background:var(--gold-pale);
}

/* ── Back-to-home bar (for screens without a full nav) ───────────────────── */
.back-home-bar {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  z-index: 10;
}
.back-home-btn {
  font-size: .82rem;
  padding: .3rem .75rem;
  opacity: .75;
  transition: opacity var(--transition);
}
.back-home-btn:hover { opacity: 1; }

/* ── Docs dropdown ───────────────────────────────────────────────────────── */
.docs-dropdown { position:relative; }
.docs-trigger  { white-space:nowrap; }
.docs-menu {
  position:absolute; right:0; top:calc(100% + 6px);
  background:white; border:1px solid var(--mist);
  border-radius:var(--radius); box-shadow:0 8px 24px rgba(0,0,0,.12);
  min-width:210px; z-index:200; padding:.4rem 0;
}
.docs-item {
  display:flex; align-items:center; gap:.6rem;
  padding:.55rem 1rem; font-size:.875rem; color:var(--ink);
  text-decoration:none; transition:background .1s;
}
.docs-item:hover { background:var(--cream); }

/* ── Learning card coloured backgrounds (match PDF face colours) ─────────── */
.learning-card-near     { background:#E8821A; }
.learning-card-ahead    { background:#7B8C1A; }
.learning-card-above    { background:#1A5C5C; }
.learning-card-backwards{ background:#B22222; }
.learning-card-far      { background:#C8A800; }
.learning-card-below    { background:#6A2D8A; }

/* ── "Your Turn" draw card ───────────────────────────────────────────────── */
#phase-draw .card img { display:block; margin:0 auto; }

/* ── 3D CSS Cube ─────────────────────────────────────────────────────────── */
/* FIX: wrap scene in a fixed-height block so siblings are not overlapped by
   translateZ() painted faces. The wrapper reserves 160px of vertical space
   (110px cube + 50px visual bleed). */
.cube3d-wrapper {
  width: 110px;
  height: 160px;           /* enough to contain the 3D bleed */
  margin: 0 auto .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.cube3d-scene {
  width:110px; height:110px;
  perspective:340px;
  /* Do NOT use isolation or contain here — they break preserve-3d */
}
.cube3d {
  width:100%; height:100%;
  position:relative;
  transform-style:preserve-3d;
  transform: rotateX(-20deg) rotateY(30deg);
  transition: transform .6s ease;
}
.cube3d-spin {
  animation: cube-roll .7s ease forwards;
}
@keyframes cube-roll {
  0%   { transform: rotateX(-20deg) rotateY(30deg); }
  50%  { transform: rotateX(-40deg) rotateY(200deg); }
  100% { transform: rotateX(-20deg) rotateY(390deg); }
}
.cube3d-face {
  position:absolute;
  width:110px; height:110px;
  border:2px solid rgba(255,255,255,.25);
  border-radius:8px;
  box-shadow: inset 0 0 12px rgba(0,0,0,.18);
  backface-visibility:visible;
  display:flex; align-items:center; justify-content:center;
  font-size:1.6rem; font-weight:700; color:#fff;
  transition: background .4s ease;
}
.cube3d-front  { transform: translateZ(55px); }
.cube3d-back   { transform: rotateY(180deg) translateZ(55px); }
.cube3d-right  { transform: rotateY( 90deg) translateZ(55px); }
.cube3d-left   { transform: rotateY(-90deg) translateZ(55px); }
.cube3d-top    { transform: rotateX( 90deg) translateZ(55px); }
.cube3d-bottom { transform: rotateX(-90deg) translateZ(55px); }

/* ── Context radar chart — larger ────────────────────────────────────────── */
.context-grid svg {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0 auto;
}

/* ── Extend timer button ─────────────────────────────────────────────────── */
#btn-extend-timer {
  border:1px solid var(--gold-light);
  color:var(--gold);
  border-radius:var(--radius);
  white-space:nowrap;
}
#btn-extend-timer:disabled { opacity:.4; cursor:default; }

/* ── Site Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 3rem 1.5rem 0;
  margin-top: auto;
  font-size: .9rem;
}
.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 640px) {
  .site-footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.footer-tagline {
  font-size: .82rem;
  color: rgba(245,240,232,.55);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.footer-heading {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(245,240,232,.45);
  margin-bottom: .9rem;
  font-weight: 600;
}
.footer-link {
  display: block;
  color: rgba(245,240,232,.75);
  text-decoration: none;
  margin-bottom: .55rem;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--cream); }
.footer-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: .9rem;
  color: rgba(245,240,232,.75);
  padding: 0;
  display: block;
  margin-bottom: .55rem;
  text-align: left;
  transition: color var(--transition);
}
.footer-link-btn:hover { color: var(--cream); }
.footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 0;
  font-size: .78rem;
  color: rgba(245,240,232,.35);
  text-align: center;
}

/* ── FAQ screen ──────────────────────────────────────────────────────────── */
.faq-group {
  margin-bottom: 2.5rem;
}
.faq-section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--slate);
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--gold-pale);
}
.faq-item {
  margin-bottom: 1.5rem;
}
.faq-q {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: .4rem;
}
.faq-a {
  color: #444;
  line-height: 1.75;
  font-size: .95rem;
}
.faq-a a { color: var(--gold); }
.faq-contact-box {
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 3rem;
}
.faq-contact-box h2 { color: var(--slate); }
.faq-contact-box p  { color: #555; margin-top: .4rem; }

/* ── End screen stars (celebration) ─────────────────────────────────────── */
#end-stars-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9000;
  overflow: hidden;
}
.end-star {
  position: absolute;
  animation: starFall linear forwards;
  opacity: 0;
}
@keyframes starFall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}
.end-download-btn {
  background: var(--slate);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  padding: .65rem 1.4rem;
  font-family: var(--font-ui);
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.end-download-btn:hover { background: var(--ink); }

/* ── Observer waiting message ────────────────────────────────────────────── */
.observer-decision-wait {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--slate);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
}
.screen { position: relative; }
