/* Created: 2026-10-20 (AUD-2293); identity pass 2026-10-20 (AUD-2296)
   Purpose: styles for the listening quiz at demo.intrect.io/survey/ (quiz, method and privacy pages).
   World: the intrect.io home (web/landing/css/redesign.css, `.rd` tokens) - studio black ground,
   graphite panels, one action blue, hairlines, flat. The quiz is a listening rack: the only lit
   thing on screen is the clip that is playing.
   Fonts are self-hosted under /fonts (CSP font-src 'self'); the files are OFL, notices alongside.
   CSP style-src 'self': nothing here relies on inline style attributes. */

@font-face {
  font-family: 'Archivo';
  src: url('/survey/fonts/archivo-latin-400-700-8f704806.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Stack Sans Notch';
  src: url('/survey/fonts/stack-sans-notch-latin-700-639fb17e.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/survey/fonts/jetbrains-mono-latin-400-600-83c005d4.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --ground: #0b0b10;
  --panel: #1a1a22;
  --inset: #121218;
  --well: #0e0e14;
  --raise: #22222c;
  --text: #e8e8ec;
  --accent: #5aa7f0;
  --accent-hover: #7cbaf4;
  --accent-ink: #06101c;
  --accent-wash: rgba(90, 167, 240, 0.14);
  --accent-line: rgba(90, 167, 240, 0.62);
  /* Text tiers: --muted is about 9:1 on the ground, --quiet about 5.5:1 and still passes on panels. */
  --muted: rgba(232, 232, 236, 0.74);
  --quiet: rgba(232, 232, 236, 0.6);
  /* Lines only, never text. --field is the 3:1 boundary of an input (WCAG 1.4.11). */
  --line: rgba(232, 232, 236, 0.09);
  --line-lit: rgba(232, 232, 236, 0.17);
  --line-strong: rgba(232, 232, 236, 0.3);
  --field: #727282;
  /* Status colours: a verdict, never decoration. */
  --good: #34d399;
  --bad: #f87171;
  --r-panel: 8px;
  --r-inset: 6px;
  --r-ctl: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: 'Archivo', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Helvetica Neue',
    Arial, sans-serif;
  /* Brand face: names and headlines only, weight 700, tight tracking. */
  --brand: 'Stack Sans Notch', 'Archivo', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic',
    'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #34343f var(--ground);
  scrollbar-width: thin;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--accent);
}

::selection {
  background: rgba(90, 167, 240, 0.38);
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: var(--r-ctl);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.skip-link:hover {
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------- header */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-word {
  font-family: var(--brand);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}

.brand:hover .brand-word {
  opacity: 0.88;
}

.brand-suffix {
  padding-left: 14px;
  border-left: 1px solid var(--line-lit);
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.ctl {
  padding: 7px 12px;
  border: 1px solid var(--line-lit);
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--text);
  font: 600 13px/1.2 var(--sans);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ctl:hover {
  border-color: var(--line-strong);
  background: var(--inset);
}

.ctl[aria-pressed='false'] {
  color: var(--quiet);
}

/* ---------------------------------------------------------------- layout */

.container {
  flex: 1;
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.container:focus {
  outline: none;
}

.screen {
  animation: screen-in 0.2s ease-out;
}

@keyframes screen-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.status {
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent);
  border-radius: var(--r-inset);
  background: color-mix(in srgb, var(--bad) 12%, var(--ground));
  color: #ffd9d9;
  font-size: 14px;
}

/* ----------------------------------------------------------------- type */

.screen-title,
.result-title,
.stage-name {
  font-family: var(--brand);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.screen-title,
.result-title {
  font-size: clamp(34px, 6vw, 48px);
}

.stage-name {
  font-size: clamp(30px, 5vw, 40px);
}

.screen-title:focus,
.result-title:focus,
.stage-name:focus,
.reveal:focus {
  outline: none;
}

.subtitle {
  margin-top: 14px;
  max-width: 56ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.byline {
  margin-top: 12px;
  font-size: 13px;
  color: var(--quiet);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-subtitle {
  margin-top: 22px;
  font-size: 15px;
  font-weight: 700;
}

.caption {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--quiet);
}

.fineprint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--quiet);
  text-align: center;
}

.tip {
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}

.empty {
  padding: 22px 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------- panels */

.card {
  margin-top: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--panel);
}

.card-resume {
  margin-top: 22px;
  border-color: var(--accent-line);
  background: var(--accent-wash);
}

.card-resume p {
  margin-bottom: 14px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rules {
  margin-top: 28px;
  padding-block: 8px;
  list-style: none;
}

.rules li {
  padding: 13px 0 13px 22px;
  border-top: 1px solid var(--line);
  position: relative;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.rules li:first-child {
  border-top: 0;
}

.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.2em;
  width: 10px;
  height: 2px;
  background: var(--line-strong);
}

.footnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.footnav a {
  color: var(--muted);
  text-decoration: none;
}

.footnav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.doc-foot {
  width: min(720px, calc(100% - 40px));
  margin: 0 auto 56px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  font: 600 15px/1.3 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

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

.btn-block {
  display: block;
  width: 100%;
  margin-top: 16px;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--text);
}

.btn-small {
  padding: 8px 18px;
  font-size: 13px;
}

/* ----------------------------------------------------------- leaderboard */

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lb-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--quiet);
}

.lb-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
}

.lb-table .lb-nick {
  max-width: 190px;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-table .lb-score {
  font-weight: 600;
  text-align: right;
}

.lb-table tr.is-mine td {
  background: var(--accent-wash);
}

.lb-you {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ----------------------------------------------------------- stage intro */

.intro {
  padding-top: 8px;
}

.intro-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.stage-number {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.stage-description {
  margin-top: 14px;
  max-width: 56ch;
  font-size: 17px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  list-style: none;
}

.chip-row li {
  padding: 4px 12px;
  border: 1px solid var(--line-lit);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.intro > .score-box {
  display: inline-grid;
  margin-top: 22px;
}

/* ladder: where this stage sits among the seven steps (warm-up plus six) */

.ladder {
  display: flex;
  gap: 5px;
  list-style: none;
}

.ladder .step {
  width: 26px;
  height: 4px;
  border-radius: 1px;
  background: var(--line-lit);
}

.ladder .step.done {
  background: var(--quiet);
}

.ladder .step.now {
  background: var(--text);
}

/* lives: three segments, lit while kept, hairline once spent */

.lives {
  display: flex;
  gap: 5px;
}

.life {
  width: 20px;
  height: 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--text);
}

.life.spent {
  border-color: var(--line-lit);
  background: transparent;
}

/* -------------------------------------------------------------- question */

.hud {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px 20px;
  margin-bottom: 18px;
}

.hud-left {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.hud-right {
  display: flex;
  gap: 8px;
}

.stage-badge {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar {
  position: relative;
  flex: 1;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--well);
}

.bar-fill {
  width: 0;
  height: 100%;
  background: var(--muted);
  transition: width 0.2s ease-out;
}

/* the in-stage bar reads as five segments */
#q-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(20% - 2px),
    var(--well) calc(20% - 2px),
    var(--well) 20%
  );
}

.count {
  min-width: 3ch;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.score-box {
  display: grid;
  gap: 4px;
  min-width: 78px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-inset);
  background: var(--well);
}

.score-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
}

.score-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.score-box .lives {
  height: 22px;
  align-items: center;
}

.note-warmup {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-inset);
  background: var(--inset);
  font-size: 14px;
  color: var(--muted);
}

/* player rack: transport on the left, hint, meter and time on the right */

.player {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'controls hint'
    'controls bar'
    'controls time';
  align-items: center;
  gap: 4px 22px;
  margin-top: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

/* The one lit thing in the room: the clip that is playing. */
.player[data-state='playing'] {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px rgba(90, 167, 240, 0.3), 0 6px 20px -8px rgba(90, 167, 240, 0.5);
}

.player-controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-play {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-play:hover {
  background: var(--accent-hover);
}

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

#play-icon {
  display: grid;
  place-items: center;
}

.btn-play .i-pause,
.player[data-state='playing'] .btn-play .i-play {
  display: none;
}

.player[data-state='playing'] .btn-play .i-pause {
  display: block;
}

.btn-replay {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-lit);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-replay:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.play-hint {
  grid-area: hint;
  font-size: 14px;
  color: var(--muted);
}

.play-hint.is-error {
  color: var(--bad);
}

.clip-bar {
  grid-area: bar;
  height: 12px;
  margin: 6px 0;
}

.clip-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 4px,
    var(--well) 4px,
    var(--well) 6px
  );
}

.player[data-state='playing'] .clip-bar .bar-fill {
  background: var(--accent);
}

.time {
  grid-area: time;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* AI | Real: one segmented control, like the home's A/B segments */

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--inset);
}

