/* Nocturne — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #000000;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9; /* review round 7 (Barron): the accent moves to
     the product's blurple — OKLCH hue 289.2, the hue of the app's own Pro
     accent (#9a8fe0, --om-accent-pro) — at the same lightness the steel
     accent held (L 0.660, so the documented ratios survive) and chroma
     in the product blurple's own range (its token sits at C 0.118; the
     accent takes 0.125, from the old steel's 0.030):
     the accent now reads as an accent rather than another neutral. */
  --color-accent-2: #a7a1db; /* the machine-derived stand-in follows: same
     hue, same L 0.734, chroma at the same 2:3 proportion it held */
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);
  --color-warn: oklch(0.74 0.15 55);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;

  --color-accent-2-100: #f5f4ff;
  --color-accent-2-200: #e7e5fe;
  --color-accent-2-300: #d2cefd;
  --color-accent-2-400: #b5afe8;
  --color-accent-2-500: #9690c9;
  --color-accent-2-600: #7972a9;
  --color-accent-2-700: #5c5783;
  --color-accent-2-800: #423e5d;
  --color-accent-2-900: #2b293a;

  /* Deck section-divider ground — review round 3: saturation as presence.
     Dividers take a saturated deep indigo (hue 277, the neutral ramp's own
     family; C 0.094 — written when the accent held C 0.030, before the
     round-7 blurple raised it past the ground's) with a lighter bloom and
     a ghost tint of the same hue, while the slide grounds stay
     desaturated. Deck-scale fills only — not interface colors. */
  --color-section: #262a60;
  --color-section-glow: #353b80;
  --color-section-ghost: #4c5397;

  --font-heading: "Inter", system-ui, sans-serif;
  --font-heading-weight: 500;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;

  --space-1: 2.8px;
  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one.
     The ground is pure black (#000), so a black ambient shadow would be
     literally invisible (same color as what's behind it) — the ambient
     component is instead a faint accent-tinted glow, which also keeps it
     visually consistent with the accent glow on the primary CTA. */
  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px color-mix(in srgb, var(--color-accent) 16%, transparent);
  --shadow-lg: 0 0 0 1px var(--color-neutral-300), 0 16px 40px color-mix(in srgb, var(--color-accent) 22%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.lighten{mix-blend-mode:lighten;background-color:transparent}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
/* Rules fade to transparent at both ends instead of stopping cleanly — a
   Nocturne signature. The ramp is 48px an end (one deck baseline unit),
   painted from the same divider token. Freestanding rules fade; box
   outlines, in-control separators, and short accent marks stay solid. */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-100); }
.tag-accent-2 { background: var(--color-accent-2-800); color: var(--color-accent-2-100); }
.tag-neutral { background: var(--color-neutral-800); color: var(--color-neutral-100); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
/* Per-turn countdown, styled as the same outlined pill as the LIVE ROUND
   badge next to it — tabular-nums keeps the digits from jittering the
   pill's width as they count down. Ticks only while it's the player's
   turn (input enabled); warns in the last 10 seconds. */
.cuss-arena-timer { font-variant-numeric: tabular-nums; }
.cuss-arena-timer.is-warn { border-color: var(--color-warn); color: var(--color-warn); }

/* — navigation — */
/* flex-wrap:nowrap deliberately — the old wrapping layout is exactly the
   "nav items wrap onto multiple lines with inconsistent spacing" bug.
   Instead .cuss-nav-links (the only flexible child) absorbs any width
   shortfall by scrolling horizontally on its own, while the mark, brand,
   and .cuss-nav-actions stay flex:none so they can never be the ones
   that get squeezed or wrap. */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  flex-wrap: nowrap;
  /* Was an inline style on the <nav> tag itself (padding: var(--space-3)
     var(--edge)) — moved here so a mobile-scoped override can actually
     win the cascade; an inline style beats any external stylesheet rule
     regardless of specificity, which is what made an earlier attempt at
     tightening this at mobile silently no-op. Same --edge value as
     before, so desktop's actual padding is unchanged by this move. */
  padding: var(--space-3) var(--edge);
  border-bottom: none;
  position: relative; /* anchors .cuss-nav-links as a dropdown on mobile, see below */
}
/* Logo mark — sits immediately left of the wordmark, the nav's own
   gap (var(--space-4)) provides the spacing between the two. */
.nav-mark { display: block; height: 34px; width: auto; flex: none; }
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; flex: none;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }
/* The one flexible piece of the nav — takes whatever width is left after
   the mark/brand/actions claim theirs, and scrolls horizontally instead
   of wrapping if that's not enough (min-width:0 is required for a flex
   child to be allowed to shrink below its content's natural width at
   all; without it flex-basis:auto would keep this as wide as its
   longest-possible layout and force the whole nav to overflow instead).
   Scrollbar hidden since this is meant to read as "one row", not a
   visibly scrollable panel — still fully scrollable by touch/drag/
   trackpad, just without the chrome. Each link is flex:none so a link's
   own text never wraps mid-word while scrolling past it. */
.cuss-nav-links {
  display: flex; align-items: center; gap: var(--space-4);
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.cuss-nav-links::-webkit-scrollbar { display: none; }
.cuss-nav-links a { flex: none; padding: 12px 4px; }
.cuss-nav-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
/* Small outlined nav Chat button — reuses .btn-primary as-is (purple
   border, transparent fill, accent text). Same outline recipe as the big
   hero Chat button now, just at nav scale, so it still reads as visually
   secondary to it purely by size. */
.nav-cta { flex: none; }
/* Optional Google sign-in (see initAuth() in script.js). [hidden] must win
   over the display values below, hence the explicit rules. */
.cuss-signin-btn[hidden], .cuss-user-chip[hidden] { display: none; }
.cuss-user-chip { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
.cuss-user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--color-accent) 25%, transparent) center / cover no-repeat;
  font-size: 13px; font-weight: 600;
}
.cuss-user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
/* User chip = a menu trigger (avatar + nickname) with a small dropdown:
   Set/Change nickname and Sign out. See initNicknameUI() in script.js. */
.cuss-user-chip { position: relative; }
.cuss-user-trigger {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  background: none; border: 0; padding: 4px 6px; border-radius: var(--radius-md);
  color: inherit; font: inherit; cursor: pointer;
}
.cuss-user-trigger:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.cuss-user-caret { flex: none; opacity: 0.6; }
.cuss-user-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 200; min-width: 180px;
  display: flex; flex-direction: column; padding: 4px;
  background: color-mix(in srgb, var(--color-surface) 45%, var(--color-bg));
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.cuss-user-menu[hidden] { display: none; }
.cuss-user-menu-item {
  background: none; border: 0; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: inherit; font: inherit; font-size: 14px;
}
.cuss-user-menu-item:hover { background: color-mix(in srgb, var(--color-text) 9%, transparent); }
.cuss-user-menu-item:disabled { opacity: 0.5; cursor: default; }

