:root {
  --color-bg: #142452;
  --color-surface: #f3f2f2;
  --color-card: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #ec3013;
  --color-accent-100: #fff2ef;
  --color-accent-300: #ffc4b8;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;
  --color-accent-800: #7c1405;
  --color-neutral-100: #f8f4f4;
  --color-gold: #ffd900;
  --color-toast: #2d2b2b;
  --color-stripe: #635bff;
  --font-heading: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --bg-gradient:
    radial-gradient(1100px 700px at 10% -10%, rgba(236,48,19,0.20), transparent 55%),
    radial-gradient(900px 650px at 105% 105%, rgba(255,217,0,0.12), transparent 55%),
    linear-gradient(160deg, #223469 0%, #142452 40%, #0d1840 72%, #080e26 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: #fff;
}
body.gradient { background: var(--bg-gradient); background-attachment: fixed; }
/* iOS Safari repaints fixed backgrounds per-scroll-frame (janky) or drops
   them entirely; phones get the plain scroll attachment. */
@media (max-width: 768px) {
  body.gradient { background-attachment: scroll; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
p { margin: 0 0 12px; }
a { color: var(--color-accent); text-underline-offset: 3px; }
a.on-navy { color: #ffd9d0; }

@keyframes wiggle { 0%,100%{ transform: rotate(0deg); } 25%{ transform: rotate(-6deg); } 75%{ transform: rotate(6deg); } }
@keyframes toastIn { from{ transform: translateX(120%); opacity: 0; } to{ transform: translateX(0); opacity: 1; } }
@keyframes popIn { from{ transform: scale(0.3); opacity: 0; } to{ transform: scale(1); opacity: 1; } }
@keyframes growWord {
  0%,100% { transform: scale(1); }
  25%,75% { transform: scale(2); }
}
@keyframes pulse {
  0%,100%{ transform: scale(1); box-shadow: 0 6px 18px rgba(236,48,19,0.35); }
  50%{ transform: scale(1.035); box-shadow: 0 10px 26px rgba(236,48,19,0.5); }
}
@keyframes babang {
  0% { transform: scale(0.2); opacity: 0; }
  15% { transform: scale(1.15); opacity: 1; }
  30% { transform: scale(0.95); opacity: 1; }
  70% { transform: scale(1.45); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}

.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main#app { flex: 1; display: flex; flex-direction: column; }

/* ---- Site footer ---- */
/* #app takes the slack, so this sits on the fold of a short screen and below
   the content of a long one, without ever floating over either. */
.site-footer {
  padding: 28px 24px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---- Top nav ---- */
.topnav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(255,255,255,0.35);
}
.wordmark { font-family: var(--font-heading); font-weight: 800; font-size: 18px; cursor: pointer; }
.nav-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-email { font-size: 12px; opacity: 0.85; }
.lang-select {
  font-family: var(--font-body); font-size: 12px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--color-neutral-100); color: var(--color-text);
  border: 1px solid rgba(32,30,29,0.35);
}

/* ---- Pills / tags ---- */
.pill {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 4px 12px; border-radius: 999px;
}
.pill-neutral { background: var(--color-neutral-100); color: #444141; }
.pill-button { border: none; cursor: pointer; font-family: var(--font-body); }
.pill-button:hover { filter: brightness(0.95); }
.pill-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.pill-outline-accent { border: 1px solid var(--color-accent); color: var(--color-accent); }
.pill-gold { background: var(--color-gold); color: var(--color-accent-800); font-weight: 800; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
  font-family: var(--font-heading); font-weight: 800; font-size: 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 22px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-cta { font-size: 15px; padding: 14px 20px; animation: pulse 2.4s ease-in-out infinite; }
.btn-cta:hover { transform: translateY(-2px) scale(1.02); }
.btn-cta-lg { font-size: 16px; padding: 16px 32px; animation: pulse 2.4s ease-in-out infinite; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { transform: none; background: rgba(255,255,255,0.12); }
.btn-outline-dark { background: transparent; color: var(--color-text); border-color: rgba(32,30,29,0.35); }
.btn-outline-dark:hover { transform: none; background: rgba(32,30,29,0.06); }
.btn-outline-accent { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn-outline-accent:hover { transform: none; background: var(--color-accent-100); }
.btn-on-accent { background: #fff; color: var(--color-accent); }
.btn-stripe { background: var(--color-stripe); color: #fff; border-radius: 8px; font-size: 15px; }
.btn-stripe:hover { transform: none; filter: brightness(1.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; filter: none; }
.linklike {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: var(--font-heading); font-weight: 800; font-size: 14px;
  background: transparent; color: #fff; border: none;
  padding: 6px 4px; text-decoration: underline;
}
.linklike-dark { color: var(--color-text); }

/* ---- Cards / layout ---- */
.card {
  background: var(--color-card); color: var(--color-text);
  padding: 14px; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(10,20,50,0.22);
}
.divider { height: 4px; border-radius: 2px; margin: 16px 0; background: rgba(255,255,255,0.3); }
.eyebrow {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #ffd9d0; position: relative;
}
.kicker {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-accent);
}
.blob { position: absolute; border-radius: 50%; pointer-events: none; }

/* ---- Forms ---- */
.field label {
  display: block; font-size: 12px; margin-bottom: 5px; color: rgba(32,30,29,0.7);
}
.field input, .field textarea {
  width: 100%; min-height: 36px; padding: 10px 12px; font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text); background: var(--color-surface);
  border: 1px solid rgba(32,30,29,0.35); border-radius: 10px;
}
.field input[readonly] { opacity: 0.7; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.form-error { color: var(--color-accent-700); font-size: 13px; margin: 0; }

.round-opts { display: flex; gap: 6px; }
.round-opt {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; font-family: var(--font-heading); font-weight: 800;
  font-size: 13px; cursor: pointer; border-radius: 999px;
  background: transparent; color: var(--color-text); border: 1px solid rgba(32,30,29,0.35);
}
.round-opt.selected { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* ---- Marketing / landing ---- */
.marketing-wrap {
  max-width: 900px; margin: 0 auto; padding: 72px 32px 64px; width: 100%;
  position: relative; text-align: center;
}
.marketing-clip { position: relative; overflow: hidden; flex: 1; }
.music-toggle { position: absolute; top: 28px; left: 32px; }
.marketing-h1 { font-size: 60px; margin: 8px auto 16px; }
.marketing-sub { font-size: 18px; max-width: 620px; margin: 0 auto 28px; opacity: 0.9; }
.preview-card {
  max-width: 520px; margin: 0 auto 36px; text-align: left;
  background: var(--color-surface); color: var(--color-text);
  border-radius: 16px; padding: 16px; position: relative;
  box-shadow: 0 14px 34px rgba(10,20,50,0.4);
}
.preview-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.preview-team { font-family: var(--font-heading); font-weight: 800; font-size: 15px; }
.preview-round { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); font-weight: 800; }
.preview-stats { margin-left: auto; display: flex; gap: 6px; }
.preview-badge {
  position: absolute; top: -14px; right: 16px;
  background: var(--color-gold); color: var(--color-accent-800);
  font-family: var(--font-heading); font-weight: 800; font-size: 11px;
  padding: 5px 12px; border-radius: 999px; box-shadow: 0 4px 10px rgba(10,20,50,0.3);
}
.preview-passage { font-size: 15px; line-height: 1.6; margin: 12px 0; }
.preview-passage .read { background: var(--color-accent-100); color: var(--color-accent-700); font-weight: 800; }
.preview-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preview-total { margin-left: auto; font-size: 11px; color: rgba(32,30,29,0.55); }
.marketing-note { font-size: 13px; margin-top: 16px; }
.marketing-trial { font-size: 12px; color: #ffd9d0; }

/* ---- Login ---- */
.login-wrap { max-width: 420px; margin: 80px auto; padding: 0 24px; width: 100%; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.or-divider {
  display: flex; align-items: center; gap: 10px;
  color: rgba(32,30,29,0.5); font-size: 12px;
}
.or-divider::before, .or-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(32,30,29,0.25);
}
/* The Google Identity Services button can't be restyled, so it sits invisibly
   on top of ours: clicks hit the real GIS button, the eye sees house style. */
.sso-google { position: relative; }
.sso-google .gsi-slot { position: absolute; inset: 0; opacity: 0; overflow: hidden; }
/* The clickable element is GIS's iframe, and it ships a `margin: -2px -10px`
   that would leave the right edge of our button dead — so flatten every layer
   down to the iframe onto the slot exactly. */
.sso-google .gsi-slot > *,
.sso-google .gsi-slot iframe {
  width: 100% !important; height: 100% !important;
  margin: 0 !important; left: 0 !important; top: 0 !important;
}
/* Our button is covered, so hover has to come from the wrapper. */
.sso-google:hover .btn-outline-dark { background: rgba(32,30,29,0.06); }
.google-g { flex: none; }
/* Sign-up needs more room than the old two-field code card. */
.login-wrap { max-width: 480px; }
.login-sub { font-size: 14px; opacity: 0.85; margin: 8px 0 18px; }
.auth-hint { font-size: 12px; color: rgba(32,30,29,0.6); text-align: center; margin: 0; }
.auth-who { font-size: 13px; margin: 0; color: rgba(32,30,29,0.8); }
.field-help { font-size: 12px; color: rgba(32,30,29,0.55); margin: 6px 0 0; }
/* The reveal sits inside the field's box rather than beside it, so showing a
   password never reflows the form under the cursor. */
.pw-row { position: relative; display: flex; align-items: center; }
.pw-row input { flex: 1; padding-right: 64px; }
.pw-reveal {
  position: absolute; right: 12px;
  background: none; border: 0; padding: 4px;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--color-accent-700); cursor: pointer;
}
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pw-meter-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(32,30,29,0.15); overflow: hidden; }
.pw-meter-bar span {
  display: block; height: 100%; width: 0;
  background: var(--color-accent); transition: width 0.2s ease;
}
.pw-meter-bar span.weak { background: rgba(32,30,29,0.35); }
.pw-meter-label { font-size: 12px; font-weight: 700; color: rgba(32,30,29,0.7); white-space: nowrap; }

/* ---- About ---- */
.linklike-nav {
  background: none; border: 0; padding: 4px;
  font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
/* overflow:hidden clips the decorative blob, which is wider than a phone
   and would otherwise push the whole page sideways — same reason
   .home-wrap and .final-wrap carry it. */
.about-wrap { max-width: 900px; margin: 0 auto; padding: 48px 32px 64px; width: 100%; position: relative; overflow: hidden; }
.about-h1 { font-size: 44px; line-height: 1.05; margin: 8px 0 0; }
.about-sub { font-size: 16px; opacity: 0.85; max-width: 620px; margin: 14px 0 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.about-card { display: flex; flex-direction: column; gap: 8px; }
.about-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.about-quote {
  margin-top: 24px; padding: 22px 26px; border-radius: 18px;
  background: var(--color-accent); color: #fff;
  font-family: var(--font-heading); font-weight: 800; font-size: 24px; line-height: 1.25;
}

/* ---- Contact ---- */
/* Shares .about-wrap's width, padding and clipped blob — the same kind of
   page, so it should not carry a second set of numbers that drift apart. */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px; align-items: start;
}
.contact-form { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
/* Louder than the account forms' labels: this page is read cold by someone
   who has never seen the app, so the four things to fill in should be legible
   at a glance rather than merely present. */
.contact-form .field label {
  text-transform: uppercase; letter-spacing: 0.07em;
  font-size: 11px; font-weight: 700; color: rgba(32,30,29,0.75);
}
.contact-select {
  width: 100%; min-height: 36px; padding: 10px 12px; font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text); background: var(--color-surface);
  border: 1px solid rgba(32,30,29,0.35); border-radius: 10px;
}
.contact-form textarea { resize: vertical; min-height: 108px; }
.contact-aside { display: flex; flex-direction: column; gap: 16px; }
/* Not .card: these are notes on the dark page, not surfaces you act on, and a
   second white panel beside the form reads as a second thing to fill in. */
.contact-note {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px; padding: 16px; color: #fff;
  display: flex; flex-direction: column; gap: 6px;
}
.contact-note .card-copy { opacity: 0.75; }
.contact-mailto { color: #fff; font-weight: 700; font-size: 14px; word-break: break-all; }

/* ---- Best Distractor certificate ---- */
.cert-page { max-width: 760px; margin: 0 auto; padding: 32px 24px 56px; width: 100%; }
.cert-gate { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.cert-gate-note { font-size: 13px; opacity: 0.8; }
/* Two nested borders in gold, the way a joke certificate insists on being
   framed. The inner sheet carries the cream; the outer is the frame. */
.cert-sheet {
  background: var(--color-gold); border-radius: 14px; padding: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.cert-sheet-inner {
  position: relative; overflow: hidden;
  background: #fdf6e3; color: #2b2118;
  border: 1px solid rgba(43,33,24,0.18); border-radius: 6px;
  /* The bottom gutter is deep enough for the stamp to sit over the signature
     block without reaching back up into the stat tiles. */
  padding: 40px 44px 46px; text-align: center;
}
.cert-top {
  font-size: 13px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-accent-700);
}
.cert-rule { width: 70px; height: 2px; background: rgba(43,33,24,0.3); margin: 12px auto 18px; }
.cert-awarded, .cert-of {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(43,33,24,0.65);
}
.cert-title {
  font-family: var(--font-heading); font-weight: 800; font-size: 40px; line-height: 1.05;
  color: var(--color-accent); text-transform: uppercase; margin: 6px 0 4px;
}
.cert-winner { font-family: var(--font-heading); font-weight: 800; font-size: 42px; margin: 18px 0 12px; }
.cert-blurb { font-size: 15px; line-height: 1.55; max-width: 460px; margin: 0 auto; }
.cert-stats { display: flex; gap: 14px; margin: 26px 0 22px; }
.cert-stat {
  flex: 1; background: #fff; border: 1px solid rgba(43,33,24,0.12);
  border-radius: 10px; padding: 14px 10px;
}
.cert-stat-value { font-family: var(--font-heading); font-weight: 800; font-size: 30px; color: var(--color-accent); }
/* A word, not a number — it has to fit the same tile without setting itself
   in 30px and wrapping to three lines. */
.cert-stat-word { font-size: 17px; line-height: 1.2; }
.cert-stat-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(43,33,24,0.6); margin-top: 4px;
}
.cert-sign { display: flex; gap: 40px; margin-top: 34px; text-align: left; }
.cert-sign > div { flex: 1; border-top: 1px solid rgba(43,33,24,0.35); padding-top: 6px; }
.cert-sign-name { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.cert-sign-role { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(43,33,24,0.55); }
.cert-stamp {
  position: absolute; right: 30px; bottom: 22px; z-index: 1;
  width: 104px; height: 104px; border-radius: 50%;
  border: 3px solid var(--color-accent); color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1.35; transform: rotate(-14deg); opacity: 0.75;
}
/* Keeps the date readable under the stamp rather than behind it. */
.cert-sign > div:last-child { padding-right: 96px; }
.cert-foot { font-size: 12px; color: rgba(43,33,24,0.6); margin: 22px 0 0; }
.cert-actions { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* Printing is the point of the certificate, so everything that is not the
   sheet gets out of the way — nav, footer, buttons, and the navy background. */
@media print {
  body { background: #fff; }
  body.gradient { background: #fff; }
  .topnav, .site-footer, .cert-actions, .cert-gate, #modals { display: none !important; }
  .cert-page { padding: 0; max-width: none; }
  .cert-sheet { box-shadow: none; }
}

/* ---- Home ---- */
.home-wrap { max-width: 1100px; margin: 0 auto; padding: 72px 32px; width: 100%; position: relative; overflow: hidden; }
.home-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.home-form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.home-h1 { font-size: 60px; max-width: 820px; }
.home-sub { font-size: 18px; max-width: 600px; opacity: 0.85; }

/* ---- Join ---- */
.join-wrap { max-width: 480px; margin: 60px auto; padding: 0 24px; width: 100%; }
.join-sub { font-size: 15px; opacity: 0.85; margin: 8px 0 0; }
.join-form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
/* The code is read off a phone screen and typed one digit at a time, so it is
   set large and tracked out rather than left as body text. */
.code-field { display: flex; align-items: center; gap: 12px; }
.code-input {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  letter-spacing: 0.18em;
}
/* Focus is on this field the moment a code is rejected, so the focus ring has
   to carry the error too — a blue ring on a red field reads as "fine". */
.code-input-bad { border-color: var(--color-accent) !important; outline-color: var(--color-accent); }
.code-from-link { font-size: 12px; font-weight: 700; color: #1a7f37; white-space: nowrap; }
.code-clock { font-size: 12px; color: rgba(32,30,29,0.6); margin: 6px 0 0; }
.code-help { font-size: 12px; color: rgba(32,30,29,0.7); margin: 0; }

/* ---- Lobby ---- */
.lobby-wrap { max-width: 900px; margin: 0 auto; padding: 56px 32px; width: 100%; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.share-card { display: flex; flex-direction: column; gap: 8px; box-shadow: none; }
.share-label { font-size: 11px; color: rgba(32,30,29,0.5); }
.share-row { display: flex; align-items: center; gap: 12px; }
.share-link { font-size: 13px; opacity: 0.75; word-break: break-all; }
/* The query string is the half that expires — coloured so a host glancing at
   the card can see the code they are about to hand out. */
.link-code { color: var(--color-accent); }
.copy-btn { padding: 10px 18px; }
.share-note { font-size: 12px; opacity: 0.75; margin: 8px 0 0; }
.link-caption { font-size: 12px; opacity: 0.75; margin-top: 8px; }
.code-block { border-top: 1px solid rgba(32,30,29,0.12); padding-top: 10px; margin-top: 2px; }
.code-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.code-refresh { text-align: right; margin-left: auto; }
.code-left { font-size: 13px; font-weight: 700; color: var(--color-accent); }
.share-code { font-family: var(--font-heading); font-size: 28px; letter-spacing: 0.08em; }
/* Runs down over the life of one code, so "refreshes in" reads at a glance. */
.code-bar { height: 4px; border-radius: 4px; background: rgba(32,30,29,0.12); margin-top: 10px; overflow: hidden; }
.code-bar span { display: block; height: 100%; background: var(--color-accent); transition: width 1s linear; }
.custom-passage { margin-top: 16px; }
/* The "why you can't use this" variant of the card above — same footprint, so
   unlocking Max doesn't shift the column. */
.custom-passage-locked { display: flex; flex-direction: column; gap: 6px; }
.custom-passage-locked .card-title { opacity: 0.55; }
.custom-passage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-passage textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; min-height: 84px; resize: vertical; margin-top: 8px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(32,30,29,0.7); cursor: pointer; }
.roster { display: flex; flex-direction: column; gap: 8px; }
.roster-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--color-card); color: var(--color-text); border-radius: 14px;
}
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 14px;
  box-shadow: 0 2px 6px rgba(10,20,50,0.25);
}
.roster-name { flex: 1; font-size: 14px; }
.lobby-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.lobby-caption { font-size: 13px; opacity: 0.8; }

/* ---- Round intro ---- */
.intro-wrap { max-width: 720px; margin: auto; padding: 56px 32px; width: 100%; }
.intro-h1 { font-size: 56px; margin-top: 16px; }
.intro-sub { font-size: 17px; opacity: 0.85; max-width: 520px; }
.intro-card { margin-top: 24px; max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-family: var(--font-heading); font-weight: 800; font-size: 17px; line-height: 1.2; }
.card-copy { margin: 0; font-size: 13px; opacity: 0.8; }

/* ---- Reading ---- */
.reading-wrap { max-width: 820px; margin: 0 auto; padding: 32px; width: 100%; position: relative; }
.reading-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.reading-stats { display: flex; gap: 20px; font-family: var(--font-heading); font-size: 20px; }
.speech-fallback { font-size: 13px; color: #ffd9d0; margin-top: 8px; }
.passage {
  margin-top: 20px; padding: 32px;
  font-size: 26px; line-height: 1.7; font-family: var(--font-heading); font-weight: 400;
  background: var(--color-card); color: var(--color-text);
  box-shadow: 0 8px 24px rgba(10,20,50,0.25);
  border-radius: 20px; border-top: 6px solid var(--color-accent);
}
.passage .word {
  display: inline-block; margin-right: 0.3em;
  transition: color .15s, background .2s;
  color: var(--color-text); opacity: 0.9;
}
.passage .word.read { color: var(--color-accent-700); opacity: 1; }
.passage .word.current { background: var(--color-accent-100); color: var(--color-text); opacity: 1; padding: 0 2px; }
.passage .word.flash { background: var(--color-accent-300); }
.passage .word.wiggle { animation: wiggle .5s ease-in-out 2; }
.passage .word.grammar { font-style: italic; color: var(--color-accent-700); opacity: 1; }
.passage .word.grow { animation: growWord 1.4s ease; }
/* Aiming: hecklers tap a word to target their next distraction at it */
.passage.aim-ready .word { cursor: pointer; }
.passage .word.aimed {
  outline: 2px dashed var(--color-gold); outline-offset: 2px;
  border-radius: 4px; opacity: 1;
}
.passage .emoji { display: inline-block; animation: popIn .3s ease; font-size: 20px; margin-right: 0.3em; }
.toast {
  position: fixed; right: 24px;
  background: var(--color-toast); color: #fff;
  padding: 10px 14px; font-size: 13px; max-width: 260px;
  box-shadow: 0 12px 32px rgba(45,43,43,0.22);
  animation: toastIn .3s ease; z-index: 50;
}
.finish-note { margin-top: 20px; font-size: 13px; opacity: 0.75; }
.sabotage {
  margin-top: 24px; padding: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
}
.sabotage-title {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-family: var(--font-heading); font-weight: 800;
  opacity: 0.85; margin-bottom: 12px;
}
.sabotage-btns { display: flex; gap: 8px; flex-wrap: wrap; }
/* Who is holding the phone. Sits above the buttons because it qualifies every
   one of them — a chip changes what the next tap means. */
.firing-as { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.firing-label { font-size: 12px; opacity: 0.7; }
.firing-chip {
  background: transparent; color: #fff; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.4); border-radius: 999px;
  padding: 5px 13px; font: inherit; font-size: 12px; font-weight: 700;
  transition: background .15s, border-color .15s;
}
.firing-chip:hover { background: rgba(255,255,255,0.12); }
.firing-chip.on { background: var(--color-accent); border-color: var(--color-accent); }
.babang {
  position: fixed; inset: 0; display: grid; place-items: center;
  pointer-events: none; z-index: 200;
}
.babang span {
  font-family: var(--font-heading); font-weight: 800; font-size: 64px;
  color: var(--color-accent);
  text-shadow: 0 4px 18px rgba(20,36,82,0.45);
  animation: babang 1.1s ease forwards;
}

/* ---- Round result ---- */
.result-wrap { max-width: 600px; margin: auto; padding: 56px 32px; width: 100%; }
.result-h1 { font-size: 44px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.stat-card { display: flex; flex-direction: column; gap: 8px; box-shadow: none; }
.stat-value { font-family: var(--font-heading); font-weight: 800; font-size: 32px; }

/* ---- Scoreboard / tables ---- */
.board-wrap { max-width: 760px; margin: 0 auto; padding: 56px 32px; width: 100%; }
.table-card { background: var(--color-card); color: var(--color-text); padding: 16px; margin-top: 16px; border-radius: 16px; overflow-x: auto; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board-h1 { font-size: 40px; }
.screen-h2 { font-size: 32px; }
.lobby-h1 { font-size: 44px; }
.table-card th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(32,30,29,0.6); padding: 8px; border-bottom: 2px solid rgba(32,30,29,0.25);
}
.table-card td { padding: 8px; border-bottom: 1px solid rgba(32,30,29,0.15); }

/* ---- Final ---- */
.final-wrap { max-width: 820px; margin: 0 auto; padding: 56px 32px; width: 100%; position: relative; overflow: hidden; }
.final-h1 { font-size: 48px; }
.winner-banner {
  margin-top: 20px; padding: 28px;
  background: var(--color-accent); color: #fff;
  box-shadow: 0 10px 28px rgba(10,20,50,0.3);
  border-radius: 20px; display: flex; align-items: center; gap: 20px; position: relative;
}
.winner-avatar {
  width: 72px; height: 72px; flex: none; border-radius: 50%;
  background: var(--color-gold); color: var(--color-accent-800);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 30px;
  box-shadow: 0 4px 12px rgba(10,20,50,0.35);
}
.winner-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.winner-name { font-family: var(--font-heading); font-weight: 800; font-size: 36px; }
.winner-sub { font-size: 14px; opacity: 0.9; }
.upsell {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.final-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ---- Modals (shared) ---- */
.modal-scrim {
  position: fixed; inset: 0; display: grid;
  padding: 16px; background: rgba(45,43,43,0.5); z-index: 100;
  overflow-y: auto;
}
/* Auto margins center the dialog but, unlike place-items: center, let a
   dialog taller than the viewport scroll from its top instead of clipping. */
.modal-scrim > * { margin: auto; }
.modal-card {
  width: min(440px, 100%);
  display: flex; flex-direction: column; gap: 12px; padding: 20px;
  background: var(--color-card); color: var(--color-text);
  box-shadow: 0 16px 40px rgba(10,20,50,0.35); border-radius: 20px;
}
.modal-title { font-family: var(--font-heading); font-weight: 800; font-size: 20px; }
.modal-sub { font-size: 13px; opacity: 0.75; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---- Membership / pricing modal ---- */
.pricing-card { width: min(560px, 100%); }
.trial-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--color-accent-100); border-radius: 12px; padding: 12px 14px;
}
.trial-banner-title { font-family: var(--font-heading); font-weight: 800; font-size: 14px; color: var(--color-accent); }
.trial-banner-sub { font-size: 12px; opacity: 0.8; }
.seg {
  display: inline-flex; gap: 4px; background: rgba(32,30,29,0.08);
  border-radius: 999px; padding: 4px; align-self: flex-start;
}
.seg button {
  font-family: var(--font-heading); font-weight: 800; font-size: 12px;
  border: none; background: transparent; color: var(--color-text);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.seg button.selected { background: var(--color-accent); color: #fff; }
.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan-card {
  border: 1px solid rgba(32,30,29,0.2); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; position: relative;
  background: var(--color-surface);
}
.plan-card.max { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.plan-badge {
  position: absolute; top: -10px; right: 14px;
  background: var(--color-gold); color: var(--color-accent-800);
  font-family: var(--font-heading); font-weight: 800; font-size: 10px;
  letter-spacing: 0.08em; padding: 4px 10px; border-radius: 999px;
}
.plan-name { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.plan-price { font-family: var(--font-heading); font-weight: 800; font-size: 32px; }
.plan-price small { font-size: 13px; font-weight: 400; opacity: 0.7; }
.plan-note { font-size: 11px; opacity: 0.7; }
.plan-features { margin: 4px 0 10px; padding-left: 18px; font-size: 13px; flex: 1; }
.plan-features li { margin-bottom: 5px; }

/* ---- Stripe checkout ---- */
.checkout-card {
  width: min(400px, 100%); background: #fff; color: #1a1f36;
  border-radius: 14px; padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 16px 40px rgba(10,20,50,0.35);
  font-family: system-ui, -apple-system, sans-serif;
}
.checkout-head { display: flex; align-items: baseline; gap: 8px; }
.checkout-head .plan { font-weight: 700; font-size: 16px; }
.checkout-head .sub { font-size: 12px; color: #697386; }
.checkout-close {
  margin-left: auto; border: none; background: transparent; cursor: pointer;
  font-size: 18px; color: #697386; align-self: flex-start;
}
.checkout-amount { font-size: 32px; font-weight: 700; }
.checkout-amount small { font-size: 13px; font-weight: 400; color: #697386; }
.checkout-renews { font-size: 12px; color: #697386; margin: -8px 0 0; }
.checkout-field label { display: block; font-size: 12px; color: #30313d; margin-bottom: 4px; }
.checkout-field input {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 1px solid #d5dbe1; border-radius: 6px; color: #1a1f36;
  font-family: inherit;
}
.checkout-field input[readonly] { background: #f6f8fa; color: #697386; }
.checkout-cardgroup input { border-radius: 0; margin-top: -1px; }
.checkout-cardgroup input:first-child { border-radius: 6px 6px 0 0; margin-top: 0; }
.checkout-cardgroup .split { display: flex; }
.checkout-cardgroup .split input { width: 50%; }
.checkout-cardgroup .split input:first-child { border-radius: 0 0 0 6px; margin-top: -1px; }
.checkout-cardgroup .split input:last-child { border-radius: 0 0 6px 0; margin-left: -1px; }
.checkout-foot { font-size: 11px; color: #697386; text-align: center; }
.checkout-foot b { color: #30313d; }

/* ---- Certificate teaser + certificate ---- */
.teaser-card { text-align: center; align-items: center; }
.teaser-emoji { font-size: 34px; }
.teaser-title { font-family: var(--font-heading); font-weight: 800; font-size: 20px; }
.teaser-sub { font-size: 13px; opacity: 0.7; margin: 0; }
.teaser-lock {
  width: 100%; background: var(--color-accent-100); color: var(--color-accent);
  font-size: 13px; font-weight: 800; font-family: var(--font-heading);
  border-radius: 10px; padding: 10px 12px;
}
.cert-card {
  width: min(560px, 100%);
  background: #fdf6df; color: var(--color-text);
  border: 3px solid var(--color-gold); outline: 1px solid var(--color-gold);
  outline-offset: -8px;
  border-radius: 14px; padding: 36px 32px;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  text-align: center;
  box-shadow: 0 16px 40px rgba(10,20,50,0.35);
}
.cert-kicker {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-accent); font-family: var(--font-heading); font-weight: 800;
}
.cert-name { font-family: var(--font-heading); font-weight: 800; font-size: 36px; color: var(--color-accent-800); }
.cert-body { font-size: 14px; max-width: 420px; margin: 0; }
.cert-speed { font-size: 14px; margin: 0; }
.cert-expiry { font-size: 12px; opacity: 0.65; max-width: 380px; margin: 0; }

/* ---- Account pill + dropdown ---- */
.account-slot { position: relative; }
.account-pill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-body); font-size: 12px; color: #fff;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 5px 12px 5px 5px;
}
.account-pill:hover { background: rgba(255,255,255,0.16); }
.account-pill-email { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { font-size: 10px; opacity: 0.8; }
.avatar-xs { width: 24px; height: 24px; font-size: 11px; background: var(--color-accent); }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; background: var(--color-accent); }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; background: var(--color-accent); }

.account-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 120;
  width: 270px; padding: 8px;
  background: var(--color-surface); color: var(--color-text);
  border-radius: 16px; box-shadow: 0 18px 44px rgba(6,12,32,0.45);
}
.account-menu-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 12px; }
.account-menu-id { flex: 1; min-width: 0; }
.account-menu-name { font-family: var(--font-heading); font-weight: 800; font-size: 15px; }
.account-menu-email {
  font-size: 11px; opacity: 0.65;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-menu-section {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(32,30,29,0.5); padding: 10px 10px 4px;
  border-top: 1px solid rgba(32,30,29,0.12);
}
.account-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer;
  padding: 10px; border: none; border-radius: 10px;
  background: transparent; color: var(--color-text);
  font-family: var(--font-body); font-size: 14px; text-align: left;
}
.account-menu-item:hover, .account-menu-item.current { background: rgba(32,30,29,0.07); }
.account-menu-icon { width: 20px; text-align: center; }
.account-menu-label { flex: 1; }
.account-menu-count { font-size: 12px; opacity: 0.55; }
.account-menu-chevron { opacity: 0.4; }
.account-menu-rule { height: 1px; background: rgba(32,30,29,0.12); margin: 6px 0; }
.account-menu-logout { font-family: var(--font-heading); font-weight: 800; }

/* ---- Shared panel screens (practice, account, history, vault) ---- */
.panel-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 32px 64px; width: 100%; }
.screen-head { margin-bottom: 24px; }
.screen-kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  font-family: var(--font-heading); font-weight: 800; color: #ffd9d0;
}
.screen-h1 { font-size: 34px; margin: 8px 0 6px; }
.screen-sub { font-size: 14px; opacity: 0.8; max-width: 640px; }
.loading-card { text-align: center; opacity: 0.8; }
.panel-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 24px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 16px; }
.hint { font-size: 12px; opacity: 0.75; margin: 8px 0 0; }
.card-title { font-family: var(--font-heading); font-weight: 800; font-size: 17px; line-height: 1.2; }

/* Segmented pickers and switches, shared by practice setup and preferences */
.seg-light { background: rgba(32,30,29,0.07); flex-wrap: wrap; }
.seg-light button { font-size: 12px; }
.seg-light button:disabled { opacity: 0.4; cursor: not-allowed; }
.switch {
  width: 46px; height: 26px; flex: none; cursor: pointer; padding: 3px;
  border: none; border-radius: 999px; background: rgba(32,30,29,0.25);
  transition: background .15s ease;
}
.switch span {
  display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(10,20,50,0.35); transition: transform .15s ease;
}
.switch.on { background: var(--color-accent); }
.switch.on span { transform: translateX(20px); }

/* ---- Practice: set up your run ---- */
.setup-card { display: flex; flex-direction: column; gap: 16px; }
.field-block { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; color: rgba(32,30,29,0.7); }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--color-accent); }
.slider-value { font-family: var(--font-heading); font-weight: 800; font-size: 13px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-title { font-family: var(--font-heading); font-weight: 800; font-size: 14px; }
.toggle-sub { font-size: 12px; opacity: 0.7; }
.setup-card textarea { min-height: 90px; resize: vertical; }
.result-banner {
  grid-column: 1 / -1;
  background: var(--color-gold); color: var(--color-accent-800);
  border-radius: 12px; padding: 10px 14px; font-size: 14px;
}

/* ---- Practice: your numbers ---- */
.numbers-card, .runs-card { display: flex; flex-direction: column; gap: 12px; }
.numbers-row { display: flex; gap: 24px; }
.numbers-value { font-family: var(--font-heading); font-weight: 800; font-size: 30px; line-height: 1; }
.numbers-label { font-size: 11px; opacity: 0.65; margin-top: 4px; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 60px; }
.trend-bar { flex: 1; border-radius: 5px; background: rgba(32,30,29,0.18); }
.trend-bar.hit { background: var(--color-accent); }
.numbers-caption { font-size: 11px; opacity: 0.6; }
.run-rows { display: flex; flex-direction: column; }
.run-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(32,30,29,0.12);
}
.run-row:last-child { border-bottom: none; }
.run-id { flex: 1; min-width: 0; }
.run-title { font-size: 14px; }
.run-meta { font-size: 11px; opacity: 0.6; }
.run-score { text-align: right; }
.run-wpm { font-family: var(--font-heading); font-weight: 800; font-size: 18px; }
.run-acc { font-size: 11px; opacity: 0.6; }

/* ---- Distraction practice ---- */
.drill-body { display: flex; flex-direction: column; gap: 18px; }
.weak-banner {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px; padding: 14px 16px;
}
.weak-icon { font-size: 20px; }
.weak-banner > div:nth-child(2) { flex: 1; }
.weak-title { font-family: var(--font-heading); font-weight: 800; font-size: 15px; }
.weak-sub { font-size: 12px; opacity: 0.8; }
.btn-gold { background: var(--color-gold); color: var(--color-accent-800); }
.drill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.drill-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--color-card); color: var(--color-text);
  border-radius: 14px; box-shadow: 0 1px 2px rgba(10,20,50,0.22);
}
.drill-card.locked { opacity: 0.75; }
.drill-card-head { display: flex; align-items: center; gap: 8px; }
.drill-emoji { font-size: 18px; }
.drill-label { flex: 1; font-family: var(--font-heading); font-weight: 800; font-size: 14px; }
.meter { position: relative; height: 6px; border-radius: 3px; background: rgba(32,30,29,0.15); }
.meter-fill { height: 100%; border-radius: 3px; background: var(--color-accent); }
/* The slider sits invisibly over its own meter: the bar is the control. */
.meter-input {
  position: absolute; inset: -8px 0; width: 100%; margin: 0;
  opacity: 0; cursor: ew-resize;
}
.meter-input:focus-visible { opacity: 0.35; }
.drill-foot { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.7; }
.drill-foot .danger { color: var(--color-accent-700); opacity: 1; font-weight: 800; }
.drill-lock {
  cursor: pointer; border: 1px solid rgba(32,30,29,0.3); background: transparent;
  color: var(--color-text); border-radius: 999px; padding: 4px 10px;
  font-family: var(--font-heading); font-weight: 800; font-size: 10px;
}
.preview-panel {
  background: rgba(255,255,255,0.07); color: #fff;
  border: 1px solid rgba(255,255,255,0.18); box-shadow: none;
  position: relative; overflow: hidden; padding: 16px;
}
.preview-panel-head { display: flex; align-items: center; justify-content: space-between; }
.preview-panel .kicker { color: #ffd9d0; }
.preview-emoji { font-size: 18px; }
.preview-text { font-size: 18px; line-height: 1.7; margin-top: 10px; }
.preview-text .pv-word { display: inline-block; transition: background .2s; }
.preview-text .pv-word.flash { background: var(--color-gold); color: var(--color-text); }
.preview-text .pv-word.wiggle { animation: wiggle .5s ease-in-out 2; }
.preview-text .pv-word.grammar { font-style: italic; color: #ffd9d0; }
.preview-text .emoji { display: inline-block; animation: popIn .3s ease; }
.preview-text.shake { animation: shake .6s ease; }
.preview-notification {
  position: absolute; right: 16px; bottom: 16px; max-width: 200px;
  background: #fff; color: var(--color-text); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; animation: popIn .25s ease;
  box-shadow: 0 8px 20px rgba(6,12,32,0.4);
}
.preview-notification b { display: block; }
.drill-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.drill-actions .btn-primary { flex: 1; }

/* ---- Account & membership ---- */
.account-wrap { max-width: 860px; display: flex; flex-direction: column; gap: 18px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-id { flex: 1; min-width: 0; }
.profile-name { font-family: var(--font-heading); font-weight: 800; font-size: 26px; }
.profile-email { font-size: 13px; opacity: 0.75; }
.screen-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.screen-tab {
  cursor: pointer; border-radius: 999px; padding: 8px 18px;
  font-family: var(--font-heading); font-weight: 800; font-size: 13px;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4);
}
.screen-tab.selected { background: #fff; color: var(--color-text); }
.plan-panel { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.plan-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-panel-title { font-family: var(--font-heading); font-weight: 800; font-size: 19px; }
.plan-panel-sub { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.pill-active { background: var(--color-accent-100); color: var(--color-accent-700); font-weight: 800; }
.pill-hot { background: var(--color-accent); color: #fff; font-weight: 800; }
.card-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(32,30,29,0.06); border-radius: 10px; padding: 10px 12px;
}
.payment-text { flex: 1; font-size: 13px; }
.plan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cancel-note { font-size: 12px; opacity: 0.65; }
.invoices { border-top: 1px solid rgba(32,30,29,0.14); padding-top: 12px; }
.invoices-title { font-size: 11px; opacity: 0.6; margin-bottom: 4px; }
.invoice-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 13px; border-bottom: 1px solid rgba(32,30,29,0.1);
}
.invoice-row:last-child { border-bottom: none; }
.invoice-row.muted { opacity: 0.6; }
.linklike-accent {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--color-accent); font-family: var(--font-heading); font-weight: 800; font-size: 13px;
}
.prefs-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.pref-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid rgba(32,30,29,0.12);
}
.pref-row:last-child { border-bottom: none; }
.pref-title { font-size: 14px; }
.pref-sub { font-size: 12px; opacity: 0.65; }
.account-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.danger-link { color: var(--color-accent-300); }

/* ---- History ---- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-tile {
  background: rgba(255,255,255,0.08); color: #fff; box-shadow: none;
  border: 1px solid rgba(255,255,255,0.16); padding: 16px;
}
.stat-tile-value { font-family: var(--font-heading); font-weight: 800; font-size: 30px; }
.stat-tile-label { font-size: 11px; opacity: 0.75; margin-top: 4px; }
.list-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-note { font-size: 11px; opacity: 0.6; }
.list-rows { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid rgba(32,30,29,0.12);
}
.list-row:last-child { border-bottom: none; }
.place-badge {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(32,30,29,0.15); color: var(--color-text);
  font-family: var(--font-heading); font-weight: 800; font-size: 12px;
}
.place-badge.gold { background: var(--color-gold); color: var(--color-accent-800); }
.list-id { flex: 1; min-width: 0; }
.list-title { font-size: 14px; }
.list-meta { font-size: 11px; opacity: 0.6; }
.list-score { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.list-score .unit { font-size: 10px; opacity: 0.6; }
.list-acc { font-size: 12px; opacity: 0.6; width: 40px; text-align: right; }
.bar-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-emoji { font-size: 16px; }
.bar-id { width: 150px; flex: none; }
.bar-title { font-size: 13px; }
.bar-meta { font-size: 11px; opacity: 0.6; }
.bar-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(32,30,29,0.14); }
.bar-fill { height: 100%; border-radius: 4px; background: rgba(32,30,29,0.45); }
.bar-fill.hot { background: var(--color-accent); }
.bar-value { font-family: var(--font-heading); font-weight: 800; font-size: 13px; width: 34px; text-align: right; }
.bar-caption { font-size: 11px; opacity: 0.55; margin: 0; }

/* ---- Certificate vault ---- */
.vault-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.vault-filter {
  cursor: pointer; border-radius: 999px; padding: 7px 14px;
  font-family: var(--font-heading); font-weight: 800; font-size: 12px;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4);
}
.vault-filter.selected { background: #fff; color: var(--color-text); }
.vault-filter-count { opacity: 0.6; }
.vault-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.vault-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px;
  background: #fdf6df; color: var(--color-text);
  border: 2px solid var(--color-gold); border-radius: 14px;
}
.vault-card.distractor { border-color: var(--color-accent); }
.vault-card.expired { opacity: 0.62; }
.vault-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vault-kicker {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  font-family: var(--font-heading); font-weight: 800; color: var(--color-accent);
}
.vault-name { font-family: var(--font-heading); font-weight: 800; font-size: 19px; }
.vault-line { font-size: 13px; }
.vault-dates { font-size: 11px; opacity: 0.6; margin-bottom: 6px; }
.vault-card-actions { display: flex; gap: 8px; margin-top: auto; }
.vault-more {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  background: rgba(255,255,255,0.07); color: #fff; box-shadow: none;
  border: 1px dashed rgba(255,255,255,0.3);
}
.vault-more-title { font-family: var(--font-heading); font-weight: 800; font-size: 16px; }
.vault-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: rgba(255,255,255,0.07); border-radius: 14px; padding: 14px 16px; font-size: 13px;
}

/* ---- Feedback ---- */
.feedback-card { position: relative; }
.modal-close {
  position: absolute; top: 12px; right: 12px; cursor: pointer;
  border: none; background: transparent; font-size: 16px; color: rgba(32,30,29,0.5);
}
.stars { display: flex; gap: 4px; }
.star {
  cursor: pointer; border: none; background: transparent; padding: 0;
  font-size: 34px; line-height: 1; color: rgba(32,30,29,0.2);
}
.star.lit { color: var(--color-gold); }
.rating-word {
  font-family: var(--font-heading); font-weight: 800; font-size: 13px;
  color: var(--color-accent); min-height: 18px;
}
.feedback-card textarea { min-height: 78px; resize: vertical; }
.feedback-actions { display: flex; align-items: center; gap: 14px; }

/* ---- Countdown distraction + toasts ---- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
.passage.shake { animation: shake .8s ease; }
.countdown {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  z-index: 60; padding: 8px 18px; border-radius: 999px;
  background: var(--color-accent); color: #fff;
  font-family: var(--font-heading); font-weight: 800; font-size: 22px;
  box-shadow: 0 10px 26px rgba(236,48,19,0.5);
  animation: pulse 1s ease-in-out infinite;
}
.countdown.out { animation: none; opacity: 0.4; }
.flash-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 150;
  background: var(--color-toast); color: #fff; border-radius: 999px;
  padding: 10px 18px; font-size: 13px; max-width: min(420px, calc(100vw - 32px));
  box-shadow: 0 12px 32px rgba(6,12,32,0.45); animation: popIn .2s ease;
}

/* Honours the Reduce motion preference from the account screen, alongside the
   OS-level setting handled at the bottom of this file. */
body.reduce-motion .btn-cta,
body.reduce-motion .btn-cta-lg,
body.reduce-motion .countdown { animation: none; }
body.reduce-motion .passage .word.wiggle,
body.reduce-motion .passage .word.grow,
body.reduce-motion .preview-text .pv-word.wiggle,
body.reduce-motion .passage.shake,
body.reduce-motion .preview-text.shake { animation: none; }
body.reduce-motion .btn:hover { transform: none; }

[hidden] { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  /* Three effect cards across needs ~700px of content width to stay legible. */
  .drill-grid, .vault-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .home-grid, .lobby-grid, .plans-grid, .panel-grid { grid-template-columns: 1fr; }
  .home-h1, .marketing-h1 { font-size: 42px; }
  .intro-h1 { font-size: 40px; }
  .final-h1, .result-h1 { font-size: 34px; }
  .panel-wrap { padding: 28px 20px 48px; }
  .drill-grid, .vault-grid { grid-template-columns: 1fr; }
  .bar-id { width: 110px; }
}

/* ---- Phones (the 390px layouts) ---- */
@media (max-width: 640px) {
  .topnav { padding: 10px 12px; gap: 8px; }
  .account-pill-email { max-width: 130px; }
  /* Anchored to the nav rather than the button: a 270px menu hanging off a
     right-aligned pill would otherwise run off the left edge on a small phone. */
  .account-menu { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }

  .panel-wrap { padding: 22px 14px 44px; }
  .screen-h1 { font-size: 26px; }
  .screen-sub { font-size: 13px; }
  .panel-grid { gap: 14px; }
  .side-col { gap: 14px; }

  .numbers-row { justify-content: space-between; gap: 8px; }
  .numbers-value { font-size: 24px; }
  .trend { height: 46px; }

  .weak-banner { flex-wrap: wrap; }
  .weak-banner .btn { width: 100%; }
  .drill-actions { flex-direction: column; }
  .drill-actions .btn { width: 100%; }
  .preview-text { font-size: 16px; }
  .preview-notification { position: static; max-width: none; margin-top: 12px; }

  .profile-name { font-size: 21px; }
  .profile-head { gap: 10px; }
  .screen-tab, .vault-filter { padding: 7px 14px; font-size: 12px; }
  .plan-actions .btn { width: 100%; }
  .plan-panel-head { flex-direction: column; }
  .account-foot { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .account-foot .btn { width: 100%; }

  .stat-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat-tile { padding: 12px 10px; }
  .stat-tile-value { font-size: 22px; }
  .stat-tile-label { font-size: 10px; }
  /* The bar rows lose their fixed label column and stack: name over bar. */
  .bar-row { flex-wrap: wrap; }
  .bar-id { width: auto; flex: 1; }
  .bar-track { flex-basis: 100%; order: 3; }
  .list-row { flex-wrap: wrap; }
  .list-row .linklike-accent { margin-left: auto; }

  .vault-card-actions .btn { flex: 1; }
  .vault-footer { flex-direction: column; align-items: stretch; text-align: center; }

  .star { font-size: 30px; }
  .feedback-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .feedback-actions .btn { width: 100%; }
  .countdown { top: 66px; font-size: 18px; }

  /* About and the certificate: two-column grids and a 44px display face are
     both desktop luxuries. */
  .about-wrap { padding: 32px 16px 48px; }
  .about-h1 { font-size: 30px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-quote { font-size: 19px; padding: 18px 20px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-form .field-row { flex-direction: column; }

  .cert-page { padding: 24px 12px 40px; }
  .cert-sheet-inner { padding: 26px 20px 24px; }
  .cert-title { font-size: 27px; }
  .cert-winner { font-size: 30px; }
  .cert-stats { flex-direction: column; }
  /* The stamp would sit on top of the signatures once the sheet narrows. */
  .cert-stamp { position: static; margin: 20px auto 0; transform: rotate(-8deg); }
  .cert-sheet-inner { padding-bottom: 24px; }
  .cert-sign > div:last-child { padding-right: 0; }
  .cert-actions .btn { width: 100%; }
}

@media (max-width: 640px) {
  /* iOS Safari auto-zooms the page when a focused control's font is under
     16px; every text control must hit 16px on phones. */
  .field input, .field textarea, .checkout-field input,
  .join-form input, .custom-passage textarea, .lang-select,
  .login-form input,
  .setup-card textarea, .feedback-card textarea, .contact-select { font-size: 16px; }

  /* Page shells: the desktop 56–72px gutters eat half a phone screen. */
  .marketing-wrap, .home-wrap, .lobby-wrap, .intro-wrap, .reading-wrap,
  .result-wrap, .board-wrap, .final-wrap { padding: 36px 16px; }
  .login-wrap { margin: 40px auto; padding: 0 16px; }
  .join-wrap { margin: 32px auto; padding: 0 16px; }
  .music-toggle { top: 12px; left: 16px; }
  /* Keep the headline clear of the absolutely-positioned music toggle
     (bottom edge ~46px) on small phones. */
  .marketing-wrap { padding-top: 64px; }

  .home-h1, .marketing-h1 { font-size: 34px; }
  .marketing-sub, .home-sub { font-size: 16px; }
  .intro-h1 { font-size: 32px; }
  .final-h1, .result-h1, .board-h1 { font-size: 28px; }
  .screen-h2 { font-size: 24px; }
  .lobby-h1 { font-size: 30px; }
  .stat-value { font-size: 26px; }
  .reading-stats { font-size: 16px; gap: 14px; }

  .passage { font-size: 19px; padding: 20px 18px; line-height: 1.75; }

  .winner-banner { padding: 20px; gap: 14px; flex-wrap: wrap; }
  .winner-avatar { width: 56px; height: 56px; font-size: 24px; }
  .winner-name { font-size: 26px; }

  .cert-card { padding: 28px 18px; }
  .cert-name { font-size: 28px; }
  .toast { right: 12px; left: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-cta, .btn-cta-lg { animation: none; }
  .passage .word.wiggle, .passage .word.grow { animation: none; }
  .btn:hover, .btn-cta:hover { transform: none; }
}
