/* =============================================================================
   Session Zéro — Design system « Encre & Laiton »
   Modern + fantasy accents. Dark "ink" theme, brass signature accent,
   engraved serif display (Cinzel) over a clean sans (Inter).
   Single stylesheet (one request = fastest). No build step.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Design tokens
   ----------------------------------------------------------------------------- */
:root {
    /* ── Palette: Ink & Brass (warm dark) ───────────────────────────────── */
    --ink-900: #15120d;   /* page background (warm near-black) */
    --ink-850: #1b1712;
    --ink-800: #211c15;   /* raised surface */
    --ink-700: #2b251c;   /* card / panel */
    --ink-650: #352e23;   /* hover surface */
    --ink-border: #3d3528;
    --ink-border-strong: #4f4534;

    --parchment: #ece3d2;        /* primary text */
    --parchment-muted: #b7ac95;  /* secondary text */
    --parchment-faint: #897f6b;  /* hints, meta */

    --brass: #c8a24b;            /* signature accent */
    --brass-bright: #e2c277;     /* hover / focus glow */
    --brass-dim: #9b7d36;
    --brass-soft: rgba(200, 162, 75, 0.14);
    --brass-edge: rgba(200, 162, 75, 0.38);

    --arcane: #8b78c4;           /* rare secondary accent */
    --arcane-soft: rgba(139, 120, 196, 0.16);

    --success: #79b186;
    --success-soft: rgba(121, 177, 134, 0.14);
    --warning: #d8a657;
    --warning-soft: rgba(216, 166, 87, 0.14);
    --danger: #d2705f;
    --danger-soft: rgba(210, 112, 95, 0.14);

    /* ── Typography ─────────────────────────────────────────────────────── */
    --font-display: 'Cinzel', 'Trajan Pro', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

    /* Hand-tuned hierarchical scale (h1/body ≈ 2.35×) */
    --fs-display: clamp(2.75rem, 6vw, 3.75rem);
    --fs-h1: clamp(2rem, 4vw, 2.5rem);
    --fs-h2: 1.875rem;
    --fs-h3: 1.375rem;
    --fs-h4: 1.125rem;
    --fs-body: 1.0625rem;   /* 17px — comfortable reading */
    --fs-sm: 0.875rem;
    --fs-xs: 0.75rem;

    --lh-tight: 1.15;
    --lh-snug: 1.3;
    --lh-body: 1.7;

    /* ── Spacing scale (closed — 5 semantic roles + hero exception) ─────── */
    --sp-section: 4rem;
    --sp-section-lg: 5.5rem;
    --sp-group: 2.5rem;
    --sp-element: 1.5rem;
    --sp-inset: 1.5rem;
    --sp-tight: 0.75rem;
    --gutter: 1.25rem;
    --gutter-lg: 2rem;

    /* ── Radii, shadows, motion, layout ────────────────────────────────── */
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 18px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
    --glow-brass: 0 0 0 3px var(--brass-soft);

    --t-fast: 130ms ease;
    --t-base: 200ms ease;
    --t-slow: 320ms cubic-bezier(0.2, 0.7, 0.2, 1);

    --max-width: 1080px;
    --measure: 64ch;       /* readable line length */
    --header-h: 4.25rem;
}

