/* ===================== 100 Trying — styles ===================== */

:root {
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --bg-sunken: #eef1f7;
  --text: #1b2130;
  --text-soft: #5a6478;
  --border: #d9deea;

  --accent: #2f6fed;   /* requests  */
  --accent-2: #7c5cff; /* logo / progress accent */
  --success: #1f9d57;  /* 2xx       */
  --warning: #e08600;  /* provisional / 3xx / 401 */
  --danger: #d8413a;   /* 4xx/5xx/6xx, BYE, CANCEL */
  --neutral: #8a93a6;  /* 100, ACK  */

  --accent-bob: #2f6fed;
  --accent-alice: #e08600;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 30px rgba(20, 30, 60, 0.08);
  --shadow-soft: 0 2px 10px rgba(20, 30, 60, 0.06);
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark palette — applied on an explicit dark choice, and on "system" when the OS prefers dark. */
:root[data-theme="dark"] {
  --bg: #0e1320;
  --bg-elev: #161d2e;
  --bg-sunken: #0a0f1a;
  --text: #e8ecf5;
  --text-soft: #9aa6bd;
  --border: #273149;

  --accent: #5b8dff;
  --accent-2: #9d86ff;
  --success: #3fce7e;
  --warning: #ffb74d;
  --danger: #ff6b63;
  --neutral: #6f7a90;

  --accent-bob: #5b8dff;
  --accent-alice: #ffb74d;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0e1320;
    --bg-elev: #161d2e;
    --bg-sunken: #0a0f1a;
    --text: #e8ecf5;
    --text-soft: #9aa6bd;
    --border: #273149;

    --accent: #5b8dff;
    --accent-2: #9d86ff;
    --success: #3fce7e;
    --warning: #ffb74d;
    --danger: #ff6b63;
    --neutral: #6f7a90;

    --accent-bob: #5b8dff;
    --accent-alice: #ffb74d;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.screen { display: none; }
.screen.active { display: block; }

.logo-name {
  color: var(--accent);
  font-weight: 800;
}
.logo-suffix {
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.85em;
}

/* ===================== Buttons ===================== */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.6rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); }

/* ===================== Language switch ===================== */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ===================== Splash ===================== */
.splash {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
  position: relative;
  background:
    radial-gradient(1100px 500px at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent),
    var(--bg);
}
.splash.active { display: flex; }
.splash-controls {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  z-index: 5;
}