/* Sign in / Create account tabs inside the sign-in dialog. */
.cuss-tabs {
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.cuss-tab {
  flex: 1; padding: 10px 12px; background: none; border: 0; border-radius: var(--radius-sm);
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cuss-tab:hover { color: var(--color-text); }
.cuss-tab.is-active { background: color-mix(in srgb, var(--color-text) 10%, transparent); color: var(--color-text); }
.cuss-panel { display: flex; flex-direction: column; gap: var(--space-4); }
.cuss-panel[hidden] { display: none; }

/* Nickname dialog fields (the dialog itself reuses .cuss-signin-dialog/-card). */
.cuss-nick-label { font-size: 13px; color: color-mix(in srgb, var(--color-text) 65%, transparent); margin-bottom: calc(-1 * var(--space-2)); }
.cuss-nick-input {
  box-sizing: border-box; width: 100%; padding: 12px 14px;
  background: transparent; color: var(--color-text);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
}
.cuss-nick-input:focus { outline: none; border-color: var(--color-accent); }
.cuss-nick-status { margin: 0; min-height: 20px; font-size: 13.5px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.cuss-nick-status.is-ok { color: oklch(0.75 0.13 150); }
.cuss-nick-status.is-bad { color: var(--color-warn); }
.cuss-nick-hint { margin: 0; font-size: 13px; line-height: 1.5; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.cuss-nick-save {
  width: 100%; padding: 14px 20px; font-size: 15px;
  background: var(--color-accent); color: var(--color-bg); border-color: transparent;
}
.cuss-nick-save:hover:not(:disabled) { background: var(--color-accent-2); }
.cuss-nick-cancel { width: 100%; padding: 12px 20px; font-size: 14px; }
/* .btn sets display, which would override the [hidden] attribute. */
.cuss-nick-cancel[hidden], .cuss-signin-close[hidden] { display: none; }

/* ---- Guest sign-in prompts ------------------------------------------------
   Everything below is shown only to guests once auth state is known:
   initAuth() sets body.auth-enabled (Supabase configured + first auth event
   received) and body.signed-in. Without auth-enabled none of this appears, so
   the site looks exactly as it did before sign-in existed. */
/* .btn .cuss-lock: must outrank `.btn svg { display: block }` above, or the
   lock would also show for signed-in users. */
.cuss-lock, .btn .cuss-lock, .cuss-guest-note { display: none; }
body.auth-enabled:not(.signed-in) .cuss-lock { display: inline-block; flex: none; opacity: 0.85; }
body.auth-enabled:not(.signed-in) #cuss-bag-nav-count,
body.auth-enabled:not(.signed-in) #cuss-bag-hero-count { display: none; }
body.auth-enabled:not(.signed-in) .cuss-guest-note {
  display: block; margin: var(--space-4) 0 0; max-width: 46ch;
  font-size: 14px; line-height: 1.5;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

/* White Google buttons (nav Sign in, dialog, round-report card). */
.cuss-signin-btn, .cuss-google-btn {
  background: #fff; color: #1f1f1f; border-color: #fff;
}
.cuss-signin-btn:hover, .cuss-google-btn:hover { background: #f1f1f4; border-color: #f1f1f4; }
.cuss-signin-btn:active, .cuss-google-btn:active { background: #e4e4e9; }
.cuss-google-btn { width: 100%; padding: 14px 20px; font-size: 15px; }

/* Sign-in dialog — same fade-in overlay approach as .cuss-bag, but a centered
   card. visibility (not just opacity) keeps its buttons out of the tab order
   while closed. */
.cuss-signin-dialog {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: var(--space-6);
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  opacity: 0; visibility: hidden; pointer-events: none;
  /* On close, visibility flips after the fade-out finishes. */
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
/* On open, visibility flips immediately (0s) — otherwise the dialog is still
   "hidden" when script calls focus() and the field can't take focus. */
.cuss-signin-dialog.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.2s ease, visibility 0s; }
.cuss-signin-card {
  position: relative; box-sizing: border-box; width: 100%; max-width: 420px;
  max-height: calc(100dvh - 2 * var(--space-6)); overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-8);
  background: color-mix(in srgb, var(--color-surface) 45%, var(--color-bg));
  border: 1px solid var(--color-divider); border-radius: var(--radius-lg);
}
.cuss-signin-close { position: absolute; top: var(--space-4); right: var(--space-4); }
.cuss-signin-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-surface) 80%, var(--color-bg));
}
.cuss-signin-title { margin: var(--space-2) 0 0; font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 28px; line-height: 1.15; }
.cuss-signin-sub { margin: 0; font-size: 15px; line-height: 1.5; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.cuss-signin-or {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 13px; color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.cuss-signin-or::before, .cuss-signin-or::after { content: ""; flex: 1; height: 1px; background: var(--color-divider); }
.cuss-signin-guest { width: 100%; padding: 14px 20px; font-size: 15px; }
.cuss-signin-foot {
  margin: 0; text-align: center; font-size: 13px; line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-signin-foot a { color: inherit; text-decoration: underline; }
.cuss-signin-foot a:hover { color: var(--color-accent); }

/* Round-report card for guests (see renderGuestBagPrompt() in script.js).
   Proportions follow the "After a round" design (roomy card, 22px title, 16px
   chips and body, 54px white Google button), in the site's own colors. */
.cuss-bag-prompt {
  box-sizing: border-box; width: 100%; max-width: 500px; margin-top: var(--space-6);
  display: flex; flex-direction: column; gap: 18px; text-align: left;
  padding: 28px;
  background: color-mix(in srgb, var(--color-surface) 45%, var(--color-bg));
  border: 1px solid var(--color-divider); border-radius: 22px;
  color: var(--color-text);
}
.cuss-bag-prompt[hidden] { display: none; }
.cuss-bag-prompt-title {
  display: flex; align-items: center; gap: 12px; margin: 0;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 22px; line-height: 1.25;
}
.cuss-lock-static { flex: none; width: 20px; height: 20px; color: var(--color-accent); }
.cuss-bag-prompt-words { display: flex; flex-wrap: wrap; gap: 10px; }
.cuss-bag-prompt-word {
  padding: 8px 16px; border-radius: 10px; font-size: 16px; font-weight: 600;
  color: oklch(0.75 0.13 150);
  background: color-mix(in srgb, oklch(0.75 0.13 150) 14%, transparent);
}
.cuss-bag-prompt-text { margin: 0; font-size: 16px; line-height: 1.55; color: color-mix(in srgb, var(--color-text) 72%, transparent); }
.cuss-bag-prompt .cuss-google-btn { height: 54px; padding: 0 20px; gap: 12px; border-radius: 14px; font-size: 16px; font-weight: 600; }
.cuss-bag-prompt .cuss-g-logo { width: 20px; height: 20px; }
.cuss-bag-prompt-later {
  align-self: center; height: 46px; padding: 0 20px; font-size: 15px; font-weight: 600;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}
.cuss-bag-prompt-later:hover { color: var(--color-text); }
@media (max-width: 640px) {
  .cuss-bag-prompt { padding: 20px; gap: 14px; border-radius: 18px; }
  .cuss-bag-prompt-title { font-size: 19px; }
  .cuss-bag-prompt-word { padding: 6px 12px; font-size: 15px; }
  .cuss-bag-prompt-text { font-size: 15px; }
}
/* Hamburger — hidden on desktop, where .cuss-nav-links is just an inline
   row; shown only at the mobile breakpoint below, which is also where
   .cuss-nav-links itself switches from "inline row" to "dropdown panel
   toggled by this button" (see initNavMenu() in script.js). */
.cuss-nav-menu-btn {
  display: none; flex: none; color: var(--color-accent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
}

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid transparent; /* keeps layout; the row paints the fading rule */
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid transparent;
}
/* Row rules as row-level strips so the end-fade spans the row, not each cell. */
.table thead tr {
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.table tbody tr {
  background: linear-gradient(to right,
    transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
    color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.table tbody tr:hover {
  /* the hover tint layers over the row rule, which keeps painting */
  background:
    linear-gradient(color-mix(in srgb, var(--color-text) 4%, transparent),
                    color-mix(in srgb, var(--color-text) 4%, transparent)) no-repeat 0 0 / 100% 100%,
    linear-gradient(to right,
      transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
      color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ══════════════════════════════════════════════════════════════════════════
   Cussator landing — page-specific rules on top of the tokens/components above.
   ══════════════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.cuss-page {
  --leading: 28px;
  --half: 14px;
  --edge: clamp(20px, 5vw, 72px);
  background:
    radial-gradient(1200px 720px at 82% -160px, color-mix(in srgb, var(--color-accent-900) 75%, transparent), transparent 60%),
    radial-gradient(1100px 800px at -10% 100%, color-mix(in srgb, black 30%, transparent), transparent 55%),
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  min-height: 100vh; min-height: 100dvh;
}
/* Desktop's ambient court-line texture (.cuss-hero-grid::before below) is
   a single illustration sized to fill exactly the hero section's own
   box — it doesn't tile, so it can't just be reused as-is for "extend
   across the full scrollable page." This is a separate, small repeating
   grid tile instead, added as its own background layer on the page
   itself (so it naturally covers however tall the page's content makes
   it, unlike a box-scoped background-size:100% 100% image) — same
   opacity and line color as the desktop texture, same "faint grid"
   character, just a repeatable pattern rather than one stretched scene.
   Mobile-only (this breakpoint already matches .cuss-hero-grid's own
   single-column collapse below): desktop keeps its existing hero-scoped
   texture untouched rather than layering a second grid on top of it. */
@media (max-width: 900px) {
  .cuss-page {
    background:
      radial-gradient(1200px 720px at 82% -160px, color-mix(in srgb, var(--color-accent-900) 75%, transparent), transparent 60%),
      radial-gradient(1100px 800px at -10% 100%, color-mix(in srgb, black 30%, transparent), transparent 55%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 0H40M0 0V40' stroke='%23e9e9ed' stroke-width='1' fill='none' opacity='0.08'/%3E%3C/svg%3E") repeat,
      var(--color-bg);
  }
}
.cuss-wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--edge); }

.cuss-nav a { text-decoration: none; font-size: 14px; }

@keyframes cuss-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.cuss-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent);
  animation: cuss-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .cuss-live-dot { animation: none; } }

.cuss-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: var(--space-3) 0 var(--space-3);
  position: relative;
  z-index: 0;
}
/* Ambient court-line texture, homepage hero only — echoes the volley
   metaphor from the "Entering the Chat" animation. Kept to a near-invisible
   opacity on purpose; it's atmosphere, not a graphic. */
.cuss-hero-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.08;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 400'%3E%3Cg fill='none' stroke='%23e9e9ed' stroke-width='1.5'%3E%3Crect x='20' y='20' width='560' height='360'/%3E%3Cline x1='90' y1='20' x2='90' y2='380'/%3E%3Cline x1='510' y1='20' x2='510' y2='380'/%3E%3Cline x1='20' y1='200' x2='580' y2='200'/%3E%3Cline x1='90' y1='103' x2='510' y2='103'/%3E%3Cline x1='90' y1='297' x2='510' y2='297'/%3E%3Cline x1='300' y1='103' x2='300' y2='297'/%3E%3C/g%3E%3C/svg%3E");
}
.cuss-hero-copy h1 {
  font-size: clamp(36px, 4.4vw, 58px); line-height: 1.08;
  letter-spacing: -0.015em; margin: 0 0 0 -0.05em;
}
.cuss-hero-copy h1 span { display: block; }
.cuss-hero-copy p {
  font-size: 17px; line-height: var(--leading); max-width: 52ch;
  margin: var(--space-4) 0 0; color: var(--color-text);
}
.cuss-hero-actions {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-4);
}
/* Bag's entry point sits immediately right of Chat, not stacked below it —
   its own row so the big primary CTA still reads as the one dominant
   action, with "How it works" staying on its own line beneath both. */
.cuss-hero-cta-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
/* Elevator Pitch (Feature 4) sits here, next to "How it works", rather than
   in .cuss-hero-cta-row with Chat/Bag — that row is already two full-size
   .cuss-cta-xl buttons wide and mobile-tuned for exactly two (see the
   comment above); a third of the same size risks the same overflow that
   row was already fixed for once. A plain .btn-secondary keeps Chat as the
   one dominant action and costs nothing on narrow screens. */
.cuss-hero-secondary-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
/* Chat — outlined, not solid: black fill, purple border and text, same
   recipe .btn-primary already uses everywhere else, just scaled up. Keeps
   the same ambient purple glow it always had (an outline can still glow),
   referenced elsewhere in this file as "the homepage Chat button's glow". */
.cuss-cta-xl {
  /* Horizontal padding scales down with the viewport instead of staying a
     flat 72px a side — at 72px fixed, this plus its own text was tight or
     overflowing on ~320-375px phones (also applies to Bag, which shares
     this class — see the comment below). */
  font-size: 24px; padding: 26px clamp(24px, 8vw, 72px); border-width: 1.5px;
  background: var(--color-bg); color: var(--color-accent); border-color: var(--color-accent);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.cuss-cta-xl:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.cuss-cta-xl:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
/* Bag is styled as Chat's exact twin now (same .btn-primary / .cuss-cta-xl
   classes in the HTML) — no separate Bag-specific look here anymore. */

@media (max-width: 640px) {
  /* h1 clamp()s down to a 36px floor and stops — tuned for desktop, where
     the clamp's growth range matters; at phone width it never actually
     reads as small. Straight override to roughly 65% of that floor so it
     reads as a strong headline without wrapping to 3 lines and pushing
     everything else below the fold. */
  .cuss-hero-copy h1 { font-size: 24px; }
  /* Chat/Bag were two full .cuss-cta-xl buttons (26px vertical padding,
     24px text) wrapping onto their own lines under flex-wrap — read as
     two stacked black tiles, not a button pair. flex:1 1 0 (an earlier
     pass) fixed the wrapping but stretched each button to fill half the
     row edge to edge, which reads as left-aligned-and-stretched against
     the hero text above it, not as a centered pair — flex:0 1 auto lets
     them size to their own compact content instead, and
     justify-content:center on the row centers that pair as a unit, with
     equal margin on both sides. */
  .cuss-hero-actions { align-items: center; }
  .cuss-hero-cta-row { flex-wrap: nowrap; justify-content: center; width: 100%; }
  .cuss-cta-xl { flex: 0 1 auto; font-size: 15px; padding: 12px 20px; min-height: 44px; }
}

/* Mobile-only live-round preview card — hidden above the hero-grid's own
   single-column collapse (max-width:900px, see .cuss-hero-grid below),
   since desktop already shows this same idea via .cuss-demo in the
   second column; showing both would be redundant. Reuses .cuss-demo's
   own head/motion/.cuss-ai-card styling rather than inventing a new
   look, just tightened and clamped to 2-3 lines. */
.cuss-hero-preview { display: none; }
@media (max-width: 900px) {
  /* z-index:2 on the heading vs. 1 on the card below, plus the card's
     own negative top margin, is what lets the card's top edge tuck just
     behind the last line of the heading instead of starting with a full
     gap under it — the heading still always wins any actual overlap. */
  .cuss-hero-copy h1 { position: relative; z-index: 2; }
  .cuss-hero-preview {
    display: flex; flex-direction: column; gap: var(--space-2);
    position: relative; z-index: 1;
    margin: -14px 0 var(--space-4); max-height: 400px; overflow: hidden;
    background: var(--color-surface); border: 1px solid var(--color-divider);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 26px var(--space-3) var(--space-3);
    transition: max-height 300ms ease, opacity 200ms ease, margin 300ms ease, padding 300ms ease;
  }
  /* Author CSS beats the browser's own [hidden]{display:none} default
     regardless of specificity (author always outranks the user-agent
     origin) — without restating it explicitly here, setting
     card.hidden = true (both the anti-flash inline script in index.html
     and the dismiss handler in script.js) silently has no visual effect
     once this rule's own display:flex applies. */
  .cuss-hero-preview[hidden] { display: none; }
  /* Clamped to keep this a genuine "2-3 lines + one short exchange"
     preview rather than a full round view shrunk down — a longer motion
     or AI line just gets an ellipsis instead of growing the card. */
  .cuss-hero-preview .cuss-demo-motion {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cuss-hero-preview .cuss-ai-card { padding: var(--space-2) var(--space-3); }
  .cuss-hero-preview .cuss-ai-body {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 13px;
  }
  /* 44x44 tappable area even though the × glyph itself is small —
     absolutely positioned in the card's own top-right corner, inside the
     padding reserved for it above. */
  .cuss-hero-preview-close {
    position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: color-mix(in srgb, var(--color-text) 55%, transparent);
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .cuss-hero-preview-close:hover { color: var(--color-text); }
  /* Dismiss animation — see initHeroPreview() in script.js, which adds
     this class then waits for the transition above before setting
     hidden. */
  .cuss-hero-preview.is-dismissing {
    max-height: 0; opacity: 0; margin-top: 0; margin-bottom: 0;
    padding-top: 0; padding-bottom: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cuss-hero-preview { transition: none; }
}

.cuss-demo {
  background: var(--color-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
}
/* Once .cuss-hero-grid collapses to one column (see max-width:900px
   below), this would otherwise just stack below the hero copy as a
   second, redundant "LIVE ROUND" widget under the new static
   .cuss-hero-preview above it — hidden here in favor of that one.
   Placed after the base rule above (equal specificity either way, so
   source order decides) rather than inside the shared mobile media
   query further down, which sits earlier in the file and would
   otherwise silently lose this override to the rule above it. */
@media (max-width: 900px) {
  .cuss-demo { display: none; }
}
.cuss-demo-head { display: flex; align-items: center; gap: var(--space-2); }
.cuss-demo-timer {
  margin-left: auto; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  font-feature-settings: 'tnum' 1;
}
.cuss-demo-motion {
  margin: 0; font-size: 12px; font-style: italic;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
.cuss-demo-label {
  margin: 0 0 4px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-demo-speech { margin: 0; font-size: 16px; line-height: 1.5; }
.cuss-demo-speech span { transition: color 0.25s ease; }

.cuss-ai-card {
  background: color-mix(in srgb, var(--color-warn) 14%, var(--color-surface));
  border-radius: var(--radius-md); padding: var(--space-3);
}
.cuss-ai-difficulty-tag { margin-bottom: 6px; }
.cuss-ai-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 4px; }
.cuss-ai-label { margin: 0; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-warn); }
.cuss-ai-card p.cuss-ai-body { margin: 0; font-size: 14px; line-height: 1.5; }
.cuss-simplify-btn {
  font-family: inherit; font-size: 10.5px; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--color-accent); background: transparent; cursor: pointer; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent); border-radius: 999px;
  padding: 3px 9px; transition: background 0.15s ease, opacity 0.15s ease, color 0.2s ease, border-color 0.2s ease;
}
.cuss-simplify-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 14%, transparent); }
.cuss-simplify-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cuss-simplify-btn.is-done { color: color-mix(in srgb, var(--color-text) 55%, transparent); border-color: var(--color-divider); }

.cuss-judge {
  display: flex; flex-direction: column; gap: 6px; padding-top: var(--space-2);
  border-top: 1px solid var(--color-divider);
  opacity: 0; transition: opacity 0.35s ease;
}
.cuss-judge.is-visible { opacity: 1; }
/* Collapses out of the flex flow entirely before the first turn resolves —
   otherwise its (invisible but full-height) box sits between the transcript
   and the legend/input, breaking the uniform gap rhythm described above. */
.cuss-judge[hidden] { display: none; }
.cuss-judge-label {
  margin: 0 0 2px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
/* Itemizes Logic/Precision/Delivery the same way the homepage's numbered
   rows are itemized — a fading rule between each, not just a bare stack of
   rows. Wraps the existing row+hint pair; nothing inside it changed. */
.cuss-judge-item {
  display: flex; flex-direction: column; padding-top: 6px;
  background: linear-gradient(to right, transparent, var(--color-neutral-800) 4px calc(100% - 4px), transparent) no-repeat top / 100% 1px;
}
.cuss-judge-item:first-child { background-image: none; padding-top: 0; }
.cuss-judge-row { display: flex; align-items: center; gap: 8px; }
.cuss-judge-row span:first-child { font-size: 12px; width: 64px; flex: none; cursor: help; }

/* Judge, demoted and collapsed — relocated below the legend (was between
   the transcript and the legend) and shrunk from a 3-row compact block
   down to one summary line: label + score per metric, dot-separated, no
   bars, no explanations, until the single "i" is tapped. The scores
   themselves are exactly the same computeJudgeScores() output as
   before — only where and how much space they take is different.
   Overrides the shared .cuss-judge base rule's column layout (that rule
   still governs the homepage demo's own #cuss-judge as-is, which never
   collapses — this override is scoped to #cuss-arena-judge alone) since
   this is now just a positioning wrapper around a button and its
   popover, not a stack of metric rows itself. */
#cuss-arena-judge {
  display: block; padding-top: 0; border-top: none; position: relative;
}
.cuss-judge-summary {
  display: flex; align-items: center; gap: 6px; width: 100%;
  font: inherit; font-size: 11px; text-align: left;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  background: transparent; border: none; padding: 6px 2px; margin: 0; cursor: pointer;
  font-feature-settings: 'tnum' 1;
}
.cuss-judge-summary:hover, .cuss-judge-summary[aria-expanded="true"] { color: var(--color-text); }
.cuss-judge-summary-label b { font-weight: 700; color: var(--color-text); }
.cuss-judge-summary-dot { opacity: 0.5; }
/* Same small circular "i" language as other info toggles in this app —
   sized to the summary row's own compact height rather than padded up
   to the usual ~44px touch-target floor elsewhere: the whole summary
   button (not just this icon) is clickable and spans nearly the full
   composer width, so the real tap target is already generous. */
.cuss-judge-info-icon {
  flex: none; margin-left: auto; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--color-text) 35%, transparent); border-radius: 50%;
  font-family: var(--font-heading); font-style: italic; font-weight: 700; font-size: 10px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cuss-judge-summary:hover .cuss-judge-info-icon, .cuss-judge-summary[aria-expanded="true"] .cuss-judge-info-icon {
  border-color: var(--color-accent); color: var(--color-accent);
}
/* Full detail — bars, scores, and the same per-metric explanations as
   the earlier compact pass, just moved off the permanently-visible
   screen and into an on-demand popover. Opens upward (same anchored-
   dropdown pattern as the Insert-from-Bag popover elsewhere in this
   file), since the summary button now sits near the very bottom of the
   screen, right above the input. */
.cuss-judge-popover {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 25;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: 6px;
}
/* Author CSS beats the browser's own [hidden]{display:none} default
   regardless of specificity (same gotcha already caught once on
   .cuss-hero-preview) — without this, setting judgePopover.hidden = true
   in script.js sets the attribute correctly but the popover stays
   visually rendered anyway, since this rule's own display:flex above
   otherwise wins. */
.cuss-judge-popover[hidden] { display: none; }
.cuss-judge-popover .cuss-judge-label { margin: 0 0 2px; }
.cuss-judge-popover .cuss-judge-item {
  display: flex; flex-direction: column; padding-top: 6px;
  background: linear-gradient(to right, transparent, var(--color-neutral-800) 4px calc(100% - 4px), transparent) no-repeat top / 100% 1px;
}
.cuss-judge-popover .cuss-judge-item:first-child { background-image: none; padding-top: 0; }
/* Always visible inside the popover now — the per-metric "i" toggle from
   the earlier compact pass is gone; tapping the one summary icon to open
   this popover already is the "tap for more detail" action, so a second
   tap per metric just to read the sentence would be redundant. */
.cuss-judge-popover .cuss-judge-hint { margin: 2px 0 0 72px; }
.cuss-judge-track { flex: 1; height: 6px; border-radius: 99px; background: var(--color-neutral-800); overflow: hidden; }
.cuss-judge-fill { height: 100%; width: 0%; background: var(--color-accent); transition: width 0.1s linear; }
.cuss-judge-fill.is-warn { background: var(--color-warn); }
.cuss-judge-val { font-size: 11px; width: 28px; text-align: right; font-feature-settings: 'tnum' 1; }

/* Credibility (HP) bars get real visual weight — thicker track, a color
   shift toward danger as they drop, and a brief pulse whenever the number
   actually changes. Scoped under .cuss-arena-health so the Judge panel's
   bars (deliberately secondary — "feedback only") stay untouched; they
   share the same .cuss-judge-track/-fill/-val classes otherwise. */
/* overflow: visible (overriding the base track's overflow:hidden) so the
   fill's glow below can actually bleed outward instead of being clipped
   at the track edge — the fill rounds its own ends to match the track's
   pill shape instead, so it doesn't need the track to clip it square.
   position:relative anchors the trailing-streak element below.
   Frosted-glass capsule treatment — a translucent white wash over the
   dark track plus a soft inset shadow for depth, closer to an Apple
   Fitness ring's material than the old flat --color-neutral-800 fill. */
.cuss-arena-health .cuss-judge-track {
  position: relative; height: 12px; overflow: visible;
  background: color-mix(in srgb, white 10%, var(--color-neutral-800));
  box-shadow: inset 0 1px 3px color-mix(in srgb, black 35%, transparent);
}
.cuss-arena-health .cuss-judge-fill {
  position: relative; z-index: 1; border-radius: 99px;
  /* Healthy = green, not the ordinary accent purple — this bar now reads
     as a real health system (green/amber/red) rather than reusing the
     app's generic accent color for "full", matching is-hp-warning/
     is-hp-critical below as one continuous green->amber->red progression
     instead of a purple->amber->red one. This is the shared base every
     tier builds on; the HUD dual bars below layer a subtle per-side
     identity tint on top of each tier rather than replacing this. */
  background: oklch(0.75 0.13 150); color: oklch(0.75 0.13 150);
  transition: width 0.5s cubic-bezier(.22,.61,.36,1), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  /* Ambient glow in whichever color the bar currently is (healthy green,
     warning, or critical) — same color-mix-with-currentColor technique as
     the hit pulse below and the same idea as the homepage Chat button's
     glow, just a symmetric blur rather than that button's directional
     drop-shadow (a 16px-down shadow reads as a shadow, not a glow, on
     something this thin). Turned up to be clearly visible at a glance,
     not just a faint edge softening. */
  box-shadow: 0 0 22px 4px color-mix(in srgb, currentColor 75%, transparent);
}
.cuss-arena-health .cuss-judge-fill.is-warn { background: var(--color-warn); color: var(--color-warn); }
.cuss-arena-health .cuss-judge-fill.is-hp-warning { background: oklch(0.78 0.16 80); color: oklch(0.78 0.16 80); }
.cuss-arena-health .cuss-judge-fill.is-hp-critical { background: oklch(0.63 0.22 25); color: oklch(0.63 0.22 25); }
/* Per-side identity tint — distinguishes the two HUD bars by color again
   without reintroducing the earlier fixed-color scheme: each tier
   (healthy/warning/critical) keeps its own danger meaning, just blended
   with that side's identity color instead of being pure danger color on
   both bars. Bumped from an earlier 80/20 blend to 60/40 — 80/20 read as
   basically plain green with only a faint cast, not clearly "blue-green"
   vs "red-green" the way the avatar rings are unambiguously blue vs red.
   "You" leans toward the blue already used for the Affirm avatar ring
   (.cuss-anchor-avatar.is-affirm); "Opponent" leans toward the same red
   already used for the Negate ring AND for is-hp-critical above — no new
   colors introduced for either side. Fixed to You=blue-leaning/
   Opponent=red-leaning regardless of which stance (affirm/negate) the
   player actually picked that round, since the HUD bars are identified
   by role (You/Opponent), not by side. */
.cuss-arena-health .cuss-hud-hp-you .cuss-judge-fill {
  background: color-mix(in srgb, oklch(0.75 0.13 150) 60%, oklch(0.72 0.15 250) 40%);
  color: color-mix(in srgb, oklch(0.75 0.13 150) 60%, oklch(0.72 0.15 250) 40%);
}
.cuss-arena-health .cuss-hud-hp-you .cuss-judge-fill.is-hp-warning {
  background: color-mix(in srgb, oklch(0.78 0.16 80) 60%, oklch(0.72 0.15 250) 40%);
  color: color-mix(in srgb, oklch(0.78 0.16 80) 60%, oklch(0.72 0.15 250) 40%);
}
.cuss-arena-health .cuss-hud-hp-you .cuss-judge-fill.is-hp-critical {
  background: color-mix(in srgb, oklch(0.63 0.22 25) 60%, oklch(0.72 0.15 250) 40%);
  color: color-mix(in srgb, oklch(0.63 0.22 25) 60%, oklch(0.72 0.15 250) 40%);
}
.cuss-arena-health .cuss-hud-hp-opponent .cuss-judge-fill {
  background: color-mix(in srgb, oklch(0.75 0.13 150) 60%, oklch(0.63 0.22 25) 40%);
  color: color-mix(in srgb, oklch(0.75 0.13 150) 60%, oklch(0.63 0.22 25) 40%);
}
.cuss-arena-health .cuss-hud-hp-opponent .cuss-judge-fill.is-hp-warning {
  background: color-mix(in srgb, oklch(0.78 0.16 80) 60%, oklch(0.63 0.22 25) 40%);
  color: color-mix(in srgb, oklch(0.78 0.16 80) 60%, oklch(0.63 0.22 25) 40%);
}
/* Opponent's identity red IS is-hp-critical's own red (oklch(0.63 0.22 25))
   — blending that color with itself is a no-op — but this rule still has
   to exist and win: the plain .cuss-hud-hp-opponent .cuss-judge-fill rule
   above matches at every tier (nothing scopes it to "not critical") and
   sits at equal specificity to the shared .is-hp-critical rule, so
   without this it would silently override critical's red back to the
   base green tint. */
.cuss-arena-health .cuss-hud-hp-opponent .cuss-judge-fill.is-hp-critical {
  background: oklch(0.63 0.22 25); color: oklch(0.63 0.22 25);
}
/* Trailing depletion streak — a second bar sitting behind the real fill
   (z-index:0 vs. the fill's 1) that snaps to the OLD width the instant HP
   drops, then eases down to the new width on a slower, slightly delayed
   transition (see setHpTrail() in script.js) — the fill has already
   "landed" at the new value by the time this catches up, reading as a
   trailing streak the way a game HUD health bar depletes, rather than
   the whole bar just shrinking as one flat block. Stays hidden (width:0)
   on a heal, since there's nothing to trail there. */
.cuss-arena-health .cuss-judge-trail {
  position: absolute; inset: 0; z-index: 0; border-radius: 99px; width: 0%;
  background: color-mix(in srgb, oklch(0.63 0.22 25) 65%, transparent);
  transition: width 0.6s ease-out 0.15s;
}
.cuss-arena-health .cuss-judge-val { font-size: 13px; font-weight: 700; transition: color 0.3s ease; }
.cuss-arena-health .cuss-judge-val.is-hp-warning { color: oklch(0.78 0.16 80); }
.cuss-arena-health .cuss-judge-val.is-hp-critical { color: oklch(0.63 0.22 25); }

@keyframes cuss-hp-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  35% { box-shadow: 0 0 16px 2px currentColor; }
  100% { box-shadow: 0 0 0 0 currentColor; }
}
.cuss-arena-health .cuss-judge-fill.is-flash { animation: cuss-hp-pulse 0.7s ease-out; }
/* A drop (filler hit or a "bad"/"solid" verdict costing this side) always
   pulses in the filler-orange used for highlighted words in the transcript,
   regardless of which HP tier color the bar itself currently is — without
   this, a small hit while still above 50 HP pulsed in the ordinary accent
   purple, which read as neutral/positive rather than "something just
   landed." Gains (a solid-argument self-heal) keep the tier-color pulse,
   since those aren't a hit. See updateHealthDisplay() in script.js. */
.cuss-arena-health .cuss-judge-fill.is-flash.is-hit { animation-name: cuss-hp-pulse-hit; }
@keyframes cuss-hp-pulse-hit {
  0% { box-shadow: 0 0 0 0 var(--color-warn); }
  35% { box-shadow: 0 0 18px 3px var(--color-warn); }
  100% { box-shadow: 0 0 0 0 var(--color-warn); }
}
@keyframes cuss-hp-val-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.cuss-arena-health .cuss-judge-val.is-flash { display: inline-block; animation: cuss-hp-val-pulse 0.5s ease-out; }

/* HUD dual HP bars — same .cuss-judge-track/-fill/-val mechanics above,
   laid out side by side instead of stacked. Previously hard-pinned to a
   fixed green(you)/red(opponent) identity color, overriding the shared
   danger-escalation tiering; reversed per the "premium health system"
   redesign (Apple Fitness rings, not a fixed-color fighting-game HUD) —
   both bars now use the same green->amber->red tiering as every other
   .cuss-arena-health bar, since the labels and left/right position above
   already make it unambiguous whose bar is whose without a fixed color
   too. See the removed .cuss-hud-hp-fill-you/-opponent overrides (git
   history) if that identity coloring is ever wanted back. */
.cuss-hud-hp-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.cuss-hud-hp { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; min-width: 0; }
.cuss-hud-hp-label {
  font-size: 11px; flex: 0 1 auto; min-width: 0; max-width: 62%; cursor: help;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
@media (max-width: 640px) {
  .cuss-hud-hp { flex: 1 1 100%; }
}

/* Live Scars counter — surfaces roundFillerWords (script.js), the exact
   per-round tally the post-round recap already reads, just live and
   compact ("like ×3, um ×2"). Hidden while empty via [hidden] (set/cleared
   from renderLiveScars() in script.js, called after every submit and from
   resetRound()) rather than rendering an empty bar. */
.cuss-live-scars {
  display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.cuss-live-scars-item { color: var(--color-warn); font-weight: 600; }
.cuss-live-scars[hidden] { display: none; }

/* Chat Bag shelf — persistent hotbar, distinct from (and sitting alongside)
   the existing Insert-from-Bag popover. Chips reuse the same green Bag
   identity color as .cuss-bag-card-word instead of a new card component,
   per the "reference the existing one, don't rebuild it" constraint.
   Horizontally scrollable so an overflowing word count never wraps the
   composer taller or forces the page itself to scroll sideways. */
.cuss-bag-shelf {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.cuss-bag-shelf[hidden] { display: none; }
.cuss-bag-shelf-chip {
  flex: none; display: flex; align-items: center; gap: 5px;
  font-family: var(--font-body, inherit); font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  color: oklch(0.75 0.13 150);
  background: color-mix(in srgb, oklch(0.75 0.13 150) 10%, var(--color-surface));
  border: 1px solid color-mix(in srgb, oklch(0.75 0.13 150) 35%, transparent);
  transition: background 0.15s ease, transform 0.1s ease;
}
.cuss-bag-shelf-chip:hover { background: color-mix(in srgb, oklch(0.75 0.13 150) 18%, var(--color-surface)); }
.cuss-bag-shelf-chip:active { transform: scale(0.94); }
.cuss-bag-shelf-chip-count {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em;
  color: color-mix(in srgb, oklch(0.75 0.13 150) 85%, var(--color-text));
  opacity: 0.85;
}
@media (max-width: 640px) {
  .cuss-bag-shelf-chip { font-size: 12px; padding: 5px 10px; }
}
/* Per-metric explanations under the live Judge panel — purely informational,
   these never feed back into Credibility (that's driven only by the per-word tags
   and the AI's per-turn verdict; folding the Judge score in too would
   double-count the same signal). */
.cuss-judge-note {
  margin: -2px 0 2px; font-size: 10px; font-style: italic;
  color: color-mix(in srgb, var(--color-text) 45%, transparent);
}
.cuss-judge-hint {
  margin: -3px 0 1px 72px; font-size: 10.5px; line-height: 1.3;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
/* Written explanation for the three scores above — fetched once from
   /api/judge-critique when the round ends (see endRound() in script.js),
   never during the round, so it fades in on its own beat rather than
   popping in with the bars. The numbers it's explaining are untouched: this
   is purely additive text, same "feedback only" spirit as .cuss-judge-note. */
.cuss-judge-critique {
  margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--color-divider);
  opacity: 0; transition: opacity 0.4s ease;
}
.cuss-judge-critique.is-visible { opacity: 1; }
.cuss-judge-critique-summary {
  margin: 0 0 4px; font-size: 12.5px; line-height: 1.45; color: var(--color-text);
}
.cuss-judge-critique-breakdown {
  margin: 0; font-size: 11.5px; line-height: 1.4;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}

.cuss-eyebrow {
  position: relative; display: block; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 calc(var(--leading) - var(--half));
}

/* Word of the Day — a slim full-width band directly under the hero, so it
   lands in the first viewport instead of a tall centered block requiring a
   scroll. The reveal is a horizontal sliding reel (case-opening style):
   see buildWordReel() in script.js. Mechanic (sequence, easing, blur,
   edge-mask, "only the landed item is styled up") is adapted from a
   reference implementation; everything visual below is Cussator's own
   tokens — accent purple for the landed word, the same muted-gray pattern
   used everywhere else for the definition, --color-text for the top/bottom
   rule (needs to read against bare page background, not a surface panel).
   No new colors, no borrowed fonts. */
.cuss-wotd {
  width: 100%; padding: var(--space-2) 0;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  display: flex; flex-direction: column; gap: 4px;
}
.cuss-wotd .cuss-eyebrow { margin: 0; }
.cuss-wotd-reel {
  width: 100%; height: 52px; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}
.cuss-wotd-track { display: flex; height: 100%; will-change: transform; }
.cuss-wotd-item {
  flex: 0 0 190px; width: 190px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 15px; letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--color-text) 38%, transparent);
  transition: color 0.5s ease, font-size 0.5s ease, transform 0.5s ease;
}
.cuss-wotd-item.is-landed {
  color: var(--color-accent); font-size: clamp(22px, 2.6vw, 28px);
  font-weight: var(--font-heading-weight); transform: scale(1.05);
}
.cuss-wotd-def {
  margin: 0; max-width: 52ch; font-size: 14px; opacity: 0;
  transition: opacity 0.4s ease; color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.cuss-wotd-def.is-visible { opacity: 1; }

.cuss-feature {
  display: grid; grid-template-columns: minmax(64px, 140px) minmax(0, 360px) minmax(0, 1fr);
  gap: var(--leading) clamp(24px, 4vw, 64px); align-items: baseline;
  padding: calc(1.4 * var(--leading)) 0;
  background: linear-gradient(to right, transparent, var(--color-neutral-800) 48px calc(100% - 48px), transparent) no-repeat top / 100% 1px;
}
.cuss-feature:first-child { background: none; }
.cuss-feature-num {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 15px;
  color: var(--color-accent); margin: 0; font-feature-settings: 'tnum' 1;
}
.cuss-feature h2 { font-size: 24px; margin: 0; letter-spacing: -0.01em; }
.cuss-feature-body {
  font-size: 15.5px; line-height: var(--leading); margin: 0;
  color: color-mix(in srgb, var(--color-text) 78%, transparent); max-width: 52ch;
}
/* Was accidentally sharing the .cuss-scars class with the real full-screen
   Vocabulary Scars overlay below (position:fixed; opacity:0 by default),
   which made this decorative preview invisible and pulled out of the grid
   entirely. Renamed so the two never collide again. */
.cuss-scars-preview { display: flex; flex-direction: column; gap: var(--space-3); }
.cuss-scars-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cuss-scars-tags .tag { background: color-mix(in srgb, var(--color-warn) 22%, var(--color-surface)); color: var(--color-warn); }

.cuss-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 32px); }
.cuss-step-num {
  font-family: var(--font-heading); font-size: 15px; color: var(--color-accent);
  margin: 0 0 8px; font-feature-settings: 'tnum' 1;
}
.cuss-steps h3 { font-size: 17px; margin: 0 0 6px; }
.cuss-steps p { font-size: 14px; line-height: 1.5; margin: 0; color: color-mix(in srgb, var(--color-text) 78%, transparent); }

.cuss-footer {
  padding: calc(1.6 * var(--leading)) 0; font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: space-between;
}
.cuss-footer-links { display: flex; gap: var(--space-3); }
.cuss-footer-links a { color: inherit; }
.cuss-footer-links a:hover { color: var(--color-accent); }

/* Terms / Privacy — plain, readable legal copy fit to the site's existing
   dark theme; deliberately not styled beyond basic typography and rhythm. */
.cuss-legal { max-width: 68ch; padding: calc(2 * var(--leading)) 0 calc(3 * var(--leading)); }
.cuss-legal h1 { margin-bottom: var(--space-2); }
.cuss-legal-updated {
  font-size: 13px; margin: 0 0 calc(1.5 * var(--leading));
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-legal h2 { font-size: 19px; margin: calc(1.5 * var(--leading)) 0 var(--space-2); }
.cuss-legal p, .cuss-legal li { font-size: 15px; line-height: var(--leading); color: color-mix(in srgb, var(--color-text) 85%, transparent); }
.cuss-legal ul { padding-left: 1.2em; margin: var(--space-2) 0; }
.cuss-legal a { color: var(--color-accent); }

@media (max-width: 900px) {
  .cuss-hero-grid { grid-template-columns: 1fr !important; }
  .cuss-feature { grid-template-columns: 1fr !important; }
  .cuss-steps { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Debate arena — the live-round screen opened from "Start round".
   ══════════════════════════════════════════════════════════════════════ */

/* Full-screen dedicated round view, not a popup over the page — the arena
   fills the viewport and owns the whole screen while a round is live. */
.cuss-arena {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center;
  padding: 0;
  background: var(--color-bg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.cuss-arena.is-open { opacity: 1; pointer-events: auto; }
.cuss-arena-inner {
  position: relative;
  /* Full-width again, not the centered "Focus Block" column from the
     glass redesign pass — that capped column read as too much empty
     margin on wider screens for a dense in-round UI. Every section
     (header, motion, HP bars, transcript, input) now shares the same
     small, fixed side inset instead of a scaling/wide one — deliberately
     NOT the marketing page's --edge token (clamp(20px, 5vw, 72px)),
     which is tuned for spacious marketing sections and would reintroduce
     large margins on wide screens; this is a flat 20px, same on every
     viewport. */
  width: 100%; height: 100%; max-height: 100vh; max-height: 100dvh;
  /* Same gap token as .cuss-arena-transcript's internal gap (see below) —
     one consistent rhythm the whole way down: head → motion → HP bars →
     transcript (→ avatar row → prompt) → legend → input. */
  display: flex; flex-direction: column; gap: var(--space-4);
  background: var(--color-bg); border-radius: 0; box-shadow: none;
  padding: var(--space-4) 20px;
  /* overflow-y:auto (was overflow:hidden) — a short viewport (landscape
     phone, browser chrome eating into the height) can leave less room
     than this column's natural content height even after the
     max-height:500px tightening below; scrolling the whole arena is the
     fallback that guarantees the input never gets silently clipped off
     the bottom, which overflow:hidden was doing here before. overflow-x
     stays hidden — nothing in this column should ever need to scroll
     sideways. */
  overflow-x: hidden; overflow-y: auto;
}
/* Short-viewport tightening — landscape on a phone is much shorter than
   any portrait width this app otherwise designs for, and the column's
   normal vertical rhythm (gaps, the transcript's min-height floor) added
   up to more than that height, pushing the input below the fold under
   .cuss-arena-inner's old overflow:hidden. Targets height, not width
   (orientation:landscape alone would also catch a landscape TABLET,
   which has plenty of vertical room and shouldn't be squeezed). */
@media (max-height: 500px) {
  .cuss-arena-inner { gap: var(--space-2); padding: var(--space-2) 20px; }
  .cuss-arena-motion { font-size: 16px; margin-bottom: 4px; }
  /* Smaller cap than the 50vh default (see .cuss-arena-transcript above)
     — on an already-short viewport (landscape phone), letting the
     transcript claim half of it leaves too little room for the controls
     below to fit without the whole arena needing its own outer scroll. */
  .cuss-arena-transcript { min-height: 60px; max-height: 35vh; max-height: 35dvh; gap: var(--space-2); }
  .cuss-color-legend { padding: 0 2px 2px; }
}
/* Screen shake on penalty — a brief, decaying horizontal rattle when the
   player's own submitted argument lands a filler/curse hit (see
   triggerScreenShake() in script.js, called from the submit handler right
   where the same word-level penalty already docks Credibility). Class-
   toggle + plain CSS keyframes, not a state-driven re-render. */
@keyframes cuss-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.cuss-arena-inner.is-shaking { animation: cuss-shake 0.5s cubic-bezier(.36, .07, .19, .97) both; }
@media (prefers-reduced-motion: reduce) {
  .cuss-arena-inner.is-shaking { animation: none; }
}
/* Stacked above the stance-select (z-index: 10) and round-over (z-index: 5)
   overlays so the close button stays clickable no matter which screen is
   showing — without this it sits at the default stacking level and the
   overlay's own layer (positioned + z-indexed) intercepts the click even
   though the header is still faintly visible through it. */
.cuss-arena-head {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.cuss-arena-head-info { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
/* Right-hand cluster mirrors the left one, same even left/right split the
   bottom legend row and the avatar row also use — keeps the header from
   reading as left-heavy with a bare close button stranded on the far right. */
.cuss-arena-head-right { display: flex; align-items: center; gap: var(--space-2); flex: none; }
/* Guaranteed minimum clearance from the arena's own right edge — without
   this, the close button sits exactly on the same boundary any inner
   overlay's scrollbar renders at (e.g. .cuss-result-transition when its
   content overflows), which reads as the button being flush against the
   scrollbar and cramped to click. Small and permanent, not conditional on
   whether a scrollbar actually happens to be showing. */
#cuss-arena-close { margin-right: 6px; }
/* Reflects the side the player already picked (see chooseStance()) — hidden
   until then. Same blue/red as the stance-select buttons and pre-round
   avatars for one consistent affirm/negate color language. Fades in
   (is-visible, added a frame after unhiding — see chooseStance()) rather
   than just popping into the header the instant a side is picked. */
.cuss-arena-side { opacity: 0; transition: opacity 0.2s ease; }
.cuss-arena-side.is-visible { opacity: 1; }
.cuss-arena-side.is-affirm { border-color: oklch(0.72 0.15 250); color: oklch(0.72 0.15 250); }
.cuss-arena-side.is-negate { border-color: oklch(0.63 0.22 25); color: oklch(0.63 0.22 25); }
.cuss-arena-side[hidden] { display: none; }
/* Keeps product identity present during an actual round, not just on the
   marketing page — same weight/family as .nav-brand, just smaller since it
   shares the row with the LIVE ROUND badge and timer. */
.cuss-arena-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; margin-right: 2px; color: var(--color-text);
}
/* This is the single most important piece of context on screen — the
   player has to hold it in mind for the whole round — so it reads as a
   real headline now: same heading font/weight as the rest of the app's
   h4-scale headings (20px, --font-heading-weight), full-opacity
   --color-text instead of a muted 60% gray. Dropped the italic at this
   size: it read fine as a small caption, but italic body text starts to
   fight legibility once it's this large. Always wraps in full (no
   ellipsis, no truncate-then-tap-to-expand) — the old single-line clamp
   made sense at caption size but not for a headline the player needs to
   actually read, not guess at. The click/tap-to-expand affordance
   (tabindex, role=button, cursor:pointer in the markup) is now a no-op
   since there's nothing left to expand — left in place rather than
   touched, since this pass is typography-only, but harmless either way. */
.cuss-arena-motion {
  margin: 0 0 8px; font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px; line-height: 1.35; font-style: normal; cursor: pointer;
  color: var(--color-text);
  white-space: normal; overflow: visible; text-overflow: clip;
}
.cuss-arena-motion:focus-visible { outline: 1px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }
.cuss-arena-transcript {
  /* Top-aligned, always — including the pre-round empty state (see
     .is-empty, toggled in resetRound()/addUserBubbleAnimated()). A
     previous pass centered .is-empty's content in the available flex:1
     space to avoid it reading as "stopped early," but that just moved the
     dead air from below the prompt to above it, opening a visible gap
     between the HP bars and the "YOUR TURN" line — reverted so the
     transcript (empty or not) starts immediately below the HP bars with
     the same var(--space-4) rhythm as every other section here. */
  /* flex:0 1 auto (was flex:1) — sized to its OWN content instead of
     "whatever's left in the column," capped at max-height instead of a
     fixed pixel height. flex:1 was strictly capping this at the leftover
     space after every other section's height, no matter how long a
     message actually was — confirmed by measurement: a long AI reply's
     scrollHeight reached 2046px while flex:1 held clientHeight at a flat
     560px regardless, forcing an internal scroll on a normal-length
     rebuttal even with room to spare elsewhere on screen. max-height
     is deliberately generous so only a genuinely very long message ever
     needs that internal scroll; .cuss-color-legend below picks up the
     leftover space instead (margin-top:auto) so a short transcript
     doesn't leave the composer floating mid-screen. Bumped from 50vh to
     55vh now that the Judge panel below is collapsed to a single line
     instead of 3 rows — that reclaimed space goes toward the transcript
     actually being allowed to grow bigger, not just toward a shorter
     page overall. */
  flex: 0 1 auto; max-height: 55vh; max-height: 55dvh;
  overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4);
  padding-right: 4px; min-height: 120px; position: relative;
}
/* Reads as an active prompt, not passive filler copy — the "YOUR TURN"
   badge reuses the exact .tag.tag-outline styling the "LIVE ROUND" badge
   uses, so the two read as the same visual language. */
.cuss-arena-empty {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  font-size: 13px; color: color-mix(in srgb, var(--color-text) 68%, transparent); margin: 0;
}
.cuss-arena-prompt-badge { flex: none; font-weight: 600; }
/* Pre-round anchor — foreshadows the left/right layout the first AI card
   and user bubble will actually use (.cuss-bubble-ai / .cuss-bubble-user),
   so the empty transcript reads as an intentional, populated layout rather
   than blank space. Removed the moment the first bubble is added. Same
   even left/right split as the bottom legend row and the header — AI
   pinned left, player pinned right, both on one horizontal line. */
.cuss-transcript-anchor { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); opacity: 0.65; }
.cuss-anchor-row { display: flex; align-items: center; gap: 8px; max-width: 46%; }
.cuss-anchor-right { flex-direction: row-reverse; }
.cuss-anchor-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor;
  font-size: 11px; font-weight: 700; font-family: var(--font-heading);
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.cuss-anchor-avatar.is-affirm { color: oklch(0.72 0.15 250); }
.cuss-anchor-avatar.is-negate { color: oklch(0.63 0.22 25); }
.cuss-anchor-label { font-size: 12px; letter-spacing: 0.02em; color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.cuss-bubble-user {
  align-self: flex-end; max-width: 88%; background: var(--color-surface);
  /* Flattened top-right corner — the corner nearest the edge the bubble
     aligns to, standard chat-bubble convention (AI's mirrors this on its
     own top-left, see .cuss-ai-card.cuss-bubble-ai below). Order is
     top-left/top-right/bottom-right/bottom-left. */
  border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
  padding: var(--space-3); font-size: 14px; line-height: 1.5; margin: 0;
}
/* Entrance for both message types — no ruled line (the arena is line-free,
   see .cuss-arena-transcript above), just motion. The player's own bubble
   gets a plain settle (fade + quick rise) since it's their own words
   appearing, not a reveal. The AI card (aliased .cuss-bubble-ai) gets a
   distinct, punchier pop — scaling up from slightly small rather than
   rising from below — so an incoming rebuttal reads as a different kind of
   event than the player's own bubble, not the same motion mirrored. Kept
   short — this fires on every turn, so it needs to feel instant. */
.cuss-bubble-user {
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cuss-bubble-user.is-visible { opacity: 1; transform: translateY(0); }
.cuss-ai-card {
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.24s ease-out, transform 0.24s cubic-bezier(.2,1.4,.4,1);
}
.cuss-ai-card.is-visible { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .cuss-bubble-user, .cuss-ai-card { transition: opacity 0.15s ease; transform: none; }
}
/* Highlight tiers — filler orange, curse red, connective blue, vocab green.
   Each gets a soft text-shadow glow in its own color, same intensity as the
   Chat button's glow (color-mix at ~35% into a blur, no hard edge). */
.cuss-weak {
  color: var(--color-warn); text-decoration: underline wavy var(--color-warn); font-weight: 600;
  text-shadow: 0 0 8px color-mix(in srgb, var(--color-warn) 35%, transparent);
}
.cuss-weak-light { text-decoration-style: dotted; }
.cuss-curse {
  color: oklch(0.63 0.22 25); text-decoration: underline wavy oklch(0.63 0.22 25); font-weight: 700;
  text-shadow: 0 0 8px color-mix(in srgb, oklch(0.63 0.22 25) 35%, transparent);
}
.cuss-connective {
  color: oklch(0.72 0.15 250); font-weight: 600;
  text-shadow: 0 0 8px color-mix(in srgb, oklch(0.72 0.15 250) 35%, transparent);
}
.cuss-weak, .cuss-curse, .cuss-connective { transition: color 0.2s ease; }
.cuss-vocab {
  position: relative; display: inline-block; color: oklch(0.75 0.13 150); font-weight: 600;
  text-shadow: 0 0 8px color-mix(in srgb, oklch(0.75 0.13 150) 35%, transparent);
}
.cuss-vocab::before {
  content: "vocab"; position: absolute; left: 50%; top: -0.4em; transform: translateX(-50%);
  font-size: 8px; line-height: 1; letter-spacing: 0.05em; text-transform: uppercase;
  color: oklch(0.75 0.13 150); opacity: 0.8; white-space: nowrap; pointer-events: none;
}
/* Post-submit filler flash+shake — applied once to the .cuss-weak spans
   already inside a just-rendered user bubble (see flagSubmittedFillers()
   in script.js), never on a live keystroke. The rest color stays the
   existing filler amber (.cuss-weak above) so filler and curse severity
   stay visually distinct at rest; the transient animation itself pulses
   through the curse red before settling back, reading as "flash red"
   without permanently recoloring filler the same as a curse word. */
@keyframes cuss-weak-flash {
  0% { color: var(--color-warn); text-shadow: 0 0 8px color-mix(in srgb, var(--color-warn) 35%, transparent); }
  30% { color: oklch(0.63 0.22 25); text-shadow: 0 0 10px color-mix(in srgb, oklch(0.63 0.22 25) 55%, transparent); }
  100% { color: var(--color-warn); text-shadow: 0 0 8px color-mix(in srgb, var(--color-warn) 35%, transparent); }
}
@keyframes cuss-weak-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
.cuss-weak.is-flagged {
  display: inline-block;
  animation: cuss-weak-flash 0.6s ease-out, cuss-weak-shake 0.4s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  .cuss-weak.is-flagged { animation: none; }
}
.cuss-bubble-ai { align-self: flex-start; max-width: 88%; }
/* Flattened top-left corner, mirroring .cuss-bubble-user's top-right above
   — the compound selector (not just .cuss-bubble-ai alone) beats
   .cuss-ai-card's own border-radius on specificity regardless of source
   order, so this can't quietly lose the cascade to it. Scoped to the real
   transcript cards only: the homepage demo's static example and the
   "AI opponent is responding" indicator use .cuss-ai-card without
   .cuss-bubble-ai, so neither picks this up. */
.cuss-ai-card.cuss-bubble-ai { border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md); }
.cuss-arena-typing[hidden] { display: none; }
/* Visible motion for the whole wait — Chair-difficulty replies can take
   15-20+ seconds, and a static "typing…" label with no animation reads as
   frozen/broken over that long. Three dots pulsing in sequence, same
   pattern as chat-app typing indicators. */
.cuss-typing-dots { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.cuss-typing-dots span {
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
  display: inline-block; opacity: 0.3; animation: cuss-typing-dot 1.2s ease-in-out infinite;
}
.cuss-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.cuss-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cuss-typing-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .cuss-typing-dots span { animation: none; opacity: 0.8; }
}
.cuss-arena-error { color: var(--color-warn); font-size: 13px; margin: 0; }

/* Color-legend key — visible from the start of every round (static, not
   tied to any round state) so new players learn the highlight system by
   reading it, not by losing Credibility first. Colors match the live
   highlight classes exactly: .cuss-weak (filler), .cuss-vocab, .cuss-curse.
   margin-top:auto — this is the first ALWAYS-present (never [hidden])
   sibling after .cuss-arena-transcript above, so with that transcript no
   longer forcing itself to fill the column's leftover space (flex:0 1
   auto instead of flex:1, see above), this is what soaks up any leftover
   space instead — pushing the legend and everything after it (Judge when
   visible, the Bag shelf, the input form) down to the bottom of the
   arena as one group, rather than leaving the composer floating right
   under a short transcript. */
.cuss-color-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 0 2px 6px; margin-top: auto; }
.cuss-legend-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cuss-legend-dot.is-filler { background: var(--color-warn); }
.cuss-legend-dot.is-vocab { background: oklch(0.75 0.13 150); }
.cuss-legend-dot.is-penalty { background: oklch(0.63 0.22 25); }

/* Point of Order — Interruption Mode. A local, debounced heuristic (no
   server round-trip): reuses classifyText()'s existing filler/hedge
   detection against the LIVE draft in the textarea, not the submitted
   argument — the same signal that already docks Credibility/Logic/
   Precision on submit, just read a beat early while the player is still
   composing. Purely advisory — never blocks typing or sending, just flags
   a hedge-heavy draft. Amber-to-red theme, both existing tokens
   (--color-warn is the AI card's own amber; the red is the same critical
   tone .cuss-token-budget.is-critical already uses) so it reads as more
   urgent than a normal AI bubble without introducing a new color. */
.cuss-point-of-order:not([hidden]) {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 8px; padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, oklch(0.63 0.22 25) 55%, var(--color-warn));
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-warn) 16%, var(--color-surface)),
    color-mix(in srgb, oklch(0.63 0.22 25) 14%, var(--color-surface)));
  opacity: 0; transform: translateY(6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.cuss-point-of-order.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.cuss-poo-avatar {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  color: oklch(0.63 0.22 25);
  animation: cuss-poo-pulse 1.6s ease-in-out infinite;
}
.cuss-poo-avatar svg { width: 100%; height: 100%; }
.cuss-poo-body { flex: 1; min-width: 0; }
.cuss-poo-label {
  margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: oklch(0.63 0.22 25);
}
.cuss-poo-text { margin: 0; font-size: 13px; line-height: 1.4; color: var(--color-text); }
.cuss-poo-dismiss {
  flex: none; width: 20px; height: 20px; border: none; background: none; cursor: pointer; padding: 0;
  font-size: 16px; line-height: 1; color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-poo-dismiss:hover { color: var(--color-text); }
@keyframes cuss-poo-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 4px oklch(0.63 0.22 25)); }
}
@media (prefers-reduced-motion: reduce) {
  .cuss-point-of-order { transition: opacity 0.12s ease; transform: none; }
  .cuss-poo-avatar { animation: none; }
}

/* Paste-blocked toast — same hidden/is-visible fade mechanism as Point of
   Order above (see the fix history on that pattern: the display rule below
   is scoped to :not([hidden]) so JS's hidden=true actually hides it rather
   than being overridden by an unconditional display declaration). Plain
   amber text line, no avatar/dismiss button — it's a one-line, self-
   dismissing notice, not an ongoing state to manage. */
.cuss-paste-blocked:not([hidden]) {
  display: block;
}
.cuss-paste-blocked {
  margin: 0 0 8px; font-size: 12.5px; color: var(--color-warn);
  opacity: 0; transform: translateY(4px); transition: opacity 0.18s ease, transform 0.18s ease;
}
.cuss-paste-blocked.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .cuss-paste-blocked { transition: opacity 0.12s ease; transform: none; }
}

/* Word Economy token budget — pinned in the bottom-right corner of the
   input bar itself, right where the player is typing. Ticks down live
   (see checkTokenBudget() in script.js) as they type, same event as the
   highlighter; turns critical-red in the last 10% of the pool as a quiet
   warning before the auto-loss actually fires. Styled like a small CLI
   readout (monospace, muted grey, not accent purple) rather than a
   game-UI label, with the lips mark recolored to match via currentColor +
   fill="currentColor" on its paths (the standalone cussator-mark.svg
   hardcodes purple internally, so an <img> of it couldn't be retinted
   from CSS). pointer-events:none so it never blocks clicking/selecting
   the text underneath; .cuss-highlight-input's bottom padding keeps typed
   text from ever reaching this corner in the first place. */
.cuss-token-budget {
  position: absolute; right: 10px; bottom: 5px; pointer-events: none; z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  transition: color 0.2s ease;
}
.cuss-token-mark { width: 13px; height: auto; flex: none; color: inherit; }
.cuss-token-arrow { font-size: 10px; }
.cuss-token-val { font-weight: 700; color: var(--color-text); transition: color 0.2s ease; }
.cuss-token-budget.is-critical, .cuss-token-budget.is-critical .cuss-token-val { color: oklch(0.63 0.22 25); }

.cuss-arena-form {
  display: flex; gap: var(--space-3); align-items: flex-end;
  padding-top: var(--space-3);
}

/* Insert-from-Bag — a text-insertion shortcut, styled as a quiet square
   twin of the Enter-key send button so the two read as the input row's
   pair of controls, not one primary action and one random extra. */
.cuss-bag-insert-wrap { position: relative; flex: none; }
.cuss-bag-insert-btn {
  width: 42px; height: 42px; flex: none; border-radius: var(--radius-sm); padding: 0;
  background: transparent; color: var(--color-accent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
}
.cuss-bag-insert-btn:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.cuss-bag-insert-icon { width: 20px; height: auto; }
.cuss-bag-insert-popover {
  /* width: min(220px, ...) instead of a flat 220px — anchored at left:0
     with nothing clamping it to the viewport, a fixed 220px could clip or
     overflow past the screen edge on narrow layouts depending on where
     the insert button sits. */
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20;
  width: min(220px, calc(100vw - 2 * var(--space-4))); max-height: 260px; overflow-y: auto;
  background: var(--color-surface); border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
  padding: var(--space-2); box-shadow: var(--shadow-lg);
}
.cuss-bag-insert-popover-title {
  margin: 0 0 4px; padding: 0 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-bag-insert-list { display: flex; flex-direction: column; gap: 2px; }
.cuss-bag-insert-word {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 13px;
  background: transparent; border: none; border-radius: var(--radius-sm); padding: 6px 6px;
  color: oklch(0.75 0.13 150); cursor: pointer;
}
.cuss-bag-insert-word:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }

/* The "pulling a card" animation — a transient, JS-created card (see
   playCardPullAnimation() in script.js) that appears at the Bag-insert
   button, flips over like a card being drawn to reveal the word (back
   face reuses the same lips mark used elsewhere in the app), then flies
   into the argument input and fades — purely cosmetic, blocks nothing,
   and the actual word insertion happens right as it finishes. */
.cuss-card-pull {
  position: fixed; z-index: 300; pointer-events: none;
  perspective: 600px;
  opacity: 0; transform: scale(0.5);
  transition: transform 0.22s ease, opacity 0.22s ease, left 0.35s cubic-bezier(.4,0,1,1), top 0.35s cubic-bezier(.4,0,1,1);
}
.cuss-card-pull.is-visible { opacity: 1; transform: scale(1); }
/* Matches .cuss-card-pull-inner's own flip duration below so the outer
   drift-up-and-grow reads as one combined motion with the flip, not two
   mistimed movements. */
.cuss-card-pull.is-flipped {
  transition: transform 0.42s cubic-bezier(.34,1.56,.64,1), opacity 0.22s ease,
    left 0.35s cubic-bezier(.4,0,1,1), top 0.35s cubic-bezier(.4,0,1,1);
}
.cuss-card-pull.is-flying { opacity: 0; transition: transform 0.38s cubic-bezier(.4,0,1,1), opacity 0.32s ease 0.06s, left 0.38s cubic-bezier(.4,0,1,1), top 0.38s cubic-bezier(.4,0,1,1); }
.cuss-card-pull-inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(.34,1.56,.64,1);
}
.cuss-card-pull.is-flipped .cuss-card-pull-inner { transform: rotateY(180deg); }
.cuss-card-pull-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; padding: var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.cuss-card-pull-back {
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 16%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-accent) 50%, transparent);
}
.cuss-card-pull-back svg { width: 36px; height: auto; }
.cuss-card-pull-front {
  transform: rotateY(180deg);
  background: color-mix(in srgb, oklch(0.75 0.13 150) 14%, var(--color-surface));
  border: 1px solid color-mix(in srgb, oklch(0.75 0.13 150) 50%, transparent);
}
.cuss-card-pull-front-word {
  font-size: 15px; font-weight: 700; text-align: center; color: oklch(0.75 0.13 150);
}
@media (prefers-reduced-motion: reduce) {
  .cuss-card-pull, .cuss-card-pull.is-flying, .cuss-card-pull-inner { transition: none; }
}

.cuss-highlight-wrap {
  /* Borderless, same --color-bg as the rest of the page — spacing alone
     (var(--space-4) gap above, from .cuss-arena-inner) separates the round
     content from the input now, not a ruled line or a boxed panel. The
     one exception is the arena's own #cuss-arena-input-wrap below, which
     gets the full frosted-glass card treatment plus a budget-aware
     gradient ring — scoped to that id alone so Pitch mode's own
     .cuss-highlight-wrap (no difficulty tier, no token/turn budget to
     react to) stays exactly as borderless/flat as before. */
  position: relative; flex: 1; min-height: 78px; border-radius: var(--radius-md);
  background: var(--color-bg);
}
/* Frosted glass card — backdrop-blur plus a translucent (not opaque) fill
   so whatever's behind the composer (transcript, page background) shows
   through softly, generous corner radius (sharp corners kill the glass
   illusion), and two layered inset shadows: a bright top-edge line to
   fake a light source from above, and a soft dark outer drop shadow for
   real depth against the page. */
/* Explicit height cap — belt-and-suspenders on top of the shared
   .cuss-highlight-wrap's min-height:78px above. flex:1 plus
   backdrop-filter on a flex item is a known cross-browser landmine (most
   notably Safari/WebKit, where the two combined can make an item ignore
   its sibling's intrinsic size and balloon to fill available cross-axis
   space instead of sizing to content) — max-height is a hard, engine-
   independent ceiling regardless of which flex/backdrop-filter quirk is
   at play, so this card can grow a little for a multi-line argument but
   can never fill the composer row's whole height. flex-shrink:0 keeps it
   from being crushed by the Bag-insert/Send buttons on either side
   either. Scoped to this id, not the shared .cuss-highlight-wrap class,
   since Pitch mode deliberately wants its own composer to stretch and
   fill its form (see .cuss-pitch-form .cuss-highlight-wrap below). */
/* Budget-aware gradient border via the standard double-background
   technique — a transparent real `border` reserves the ring's width,
   and two background layers clip to different boxes: the top layer
   (solid black) clips to padding-box (i.e. stops at the inner edge of
   the border), the bottom layer (the gradient) clips to border-box
   (fills all the way to the outer edge) — so the gradient only shows
   through in the actual border strip the top layer doesn't cover.
   Replaces an earlier ::before pseudo-element with position:absolute;
   inset:-2px; z-index:-1 — that approach silently broke the moment
   backdrop-filter was added just below: backdrop-filter forces this
   element to establish its own stacking context, and a negative-
   z-index child of a stacking context still paints ABOVE that
   context's own root background (CSS's painting order puts negative-
   z-index descendants right after the root's background, not before
   it) — so the "hidden behind an opaque body" assumption never actually
   held once backdrop-filter was in the mix, and the full-size gradient
   (inset:-2px covers essentially the whole card, not just a thin edge)
   was visibly bleeding through as what looked like a solid tinted fill.
   The double-background technique has no stacking context to fight —
   it's one element's own background layers, ordered by CSS's well-
   defined (unambiguous) background-layer painting rules instead.
   Driven by updateInputBorderState() in script.js, called on every timer
   tick and Word Economy change — tracks whichever of tokens-remaining /
   time-remaining is more depleted (the "worse of the two", since running
   out of either ends the turn). Safe state uses the app's own accent
   purple (not the earlier Affirm blue) so it matches the send button and
   Bag-insert button sitting right next to it; warning/critical stay the
   existing amber/red — no new palette either way. */
#cuss-arena-input-wrap {
  max-height: 160px; flex-shrink: 0;
  border-radius: 20px; border: 2px solid transparent;
  background:
    linear-gradient(var(--color-bg), var(--color-bg)) padding-box,
    linear-gradient(90deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 55%, transparent)) border-box;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 18%, transparent),
    0 8px 24px color-mix(in srgb, black 30%, transparent);
  transition: background 300ms ease, box-shadow 300ms ease;
}
#cuss-arena-input-wrap.cuss-budget-warning {
  background:
    linear-gradient(var(--color-bg), var(--color-bg)) padding-box,
    linear-gradient(90deg, var(--color-warn), color-mix(in srgb, var(--color-warn) 55%, transparent)) border-box;
}
#cuss-arena-input-wrap.cuss-budget-critical {
  background:
    linear-gradient(var(--color-bg), var(--color-bg)) padding-box,
    linear-gradient(90deg, oklch(0.63 0.22 25), color-mix(in srgb, oklch(0.63 0.22 25) 55%, transparent)) border-box;
}
/* Critical pulse — an INSET glow pulsing on the glass card itself (layered
   on top of its resting top-edge-highlight + drop-shadow, not replacing
   them) rather than the outer ring fading in and out. Reads as "the glass
   itself is warming up" from within, matching the frosted-glass material
   metaphor better than a flat outer ring blinking would. */