/* ── Light "Parchment" theme (opt-in via the header toggle) ─────────────── */
:root[data-theme="light"] {
    --ink-900: #f4eede;
    --ink-850: #f9f4e8;
    --ink-800: #fcf8ee;
    --ink-700: #fdfaf2;
    --ink-650: #f0e8d6;
    --ink-border: #ddd1b6;
    --ink-border-strong: #c9ba98;

    --parchment: #2d251d;        /* primary text becomes dark ink */
    --parchment-muted: #5c5140;
    --parchment-faint: #6e6149;  /* darkened so 12px hints clear AA on cream */

    --brass: #8a6a22;
    --brass-bright: #7a5e1c;     /* darkened: links/button labels clear AA on cream */
    --brass-dim: #6f5519;
    --brass-soft: rgba(138, 106, 34, 0.12);
    --brass-edge: rgba(138, 106, 34, 0.4);

    --arcane: #5f4f93;
    --arcane-soft: rgba(95, 79, 147, 0.12);

    /* Semantic colours must also flip for the cream surface (WCAG AA). */
    --success: #2f7d44;
    --success-soft: rgba(47, 125, 68, 0.12);
    --warning: #9a6b14;
    --warning-soft: rgba(154, 107, 20, 0.14);
    --danger: #b23b28;
    --danger-soft: rgba(178, 59, 40, 0.12);

    --shadow-sm: 0 1px 2px rgba(60, 45, 20, 0.1);
    --shadow-md: 0 6px 18px -6px rgba(60, 45, 20, 0.18);
    --shadow-lg: 0 18px 40px -12px rgba(60, 45, 20, 0.22);
}
:root[data-theme="light"] body {
    background-image:
        radial-gradient(60rem 40rem at 12% -10%, rgba(138, 106, 34, 0.08), transparent 60%),
        radial-gradient(50rem 40rem at 100% 0%, rgba(95, 79, 147, 0.06), transparent 55%);
}

/* -----------------------------------------------------------------------------
   2. Reset & base
   ----------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--parchment);
    background-color: var(--ink-900);
    /* Subtle atmospheric depth: two faint radial pools of brass/arcane light */
    background-image:
        radial-gradient(60rem 40rem at 12% -10%, rgba(200, 162, 75, 0.07), transparent 60%),
        radial-gradient(50rem 40rem at 100% 0%, rgba(139, 120, 196, 0.06), transparent 55%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--brass-bright);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--brass-edge);
    color: var(--ink-900);
}

/* -----------------------------------------------------------------------------
   3. Typography
   ----------------------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: var(--lh-tight);
    color: var(--parchment);
    font-weight: 600;
}

h1 { font-size: var(--fs-h1); letter-spacing: 0.01em; }
h2 { font-size: var(--fs-h2); letter-spacing: 0.02em; }
h3 { font-size: var(--fs-h3); font-family: var(--font-body); font-weight: 600; letter-spacing: 0.01em; }
h4 {
    font-size: var(--fs-sm);
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brass);
}

p { color: var(--parchment-muted); }

a {
    color: var(--brass-bright);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color var(--t-fast);
}
a:hover { color: var(--brass); text-decoration-thickness: 2px; }

strong { color: var(--parchment); font-weight: 600; }

.eyebrow {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--brass);
}

/* Ornamental divider: a centered brass rule with a diamond node */
.rule {
    border: none;
    height: 1px;
    margin: var(--sp-group) auto;
    width: min(18rem, 60%);
    background: linear-gradient(90deg, transparent, var(--brass-edge), transparent);
    position: relative;
    overflow: visible;
}
.rule::after {
    content: "";
    position: absolute;
    inset-block-start: -3px;
    inset-inline-start: 50%;
    width: 7px;
    height: 7px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--brass);
    box-shadow: 0 0 8px var(--brass-edge);
}

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