.splash-inner {
  max-width: 640px;
  width: 100%;
  text-align: center;
  position: relative;
  background-color: var(--bg-elev);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%235f6a82' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' opacity='0.09'%3E%3Cg transform='translate(22 30) scale(1.9)'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/g%3E%3Cg transform='translate(338 250) scale(0.65)'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/g%3E%3Cg transform='translate(150 320) scale(1.15)'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/g%3E%3Cg transform='translate(316 68) scale(1.7)'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/g%3E%3Cg transform='translate(120 150) scale(0.6)'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/g%3E%3Cg transform='translate(40 300) scale(1.0)'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/g%3E%3Ctext x='196' y='140' font-family='monospace' font-size='34' font-weight='700' fill='%235f6a82' stroke='none'%3ESIP%3C/text%3E%3Ctext x='44' y='236' font-family='monospace' font-size='15' font-weight='700' fill='%235f6a82' stroke='none'%3EBYE%3C/text%3E%3Ctext x='330' y='388' font-family='monospace' font-size='21' font-weight='700' fill='%235f6a82' stroke='none'%3ESIP%3C/text%3E%3Ctext x='268' y='58' font-family='monospace' font-size='30' font-weight='700' fill='%235f6a82' stroke='none'%3E@%3C/text%3E%3Ctext x='96' y='384' font-family='monospace' font-size='16' font-weight='700' fill='%235f6a82' stroke='none'%3E@%3C/text%3E%3Ctext x='392' y='300' font-family='monospace' font-size='12' font-weight='700' fill='%235f6a82' stroke='none'%3E@%3C/text%3E%3Ctext x='30' y='128' font-family='monospace' font-size='18' font-weight='700' fill='%235f6a82' stroke='none'%3E200 OK%3C/text%3E%3Ctext x='300' y='340' font-family='monospace' font-size='12' font-weight='700' fill='%235f6a82' stroke='none'%3E200 OK%3C/text%3E%3Ctext x='250' y='220' font-family='monospace' font-size='27' font-weight='700' fill='%235f6a82' stroke='none'%3E488%3C/text%3E%3Ctext x='60' y='388' font-family='monospace' font-size='13' font-weight='700' fill='%235f6a82' stroke='none'%3E488%3C/text%3E%3Ctext x='150' y='250' font-family='monospace' font-size='15' font-weight='700' fill='%235f6a82' stroke='none'%3EACK%3C/text%3E%3Ctext x='370' y='150' font-family='monospace' font-size='11' font-weight='700' fill='%235f6a82' stroke='none'%3EACK%3C/text%3E%3Ctext x='200' y='366' font-family='monospace' font-size='12' font-weight='700' fill='%235f6a82' stroke='none'%3E180 Ringing%3C/text%3E%3Ctext x='120' y='252' font-family='monospace' font-size='13' font-weight='700' fill='%235f6a82' stroke='none'%3EINVITE%3C/text%3E%3Ctext x='24' y='196' font-family='monospace' font-size='11' font-weight='700' fill='%235f6a82' stroke='none'%3ECANCEL%3C/text%3E%3Cpath d='M366 46v-9M374 46v-16M382 46v-23M390 46v-30'/%3E%3Cpath d='M22 352v-4M28 352v-7M34 352v-11M40 352v-15' stroke-width='1.1'/%3E%3Cg transform='translate(160 40) scale(1.0)'%3E%3Crect x='0' y='0' width='30' height='22' rx='6'/%3E%3Cpath d='M8 30l4-8h6'/%3E%3C/g%3E%3Cg transform='translate(30 360) scale(0.55)'%3E%3Crect x='0' y='0' width='30' height='22' rx='6'/%3E%3Cpath d='M8 30l4-8h6'/%3E%3C/g%3E%3Cg transform='translate(376 348) scale(0.8)'%3E%3Crect x='0' y='0' width='30' height='22' rx='6'/%3E%3Cpath d='M8 30l4-8h6'/%3E%3C/g%3E%3Ccircle cx='210' cy='96' r='2.6' fill='%235f6a82' stroke='none'/%3E%3Ccircle cx='104' cy='250' r='1.4' fill='%235f6a82' stroke='none'/%3E%3Ccircle cx='300' cy='170' r='2' fill='%235f6a82' stroke='none'/%3E%3Ccircle cx='88' cy='96' r='1.2' fill='%235f6a82' stroke='none'/%3E%3Ccircle cx='250' cy='300' r='1.8' fill='%235f6a82' stroke='none'/%3E%3Ccircle cx='390' cy='230' r='1.4' fill='%235f6a82' stroke='none'/%3E%3Ccircle cx='150' cy='196' r='2.2' fill='%235f6a82' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 2rem 2.6rem;
}

.logo {
  font-size: clamp(2.6rem, 8vw, 4rem);
  margin: 0.2rem 0 0.1rem;
  letter-spacing: -1px;
}
.logo .logo-suffix { font-size: 0.62em; }
.splash-sub { color: var(--text-soft); font-size: 0.98rem; margin: 0.2rem 0 1rem; }
.tagline {
  font-size: 1.08rem;
  line-height: 1.5;
  margin: 0 auto 1.6rem;
  max-width: 30rem;
}

.level-scale {
  display: flex;
  flex-direction: column;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 1.8rem;
  text-align: left;
}
.scale-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.32rem 0;
}
/* connecting line between the level badges */
.scale-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.1rem - 1px);
  top: 50%;
  height: 100%;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