#cuss-arena-input-wrap.cuss-budget-critical {
  animation: cuss-input-glass-pulse 1.1s ease-in-out infinite;
}
@keyframes cuss-input-glass-pulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 18%, transparent),
      0 8px 24px color-mix(in srgb, black 30%, transparent),
      inset 0 0 0 0 transparent;
  }
  50% {
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, white 18%, transparent),
      0 8px 24px color-mix(in srgb, black 30%, transparent),
      inset 0 0 22px 4px color-mix(in srgb, oklch(0.63 0.22 25) 55%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  #cuss-arena-input-wrap.cuss-budget-critical { animation: none; }
}

/* Floating filler-penalty pill — post-submit only (see
   showFillerPenaltyPill() in script.js), purely cosmetic feedback layered
   on top of the HP bar drop that already happens; the HP bar itself
   remains the source of truth for the actual penalty. Positioned above
   the input, anchored to the same #cuss-arena-input-wrap as the gradient
   border above. Longer transition on the base rule (fade-out) than on
   .is-visible (fade-in) so the two legs of the lifecycle read as a quick
   pop in, held, then a slower settle out — same base+modifier pattern as
   .cuss-paste-blocked's own show/hide timing elsewhere in this file. */
.cuss-filler-pill {
  position: absolute; top: -24px; left: 8px; z-index: 5;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  color: oklch(0.63 0.22 25);
  background: color-mix(in srgb, oklch(0.63 0.22 25) 16%, var(--color-surface));
  border: 1px solid color-mix(in srgb, oklch(0.63 0.22 25) 45%, transparent);
  opacity: 0; transform: translateY(4px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.cuss-filler-pill[hidden] { display: none; }
.cuss-filler-pill.is-visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 150ms ease, transform 150ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .cuss-filler-pill { transition: opacity 150ms ease; transform: none; }
  .cuss-filler-pill.is-visible { transition: opacity 150ms ease; }
}
/* Send — styled like a physical keyboard Enter key (rectangular keycap,
   small corner radius, the return-arrow glyph a real Enter key shows)
   rather than a circular chat-app send button — reinforces that pressing
   the actual Enter key does the same thing. Solid accent purple, same
   color as .cuss-cta-xl (the Chat CTA), but far smaller/quieter. */
/* Specular gradient (lighter top-left, darker bottom-right) rather than a
   flat fill plus a loud outer glow — closer to how an iOS glass button
   signals "tappable" via a faint light source across its own face than
   how a gamer-HUD button would (a hard neon ring). The glow is kept, just
   turned down (lower opacity, softer blur) to a supporting role instead
   of the primary effect. */
.cuss-send-btn {
  width: 68px; height: 42px; flex: none; border-radius: var(--radius-sm); padding: 0;
  /* Solid black fill, solid purple outline, purple glyph — a dashed
     border and a purple-fill/black-glyph treatment both read as
     "placeholder" or "disabled" rather than a real actionable button,
     especially on mobile where there's no hover state to clarify intent.
     Shared by every send/submit button in the app (round view and
     Elevator Pitch both use .cuss-send-btn), so this is one change, not
     two. */
  background: var(--color-bg);
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--color-accent) 25%, transparent);
}
.cuss-send-btn:hover {
  background: color-mix(in srgb, var(--color-accent) 14%, var(--color-bg));
  border-color: var(--color-accent-2); color: var(--color-accent-2);
}
.cuss-send-btn:active { background: color-mix(in srgb, var(--color-accent) 24%, var(--color-bg)); }
.cuss-send-glyph { font-size: 20px; line-height: 1; }
/* Fires when Enter is pressed on the textarea (see script.js) — the button
   itself never receives that keystroke, so without this it would sit
   there inert while a physical key visibly depresses. Also plays on a
   real mouse click, same class, since :active alone doesn't leave a
   visible trace once the mouse button is released. Pushed well past a
   micro-interaction (deep scale-down + a small overshoot on the way back)
   so it reads unmistakably as "this key was just pressed" even without a
   mouse involved. Duration must match SEND_KEY_PRESS_DURATION in script.js. */
