/* ==========================================================================
   Cậu bị ngáo à? — stylesheet
   One page, four sections, two themes.

   House rules (keep them if you edit this file):
   - Two typefaces only: Playfair for display, Jakarta for everything else.
   - Colour comes from tokens. No raw hex in component rules.
   - Two shadow levels, three radii. If you need a third shadow, you don't.
   - Emoji belong in the satirical output, never in the form controls.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
    /* Dark is the default: the joke lands better at night */
    --bg:            #0e1a14;
    --bg-sunk:       #0a140f;
    --surface:       #152219;
    --surface-2:     #1b2b21;
    --surface-3:     #223528;

    --line:          rgba(228, 236, 228, 0.10);
    --line-strong:   rgba(228, 236, 228, 0.20);

    --ink:           #eef2ea;
    --ink-2:         #b0c4b6;
    --ink-3:         #7c9384;

    --accent:        #5fb98a;
    --accent-soft:   rgba(95, 185, 138, 0.14);
    --accent-line:   rgba(95, 185, 138, 0.34);
    --on-accent:     #08150f;

    --gold:          #d9a441;
    --gold-soft:     rgba(217, 164, 65, 0.13);
    --gold-line:     rgba(217, 164, 65, 0.32);

    --info:          #74a9d8;
    --warn:          #e08a4a;
    --danger:        #e05c56;
    --danger-soft:   rgba(224, 92, 86, 0.12);
    --danger-line:   rgba(224, 92, 86, 0.32);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-2: 0 14px 34px rgba(0, 0, 0, 0.34);

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --r-sm: 7px;
    --r:    13px;
    --r-lg: 20px;
    --r-full: 999px;

    --shell: 1180px;
    --topbar-h: 61px;
}

[data-theme="light"] {
    --bg:            #f6f3ea;
    --bg-sunk:       #ece7da;
    --surface:       #fffdf7;
    --surface-2:     #f4f0e5;
    --surface-3:     #ebe5d6;

    --line:          rgba(22, 46, 32, 0.13);
    --line-strong:   rgba(22, 46, 32, 0.24);

    --ink:           #16281d;
    --ink-2:         #47604f;
    --ink-3:         #768b7d;

    --accent:        #2f6b4d;
    --accent-soft:   rgba(47, 107, 77, 0.10);
    --accent-line:   rgba(47, 107, 77, 0.28);
    --on-accent:     #ffffff;

    --gold:          #9d7220;
    --gold-soft:     rgba(157, 114, 32, 0.10);
    --gold-line:     rgba(157, 114, 32, 0.26);

    --info:          #2f5f8a;
    --warn:          #b5561f;
    --danger:        #b23b36;
    --danger-soft:   rgba(178, 59, 54, 0.09);
    --danger-line:   rgba(178, 59, 54, 0.26);

    --shadow-1: 0 1px 2px rgba(30, 50, 38, 0.07);
    --shadow-2: 0 14px 34px rgba(30, 50, 38, 0.10);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.62;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* A single flat wash at the top instead of three animated blur blobs. */
body::before {
    content: '';
    position: fixed;
    inset: 0 0 auto 0;
    height: 420px;
    background: linear-gradient(180deg, var(--surface) 0%, transparent 100%);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.22; }

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

canvas { display: block; }

.hidden { display: none !important; }

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

/* Numerals that don't jitter while they animate */
.tabular { font-variant-numeric: tabular-nums; }

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

/* --------------------------------------------------------------------------
   3. Shell & top bar
   -------------------------------------------------------------------------- */

.shell {
    position: relative;
    z-index: 1;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Brand ------------------------------------------------------------------ */

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
}

.brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.brand-name b {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
}

.brand-name small {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--ink-3);
}

/* Section nav ------------------------------------------------------------ */

.nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    padding: 0.2rem;
    /* Flex items default to min-width:auto, so without this the four tabs
       widen the whole document instead of scrolling inside the pill. */
    min-width: 0;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--ink-2);
    border-radius: var(--r-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-tab i { width: 15px; height: 15px; }

.nav-tab:hover { color: var(--ink); background: var(--surface-3); }

.nav-tab.active {
    background: var(--accent);
    color: var(--on-accent);
}

.nav-tab.active i { color: currentColor; }

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

.topbar-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

.btn-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-2);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-icon:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-3); }
.btn-icon i { width: 17px; height: 17px; }
.btn-icon.is-off { color: var(--ink-3); }

/* --------------------------------------------------------------------------
   4. Sections
   -------------------------------------------------------------------------- */