/* -----------------------------------------------------------------------------
   4. Skip link & layout
   ----------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -3rem;
    z-index: 200;
    background: var(--brass);
    color: var(--ink-900);
    padding: var(--sp-tight) var(--sp-element);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: top var(--t-base);
}
.skip-link:focus { top: var(--sp-tight); color: var(--ink-900); }

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding: var(--sp-section) var(--gutter);
}
@media (min-width: 768px) {
    .main { padding-inline: var(--gutter-lg); }
}

/* -----------------------------------------------------------------------------
   5. Header
   ----------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-element);
    height: var(--header-h);
    padding-inline: var(--gutter);
    background: color-mix(in srgb, var(--ink-850) 86%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ink-border);
}
@media (min-width: 768px) {
    .site-header { padding-inline: var(--gutter-lg); }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-tight);
    background: none;
    border: none;
    text-decoration: none;
}
.brand__mark { width: 1.9rem; height: 1.9rem; flex-shrink: 0; }
.brand__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--parchment);
}
.brand__name em {
    font-style: normal;
    color: var(--brass);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-tight);
}

.lang-select {
    appearance: none;
    padding: 0.4rem 1.8rem 0.4rem 0.7rem;
    background: var(--ink-700)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b7ac95' d='M6 8L2 4h8z'/%3E%3C/svg%3E")
        no-repeat right 0.6rem center;
    border: 1px solid var(--ink-border);
    border-radius: var(--radius-md);
    color: var(--parchment);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: border-color var(--t-fast);
}
.lang-select:hover { border-color: var(--brass-edge); }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--ink-border);
    border-radius: var(--radius-md);
    background: var(--ink-700);
    color: var(--parchment-muted);
    transition: color var(--t-fast), border-color var(--t-fast);
}
.theme-toggle:hover { color: var(--brass); border-color: var(--brass-edge); }

/* -----------------------------------------------------------------------------
   6. Pages
   ----------------------------------------------------------------------------- */
.page { display: none; }
.page.is-active { display: block; animation: fade-in var(--t-slow); }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* -----------------------------------------------------------------------------
   7. Hero (home)
   ----------------------------------------------------------------------------- */
.hero {
    text-align: center;
    max-width: var(--measure);
    margin-inline: auto;
    padding-block: var(--sp-section) var(--sp-group);
}
.hero__title {
    font-size: var(--fs-display);
    margin-block: var(--sp-tight) var(--sp-element);
    background: linear-gradient(180deg, var(--parchment) 30%, var(--brass));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero__subtitle {
    font-size: var(--fs-h4);
    color: var(--parchment-muted);
    margin-bottom: var(--sp-group);
    line-height: var(--lh-snug);
}
.hero__cta { margin-bottom: var(--sp-group); }

.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: var(--sp-element);
    margin-top: var(--sp-group);
}
.pillar {
    background: var(--ink-700);
    border: 1px solid var(--ink-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-inset);
    text-align: left;
    transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.pillar:hover {
    transform: translateY(-3px);
    border-color: var(--brass-edge);
    box-shadow: var(--shadow-lg);
}
.pillar__icon {
    width: 2.5rem; height: 2.5rem;
    margin-bottom: var(--sp-tight);
    color: var(--brass);
}
.pillar__title {
    font-size: var(--fs-h3);
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: var(--sp-tight);
}
.pillar__text { font-size: var(--fs-sm); margin: 0; }

/* -----------------------------------------------------------------------------
   8. Buttons
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-tight);
    padding: 0.7rem 1.4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color var(--t-fast), border-color var(--t-fast),
        transform var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--primary {
    background: linear-gradient(180deg, var(--brass-bright), var(--brass));
    color: var(--ink-900);
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) {
    background: var(--brass-bright);
    box-shadow: var(--shadow-md), var(--glow-brass);
    color: var(--ink-900);
}

.btn--secondary {
    background: var(--ink-700);
    border-color: var(--ink-border-strong);
    color: var(--parchment);
}
.btn--secondary:hover:not(:disabled) { border-color: var(--brass-edge); background: var(--ink-650); }

.btn--ghost {
    background: transparent;
    border-color: var(--ink-border);
    color: var(--parchment-muted);
}
.btn--ghost:hover:not(:disabled) { color: var(--brass); border-color: var(--brass-edge); }

.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn--large { padding: 0.95rem 2rem; font-size: var(--fs-h4); }
.btn--small { padding: 0.4rem 0.8rem; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn--icon { padding: 0.5rem; width: 2.4rem; height: 2.4rem; }

/* -----------------------------------------------------------------------------
   9. Forms
   ----------------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-element); }
.field__label {
    display: block;
    margin-bottom: var(--sp-tight);
    font-weight: 600;
    color: var(--parchment);
}
.field__hint {
    display: block;
    margin-top: var(--sp-tight);
    font-size: var(--fs-xs);
    color: var(--parchment-faint);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--ink-850);
    border: 1px solid var(--ink-border);
    border-radius: var(--radius-md);
    color: var(--parchment);
    font: inherit;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { resize: vertical; min-height: 5rem; line-height: var(--lh-body); }
.input::placeholder,
.textarea::placeholder { color: var(--parchment-faint); }
.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: var(--glow-brass);
}
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%23b7ac95' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-element);
}
.field-row .field { flex: 1 1 12rem; margin-bottom: 0; }

/* Player expectation cards */
.players { display: flex; flex-direction: column; gap: var(--sp-element); margin-bottom: var(--sp-element); }
.player {
    background: var(--ink-800);
    border: 1px solid var(--ink-border);
    border-radius: var(--radius-md);
    padding: var(--sp-inset);
    position: relative;
}
.player__title {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brass);
    margin-bottom: var(--sp-tight);
}
.player__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: var(--sp-element);
}
.player-remove { position: absolute; top: var(--sp-tight); right: var(--sp-tight); }