@keyframes cuss-send-key-press {
  0% { transform: scale(1); }
  35% { transform: scale(0.72); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.cuss-send-btn.is-pressed { animation: cuss-send-key-press 0.32s ease; }
.cuss-highlight-layer, .cuss-highlight-input {
  /* Bottom padding reserves room for the token counter chip pinned in this
     corner (see .cuss-token-budget) so typed text never runs under it. */
  position: absolute; inset: 0; margin: 0; padding: 16px 10px 22px; font: inherit; font-size: 14px; line-height: 1.5;
}
.cuss-highlight-layer {
  white-space: pre-wrap; word-wrap: break-word; overflow: hidden;
  color: var(--color-text); pointer-events: none;
}
.cuss-highlight-input {
  width: 100%; height: 100%; background: transparent; color: transparent;
  caret-color: var(--color-text); border: none; outline: none; resize: none; overflow: auto;
}
.cuss-highlight-input::placeholder { color: color-mix(in srgb, var(--color-text) 45%, transparent); }

/* Stance-select screen — covers the arena when a round opens, until the
   player picks a side. Blue for Affirm, red for Negate, matching the same
   hues used elsewhere (connective blue, curse red) for visual consistency.
   Also hosts "Entering the Chat" (.cuss-enter-stage) now — the two used to
   be separate overlays that crossfaded (a second screen hand-off, exactly
   the kind of seam a homepage-flash bug lives in; see playEnterThenOpen()
   in script.js). The stage animates and fades itself to invisible via its
   own existing keyframes (unchanged), then .cuss-stance-content fades in
   on this SAME element — nothing is ever swapped for a different screen. */
.cuss-stance-select {
  position: absolute; inset: 0; z-index: 10; background: var(--color-bg);
}
.cuss-stance-select[hidden] { display: none; }
.cuss-stance-content {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-4); text-align: center;
  padding: var(--space-4);
  opacity: 1; transition: opacity 0.4s ease;
}
/* Suppressed (no transition, so it doesn't fade back in mid-animation)
   for exactly as long as the entrance is playing — see is-entering below. */
.cuss-stance-select.is-entering .cuss-stance-content { opacity: 0; transition: none; }
.cuss-stance-eyebrow {
  margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-stance-motion {
  margin: 0; max-width: 60ch; font-size: clamp(18px, 3vw, 26px); font-style: italic; line-height: 1.4;
}
.cuss-difficulty-select { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cuss-difficulty-eyebrow {
  margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
/* Ledger-row picker — same numbered-line-item language as the homepage's
   "How it works" steps (see .cuss-feature's fading top-rule), reused here
   instead of the equal bordered boxes this screen used to show. Only the
   contents/CSS of .cuss-difficulty-btn changed; the element itself keeps
   its id/class/data-difficulty untouched, so setDifficulty()'s querySelectorAll
   and .is-active toggling in script.js need no changes. */
.cuss-difficulty-buttons { display: flex; flex-direction: column; width: 100%; max-width: 440px; margin: 0 auto; }
.cuss-difficulty-btn {
  display: flex; align-items: baseline; gap: var(--space-3); width: 100%; text-align: left;
  padding: var(--space-2) var(--space-2); border: none; border-radius: var(--radius-sm);
  /* This is a bare <button>, not a .btn — without an explicit background
     here, the browser's native UA-stylesheet button background (a pale
     gray/white "buttonface") shows through instead of the page's dark
     background, since nothing else in this rule ever set one. That's what
     made Rookie/Chair render as pale unreadable boxes: only .is-active
     (Delegate) happened to set its own background-color, which is the
     only reason it looked correct. Regressed when the divider-line
     background (a repeating-gradient) was removed from here without a
     transparent replacement. */
  background: transparent;
  color: var(--color-text); cursor: pointer; font-family: inherit;
  transition: background-color 0.15s ease;
}
.cuss-difficulty-btn:hover { background-color: color-mix(in srgb, var(--color-text) 6%, transparent); }
.cuss-difficulty-num {
  flex: none; width: 20px; font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; color: var(--color-accent); font-feature-settings: 'tnum' 1;
}
.cuss-difficulty-text { display: flex; flex-direction: column; gap: 2px; }
.cuss-difficulty-btn-title { font-size: 14px; font-weight: var(--font-heading-weight); }
.cuss-difficulty-btn-sub { font-size: 10.5px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.cuss-difficulty-btn.is-active { background-color: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.cuss-difficulty-btn.is-active .cuss-difficulty-btn-title,
.cuss-difficulty-btn.is-active .cuss-difficulty-num { color: var(--color-accent); }

.cuss-stance-buttons { display: flex; gap: var(--space-4); flex-wrap: wrap; justify-content: center; margin-top: var(--space-2); }
/* Affirm/Negate keep their size and color-coding, but now differ in more
   than color: each reuses the exact avatar recipe from .cuss-anchor-avatar
   (the same lettered-circle mark that appears once the round actually
   starts), mirrored left/right — Affirm's mark leads, Negate's trails —
   the same left/right mirroring already used for the pre-round transcript
   anchor, so the picker, the anchor, and the real transcript all share one
   avatar convention instead of introducing a new shape just for this screen. */
.cuss-stance-btn {
  /* min(240px, 100%) instead of a hard 240px — .cuss-stance-buttons already
     wraps these onto their own line at narrow widths, but the fixed width
     never actually shrank with the viewport; this caps at 240px on room to
     spare and fills the available width instead of overflowing it when
     there isn't. */
  flex-direction: row; align-items: center; width: min(240px, 100%); height: auto;
  padding: 22px 22px; gap: var(--space-3);
  border-radius: var(--radius-lg); transition: transform 0.15s ease, background 0.15s ease;
}
.cuss-stance-btn:hover { transform: translateY(-2px); }
.cuss-stance-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.cuss-stance-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid currentColor;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px;
}
.cuss-stance-text { display: flex; flex-direction: column; gap: 4px; }
.cuss-stance-btn-title { font-size: 22px; font-weight: var(--font-heading-weight); letter-spacing: 0.02em; }
.cuss-stance-btn-sub { font-size: 12.5px; font-weight: 400; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.cuss-stance-affirm {
  border-color: oklch(0.72 0.15 250); color: oklch(0.72 0.15 250);
}
.cuss-stance-affirm:hover { background: color-mix(in srgb, oklch(0.72 0.15 250) 12%, transparent); }
.cuss-stance-affirm .cuss-stance-btn-title { text-shadow: 0 0 10px color-mix(in srgb, oklch(0.72 0.15 250) 40%, transparent); }
.cuss-stance-negate {
  flex-direction: row-reverse; text-align: right;
  border-color: oklch(0.63 0.22 25); color: oklch(0.63 0.22 25);
}
.cuss-stance-negate .cuss-stance-text { align-items: flex-end; }
.cuss-stance-negate:hover { background: color-mix(in srgb, oklch(0.63 0.22 25) 12%, transparent); }
.cuss-stance-negate .cuss-stance-btn-title { text-shadow: 0 0 10px color-mix(in srgb, oklch(0.63 0.22 25) 40%, transparent); }

.cuss-stance-confirm { display: flex; flex-direction: column; gap: 8px; }
.cuss-stance-confirm[hidden] { display: none; }
.cuss-stance-confirm-row {
  margin: 0; font-size: 20px; font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease;
}
.cuss-stance-confirm-row.is-visible { opacity: 1; transform: translateY(0); }
.cuss-stance-confirm-row.cuss-text-affirm { color: oklch(0.72 0.15 250); }
.cuss-stance-confirm-row.cuss-text-negate { color: oklch(0.63 0.22 25); }

/* Post-round filler-word recap — the player's own words from that round
   only, each paired with a stronger alternative. */
.cuss-recap { display: flex; flex-direction: column; gap: 6px; align-items: center; max-width: 46ch; }
.cuss-recap:empty { display: none; }
.cuss-recap-heading {
  margin: 0; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.cuss-recap-clean { margin: 0; font-size: 14px; color: color-mix(in srgb, var(--color-text) 75%, transparent); }
.cuss-recap-row {
  display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap;
  font-size: 14.5px;
}
.cuss-recap-from { color: var(--color-warn); font-weight: 600; }
.cuss-recap-arrow { color: color-mix(in srgb, var(--color-text) 40%, transparent); }
.cuss-recap-to { color: oklch(0.75 0.13 150); font-weight: 600; }

/* Round-result screen — plays once when a round ends (either side hits 0
   Credibility): the win/lose volley animation, then the round stats and
   Rematch button fade in on this same screen (see .cuss-result-stats
   below) rather than handing off to a separate screen. Same ping-pong-
   volley language as "Entering the Chat" (.cuss-enter-*): the two
   lip halves lifted from the logo mark volley the ball, then on the final
   exchange the winning side's lip returns it (pulses, stays solid) and the
   losing side's lip fades out as the ball flies past. Upper = player, lower
   = AI opponent, matching the health-bar order above. See
   playRoundResultTransition() in script.js. Reuses the exact --u scale-
   factor technique .cuss-enter-stage uses so this also scales down on small
   viewports instead of overflowing the arena card. */
.cuss-result-transition {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; overflow-y: auto; scrollbar-gutter: stable;
  background: var(--color-bg); opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  padding: 6px var(--edge);
}
.cuss-result-transition[hidden] { display: none; }
.cuss-result-transition.playing-win, .cuss-result-transition.playing-lose { opacity: 1; pointer-events: auto; }
/* Same 65vmin/420px cap as .cuss-enter-stage ("Entering the Chat") so the
   lips mark reads as one consistent size everywhere it appears — --u
   (used by every lip/ball keyframe below) is derived from this the same
   way there, so matching this one value matches lip and ball size too. */
.cuss-result-stage {
  position: relative; flex: none; width: min(65vmin, 420px); height: min(65vmin, 420px);
  --u: calc(min(65vmin, 420px) / 520px);
}
.cuss-result-lip {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--u) * 170px); height: calc(var(--u) * 130px);
  margin-left: calc(var(--u) * -85px); margin-top: calc(var(--u) * -65px);
  opacity: 0;
}
.cuss-result-lip svg { width: 100%; height: 100%; display: block; }
.cuss-result-ball {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--u) * 14px); height: calc(var(--u) * 14px);
  margin-left: calc(var(--u) * -7px); margin-top: calc(var(--u) * -7px);
  border-radius: 50%; background: #8B5CF6;
  box-shadow: 0 0 18px 4px rgba(139, 92, 246, 0.6);
  opacity: 0;
}
/* Sits below the stage in normal flow now (not absolutely hung off it) so
   the stats block added below it (see .cuss-result-stats) can grow the
   screen naturally instead of overlapping the lips/ball. */
.cuss-result-verdict { flex: none; margin-top: -60px; text-align: center; opacity: 0; }
.cuss-result-rule-line { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 8px; }
.cuss-result-rule { display: inline-block; height: 1px; width: 60px; background: currentColor; transform: scaleX(0); transform-origin: center; }
.cuss-result-verdict.line-drawn .cuss-result-rule { animation: cuss-result-rule-draw 0.5s ease forwards; }
@keyframes cuss-result-rule-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cuss-result-rule-text {
  font-family: var(--font-heading); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
}
.cuss-result-headline {
  margin: 0; font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.01em;
}
.cuss-result-sub {
  margin: 4px 0 0; font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
/* Round stats + Rematch — folded onto this same screen instead of a
   separate .cuss-gameover screen (removed) that used to take over after
   this animation finished; that hand-off was itself a second screen
   transition (its own place for a flash-of-the-wrong-screen glitch, same
   family as the "Entering the Chat" bug) and read as a different, plainer
   screen stitched on after a more polished one. Fades in on its own,
   timed from playRoundResultTransition() to land shortly after the
   verdict rule-line finishes drawing in, not instantly with everything
   else. Reuses .cuss-trend/.cuss-recap exactly as before — same data,
   same markup, just a new parent and entrance. */
.cuss-result-stats {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.cuss-result-stats.is-visible { opacity: 1; transform: translateY(0); }
/* Solid accent-purple fill, same recipe as .cuss-cta-xl (the hero Chat
   button) just sized down for a secondary action on this screen rather
   than a marketing hero — a clear, unambiguous "this is Cussator" button
   instead of the previous screen's plain light box. */
.cuss-result-rematch {
  margin-top: 2px; font-size: 15px; font-weight: var(--font-heading-weight); padding: 11px 32px;
  background: var(--color-accent); color: var(--color-bg); border-color: transparent;
}
.cuss-result-rematch:hover { background: var(--color-accent-2); }
.cuss-result-rematch:active { background: var(--color-accent); }

/* Full Report — opens the Feature 3 post-round dashboard (see the
   .cuss-dashboard rules near the end of this file). Sits beside Rematch as
   a plainly secondary action (.btn-secondary, an outline the app already
   uses elsewhere) so Rematch stays the one loud choice on this screen. */
.cuss-result-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: center; }
.cuss-result-actions .cuss-result-rematch { margin-top: 0; }

/* Win: upper (player) lip returns the final volley, lower (AI) lip misses —
   same green already used elsewhere (e.g. .cuss-vocab), no new colors. */
.cuss-result-transition.playing-win .cuss-result-lip-upper { animation: cuss-result-upper-win 3.6s cubic-bezier(0.4,0,0.2,1) forwards; }
.cuss-result-transition.playing-win .cuss-result-lip-lower { animation: cuss-result-lower-win 3.6s cubic-bezier(0.4,0,0.2,1) forwards; }
.cuss-result-transition.playing-win .cuss-result-ball { animation: cuss-result-ball-win 3.6s cubic-bezier(0.45,0,0.55,1) forwards; }
.cuss-result-transition.playing-win .cuss-result-verdict { animation: cuss-result-reveal 3.6s ease forwards; color: oklch(0.75 0.13 150); }

@keyframes cuss-result-upper-win {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  15%  { transform: translate(0, calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  35%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  55%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  75%  { transform: translate(0, calc(var(--u) * -150px)) scale(1.15); opacity: 1; }
  85%  { transform: translate(0, calc(var(--u) * -150px)) scale(1); opacity: 1; }
  100% { transform: translate(0, calc(var(--u) * -150px)) scale(1); opacity: 0.3; }
}
@keyframes cuss-result-lower-win {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  15%  { transform: translate(0, calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  35%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  55%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  75%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 150px)) scale(0.9); opacity: 0.6; }
  100% { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 150px)) scale(0.8); opacity: 0.15; }
}
@keyframes cuss-result-ball-win {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  12%  { transform: translate(0, 0) scale(1); opacity: 1; }
  25%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * -120px)) scale(1); opacity: 1; }
  35%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * 120px)) scale(1); opacity: 1; }
  45%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * -120px)) scale(1); opacity: 1; }
  55%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 120px)) scale(1); opacity: 1; }
  68%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 340px)) scale(0.5); opacity: 0.5; }
  72%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Lose: lower (AI) lip returns the final volley, upper (player) lip misses. */