.subpage-view { display: none; }
.subpage-view.active-view { display: block; animation: sectionIn 0.28s ease both; }

@keyframes sectionIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* Editorial section header, left-aligned. Not a centred hero. */
.section-head {
    padding: 2.75rem 0 1.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.7rem;
}

.eyebrow i { width: 14px; height: 14px; }

.section-head h1 {
    font-size: clamp(1.9rem, 4vw, 2.85rem);
    letter-spacing: -0.015em;
    max-width: 20ch;
}

.section-head .lede {
    margin-top: 0.7rem;
    max-width: 62ch;
    font-size: 1.03rem;
    color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   5. Card primitives
   -------------------------------------------------------------------------- */

/* Content sits directly on the page. Nothing here is a floating panel:
   separation comes from rules and whitespace, not from boxes stacked on boxes.
   Only genuinely detached surfaces (modal, toast, mobile bar) keep a card look. */
.card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.card + .card { margin-top: 2.75rem; }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.7rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.card-head h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.22rem;
}

.card-head h2 i { width: 19px; height: 19px; color: var(--accent); }

/* A grouping inside a column: a rule above it, never a border around it */
.panel {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 1.3rem 0 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.panel-title i { width: 17px; height: 17px; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   6. Calculator layout
   -------------------------------------------------------------------------- */

/* Two columns of one page, divided by a single rule — not two cards side by side */
.calc-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0;
    align-items: start;
}

/* Grid items also default to min-width:auto; wide content (radio grids,
   canvases) would otherwise push the column past its track. */
.calc-grid > * { min-width: 0; }
.calc-grid > :first-child { padding-right: 2.75rem; }

.results-col {
    position: sticky;
    top: calc(var(--topbar-h) + 1rem);
    max-height: calc(100vh - var(--topbar-h) - 2rem);
    padding-left: 2.75rem;
    border-left: 1px solid var(--line);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.results-col::-webkit-scrollbar { width: 7px; }
.results-col::-webkit-scrollbar-track { background: transparent; }
.results-col::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: var(--r-full);
}

/* --------------------------------------------------------------------------
   7. Form controls
   -------------------------------------------------------------------------- */

.field { margin-bottom: 1.45rem; display: flex; flex-direction: column; gap: 0.55rem; }
.field:last-child { margin-bottom: 0; }

.field-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.field-label,
.field > label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
}

.field-label i,
.field > label i { width: 17px; height: 17px; color: var(--ink-3); }

.field-note { font-size: 0.82rem; color: var(--ink-3); }

.value-display {
    font-size: 0.86rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0.2rem 0.65rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    border-radius: var(--r-sm);
    white-space: nowrap;
}

.value-display.is-gold {
    background: var(--gold-soft);
    border-color: var(--gold-line);
    color: var(--gold);
}

/* Sliders ---------------------------------------------------------------- */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: var(--r-full);
    background: var(--surface-3);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: var(--r-full);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 17px;
    height: 17px;
    margin-top: -6.5px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--accent-line);
    cursor: pointer;
    transition: transform 0.14s ease;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.14); }

input[type="range"]::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    cursor: pointer;
}

input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: var(--r-full);
    background: var(--surface-3);
}

.range-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* Dual range (age) ------------------------------------------------------- */

.dual-range {
    position: relative;
    height: 22px;
    display: flex;
    align-items: center;
}

.dual-range-track {
    position: absolute;
    inset-inline: 0;
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--r-full);
}

.dual-range input[type="range"] {
    position: absolute;
    inset-inline: 0;
    background: transparent;
    pointer-events: none;
    height: 4px;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
.dual-range input[type="range"]::-moz-range-track { background: transparent; }
.dual-range input[type="range"]::-webkit-slider-thumb { pointer-events: auto; }
.dual-range input[type="range"]::-moz-range-thumb { pointer-events: auto; }

/* Select ----------------------------------------------------------------- */

.select-wrap { position: relative; }

.select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.62rem 2.4rem 0.62rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.18s ease;
}

.select:hover, .select:focus { border-color: var(--accent-line); outline: none; }
.select option { background: var(--surface); color: var(--ink); }

.select-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ink-3);
    pointer-events: none;
}

/* Chips ------------------------------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-2);
    padding: 0.28rem 0.7rem;
    border-radius: var(--r-full);
    font-size: 0.79rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
}

.chip:hover { border-color: var(--line-strong); color: var(--ink); }

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* Radio cards ------------------------------------------------------------ */