.scale-emoji {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 50%;
}
.scale-name { font-weight: 600; font-size: 0.95rem; }
.btn-start { font-size: 1.1rem; padding: 0.95rem 2.4rem; }

/* ===================== Game header ===================== */
.game { max-width: 1180px; margin: 0 auto; padding: 1rem 1.2rem 3rem; }
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.header-title { font-size: 1.4rem; font-weight: 800; }
.header-stats { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.header-right { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.header-stat { font-size: 0.9rem; color: var(--text-soft); }
.header-stat strong { color: var(--text); font-size: 1.05rem; }

/* Icon-only button (theme toggle) */
.btn-icon {
  padding: 0.4rem;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  line-height: 1;
}
.btn-icon .theme-icon { font-size: 1.05rem; }

/* ===================== Level block ===================== */
.level-block { margin: 1rem 0 1.2rem; }
.level-badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}
.level-emoji { font-size: 1.7rem; }
.level-text { display: flex; flex-direction: column; line-height: 1.1; }
.level-caption { font-size: 0.72rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.level-name { font-size: 1.05rem; font-weight: 700; }
.level-next { margin-left: auto; font-size: 0.85rem; color: var(--text-soft); }

.xp-bar {
  position: relative;
  height: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: visible;
}
.xp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.xp-markers { position: absolute; inset: 0; }
.xp-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  transform: translate(-50%, -50%);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.xp-marker.passed { background: var(--success); border-color: var(--success); }
.xp-marker.current {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 30%, transparent);
}

/* ===================== Two columns ===================== */
.game-main {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
  gap: 1.4rem;
  margin-top: 0.4rem;
}
.col {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-soft);
}

/* ===================== Ladder diagram ===================== */
.ladder-agents {
  display: grid;
  grid-template-columns: 24% 1fr 24%;
  align-items: center;
  justify-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.agent { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.agent-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border-radius: 12px;
}
.agent-icon.bob { background: color-mix(in srgb, var(--accent-bob) 18%, transparent); }
.agent-icon.alice { background: color-mix(in srgb, var(--accent-alice) 20%, transparent); }
.agent-name { font-weight: 700; }
.agent-role { font-size: 0.72rem; color: var(--text-soft); font-family: var(--mono); }
.call-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}
.call-status[data-status="connected"] { color: var(--success); border-color: var(--success); }
.call-status[data-status="ringing"] { color: var(--warning); border-color: var(--warning); }
.call-status[data-status="ending"] { color: var(--danger); border-color: var(--danger); }
.call-status[data-status="calling"] { color: var(--accent); border-color: var(--accent); }

.ladder-canvas {
  position: relative;
  padding: 0.6rem 0;
  min-height: 180px;
}
.lifeline {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(var(--border) 0 6px, transparent 6px 12px);
}
.lifeline-left { left: 12%; }
.lifeline-right { right: 12%; }

.arrows { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.55rem; }
.arrow-row {
  position: relative;
  margin: 0 12%;
  height: 30px;
  display: flex;
  align-items: center;
  animation: arrowIn 0.35s ease;
}
@keyframes arrowIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.arrow-label {
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-family: var(--mono);
  font-weight: 600;
  background: var(--bg-elev);
  padding: 0 0.35rem;
  white-space: nowrap;
  max-width: 96%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}
.arrow-line {
  position: absolute;
  left: 0; right: 0;
  top: 60%;
  height: 2px;
}
.arrow-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateY(-50%);
}
/* direction */
.arrow-row.in .arrow-line::after { right: -1px; border-left: 8px solid currentColor; }
.arrow-row.out .arrow-line::after { left: -1px; border-right: 8px solid currentColor; }