.cuss-result-transition.playing-lose .cuss-result-lip-upper { animation: cuss-result-upper-lose 3.6s cubic-bezier(0.4,0,0.2,1) forwards; }
.cuss-result-transition.playing-lose .cuss-result-lip-lower { animation: cuss-result-lower-lose 3.6s cubic-bezier(0.4,0,0.2,1) forwards; }
.cuss-result-transition.playing-lose .cuss-result-ball { animation: cuss-result-ball-lose 3.6s cubic-bezier(0.45,0,0.55,1) forwards; }
.cuss-result-transition.playing-lose .cuss-result-verdict { animation: cuss-result-reveal 3.6s ease forwards; color: oklch(0.63 0.22 25); }

@keyframes cuss-result-upper-lose {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  15%  { transform: translate(0, calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  35%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  55%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  75%  { transform: translate(calc(var(--u) * -40px), calc(var(--u) * -150px)) scale(0.9); opacity: 0.6; }
  100% { transform: translate(calc(var(--u) * -40px), calc(var(--u) * -150px)) scale(0.8); opacity: 0.15; }
}
@keyframes cuss-result-lower-lose {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  15%  { transform: translate(0, calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  35%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  55%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  75%  { transform: translate(0, calc(var(--u) * 150px)) scale(1.15); opacity: 1; }
  85%  { transform: translate(0, calc(var(--u) * 150px)) scale(1); opacity: 1; }
  100% { transform: translate(0, calc(var(--u) * 150px)) scale(1); opacity: 0.3; }
}
@keyframes cuss-result-ball-lose {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  12%  { transform: translate(0, 0) scale(1); opacity: 1; }
  25%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * -120px)) scale(1); opacity: 1; }
  35%  { transform: translate(calc(var(--u) * -70px), calc(var(--u) * 120px)) scale(1); opacity: 1; }
  45%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * -120px)) scale(1); opacity: 1; }
  55%  { transform: translate(calc(var(--u) * 60px), calc(var(--u) * 120px)) scale(1); opacity: 1; }
  68%  { transform: translate(calc(var(--u) * -40px), calc(var(--u) * -340px)) scale(0.5); opacity: 0.5; }
  72%  { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes cuss-result-reveal {
  0%, 60%  { opacity: 0; transform: translateY(6px); }
  78%      { opacity: 1; transform: translateY(0); }
  100%     { opacity: 1; transform: translateY(0); }
}

/* "Entering the Chat" — plays once when Chat is clicked, hosted directly on
   .cuss-stance-select (see above) rather than a separate overlay that used
   to crossfade into the round-setup screen underneath. Built from the same
   two lip paths as the logo mark (cussator-mark.svg), split so each half
   can move independently. --u is a unitless scale factor (current stage
   size ÷ the 520px size the motion was originally tuned at) — every
   distance below is `var(--u) * <original px>` so the whole animation
   scales proportionally on small viewports instead of overflowing or
   feeling out of place. Triggered by .is-entering on WHICHEVER container
   currently hosts a .cuss-enter-stage (see playEnterThenOpen() in
   script.js for the round entrance, playBagEnterThenOpen() for the Bag
   drawer's own copy) — the selector below matches any ancestor with that
   class, not just .cuss-stance-select, so both reuse the exact same
   animation/timing (ENTER_ANIM_DURATION). */
.cuss-enter-stage {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(65vmin, 420px); height: min(65vmin, 420px);
  --u: calc(min(65vmin, 420px) / 520px);
  pointer-events: none;
}
.cuss-enter-lip {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--u) * 170px); height: calc(var(--u) * 130px);
  margin-left: calc(var(--u) * -85px); margin-top: calc(var(--u) * -65px);
  opacity: 0;
}
.cuss-enter-lip svg { width: 100%; height: 100%; display: block; }
.is-entering .cuss-enter-lip-upper {
  animation: cuss-enter-upper-lip 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.is-entering .cuss-enter-lip-lower {
  animation: cuss-enter-lower-lip 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes cuss-enter-upper-lip {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  20%  { transform: translate(0, calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  45%  { transform: translate(calc(var(--u) * -90px), calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  70%  { transform: translate(calc(var(--u) * 70px), calc(var(--u) * -150px)) scale(0.92); opacity: 0.9; }
  100% { transform: translate(0, calc(var(--u) * -150px)) scale(0.95); opacity: 0; }
}
@keyframes cuss-enter-lower-lip {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  20%  { transform: translate(0, calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  45%  { transform: translate(calc(var(--u) * -90px), calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  70%  { transform: translate(calc(var(--u) * 70px), calc(var(--u) * 150px)) scale(0.92); opacity: 0.9; }
  100% { transform: translate(0, calc(var(--u) * 150px)) scale(0.95); opacity: 0; }
}
.cuss-enter-ball {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--u) * 14px); height: calc(var(--u) * 14px);
  margin-left: calc(var(--u) * -7px); margin-top: calc(var(--u) * -7px);
  border-radius: 50%; background: #8B5CF6;
  box-shadow: 0 0 18px 4px rgba(139, 92, 246, 0.6);
  opacity: 0;
}
.is-entering .cuss-enter-ball {
  animation: cuss-enter-ball 2.2s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}
@keyframes cuss-enter-ball {
  0%   { transform: translate(0, 0); opacity: 0; }
  20%  { transform: translate(0, 0); opacity: 1; }
  35%  { transform: translate(calc(var(--u) * -90px), calc(var(--u) * -120px)); }
  45%  { transform: translate(calc(var(--u) * -90px), calc(var(--u) * 120px)); }
  60%  { transform: translate(calc(var(--u) * 70px), calc(var(--u) * -120px)); }
  70%  { transform: translate(calc(var(--u) * 70px), calc(var(--u) * 120px)); }
  90%  { transform: translate(0, calc(var(--u) * -40px)); opacity: 1; }
  100% { transform: translate(0, 0) scale(0.3); opacity: 0; }
}
.cuss-enter-label {
  position: absolute; left: 0; right: 0; bottom: calc(var(--u) * -70px); text-align: center;
  font-family: var(--font-heading); font-size: 13px; letter-spacing: 0.18em;
  color: color-mix(in srgb, var(--color-text) 55%, transparent); opacity: 0;
}
.cuss-enter-label b { color: var(--color-text); font-weight: 600; }
.is-entering .cuss-enter-label {
  animation: cuss-enter-label-fade 2.2s ease-in-out forwards;
}
@keyframes cuss-enter-label-fade {
  0%, 25% { opacity: 0; }
  45% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* Vocabulary Scars — a persistent, cross-round view of the same filler
   data the post-round recap already computes (site/script.js accumulates
   it into localStorage as each argument is scored), so this page is just a
   different display of existing numbers, not a new tracker. Full-screen,
   same pattern as .cuss-arena. */
.cuss-scars {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center;
  padding: 0; background: var(--color-bg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.cuss-scars.is-open { opacity: 1; pointer-events: auto; }
.cuss-scars-inner {
  width: 100%; max-width: 720px; height: 100%; max-height: 100vh; max-height: 100dvh;
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4) var(--edge); overflow-y: auto;
}
.cuss-scars-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cuss-scars-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 20px; }
.cuss-scars-sub {
  margin: 0; font-size: 13.5px; max-width: 60ch;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
/* Responsive card grid — one column narrow, two once there's room for a
   pair of ~260px+ cards, via auto-fit/minmax rather than a hard breakpoint
   (same technique as the dashboard's chart grid). */
.cuss-scars-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); padding-top: var(--space-2); }

/* Vocabulary Scars debuff card — deliberately its OWN classes, not a reuse
   of .cuss-recap-row/-from/-to (those are shared with the post-round
   recap on the result screen; restyling them here would have restyled that
   screen too). Colors are all existing app tokens, not new ones: amber
   (--color-warn) for the "debuff" language, matching the filler-word color
   already used everywhere else in the app (the live highlighter, the
   result-screen recap, the color legend); green (the same oklch(0.75 0.13
   150) already used for "vocab"/the recap's swap-to color) for the
   recommended-swap pill. */
.cuss-scar-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--color-surface); border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--color-warn) 30%, var(--color-divider));
  padding: var(--space-3);
}
.cuss-scar-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.cuss-scar-badge-label {
  margin: 0 0 2px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-warn);
}
.cuss-scar-badge-title {
  margin: 0; font-family: var(--font-heading); font-weight: 700; font-size: 17px;
  letter-spacing: -0.01em; color: var(--color-text);
}
.cuss-scar-count {
  flex: none; font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-warn) 18%, var(--color-surface));
  color: var(--color-warn); border: 1px solid color-mix(in srgb, var(--color-warn) 45%, transparent);
}
.cuss-scar-desc {
  margin: 0; font-size: 13px; line-height: 1.5;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.cuss-scar-word-pill {
  font-family: var(--font-mono); font-weight: 600; color: var(--color-warn);
  background: color-mix(in srgb, var(--color-warn) 16%, transparent);
  padding: 1px 5px; border-radius: 4px;
}
.cuss-scar-swap-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-top: 2px; padding-top: var(--space-2); border-top: 1px solid var(--color-divider);
}
.cuss-scar-swap-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.cuss-scar-swap-pill {
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  color: oklch(0.75 0.13 150); background: color-mix(in srgb, oklch(0.75 0.13 150) 14%, transparent);
  border: 1px solid color-mix(in srgb, oklch(0.75 0.13 150) 40%, transparent);
  padding: 4px 9px; border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}
.cuss-scar-swap-pill:hover { transform: scale(1.05); }

/* Connector Log — same full-screen panel pattern as Vocabulary Scars just
   above (own class namespace so either can be removed independently), but
   a positive tracker like the Bag rather than a corrective one: just a
   running use-count per connector, no suggested alternative. See
   recordConnectiveWords()/initConnectorLog() in script.js. */
.cuss-connector-log {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center;
  padding: 0; background: var(--color-bg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.cuss-connector-log.is-open { opacity: 1; pointer-events: auto; }
.cuss-connector-log-inner {
  width: 100%; max-width: 720px; height: 100%; max-height: 100vh; max-height: 100dvh;
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4) var(--edge); overflow-y: auto;
}
.cuss-connector-log-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cuss-connector-log-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 20px; }
.cuss-connector-log-sub {
  margin: 0; font-size: 13.5px; max-width: 60ch;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.cuss-connector-log-list { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-2); }
.cuss-connector-log-list .cuss-recap-row { justify-content: flex-start; font-size: 15px; }
/* Same blue already used for the live .cuss-connective highlight, so the
   word reads as the same category here as it did mid-round. */
.cuss-connector-word { color: oklch(0.72 0.15 250); font-weight: 600; }

/* Bag — the positive mirror of Vocabulary Scars just above: identical
   full-screen panel structure, but the word itself is styled in the same
   green already used for the live "vocab" highlight (.cuss-vocab) instead
   of Scars' filler-orange, so the trophy-case framing reads immediately
   even before the sub-copy is read. See initBag() in script.js. */
.cuss-bag {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center;
  padding: 0; background: var(--color-bg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.cuss-bag.is-open { opacity: 1; pointer-events: auto; }
.cuss-bag-inner {
  position: relative;
  width: 100%; max-width: 720px; height: 100%; max-height: 100vh; max-height: 100dvh;
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4) var(--edge); overflow-y: auto;
}
/* Same "Entering the Chat" lips-paddle animation as opening a round (see
   .cuss-enter-stage above and playBagEnterThenOpen() in script.js), just
   hosted on this panel instead — the content fades in on this SAME
   element the instant it finishes, no separate screen to hand off to. */
.cuss-bag-content { opacity: 1; transition: opacity 0.4s ease; }
.cuss-bag.is-entering .cuss-bag-content { opacity: 0; transition: none; }
.cuss-bag-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cuss-bag-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 20px; }
.cuss-bag-sub {
  margin: 0; font-size: 13.5px; max-width: 60ch;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
/* Collected words as a trading-card lineup — a row/grid of individual
   cards (word + "level", i.e. how many times it's actually landed) rather
   than a plain list, so the Bag reads as a collection to show off, not a
   log. Each card settles in with its own small pop (see .is-visible,
   staggered from renderBag() in script.js) instead of all appearing at
   once, echoing dealing out cards one at a time. */
.cuss-bag-list { display: flex; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-2); }
.cuss-bag-card {
  width: 136px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--space-3) var(--space-2); border-radius: var(--radius-md); text-align: center;
  background: color-mix(in srgb, oklch(0.75 0.13 150) 10%, var(--color-surface));
  border: 1px solid color-mix(in srgb, oklch(0.75 0.13 150) 35%, transparent);
  opacity: 0; transform: translateY(10px) scale(0.94);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
.cuss-bag-card.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.cuss-bag-card-level {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  color: color-mix(in srgb, oklch(0.75 0.13 150) 85%, var(--color-text));
  border: 1px solid color-mix(in srgb, oklch(0.75 0.13 150) 45%, transparent);
  border-radius: 999px; padding: 1px 8px;
}
/* Purely cosmetic — flags words that are also real MUN/diplomatic
   vocabulary (see MUN_TERMS in script.js). Accent purple rather than the
   card's green, so it reads as a distinct second tag next to the CEFR
   level pill above, not a variant of it. */
.cuss-bag-card-mun {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  border-radius: 999px; padding: 1px 8px;
}
/* Purely cosmetic, same pattern as .cuss-bag-card-mun above — flags words
   also on the Academic Word List (see AWL_TERMS in script.js). Its own
   third color (the site's existing warn/amber token) so a word carrying
   both tags at once still reads as two distinct badges, not two of the
   same thing. */
.cuss-bag-card-awl {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--color-warn);
  border: 1px solid color-mix(in srgb, var(--color-warn) 45%, transparent);
  border-radius: 999px; padding: 1px 8px;
}
.cuss-bag-card-word { font-size: 16px; font-weight: 700; color: oklch(0.75 0.13 150); }
.cuss-bag-card-def { font-size: 11.5px; line-height: 1.35; color: color-mix(in srgb, var(--color-text) 65%, transparent); }