.prompt {
  grid-column: 1 / -1;
  padding: 8px 10px 6px;
  font-size: 14px;
  color: var(--muted);
}

.btn-choice {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 84px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--r-inset);
  background: var(--panel);
  color: var(--text);
  font-family: var(--sans);
}

.btn-choice strong {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-choice span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.btn-choice:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--raise);
  transform: none;
}

.btn-choice:disabled {
  opacity: 0.5;
}

.btn-choice.is-truth,
.btn-choice.is-picked {
  opacity: 1;
}

.btn-choice.is-truth {
  border-color: var(--line-strong);
  background: var(--raise);
}

.btn-choice.is-picked {
  border-color: color-mix(in srgb, var(--good) 55%, transparent);
  background: color-mix(in srgb, var(--good) 14%, var(--panel));
}

.btn-choice.is-picked.is-wrong {
  border-color: color-mix(in srgb, var(--bad) 55%, transparent);
  background: color-mix(in srgb, var(--bad) 14%, var(--panel));
}

/* reveal: a readout, not a paragraph */

.reveal {
  padding: 20px 22px;
}

.reveal-verdict {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--line-lit);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.reveal-verdict.is-correct {
  border-color: color-mix(in srgb, var(--good) 40%, transparent);
  background: color-mix(in srgb, var(--good) 12%, var(--panel));
  color: var(--good);
}