/* Range slider with a value bubble */
.range-field { display: flex; flex-direction: column; gap: 0.4rem; }
.range-field__top { display: flex; justify-content: space-between; align-items: baseline; }
.range-field__value {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--brass);
}
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--ink-border-strong);
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: var(--radius-full);
    background: var(--brass);
    border: 2px solid var(--ink-900);
    box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: var(--radius-full);
    background: var(--brass);
    border: 2px solid var(--ink-900);
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px var(--brass-soft), var(--shadow-sm);
}
input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px var(--brass-soft), var(--shadow-sm);
}

/* -----------------------------------------------------------------------------
   10. Journey: stepper
   ----------------------------------------------------------------------------- */
.journey { max-width: 56rem; margin-inline: auto; }

.stepper {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-tight);
    list-style: none;
    margin-bottom: var(--sp-group);
    padding-bottom: var(--sp-element);
    border-bottom: 1px solid var(--ink-border);
}
.stepper__item { flex: 1 1 auto; }
.stepper__btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--parchment-faint);
    font-size: var(--fs-sm);
    text-align: left;
    transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.stepper__btn:hover { color: var(--parchment); background: var(--ink-700); }
.stepper__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem; height: 1.6rem;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    border: 1px solid var(--ink-border-strong);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--parchment-muted);
}
.stepper__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper__item.is-active .stepper__btn { color: var(--brass); background: var(--brass-soft); border-color: var(--brass-edge); }
.stepper__item.is-active .stepper__num { border-color: var(--brass); color: var(--brass); }
.stepper__item.is-done .stepper__num { background: var(--brass); border-color: var(--brass); color: var(--ink-900); }
.stepper__item.is-done .stepper__num::after { content: "\2713"; }
.stepper__item.is-done .stepper__num span { display: none; }

/* -----------------------------------------------------------------------------
   11. Journey: step panels
   ----------------------------------------------------------------------------- */
.step { display: none; }
.step.is-active { display: block; animation: fade-in var(--t-slow); }

.step__header { margin-bottom: var(--sp-group); }
.step__eyebrow { margin-bottom: var(--sp-tight); }
.step__title { margin-bottom: var(--sp-tight); }
.step__intro {
    max-width: var(--measure);
    color: var(--parchment-muted);
    font-size: var(--fs-h4);
    line-height: var(--lh-snug);
    margin: 0;
}

.step__body { margin-bottom: var(--sp-group); }

.journey__nav {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-element);
    margin-top: var(--sp-group);
    padding-top: var(--sp-element);
    border-top: 1px solid var(--ink-border);
}

/* -----------------------------------------------------------------------------
   12. Results & content cards
   ----------------------------------------------------------------------------- */