.radio-grid { display: grid; gap: 0.4rem; }
.radio-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.radio-grid.grid-4 { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.radio-grid.grid-5 { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.radio-grid.grid-wide { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }

.radio-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.55rem 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-2);
    line-height: 1.32;
    cursor: pointer;
    user-select: none;
    transition: all 0.16s ease;
}

.radio-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.radio-card span { pointer-events: none; }
.radio-card:hover { border-color: var(--line-strong); color: var(--ink); }

.radio-card.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
}

/* Two-up lifestyle block */
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

/* Switches --------------------------------------------------------------- */

.switch-list { display: flex; flex-direction: column; gap: 0.5rem; }

/* A ruled list, not a stack of boxes */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
}

.switch-list { gap: 0; border-top: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }

.switch-text { display: flex; align-items: center; gap: 0.55rem; font-size: 0.87rem; font-weight: 600; }
.switch-text i { width: 17px; height: 17px; color: var(--ink-3); }
.switch-text small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--ink-3); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch-track {
    position: absolute;
    inset: 0;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-track::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ink-3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(18px); background: var(--on-accent); }

/* BMI readout ------------------------------------------------------------ */

/* Plain readout. It used to be a bordered box directly under the weight
   select, which made it look like a second dropdown and invited clicks. */
.bmi-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.1rem 0 0;
}

.bmi-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.84rem; font-weight: 600; }
.bmi-label i { width: 16px; height: 16px; color: var(--ink-3); }
.bmi-value { font-size: 0.84rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bmi-status { font-size: 0.78rem; color: var(--ink-3); }

.bmi-quip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--danger-soft);
    border: 1px solid var(--danger-line);
    border-radius: var(--r-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--danger);
}

.bmi-quip i { width: 16px; height: 16px; flex-shrink: 0; }

/* Buttons ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 1.05rem;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: 0.87rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn i { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--ink); }

.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.8rem; }

.btn-row { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   8. Calculator results
   -------------------------------------------------------------------------- */

.result-stack { display: flex; flex-direction: column; gap: 1.15rem; }

.result-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.result-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.result-source { font-size: 0.74rem; color: var(--ink-3); }

.headline-stat { text-align: center; padding: 0.5rem 0 0.2rem; }

.headline-stat .num {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.12rem;
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 8vw, 4.6rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.headline-stat .num .unit { font-size: 0.42em; color: var(--ink-3); }
.headline-stat .caption { margin-top: 0.4rem; font-size: 0.9rem; color: var(--ink-2); }

.count-line {
    text-align: center;
    font-size: 0.86rem;
    color: var(--ink-2);
    padding: 0;
}

.count-line strong { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Difficulty meter ------------------------------------------------------- */

.meter { display: flex; flex-direction: column; gap: 0.45rem; }

.meter-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.meter-head span:first-child { color: var(--ink-3); }
#delusion-score-text { color: var(--gold); text-align: right; }

.meter-track {
    height: 6px;
    background: var(--surface-3);
    border-radius: var(--r-full);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 5%;
    border-radius: var(--r-full);
    background: var(--accent);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.45s ease;
}

.meter-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--ink-3);
}

/* Verdict ---------------------------------------------------------------- */

/* Reads as a pull-quote off a rule, rather than a tinted box */
.verdict {
    background: transparent;
    border: 0;
    border-left: 2px solid var(--accent);
    border-radius: 0;
    padding: 0.1rem 0 0.1rem 1rem;
}

.verdict-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.verdict h3 { font-size: 1.12rem; margin-bottom: 0.3rem; }
.verdict p { font-size: 0.88rem; color: var(--ink-2); }

/* Stadium ---------------------------------------------------------------- */

.stadium-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.stadium-badge {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.stadium-note { font-size: 0.78rem; color: var(--ink-3); margin-bottom: 0.8rem; }

/* The dots describe the stadium on their own — no tray needed under them */
.stadium-field {
    position: relative;
    width: 100%;
    aspect-ratio: 1.62 / 1;
    overflow: hidden;
}

.oval-dot-cell {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--line-strong);
    transform: translate(-50%, -50%);
    transition: background-color 0.25s ease;
}

.oval-dot-cell.active-emerald { background: var(--accent); }
.oval-dot-cell.active-gold    { background: var(--gold); }
.oval-dot-cell.active-pink    { background: var(--danger); }

.stadium-quip {
    margin-top: 0.8rem;
    font-size: 0.83rem;
    color: var(--ink-2);
    line-height: 1.55;
}

/* Chart ------------------------------------------------------------------ */