/* Round-end trend — this round's filler count against the player's own
   last-3-rounds average, pulled from the same localStorage history that
   feeds the homepage's real per-player stat tile. */
.cuss-trend { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.cuss-trend:empty { display: none; }
.cuss-trend-count { margin: 0; font-size: 16px; font-weight: 600; }
.cuss-trend-note { margin: 0; font-size: 13.5px; }
.cuss-trend-down { color: oklch(0.75 0.13 150); }
.cuss-trend-up { color: oklch(0.63 0.22 25); }
.cuss-trend-flat { color: color-mix(in srgb, var(--color-text) 60%, transparent); }

@media (max-width: 640px) {
  .cuss-arena-inner { padding: var(--space-3); gap: var(--space-2); }
  /* Grid, not the earlier column-stack — keeps the Bag-insert button,
     the input card, and the send button all on ONE row (standard chat-
     input pattern: icon | flexible text field | send docked at the end)
     instead of three separate full-width rows. The input card is the
     only flexible column; the two icon buttons keep their own fixed
     size on either side of it. */
  .cuss-arena-form { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 6px; }
  .cuss-scars-inner { padding: var(--space-3); }
  .cuss-connector-log-inner { padding: var(--space-3); }
  .cuss-bag-inner { padding: var(--space-3); }
  /* Legend dots (Filler/Vocab/Penalty) and the utility buttons around the
     composer used desktop-scale gaps that read as sparse/disconnected on
     a narrow screen — tightened here, and pinned to the left edge (no
     centering) so they read as one aligned cluster, not floating pieces. */
  .cuss-color-legend { gap: 10px; padding: 0 2px 4px; justify-content: flex-start; }
  .cuss-bag-shelf { gap: 6px; }
  /* Touch targets — every tappable control here should clear ~44x44px on
     mobile even where the visual element stays smaller, per WCAG/mobile
     guidance. Padding/min-size only; no visual restyle beyond size. */
  .cuss-bag-insert-btn { width: 44px; height: 44px; }
  #cuss-arena-close { width: 44px; height: 44px; }
  /* Send button becomes a compact square icon button on mobile instead
     of the wider rectangular keycap — closer to a standard mobile
     send-icon control, docked at the end of the input row above. Still
     clears the 44px touch-target floor. */
  .cuss-send-btn { width: 46px; height: 46px; min-height: 46px; }

  /* General mobile scale-down — headings, badges, and the HP bar section
     were all reusing desktop-scale type/spacing transplanted onto a
     phone screen. Motion gets its own, smaller mobile size (the earlier
     20px "headline" size was tuned for desktop, where there's room for
     it — at mobile width the same size wrapped to 3-4 lines and
     dominated the screen); everything else here is a straight reduction
     of the same rule used at desktop. */
  .cuss-arena-motion { font-size: 15px; line-height: 1.3; margin-bottom: 4px; }
  .cuss-hud-hp-label { font-size: 10px; }
  .cuss-arena-health .cuss-judge-val { font-size: 12px; }
  .cuss-arena-health .cuss-judge-track { height: 8px; }
  .cuss-hud-hp-row { gap: 8px; }
  .tag { font-size: 10px; padding: 2px 8px; }
  .cuss-arena-head-info, .cuss-arena-head-right { gap: 6px; }
}

/* ── Mobile nav: hamburger dropdown ──────────────────────────────────
   .cuss-nav-links switches from "inline scrollable row" (desktop) to
   "hidden by default, toggled open as a dropdown panel below the header"
   — fixes "How it works" clipping mid-word, which happened because the
   scrollable-row approach still rendered each link at full desktop
   width/font-size with no room to show more than a fragment of the
   first one. Chat/Bag (.cuss-nav-actions) are untouched by any of this —
   they stay inline in the header at every width. */
@media (max-width: 640px) {
  .cuss-nav-menu-btn { display: inline-flex; width: 44px; height: 44px; }
  .cuss-nav-links {
    display: none;
    position: absolute; top: 100%; left: 20px; right: 20px; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--color-surface); border: 1px solid var(--color-divider);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    margin-top: 6px; padding: var(--space-2);
    overflow-x: visible; /* override the desktop row's horizontal scroll */
  }
  .cuss-nav-links.is-open { display: flex; }
  .cuss-nav-links a {
    padding: 12px 10px; border-radius: var(--radius-sm);
    white-space: normal; /* full label on its own row, nothing to clip */
  }
  .cuss-nav-links a:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
  /* Item 2 of the mobile scale-down pass: Chat/Bag read as oversized
     rounded-rect buttons at mobile scale (~a third of the screen width
     each) — same visual language, compact footprint. min-height keeps
     the 44px touch-target floor without the desktop-scale horizontal
     padding/font-size that was making them so wide. */
  .nav-cta { padding: 0 8px; min-height: 44px; font-size: 12.5px; }
  /* Signed-in chip: avatar + Sign out only, the name won't fit at 320px. */
  .cuss-user-name { display: none; }
  /* Guest Sign in button: keep the G + label, trimmed to fit the 320px row. */
  .cuss-signin-btn { gap: 4px; }
  .cuss-signin-btn .cuss-g-logo { width: 14px; height: 14px; }
  .cuss-signin-card { padding: var(--space-6); }
  .cuss-signin-title { font-size: 24px; }
  /* The hamburger button added ~55px (its own width + gap) to this row
     that the original nav-overflow fix never accounted for — closes the
     resulting overflow at the narrowest real phone width (320px) by
     tightening the row's own gap and horizontal padding specifically at
     mobile, on top of the nav-cta padding/font trim above. */
  .nav { gap: 6px; padding-left: var(--space-3); padding-right: var(--space-3); }
}