.results { margin-top: var(--sp-element); }
/* aria-live region kept in the layout (no :empty display:none) so the first
   generated result is reliably announced by assistive tech. */

/* Empty-state invite shown until a result exists (pure CSS toggle). */
.empty-state {
    margin-top: var(--sp-element);
    padding: var(--sp-inset);
    border: 1px dashed var(--ink-border);
    border-radius: var(--radius-md);
    color: var(--parchment-faint);
    font-style: italic;
    font-size: var(--fs-sm);
}
.results:not(:empty) + .empty-state { display: none; }

/* "Regenerate" action under a rendered result. */
.result-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--sp-element);
}

.results__status {
    display: flex;
    align-items: center;
    gap: var(--sp-tight);
    padding: var(--sp-inset);
    color: var(--parchment-muted);
    font-style: italic;
}
.spinner {
    width: 1.1rem; height: 1.1rem;
    border: 2px solid var(--ink-border-strong);
    border-top-color: var(--brass);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
    padding: var(--sp-tight) var(--sp-inset);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--danger);
    background: var(--danger-soft);
    color: var(--parchment);
}

/* The generated result "scroll": a parchment-edged panel */
.result-scroll {
    background:
        linear-gradient(var(--ink-800), var(--ink-800)) padding-box,
        linear-gradient(160deg, var(--brass-edge), transparent 40%) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--sp-inset);
    box-shadow: var(--shadow-md);
}
.result-scroll__header {
    display: flex;
    align-items: center;
    gap: var(--sp-tight);
    margin-bottom: var(--sp-element);
}
.result-scroll__title { margin: 0; }
.result-scroll__lead {
    font-family: var(--font-display);
    font-size: var(--fs-h4);
    font-weight: 500;
    color: var(--parchment);
    line-height: var(--lh-snug);
    margin-bottom: var(--sp-element);
}
.result-actions {
    display: flex;
    gap: var(--sp-tight);
    margin-top: var(--sp-element);
    padding-top: var(--sp-element);
    border-top: 1px solid var(--ink-border);
}

.tone-chip {
    display: inline-block;
    margin-bottom: var(--sp-element);
    padding: 0.3rem 0.8rem;
    background: var(--arcane-soft);
    border: 1px solid rgba(139, 120, 196, 0.4);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    color: var(--parchment);
}

/* Sub-section inside a result */
.result-block { margin-bottom: var(--sp-element); }
.result-block:last-child { margin-bottom: 0; }
.result-block__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--sp-tight);
}

/* Token-styled lists: lines (forbidden), veils (faded), rules (procedure) */
.token-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.token-list li {
    position: relative;
    padding-left: 1.6rem;
    color: var(--parchment);
}
.token-list li::before {
    position: absolute;
    left: 0;
    top: 0.1em;
    font-size: 0.95em;
}
.token-list--lines li::before { content: "\2715"; color: var(--danger); }   /* ✕ */
.token-list--veils li::before { content: "\25D1"; color: var(--arcane); }   /* ◑ */
.token-list--rules li::before { content: "\26AC"; color: var(--brass); }    /* ⚬ */
.token-list--qa li::before { content: "\203B"; color: var(--brass); }       /* ※ */
.token-list--hooks li::before { content: "\2042"; color: var(--brass); }    /* ⁂ */

/* Facilitator note: a callout in the brass voice */
.facilitator-note {
    margin-top: var(--sp-element);
    padding: var(--sp-tight) var(--sp-inset);
    background: var(--brass-soft);
    border-left: 3px solid var(--brass);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.facilitator-note p { color: var(--parchment); margin: 0; }
.facilitator-note__label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brass);
    margin-bottom: 0.3rem;
}