.reveal-verdict.is-wrong {
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 12%, var(--panel));
  color: var(--bad);
}

.reveal-truth {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

/* One well: the outer element. The box the script builds inside it carries no frame of its own. */
#reveal-detail {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-inset);
  background: var(--well);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

#reveal-detail .reveal-detail {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.reveal-detail p + p {
  margin-top: 4px;
}

/* the title and artist are words, not readouts: reading face; licence and generator stay mono */
.reveal-track {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.reveal-track strong {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.reveal-detail a {
  color: var(--accent);
}

.reveal-lines {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.reveal-lines p + p {
  margin-top: 4px;
}

.reveal-points {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.reveal-bonus {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.score-popup {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 40;
  padding: 8px 16px;
  border: 1px solid var(--line-lit);
  border-radius: var(--r-inset);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  pointer-events: none;
  transform: translateX(-50%);
}

.score-popup.pop {
  animation: pop-up 0.9s var(--ease-out) forwards;
}

@keyframes pop-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}

/* ---------------------------------------------------------------- result */

.result-head {
  padding-bottom: 6px;
}

.status-chip {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 12px;
  border: 1px solid var(--line-lit);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.big-score {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: clamp(44px, 9vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin-top: 22px;
  padding: 4px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--panel);
}

.stats-grid .stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stats-grid .stat:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.stats-grid dt {
  font-size: 13px;
  color: var(--muted);
}

.stats-grid dd {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
}

.stage-list {
  margin-top: 12px;
  list-style: none;
}

.stage-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'name status'
    'detail detail';
  gap: 2px 14px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.stage-row-name {
  grid-area: name;
  font-size: 15px;
  font-weight: 600;
}

.stage-row-detail {
  grid-area: detail;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.stage-row-status {
  grid-area: status;
  justify-self: end;
  padding: 1px 10px;
  border: 1px solid var(--line-lit);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.stage-row.is-done .stage-row-status {
  border-color: color-mix(in srgb, var(--good) 40%, transparent);
  background: color-mix(in srgb, var(--good) 12%, var(--panel));
  color: var(--good);
}

.stage-row.is-failed .stage-row-status {
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 12%, var(--panel));
  color: var(--bad);
}

.stage-row.is-locked .stage-name,
.stage-row.is-locked .stage-row-name {
  color: var(--quiet);
}

.form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.form .btn {
  justify-self: start;
  margin-top: 4px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

input[type='text'],
input[type='email'],
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--field);
  border-radius: var(--r-inset);
  background: var(--well);
  color: var(--text);
  font: 400 15px/1.4 var(--sans);
  transition: border-color 0.15s ease;
}

input[type='text']:hover,
input[type='email']:hover,
select:hover {
  border-color: var(--muted);
}

input[type='text']:focus,
input[type='email']:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[readonly] {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

select {
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a9a9b2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
}

select option {
  background: var(--panel);
  color: var(--text);
}

.checks {
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-inset);
}

.checks legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.msg {
  min-height: 1.4em;
  font-size: 13px;
  color: var(--muted);
}

.msg.is-error {
  color: var(--bad);
}

.msg.is-ok {
  color: var(--good);
}

.share-image {
  margin-top: 14px;
}

.share-image img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-inset);
}

/* the home's two jobs, side by side with equal weight */

.link-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  list-style: none;
}

.link-card {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--inset);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.link-card:hover {
  border-color: var(--line-lit);
  color: var(--text);
  transform: translateY(-2px);
}

.link-card strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.link-card .product-name {
  font-family: var(--brand);
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #fff;
}

.link-card span {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* -------------------------------------------------- method / privacy pages */

.doc {
  padding-top: 48px;
}

.doc h1 {
  font-family: var(--brand);
  font-size: clamp(32px, 5.4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.doc h2 {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.doc p,
.doc li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.doc p {
  margin-top: 12px;
  max-width: 70ch;
}

.doc ul {
  margin-top: 12px;
  padding-left: 20px;
}

.doc li {
  max-width: 70ch;
  margin-top: 8px;
}

.doc strong {
  color: var(--text);
}

.doc .lede {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.65;
}

.doc .updated {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--quiet);
}

.doc .table-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-inset);
  background: var(--panel);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.doc .table-wrap table {
  min-width: 520px;
}

.doc th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--quiet);
}

.doc td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.doc tr:last-child td {
  border-bottom: 0;
}

.doc td:first-child {
  font-weight: 600;
  color: var(--text);
}

.doc code {
  padding: 1px 6px;
  border-radius: var(--r-ctl);
  background: var(--well);
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--text);
}

html[lang='ko'] body {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

html[lang='ko'] .doc-en,
html:not([lang='ko']) .doc-ko {
  display: none;
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 640px) {
  .topbar {
    padding: 14px 16px;
  }

  .brand-suffix {
    display: none;
  }

  .container {
    width: calc(100% - 32px);
    padding: 28px 0 56px;
  }

  .card {
    padding: 18px 16px;
  }

  .link-list {
    grid-template-columns: 1fr;
  }

  .check-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    padding: 4px 16px;
  }

  .stats-grid .stat:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .hud {
    grid-template-columns: 1fr;
  }

  .hud-right {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .score-box {
    min-width: 0;
  }

  .player {
    gap: 4px 16px;
    padding: 16px;
  }

  .btn-play {
    width: 52px;
    height: 52px;
  }

  .btn-choice {
    min-height: 76px;
  }

  .doc {
    padding-top: 32px;
  }
}

@media (max-width: 400px) {
  .form .btn,
  .row .btn {
    width: 100%;
  }

  .lb-table .lb-nick {
    max-width: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .life,
  .ladder .step.done {
    background: CanvasText;
  }

  .life.spent {
    border-color: CanvasText;
    background: Canvas;
  }

  .ladder .step.now {
    background: Highlight;
  }

  .btn-choice.is-picked,
  .btn-choice.is-truth,
  .player[data-state='playing'] {
    border-color: Highlight;
  }
}