/* =========================================================================
   Post-round dashboard (Feature 3) — a full-screen report opened from the
   result screen's "Full Report" button (see .cuss-result-actions above),
   or opened directly by Elevator Pitch mode (Feature 4), bypassing the
   win/lose screen entirely. Same fixed-overlay + is-open mechanism as
   .cuss-arena (see above), stacked one z-index above it (101 vs 100) so it
   can layer over an arena that's still open underneath.

   Deliberately its own visual language ("Dark Snapchat-style": near-black
   surfaces, neon yellow/green accents, high-contrast text) rather than the
   site's purple/lavender accent system — scoped entirely to custom
   properties on .cuss-dashboard so nothing here leaks into the rest of the
   app. The two accents (--dash-you / --dash-ai) were run through the
   dataviz skill's palette validator: chroma floor, CVD separation (worst
   adjacent ΔE 16.7 protan) and the normal-vision floor (ΔE 22.6, well
   above the 15 floor) all pass against this surface. They sit well above
   the validator's dark-mode lightness band (~0.48-0.67 L) — an accepted,
   deliberate tradeoff for the neon look the brief specifically asked for,
   not an oversight — so identity is never left to hue alone anyway: every
   chart below also keys "You" vs "AI opponent" by a legend, distinct point
   shapes, and direct end-labels, never color by itself. */