/* Faction / location cards grid */
.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--sp-element);
}
.entity-card {
    background: var(--ink-700);
    border: 1px solid var(--ink-border);
    border-radius: var(--radius-md);
    padding: var(--sp-inset);
}
.entity-card__name { font-family: var(--font-display); color: var(--parchment); margin-bottom: 0.4rem; }
.entity-card__line { font-size: var(--fs-sm); margin-bottom: 0.5rem; }
.entity-card__line:last-child { margin-bottom: 0; }
.entity-card__line .k {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brass);
    margin-right: 0.4rem;
}
.entity-card__line--secret .k { color: var(--arcane); }
.entity-card__line--danger .k { color: var(--danger); }

/* Expectations meter */
.meter { margin-bottom: var(--sp-element); }
.meter__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.meter__score { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--brass); }
.meter__track { height: 8px; border-radius: var(--radius-full); background: var(--ink-border-strong); overflow: hidden; }
.meter__fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
    transition: width var(--t-slow);
}

/* Table dimension balance (player typology) */
.dimensions { margin-bottom: var(--sp-element); }
.dim-row {
    display: grid;
    grid-template-columns: 8rem 1fr 4.5rem;
    align-items: center;
    gap: var(--sp-tight);
    margin-bottom: 0.4rem;
}
.dim-row__label { font-size: var(--fs-sm); color: var(--parchment-muted); }
.dim-row__track {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--ink-border-strong);
    overflow: hidden;
}
.dim-row__fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--brass);
    transition: width var(--t-slow);
}
.dim-row__level {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--parchment-faint);
    text-align: right;
}
.dim-level--absent { background: var(--danger); }
.dim-level--faible { background: var(--warning); }
.dim-level--moyen { background: var(--brass); }
.dim-level--fort { background: var(--success); }
.typology-credit { margin-top: var(--sp-tight); }
.archetype-desc {
    font-size: var(--fs-sm);
    font-style: italic;
    line-height: 1.4;
    min-height: 1.2em;
    margin-top: 0.4rem;
    color: var(--parchment-muted);
}
@media (max-width: 640px) {
    .dim-row { grid-template-columns: 6rem 1fr 3.5rem; }
}

/* -----------------------------------------------------------------------------
   13. Charter (recap)
   ----------------------------------------------------------------------------- */
.charter__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-element);
    margin-bottom: var(--sp-group);
    font-size: var(--fs-sm);
    color: var(--parchment-muted);
}
.charter__meta dt {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brass);
}
.charter__meta dd { font-family: var(--font-display); font-size: var(--fs-h4); color: var(--parchment); }
.charter__section { margin-bottom: var(--sp-group); }
.charter__empty { color: var(--parchment-faint); font-style: italic; }

/* -----------------------------------------------------------------------------
   14. Auth UI
   ----------------------------------------------------------------------------- */
.auth-user { display: flex; align-items: center; gap: var(--sp-tight); }
.auth-avatar {
    width: 2rem; height: 2rem;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--brass-edge);
}
.auth-name { font-size: var(--fs-sm); color: var(--parchment); }

/* -----------------------------------------------------------------------------
   15. Footer
   ----------------------------------------------------------------------------- */
.site-footer {
    padding: var(--sp-group) var(--gutter);
    text-align: center;
    color: var(--parchment-faint);
    font-size: var(--fs-sm);
    border-top: 1px solid var(--ink-border);
}

/* -----------------------------------------------------------------------------
   16. Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .player__grid { grid-template-columns: 1fr; }
    .stepper { flex-wrap: nowrap; overflow-x: auto; }
    .stepper__label { display: none; }
    .stepper__item { flex: 0 0 auto; }
    .journey__nav { flex-direction: column-reverse; }
    .journey__nav .btn { width: 100%; }
}

/* -----------------------------------------------------------------------------
   17. Reduced motion
   ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* -----------------------------------------------------------------------------
   18. New-charter controls & export actions
   ----------------------------------------------------------------------------- */
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--sp-element);
    margin-bottom: var(--sp-group);
}
.hero__actions .hero__cta { margin-bottom: 0; }