.arrow-row.accent { color: var(--accent); }
.arrow-row.success { color: var(--success); }
.arrow-row.warning { color: var(--warning); }
.arrow-row.danger { color: var(--danger); }
.arrow-row.neutral { color: var(--neutral); }
.arrow-line { background: currentColor; }
.arrow-row.reply .arrow-label { box-shadow: 0 0 0 1px currentColor; border-radius: 4px; }

.situation { margin-top: 1rem; }
.situation-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  font-weight: 700;
}
.situation p { margin: 0.3rem 0 0; line-height: 1.5; }

/* ===================== Question column ===================== */
.raw-block { margin-bottom: 1.1rem; }
.raw-label, .explanation-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  font-weight: 700;
}
.raw-sip {
  margin: 0.35rem 0 0;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
  max-height: 220px;
  overflow-y: auto;
}
.tok-method { color: var(--accent); font-weight: 700; }
.tok-status { color: var(--warning); font-weight: 700; }
.tok-header { color: var(--success); }
.tok-comment { color: var(--text-soft); }

.q-meta { margin-bottom: 0.5rem; }
.category-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
}
.question-text { font-size: 1.15rem; margin: 0.2rem 0 1rem; line-height: 1.35; }

.options { display: flex; flex-direction: column; gap: 0.55rem; }
.option {
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; }
.option .opt-key {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-soft);
  flex: 0 0 auto;
}
.option.correct {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}
.option.correct .opt-key { color: var(--success); }
.option.wrong {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.option.wrong .opt-key { color: var(--danger); }

/* ===================== Feedback ===================== */
.feedback { margin-top: 1.1rem; animation: arrowIn 0.3s ease; }
.feedback-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}
.feedback-badge.ok { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.feedback-badge.no { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.explanation p { margin: 0.3rem 0 0.6rem; line-height: 1.5; }
.reference { font-size: 0.85rem; color: var(--text-soft); }
.reference code {
  font-family: var(--mono);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  color: var(--text);
}
.feedback .btn { margin-top: 1rem; }

/* ===================== Results ===================== */
.results {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
}
.results.active { display: flex; }
.results-card {
  max-width: 460px;
  width: 100%;
  text-align: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 2rem;
}
.results-emoji { font-size: 4rem; }
.results-title { margin: 0.4rem 0 0.2rem; }
.results-level { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.8rem; }
.results-motivation { color: var(--text-soft); line-height: 1.5; margin-bottom: 1.4rem; }
.results-stats { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.6rem; }
.results-stat strong { font-size: 1.6rem; }
.results-card .btn { display: block; width: 100%; margin-top: 0.6rem; }

/* ===================== Quit modal ===================== */
.btn-danger { background: var(--danger); }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: color-mix(in srgb, #000 45%, transparent);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  text-align: center;
  animation: arrowIn 0.22s ease;
}
.modal-title { margin: 0 0 1rem; font-size: 1.3rem; }
.modal-stats {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.modal-stat { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.modal-stat-label { font-size: 0.8rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.modal-stat-value { font-weight: 700; }
.modal-body { color: var(--text-soft); margin: 0 0 1.4rem; }
.modal-actions { display: flex; gap: 0.6rem; }
.modal-actions .btn { flex: 1 1 0; }

/* ===================== Toast ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 120%);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0.8rem 1.2rem;
  z-index: 50;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  opacity: 0;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-emoji { font-size: 1.8rem; }
.toast-text { display: flex; flex-direction: column; line-height: 1.2; }
.toast-title { font-size: 0.74rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.toast-name { font-weight: 800; }

/* ===================== Celebration canvas ===================== */
.fx-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
}

/* ===================== Responsive ===================== */
@media (max-width: 820px) {
  .game-main { grid-template-columns: 1fr; }
  .col-question { order: -1; }
}
@media (max-width: 520px) {
  .splash-inner { padding: 1.8rem 1.2rem 2rem; }
  .header-right { width: 100%; justify-content: space-between; }
  .results-stats { gap: 1.2rem; }
}