.cuss-dashboard {
  --dash-bg: #050506;
  --dash-panel: #131316;
  --dash-panel-2: #1a1a1e;
  --dash-border: #2c2c31;
  --dash-you: #eaff00;
  --dash-ai: #00e0a8;
  --dash-text: #f5f5f7;
  --dash-text-dim: #9a9aa2;

  position: fixed; inset: 0; z-index: 101; display: flex; justify-content: center;
  background: var(--dash-bg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  overflow-y: auto;
}
.cuss-dashboard.is-open { opacity: 1; pointer-events: auto; }
.cuss-dash-inner {
  width: 100%; max-width: 1040px;
  padding: var(--space-4) var(--edge) calc(var(--space-4) * 2);
  display: flex; flex-direction: column; gap: var(--space-4);
  color: var(--dash-text);
  font-family: var(--font-body, inherit);
}

.cuss-dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cuss-dash-head-info { display: flex; flex-direction: column; gap: 4px; }
.cuss-dash-eyebrow {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dash-you);
}
.cuss-dash-motion { margin: 0; font-size: 13px; color: var(--dash-text-dim); max-width: 56ch; }
.cuss-dash-head-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.cuss-dash-rematch {
  font-size: 14px; font-weight: var(--font-heading-weight); padding: 9px 20px;
  background: var(--dash-you); color: #0b0b0c; border-color: transparent;
}
.cuss-dash-rematch:hover { background: color-mix(in srgb, var(--dash-you) 85%, white); }
.cuss-dash-rematch:active { background: color-mix(in srgb, var(--dash-you) 80%, black); }
.cuss-dash-close {
  color: var(--dash-text); border: 1px solid var(--dash-border); background: var(--dash-panel);
}
.cuss-dash-close:hover { background: var(--dash-panel-2); }

/* Elevator Pitch mode (Feature 4) populates and unhides this; a normal
   round never touches it, so it stays hidden. Left-rule in the "You"
   accent for a clean two-tone dashboard, not a third color. */
.cuss-dash-critique {
  border: 1px solid var(--dash-border); border-left: 3px solid var(--dash-you);
  background: var(--dash-panel); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.cuss-dash-critique-label {
  margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--dash-you);
}
.cuss-dash-critique-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--dash-text); }

/* Charting-library-missing banner (see the CDN-then-vendor-fallback loader
   in index.html's <head> and initDashboard() below) — red-bordered rather
   than the critique block's "You" yellow, so it reads as a warning, not
   feedback. Rare in practice (the vendored copy only misses if both it and
   the CDN fail), but silent nothing was the actual bug being fixed here. */
.cuss-dash-lib-error {
  border: 1px solid oklch(0.63 0.22 25 / 55%); border-left: 3px solid oklch(0.63 0.22 25);
  background: var(--dash-panel); border-radius: var(--radius-md);
  padding: 10px 14px; font-size: 13px; line-height: 1.5; color: var(--dash-text);
}

.cuss-dash-quickstats { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cuss-dash-stat {
  flex: 1 1 130px; border: 1px solid var(--dash-border); background: var(--dash-panel);
  border-radius: var(--radius-md); padding: 10px 14px;
}
.cuss-dash-stat-label { margin: 0 0 2px; font-size: 11px; color: var(--dash-text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.cuss-dash-stat-value { margin: 0; font-size: 22px; font-weight: 700; color: var(--dash-text); font-variant-numeric: proportional-nums; }

.cuss-dash-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-3);
}
.cuss-dash-panel {
  border: 1px solid var(--dash-border); background: var(--dash-panel);
  border-radius: var(--radius-lg); padding: var(--space-3) var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2); min-width: 0;
}
.cuss-dash-panel-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--dash-text-dim); }
.cuss-dash-chart-wrap { position: relative; height: 220px; width: 100%; }
/* :not([hidden]) is deliberate — an unconditional display:flex here would
   override the browser's own [hidden]{display:none} default (author styles
   always win over the UA stylesheet regardless of specificity), so the
   fallback text would render on top of a successfully-drawn chart any time
   JS sets hidden=true on it instead of actually disappearing. Same class of
   bug already caught once on .cuss-point-of-order — scoping the display
   declaration to :not([hidden]) is the fix both times. */
.cuss-dash-chart-fallback:not([hidden]) {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--dash-text-dim);
}

/* WPM pacing sparkline — pure inline SVG, zero library dependency, so this
   one panel can never hit the "Chart unavailable" state the other two can.
   Monochrome in --dash-you (not a new emerald/green): the sparkline is
   always about the player's own pace, same entity the yellow line/bars
   already mean everywhere else on this dashboard, so a second color here
   would mean two different things by the same rule that keeps --dash-you
   meaning "You" and --dash-ai meaning "AI opponent" everywhere else. */
.cuss-spark-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cuss-spark-badge {
  flex: none; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius-sm);
  color: var(--dash-you); background: color-mix(in srgb, var(--dash-you) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--dash-you) 40%, transparent);
}
.cuss-spark-wrap {
  height: 220px; margin-top: var(--space-2); padding: var(--space-2);
  background: var(--dash-panel-2); border: 1px solid var(--dash-border); border-radius: var(--radius-md);
}
.cuss-spark-svg { width: 100%; height: 100%; overflow: visible; }
.cuss-spark-grid { stroke: var(--dash-border); stroke-width: 0.5; stroke-dasharray: 2; }
.cuss-spark-line { fill: none; stroke: var(--dash-you); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cuss-spark-labels {
  display: flex; justify-content: space-between; margin-top: var(--space-2);
  font-family: var(--font-mono); font-size: 10px; color: var(--dash-text-dim);
}

@media (max-width: 640px) {
  .cuss-spark-wrap { height: 200px; }
}

.cuss-dash-scores { justify-content: flex-start; }
.cuss-dash-score-cards { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cuss-dash-score-card { flex: 1 1 140px; display: flex; flex-direction: column; gap: 6px; }
.cuss-dash-score-label { margin: 0; font-size: 12px; color: var(--dash-text-dim); }
.cuss-dash-score-value { margin: 0; font-size: 34px; font-weight: 700; color: var(--dash-text); line-height: 1; }
.cuss-dash-score-track { height: 4px; border-radius: 2px; background: var(--dash-panel-2); overflow: hidden; }
.cuss-dash-score-fill { height: 100%; border-radius: 2px; background: var(--dash-you); transition: width 0.6s ease; }

@media (max-width: 640px) {
  .cuss-dash-inner { padding: var(--space-3) var(--edge) calc(var(--space-4) * 2); }
  .cuss-dash-grid { grid-template-columns: 1fr; }
  .cuss-dash-chart-wrap { height: 200px; }
  .cuss-dash-head-actions { width: 100%; justify-content: space-between; }
}

/* =========================================================================
   60-Second Elevator Pitch (Feature 4) — its own overlay, same fixed +
   is-open mechanism as .cuss-arena (see above), so it can be opened
   straight from the home screen as an alternative round type rather than
   living inside the normal turn-based arena's state machine (HP bars, per-
   turn timer, Word Economy, Point of Order — none of that fits a single
   60-second solo pitch with no opponent turn). Reuses .cuss-stance-select/
   .cuss-stance-content/.cuss-stance-buttons as-is for the side picker (see
   the stance-select rules earlier in this file) — same visual language,
   new ids, no new CSS needed for that part. */
.cuss-pitch {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center;
  background: var(--color-bg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.cuss-pitch.is-open { opacity: 1; pointer-events: auto; }
.cuss-pitch-inner {
  position: relative; width: 100%; height: 100%; max-height: 100vh; max-height: 100dvh;
  display: flex; flex-direction: column; gap: var(--space-4);
  background: var(--color-bg); padding: var(--space-4) var(--edge); overflow: hidden;
}
.cuss-pitch-intro { max-width: 46ch; margin: 0; font-size: 14px; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.cuss-pitch-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cuss-pitch-head-info { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* The "prominent, hard 60-second visual countdown" the brief asks for —
   deliberately much larger than the arena's small timer chip (that one is
   a background pressure cue for a multi-turn round; this is the entire
   point of this mode). Same amber-at-10s / red-at-5s escalation language
   as the rest of the app (--color-warn, then the critical red already used
   by .cuss-token-budget.is-critical), just scaled way up. */
.cuss-pitch-timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* Circular clock sweep — pure SVG/CSS, zero dependency by construction
   (can't hit the "Chart unavailable" failure mode the CDN-based charts
   can). A static track ring plus one hand that rotates a full 360° over
   the 60 real seconds (see .cuss-pitch-clock-hand below), landing back at
   12 o'clock exactly as time runs out. The number sits on top as the
   primary at-a-glance readout; the ring is a layer around it, not a
   replacement. */
.cuss-pitch-clock {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: clamp(130px, 28vw, 210px); height: clamp(130px, 28vw, 210px);
}
.cuss-pitch-clock-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cuss-pitch-clock-track {
  fill: none; stroke: var(--color-accent); stroke-width: 2;
  opacity: 0.25; transition: stroke 0.2s ease;
}
.cuss-pitch-clock-hand {
  stroke: var(--color-accent); stroke-width: 3; stroke-linecap: round;
  transform-origin: 50px 50px; transition: stroke 0.2s ease;
}
/* The sweep itself — started/restarted from JS via the same remove-class,
   force-reflow, re-add-class trick triggerScreenShake() uses elsewhere in
   the app, so a fresh pitch always begins the hand at 12 o'clock rather
   than resuming wherever the last round's hand stopped. animation-fill-mode:
   forwards (the trailing "forwards" on the shorthand) holds the hand at
   360deg/back-at-start once the round's 60s elapse, instead of snapping back
   to 0deg. */
.cuss-pitch-clock.is-sweeping .cuss-pitch-clock-hand {
  animation: cuss-clock-sweep 60s linear forwards;
}
@keyframes cuss-clock-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.cuss-pitch-clock.is-warn .cuss-pitch-clock-track,
.cuss-pitch-clock.is-warn .cuss-pitch-clock-hand { stroke: var(--color-warn); }
.cuss-pitch-clock.is-critical .cuss-pitch-clock-track,
.cuss-pitch-clock.is-critical .cuss-pitch-clock-hand { stroke: oklch(0.63 0.22 25); }
@media (prefers-reduced-motion: reduce) {
  /* No continuous sweep — the hand's rotation is instead set directly by
     JS once a second (see updateTimerDisplay() in script.js), matching the
     digit's own update cadence rather than a smooth 60s animation. */
  .cuss-pitch-clock.is-sweeping .cuss-pitch-clock-hand { animation: none; }
}
.cuss-pitch-timer {
  position: relative; z-index: 1; /* sits above the SVG, not behind it */
  margin: 0;
  /* Brand font, not the generic system-monospace stack — every other
     numeral/heading in the app (the wordmark, the arena's own small turn
     timer, headings) already renders in Inter; this was the one outlier
     reaching for var(--font-mono) instead. Inter's own tabular figures
     (font-variant-numeric: tabular-nums) keep digit width stable as the
     count changes, same stability a monospace stack would give, so
     nothing is lost switching away from it — already loaded at this
     weight too (see the Inter import at the top of this file), no new
     font request. */
  font-family: var(--font-heading); font-variant-numeric: tabular-nums;
  font-size: clamp(56px, 14vw, 96px); font-weight: 700; line-height: 1; color: var(--color-text);
  transition: color 0.2s ease;
  /* Glowing-clock look: text-shadow keyed to currentColor so it's a soft
     white halo normally, then automatically follows color into amber
     (is-warn) and red (is-critical) below with no separate glow color to
     keep in sync — one declaration, three looks. The breathing animation
     is the "ticking clock" feel; is-critical layers its own faster opacity
     pulse on TOP of it (multiple comma-separated animations), rather than
     replacing it, so the glow keeps breathing even in the urgent state. */
  text-shadow: 0 0 10px currentColor, 0 0 26px color-mix(in srgb, currentColor 55%, transparent);
  animation: cuss-pitch-glow-pulse 1.6s ease-in-out infinite;
}
.cuss-pitch-timer.is-warn { color: var(--color-warn); }
.cuss-pitch-timer.is-critical {
  color: oklch(0.63 0.22 25);
  animation: cuss-pitch-pulse 1s ease-in-out infinite, cuss-pitch-glow-pulse 1.6s ease-in-out infinite;
}
@keyframes cuss-pitch-glow-pulse {
  0%, 100% { text-shadow: 0 0 8px currentColor, 0 0 20px color-mix(in srgb, currentColor 45%, transparent); }
  50% { text-shadow: 0 0 16px currentColor, 0 0 34px color-mix(in srgb, currentColor 65%, transparent); }
}
.cuss-pitch-timer-track { width: min(360px, 100%); height: 6px; border-radius: 3px; background: var(--color-surface); overflow: hidden; }
.cuss-pitch-timer-fill {
  height: 100%; width: 100%; border-radius: 3px; background: var(--color-accent);
  transform-origin: left; transition: width 1s linear, background-color 0.2s ease;
}
.cuss-pitch-timer-fill.is-warn { background: var(--color-warn); }
.cuss-pitch-timer-fill.is-critical { background: oklch(0.63 0.22 25); }
@keyframes cuss-pitch-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  /* Static glow stays (it's just a text-shadow, not motion) — only the
     breathing/pulsing animations are dropped. */
  .cuss-pitch-timer, .cuss-pitch-timer.is-critical { animation: none; }
}

/* Grows to fill the space below the timer, then stretches just the text
   box to fill IT — align-self:stretch on .cuss-highlight-wrap alone,
   not align-items on the whole row, so the Send button keeps
   .cuss-arena-form's own flex-end (bottom-anchored keycap) instead of
   being stretched tall itself. flex:1 on .cuss-pitch-form gives it a real
   used-value height from the outer column layout, which is what makes
   height:100% on .cuss-highlight-wrap and the textarea inside it resolve
   to something meaningful instead of collapsing. */
.cuss-pitch-form { flex: 1; min-height: 0; }
.cuss-pitch-form .cuss-highlight-wrap { align-self: stretch; height: auto; }

@media (max-width: 640px) {
  .cuss-pitch-inner { padding: var(--space-3); }
  .cuss-pitch-form { flex-direction: column; align-items: stretch; }
}