.chart-box { height: 190px; position: relative; width: 100%; }

/* --------------------------------------------------------------------------
   9. So Kèo (self-rating) section
   -------------------------------------------------------------------------- */

.preset-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.45rem;
}

.sk-score { text-align: center; padding: 0.4rem 0 0.2rem; }

.sk-score .rank {
    font-family: var(--font-display);
    font-size: clamp(2.7rem, 7vw, 3.9rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.sk-score .caption { margin-top: 0.4rem; font-size: 0.88rem; color: var(--ink-2); }

.sk-tier {
    display: inline-block;
    margin-top: 0.7rem;
    padding: 0.24rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-full);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink-2);
}

.sk-tier.ts-S { border-color: var(--gold-line);   color: var(--gold);   background: var(--gold-soft); }
.sk-tier.ts-A { border-color: var(--danger-line); color: var(--danger); background: var(--danger-soft); }
.sk-tier.ts-B { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.sk-tier.ts-C { border-color: var(--line-strong); color: var(--info); }
.sk-tier.ts-D { border-color: var(--line-strong); color: var(--ink-2); }
.sk-tier.ts-E { border-color: var(--line);        color: var(--ink-3); }

.sk-blurb { font-size: 0.88rem; color: var(--ink-2); text-align: center; }

.sk-nudge {
    display: none;
    font-size: 0.82rem;
    color: var(--ink-2);
    border-left: 2px solid var(--gold);
    padding: 0.05rem 0 0.05rem 0.8rem;
}

.sk-nudge.show { display: block; }
.sk-nudge b { color: var(--gold); }

.sk-rarity { display: flex; flex-direction: column; gap: 0.4rem; }

.sk-rarity-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--ink-3);
}

.sk-callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }

.sk-callout {
    background: transparent;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    padding: 0.05rem 0 0.05rem 0.8rem;
}

.sk-callout .label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.2rem;
}

.sk-callout .value { font-size: 0.88rem; font-weight: 700; }
.sk-callout .sub { font-size: 0.74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.sk-callout.is-best { border-left-color: var(--accent); }
.sk-callout.is-best .label { color: var(--accent); }
.sk-callout.is-worst { border-left-color: var(--gold); }
.sk-callout.is-worst .label { color: var(--gold); }

/* Per-criterion breakdown list */
.sk-breakdown { display: flex; flex-direction: column; }

.sk-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.84rem;
}

.sk-row:last-child { border-bottom: none; }
.sk-row .name { color: var(--ink-2); white-space: nowrap; }
.sk-row .rule { flex: 1; border-bottom: 1px dotted var(--line-strong); margin-bottom: 0.28rem; }
.sk-row .pct { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sk-row .grade {
    min-width: 1.5rem;
    text-align: right;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ink-3);
}

.sk-radar { height: 250px; position: relative; }

/* --------------------------------------------------------------------------
   10. Statistics & data sources
   -------------------------------------------------------------------------- */

.prose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem 2.75rem;
}

/* Columns of an article, each opening under its own rule */
.prose-card {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 1rem 0 0;
}

.prose-card h3 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 1.08rem;
    margin-bottom: 0.5rem;
}

.prose-card h3 .n {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-sans);
}

.prose-card p { font-size: 0.9rem; color: var(--ink-2); }
.prose-card p + p { margin-top: 0.6rem; }

/* Pull figure used inside prose */
.figure-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
}

.figure {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 0.05rem 0 0.05rem 0.9rem;
}

.figure .big {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.figure .cap { font-size: 0.76rem; color: var(--ink-3); margin-top: 0.15rem; }

/* Data-source accordions (native details/summary — no JS required) */
.sources { display: flex; flex-direction: column; border-top: 1px solid var(--line); }

.source {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}

.source > summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.source > summary::-webkit-details-marker { display: none; }

.source > summary::after {
    content: '+';
    margin-left: auto;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--ink-3);
    line-height: 1;
}

.source[open] > summary::after { content: '−'; }
.source > summary:hover { color: var(--accent); }

.source-body { padding: 0 0 1rem; font-size: 0.87rem; color: var(--ink-2); }
.source-body strong { color: var(--ink); }

.dl { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; margin-top: 0.6rem; }
.dl dt { color: var(--ink-2); font-size: 0.85rem; }
.dl dd { font-weight: 700; font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   11. Remedies
   -------------------------------------------------------------------------- */

.rx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.75rem 2.75rem; }

.rx {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: transparent;
    border: 0;
    border-top: 2px solid var(--gold);
    border-radius: 0;
    padding: 1rem 0 0;
}