.journey__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-element);
    margin-bottom: var(--sp-element);
}
.journey__progress {
    display: flex;
    align-items: center;
    gap: var(--sp-tight);
}
.journey__progress-track {
    display: block;
    width: 6rem;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--ink-border-strong);
    overflow: hidden;
}
.journey__progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    background: var(--brass);
    transition: width var(--t-slow);
}
.journey__progress-label {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--parchment-faint);
}
.alert__actions { margin-top: var(--sp-tight); }

/* Non-modal toasts / confirmations */
.toasts {
    position: fixed;
    left: 50%;
    bottom: var(--gutter);
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--sp-tight);
    width: min(30rem, calc(100vw - 2 * var(--gutter)));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-tight);
    /* Elevated, tone-tinted surface so toasts stand out from page cards.
       The solid line is a fallback for browsers without color-mix. */
    background: var(--ink-650);
    background: color-mix(in srgb, var(--brass) 14%, var(--ink-650));
    border: 1px solid var(--brass);
    border-left: 4px solid var(--brass);
    border-radius: var(--radius-md);
    padding: var(--sp-element) var(--sp-inset);
    color: var(--parchment);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.35);
    animation: toast-in var(--t-base);
}
.toast--success {
    background: var(--ink-650);
    background: color-mix(in srgb, var(--success) 16%, var(--ink-650));
    border-color: var(--success);
}
.toast--warning {
    background: var(--ink-650);
    background: color-mix(in srgb, var(--warning) 18%, var(--ink-650));
    border-color: var(--warning);
}
.toast--info {
    background: var(--ink-650);
    background: color-mix(in srgb, var(--brass) 14%, var(--ink-650));
    border-color: var(--brass);
}
.toast__msg { margin: 0; color: var(--parchment); flex: 1 1 12rem; }
.toast__actions { display: flex; gap: var(--sp-tight); margin-left: auto; }
.toast__close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--parchment-muted);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.2rem;
}
.toast__close:hover { color: var(--brass); }
.toast.is-leaving { opacity: 0; transition: opacity 0.2s ease; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.charter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-tight);
    margin-top: var(--sp-element);
}

.shared-banner {
    text-align: center;
    margin-bottom: var(--sp-group);
    padding-bottom: var(--sp-element);
    border-bottom: 1px solid var(--ink-border);
}
.shared-banner .eyebrow { display: block; margin-bottom: var(--sp-tight); }
.shared-actions { margin-top: var(--sp-group); text-align: center; }

/* -----------------------------------------------------------------------------
   19. Print — turn the active charter into a clean paper / PDF page
   ----------------------------------------------------------------------------- */
@media print {
    body {
        background: #fff !important;
        background-image: none !important;
        color: #111 !important;
    }
    .site-header,
    .site-footer,
    .skip-link,
    .stepper,
    .journey__toolbar,
    .journey__nav,
    .charter-actions,
    .shared-actions,
    .empty-state,
    .result-foot,
    .toasts,
    .step__eyebrow,
    .step__intro,
    .page:not(.is-active),
    .step:not(.is-active) {
        display: none !important;
    }
    .main { max-width: none; padding: 0; }
    .step.is-active { animation: none; }

    .step__title,
    .charter__meta dd,
    .charter h3,
    .result-scroll__title,
    .result-scroll__lead,
    .result-block__title,
    .entity-card__name,
    .token-list li,
    .facilitator-note p {
        color: #111 !important;
    }
    .charter__meta dt,
    .result-block__title,
    .charter h3 { color: #7a5e1c !important; }

    .result-scroll,
    .entity-card,
    .facilitator-note,
    .charter__section { break-inside: avoid; }
    .result-scroll,
    .entity-card {
        background: #fff !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    .facilitator-note {
        background: #faf6ec !important;
        border-left: 3px solid #c8a24b !important;
    }
    .tone-chip {
        background: #fff !important;
        border: 1px solid #999 !important;
        color: #111 !important;
    }
    a { color: #111 !important; text-decoration: none; }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