.rx-no {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--gold);
}

.rx h3 { font-size: 1.1rem; }
.rx dt { font-size: 0.78rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.rx dd { font-size: 0.88rem; color: var(--ink-2); margin-bottom: 0.6rem; }
.rx dd:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.site-footer h4 { font-size: 0.95rem; display: flex; align-items: center; gap: 0.45rem; }
.site-footer h4 i { width: 16px; height: 16px; color: var(--ink-3); }
.site-footer p { font-size: 0.82rem; color: var(--ink-3); max-width: 80ch; }

.footer-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   13. Modal, toast, mobile bar
   -------------------------------------------------------------------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(6, 14, 10, 0.82);
    backdrop-filter: blur(6px);
    transition: opacity 0.25s ease;
}

.modal-overlay.hidden { opacity: 0; pointer-events: none; }

.modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--danger-line);
    border-top: 4px solid var(--danger);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
    padding: 1.75rem;
    text-align: center;
}

.modal .modal-emoji { font-size: 2.4rem; line-height: 1; }
.modal h2 { font-size: 1.5rem; margin: 0.6rem 0 0.15rem; color: var(--danger); }
.modal .modal-sub { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.9rem; }
.modal p { font-size: 0.9rem; color: var(--ink-2); }

.modal-quote {
    margin: 1rem 0 1.25rem;
    padding: 0.9rem 1.05rem;
    background: var(--surface-2);
    border-left: 3px solid var(--gold);
    border-radius: var(--r-sm);
    text-align: left;
    font-size: 0.89rem;
    font-style: italic;
    color: var(--ink-2);
}

.floating-emojis { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.floating-emoji-item {
    position: absolute;
    font-size: 1.3rem;
    opacity: 0.5;
    animation: floatUp 3.2s ease-in-out infinite;
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0); opacity: 0.18; }
    50%      { transform: translateY(-16px); opacity: 0.55; }
}

/* Screen shake when nobody qualifies */
body.delusion-shake { animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* Toast ------------------------------------------------------------------ */

.toast {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--accent-line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-2);
    padding: 0.65rem 1rem;
    font-size: 0.86rem;
    font-weight: 600;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast i { width: 16px; height: 16px; color: var(--accent); }
.toast.hidden { opacity: 0; transform: translateY(10px); pointer-events: none; display: flex !important; }

/* Mobile result bar ------------------------------------------------------ */

.mobile-bar { display: none; }

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1040px) {
    .calc-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .calc-grid > :first-child { padding-right: 0; }

    /* Stacked: the vertical divider becomes meaningless */
    .results-col {
        position: static;
        max-height: none;
        overflow: visible;
        padding-left: 0;
        border-left: 0;
    }

    /* Results first on narrow screens: the answer shouldn't be 20 fields away */
    .calc-grid .results-col { order: -1; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }

    .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; justify-content: flex-start; }
    .topbar-inner { flex-wrap: wrap; padding-bottom: 0.5rem; }
    .topbar-actions { margin-left: auto; }
    .nav-tab { font-size: 0.78rem; padding: 0.38rem 0.75rem; }
}

@media (max-width: 760px) {
    .shell { padding: 0 1rem 6rem; }
    .card { padding: 1.15rem; border-radius: var(--r); }
    .section-head { padding: 1.75rem 0 1.1rem; margin-bottom: 1.35rem; }
    .pair-grid { grid-template-columns: 1fr; }
    .sk-callouts { grid-template-columns: 1fr; }
    .radio-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }
    .radio-grid.grid-wide { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .brand-name small { display: none; }

    .mobile-bar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.55rem 1rem;
        background: var(--surface);
        border-top: 1px solid var(--line-strong);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
    }

    .mobile-bar .label {
        font-size: 0.64rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink-3);
    }

    .mobile-bar .pct {
        font-family: var(--font-display);
        font-size: 1.3rem;
        font-weight: 700;
        line-height: 1.1;
        font-variant-numeric: tabular-nums;
    }

    .toast { left: 1rem; right: 1rem; bottom: 4.75rem; justify-content: center; }
}

@media (max-width: 460px) {
    .radio-grid.grid-3,
    .radio-grid.grid-4,
    .radio-grid.grid-5,
    .radio-grid.grid-wide { grid-template-columns: 1fr 1fr; }
    .headline-stat .num { font-size: 2.9rem; }
    .modal { padding: 1.25rem; }
}

/* Respect the user's motion preference — every animation here is decorative */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
