/* ============================================================
   VERBONKS — verbblast.css (the game was called Verb Blast before)
   Brand: Verbonks, a Shiba with a bat | verbonks.com
   Look: arcade "toy" UI. Night-blue stage, chunky ink outlines,
   3D push buttons, Lilita One display type.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Special+Elite&family=Great+Vibes&family=Press+Start+2P&family=Lilita+One&family=Nunito:wght@600;700;800;900&display=swap');

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Stage */
  --night:     #0e1838;
  --night-2:   #16234d;
  --panel:     #1f3170;
  --panel-hi:  #2a4190;
  --slot:      #0a1230;
  --ink:       #070b1f;

  /* Legacy names, remapped to the stage (inline styles use them) */
  --bg:        var(--night-2);
  --card:      var(--panel);
  --border:    #33498f;
  --surface:   var(--panel-hi);
  --shadow:    0 6px 0 var(--ink);
  --shadow-lg: 0 10px 0 var(--ink), 0 18px 40px rgba(3,6,20,0.55);

  /* Game colours: base + shade (shade = 3D underside) */
  --gold:      #ffc83d;  --gold-dk:  #d98c00;
  --mint:      #3ee09c;  --mint-dk:  #14a368;
  --red:       #ff5470;  --red-dk:   #c4213f;
  --sky:       #43c4ff;  --sky-dk:   #1285c7;
  --grape:     #b183ff;  --grape-dk: #7a48dc;
  --pink:      #ff7ac8;  --pink-dk:  #c93d8f;

  --green:     var(--mint);   --green-lt:  rgba(62,224,156,0.16);
  --coral:     var(--red);    --coral-lt:  rgba(255,84,112,0.16);
  --yellow:    var(--gold);   --yellow-lt: rgba(255,200,61,0.16);
  --blue:      var(--sky);    --blue-lt:   rgba(67,196,255,0.16);
  --purple:    var(--grape);  --purple-lt: rgba(177,131,255,0.16);
  --pink-lt:   rgba(255,122,200,0.16);

  --text:      #f6f3ff;
  --text-lt:   #c9d2f5;
  --muted:     #8f9cd0;

  /* CEFR level colours */
  --a1: var(--mint);  --a1-lt: var(--green-lt);
  --a2: var(--sky);   --a2-lt: var(--blue-lt);
  --b1: var(--gold);  --b1-lt: var(--yellow-lt);
  --b2: var(--red);   --b2-lt: var(--coral-lt);
  --c1: var(--grape); --c1-lt: var(--purple-lt);
  --c2: var(--pink);  --c2-lt: var(--pink-lt);

  /* Type */
  --font-head: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --font-body: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;

  /* Shape */
  --nav-h: 60px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 8px;
  --edge: 3px solid var(--ink);

  --t: 0.15s ease;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & stage ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(67,196,255,0.28), transparent 70%),
    radial-gradient(circle at 15% 85%, rgba(177,131,255,0.14), transparent 40%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.025) 0 18px, transparent 18px 36px);
  background-attachment: fixed;
}
/* Faint starfield, fixed so it never repaints on scroll */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 42% 66%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 88% 58%, rgba(255,200,61,0.5), transparent),
    radial-gradient(1px 1px at 26% 82%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 62% 34%, rgba(255,255,255,0.3), transparent);
}
#page, #navbar { position: relative; z-index: 1; }

::selection { background: var(--gold); color: var(--ink); }

.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--panel-hi); border-radius: 4px; }

/* Icons (Phosphor fill, inlined as a sprite) */
.ico { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; vertical-align: -0.125em; }

/* Outlined game lettering */
.stroke-text,
.home-greeting, .section-title, .result-title, .secret-title,
.bonus-title, .race-go, .mode-card h3, .level-card h3, .vl-title, .auth-card h2,
.gangs-card h3, .cert-card h3 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: linear-gradient(var(--night) 60%, rgba(14,24,56,0));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  gap: 12px;
}

#nav-logo {
  width: 42px; height: 42px; padding: 0; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 1.35rem; color: var(--text); cursor: pointer;
  background: var(--panel); border: var(--edge); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.15s var(--spring), color 0.15s ease;
}
#nav-logo:hover { color: var(--gold); transform: translateY(-2px); }
#nav-logo:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

#nav-logo-dots { display: flex; gap: 2px; align-items: center; margin-left: 4px; }
#nav-logo-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--border); transition: background var(--t); }
#nav-logo-dots span.lit { background: var(--gold); }

#nav-title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  /* Centered on the bar itself, whatever sits on the left or right */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}
#nav-title .bolt { color: var(--gold); display: inline-flex; -webkit-text-stroke: 0; }
#nav-title .bolt .ico { filter: drop-shadow(0 2px 0 var(--ink)); }
#nav-title .nav-dog { width: 28px; height: 28px; display: block; }
#nav-version {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--muted);
  -webkit-text-stroke: 0;
  align-self: flex-end;
  margin-bottom: 6px;
}

#god-badge {
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--font-head);
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
  animation: godPulse 2s infinite;
}
@keyframes godPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,200,61,0.5); }
  50%     { box-shadow: 0 0 0 6px rgba(255,200,61,0); }
}

#nav-user { flex-shrink: 0; position: relative; z-index: 1; }
#nav-user-btn {
  background: var(--panel);
  border: var(--edge);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
#nav-user-btn:hover { background: var(--panel-hi); }

#nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--panel);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  overflow: hidden;
  animation: dropIn 0.15s ease;
  z-index: 100;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
#nav-dropdown .dd-info { padding: 12px 16px; background: var(--night-2); font-size: 0.8rem; color: var(--text-lt); border-bottom: 2px solid var(--ink); }
#nav-dropdown .dd-info strong { display: block; color: var(--text); font-size: 0.95rem; }
#nav-dropdown button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left; padding: 11px 16px;
  background: none; border: none;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 800;
  color: var(--text); cursor: pointer;
}
#nav-dropdown button:hover { background: var(--panel-hi); }
#nav-dropdown button.logout { color: var(--red); }

/* ============================================================
   PAGE & SCREENS
   ============================================================ */
#page { padding-top: calc(var(--nav-h) + 12px); min-height: 100vh; }

.screen    { max-width: 960px; margin: 0 auto; padding: 0 20px 60px; }
.screen-sm { max-width: 500px; margin: 0 auto; padding: 0 20px 60px; }

/* Shared panel look */
.auth-card, .result-card, .mode-card, .level-card, .hs-item, .vl-modal,
.verb-table-wrap, .game-score-card, .timed-toggle, .recovery-card {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 46%);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow);
}

/* ============================================================
   BUTTONS — 3D push buttons
   ============================================================ */
.btn-primary, .action-btn, .advance-footer button, .btn-secret-enter, .guest-upsell button, .god-btn {
  --b: var(--mint); --b-dk: var(--mint-dk); --b-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--b-fg);
  background: var(--b);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 -6px 0 var(--b-dk), inset 0 3px 0 rgba(255,255,255,0.35), 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover:not(:disabled), .action-btn:hover:not(:disabled),
.advance-footer button:hover, .guest-upsell button:hover { filter: brightness(1.08); }
.btn-primary:active:not(:disabled), .action-btn:active:not(:disabled),
.advance-footer button:active, .btn-secret-enter:active, .guest-upsell button:active, .god-btn:active {
  transform: translateY(4px);
  box-shadow: inset 0 -3px 0 var(--b-dk), inset 0 3px 0 rgba(255,255,255,0.35), 0 1px 0 var(--ink);
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.35rem;
  --b: var(--gold); --b-dk: var(--gold-dk);
}
.btn-primary:disabled { filter: grayscale(0.8) brightness(0.7); cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: var(--panel);
  color: var(--text);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-head);
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-lt);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover { color: var(--gold); }

/* ============================================================
   AUTH
   ============================================================ */
#screen-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: 24px 20px;
}
.auth-card {
  padding: 32px 36px;
  width: 100%;
  max-width: 460px;
  animation: popIn 0.35s var(--spring);
}
.auth-card h2 { font-size: 2.2rem; text-align: center; margin-bottom: 20px; }

.auth-tabs {
  display: flex;
  background: var(--slot);
  border: var(--edge);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: var(--sky); color: var(--ink); box-shadow: inset 0 -3px 0 var(--sky-dk); }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-lt);
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--slot);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 3px 0 rgba(0,0,0,0.35);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: box-shadow var(--t);
}
.form-group input::placeholder { color: #5d6aa3; }
.form-group input:focus,
.form-group select:focus { box-shadow: inset 0 3px 0 rgba(0,0,0,0.35), 0 0 0 3px var(--gold); }
.form-group select:disabled { opacity: 0.5; }
.form-group input.invalid { box-shadow: 0 0 0 3px var(--red); }
.form-group input.valid   { box-shadow: 0 0 0 3px var(--mint); }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.username-status { font-size: 0.78rem; margin-top: 4px; min-height: 18px; }
.username-status.available { color: var(--mint); }
.username-status.taken     { color: var(--red); }
.username-status.checking  { color: var(--muted); }
.pass-hint { font-size: 0.78rem; margin-top: 4px; min-height: 18px; }

.auth-guest { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--muted); }
.auth-guest button {
  background: none; border: none; color: var(--gold);
  font-family: var(--font-body); font-weight: 900; font-size: 0.9rem;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.auth-recovery { text-align: center; }

.recovery-card { padding: 4px 0 0; background: none; border: none; box-shadow: none; }
.recovery-card h3 { font-family: var(--font-head); font-weight: 400; font-size: 1.4rem; margin-bottom: 6px; }
.recovery-card p { color: var(--text-lt); font-size: 0.88rem; margin-bottom: 16px; }
.code-inputs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.code-digit {
  width: 46px; height: 56px;
  text-align: center;
  font-family: var(--font-head); font-size: 1.6rem;
  background: var(--slot); color: var(--text);
  border: var(--edge); border-radius: var(--radius-xs); outline: none;
}
.code-digit:focus { box-shadow: 0 0 0 3px var(--gold); }

/* ============================================================
   HOME
   ============================================================ */
#screen-home { text-align: left; }

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0 22px;
  text-align: center;
}

/* Synthwave hero: the dog in shades over a striped sun, chrome wordmark */
.home-brand { position: relative; display: grid; place-items: center; width: clamp(170px, 46vw, 240px); }
.home-sun {
  position: absolute; left: 6%; right: 6%; top: 4%; aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(#ffe259 0%, #ff9a3c 45%, #ff3c8e 85%);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 52% no-repeat,
                repeating-linear-gradient(#000 0 12px, transparent 12px 17px) bottom / 100% 48% no-repeat;
          mask: linear-gradient(#000 0 0) top / 100% 52% no-repeat,
                repeating-linear-gradient(#000 0 12px, transparent 12px 17px) bottom / 100% 48% no-repeat;
  filter: drop-shadow(0 0 28px rgba(255, 90, 140, 0.55));
}
.home-dog { position: relative; width: 100%; animation: logoIn 0.6s var(--spring) both; }
.synth-logo {
  font-family: 'Bungee', var(--font-head); font-weight: 400; font-style: italic;
  font-size: clamp(2.7rem, 13vw, 5.2rem); line-height: 1; margin-top: -6px;
  transform: skewX(-8deg); user-select: none;
  background: linear-gradient(#fff6a8 10%, #ffc83d 45%, #ff7a1a 70%, #ff3c8e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #2a0a4a;
  filter: drop-shadow(0 4px 0 #2a0a4a) drop-shadow(0 0 16px rgba(255, 90, 170, 0.7));
  animation: logoIn 0.6s var(--spring) both 0.1s;
}
.synth-sub {
  font-family: var(--font-body); font-style: italic; font-weight: 900;
  font-size: clamp(1.05rem, 4.6vw, 1.6rem); color: #7ff6ff; margin-top: 4px;
  text-shadow: 0 2px 0 #1d2a8a, 0 0 14px rgba(80, 220, 255, 0.8);
}

/* Game logo */
.game-logo {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 0.82;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(-4deg);
  user-select: none;
  animation: logoIn 0.6s var(--spring) both;
}
.game-logo span {
  display: block;
  -webkit-text-stroke: 10px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--ink);
}
.logo-verb  { font-size: clamp(3rem, 9vw, 4.6rem); color: var(--gold); }
.logo-blast {
  font-size: clamp(3.4rem, 12vw, 6.2rem);
  color: var(--red);
  display: flex !important;
  align-items: center;
  gap: 0.05em;
}
.logo-blast .ico {
  width: 0.62em; height: 0.62em;
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 22px;
  paint-order: stroke fill;
  filter: drop-shadow(0 5px 0 var(--ink));
  transform: rotate(14deg);
  animation: boltZap 2.8s ease-in-out infinite 0.8s;
}
@keyframes logoIn { from { opacity: 0; transform: rotate(-4deg) scale(0.6); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }
@keyframes boltZap {
  0%, 86%, 100% { transform: rotate(14deg) scale(1); }
  90% { transform: rotate(4deg) scale(1.18); }
  94% { transform: rotate(20deg) scale(0.96); }
}

.home-greeting { font-size: 1.6rem; margin-top: 18px; -webkit-text-stroke-width: 5px; text-shadow: 0 3px 0 var(--ink); }
.home-sub { display: none; }

/* HUD: streak · daily goal · XP */
.home-stats {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  margin: 0 auto 24px;
  max-width: 720px;
  animation: fadeUp 0.4s ease 0.15s both;
}
.hs-item {
  border-radius: 999px;
  padding: 8px 18px 8px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 4px 0 var(--ink);
}
.hs-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: var(--edge);
  display: grid; place-items: center;
  font-size: 1.35rem;
  color: var(--ink);
  background: var(--gold);
  box-shadow: inset 0 -4px 0 var(--gold-dk);
  flex-shrink: 0;
}
#hs-streak .hs-icon { background: var(--red); box-shadow: inset 0 -4px 0 var(--red-dk); color: #fff2c4; }
#hs-streak.hs-cold .hs-icon { background: #4a5688; box-shadow: inset 0 -4px 0 #343e6b; color: #8f9cd0; }
.hs-num {
  font-family: var(--font-head);
  font-size: 1.7rem;
  line-height: 1;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}
.hs-label { font-size: 0.72rem; font-weight: 900; color: var(--text-lt); text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.1; }
.hs-goal { padding: 10px 18px; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
.hs-goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hs-goal-text { font-family: var(--font-head); font-size: 0.95rem; color: var(--gold); }
.hs-goal-bar {
  height: 16px;
  border-radius: 999px;
  background: var(--slot);
  border: var(--edge);
  overflow: hidden;
}
.hs-goal-fill {
  height: 100%;
  width: 0;
  min-width: 0;
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.22) 0 8px, transparent 8px 16px),
    linear-gradient(var(--gold), var(--gold-dk));
  border-right: 3px solid var(--ink);
  transition: width 0.8s var(--spring);
}

/* Mode tiles: Daily Blast is the big one */
.mode-cards {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-auto-rows: minmax(0, auto);
  gap: 16px;
  animation: fadeUp 0.4s ease 0.25s both;
}
.mode-card {
  --accent: var(--mint); --accent-dk: var(--mint-dk);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}
.mode-card:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 10px 0 var(--ink); }
.mode-card:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 2px 0 var(--ink); }

.mode-card .mode-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  border: var(--edge);
  background: var(--accent);
  box-shadow: inset 0 -6px 0 var(--accent-dk), inset 0 3px 0 rgba(255,255,255,0.4);
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  color: var(--ink);
}
.mode-card h3 { font-size: 1.7rem; line-height: 1; margin-bottom: 4px; -webkit-text-stroke-width: 5px; text-shadow: 0 3px 0 var(--ink); }
.mode-card p { font-size: 0.86rem; color: var(--text-lt); line-height: 1.4; font-weight: 700; }
.mode-card .mode-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: var(--accent);
}
.mode-card.practice { --accent: var(--mint);  --accent-dk: var(--mint-dk); }
.mode-card.test     { --accent: var(--red);   --accent-dk: var(--red-dk); }
.mode-card.review   { --accent: var(--grape); --accent-dk: var(--grape-dk); }
.mode-card.daily    { --accent: var(--gold);  --accent-dk: var(--gold-dk); }

/* Featured Daily tile */
.mode-card.daily {
  grid-row: span 3;
  min-height: 340px;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 28px 24px 26px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,200,61,0.35), transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 32%, rgba(255,255,255,0.06) 0 10deg, transparent 10deg 20deg),
    linear-gradient(180deg, #2f4aa6, var(--panel) 70%);
}
.mode-card.daily .mode-icon { width: 104px; height: 104px; border-radius: 28px; font-size: 3.4rem; transform: rotate(-6deg); }
.mode-card.daily h3 { font-size: 2.6rem; margin-top: 4px; -webkit-text-stroke-width: 7px; text-shadow: 0 5px 0 var(--ink); }
.mode-card.daily p { max-width: 30ch; font-size: 0.95rem; }
.mode-card .mode-play {
  margin-top: 16px;
  padding: 12px 40px;
  font-family: var(--font-head);
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--gold);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 -6px 0 var(--gold-dk), inset 0 3px 0 rgba(255,255,255,0.45), 0 5px 0 var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  animation: playPulse 1.8s ease-in-out infinite;
}
@keyframes playPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mode-card.daily.done .mode-play { display: none; }
.mode-card.daily.done .mode-badge { background: var(--mint); color: var(--ink); }
body.public-mode .mode-card.daily { grid-row: span 2; }

.mode-card.locked { filter: grayscale(0.7) brightness(0.85); opacity: 0.8; cursor: not-allowed; }
.mode-card.locked:hover { transform: none; box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow); }

/* ============================================================
   LEVEL SELECT
   ============================================================ */
#screen-level-select .section-title { font-size: 2.4rem; margin: 6px 0 6px; }
#screen-level-select .section-sub { color: var(--text-lt); font-size: 0.92rem; margin-bottom: 22px; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.level-card {
  --lc-color: var(--mint); --lc-dk: var(--mint-dk);
  padding: 18px 18px 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}
.level-card::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--lc-color);
  opacity: 0.18;
}
.level-card:hover { transform: translateY(-4px) rotate(0.6deg); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 10px 0 var(--ink); }
.level-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.level-card .lc-badge {
  display: inline-grid;
  place-items: center;
  min-width: 64px; height: 52px;
  padding: 0 10px;
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--ink);
  background: var(--lc-color);
  border: var(--edge);
  border-radius: 14px;
  box-shadow: inset 0 -5px 0 var(--lc-dk), inset 0 3px 0 rgba(255,255,255,0.4), 0 4px 0 var(--ink);
  margin-bottom: 12px;
}
.level-card h3 { font-size: 1.45rem; -webkit-text-stroke-width: 5px; text-shadow: 0 3px 0 var(--ink); margin-bottom: 4px; }
.level-card .lc-meta { font-size: 0.8rem; color: var(--text-lt); font-weight: 800; }

.lc-a1 { --lc-color: var(--mint);  --lc-dk: var(--mint-dk); }
.lc-a2 { --lc-color: var(--sky);   --lc-dk: var(--sky-dk); }
.lc-b1 { --lc-color: var(--gold);  --lc-dk: var(--gold-dk); }
.lc-b2 { --lc-color: var(--red);   --lc-dk: var(--red-dk); }
.lc-c1 { --lc-color: var(--grape); --lc-dk: var(--grape-dk); }
.lc-c2 { --lc-color: var(--pink);  --lc-dk: var(--pink-dk); }

.view-verbs-link {
  color: var(--gold);
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.view-verbs-link:hover { color: #fff; }

/* ============================================================
   DIFFICULTY
   ============================================================ */
.diff-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.diff-btn {
  padding: 12px 6px 10px;
  background: var(--panel);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), 0 4px 0 var(--ink);
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background var(--t);
}
.diff-btn .diff-emoji { font-size: 1.8rem; display: grid; place-items: center; margin-bottom: 4px; color: var(--muted); }
.diff-btn .diff-sub { font-size: 0.68rem; display: block; font-family: var(--font-body); font-weight: 800; color: var(--muted); margin-top: 2px; }
.diff-btn:hover { background: var(--panel-hi); }
.diff-btn.selected {
  background: var(--gold);
  color: var(--ink);
  transform: translateY(3px);
  box-shadow: inset 0 -5px 0 var(--gold-dk), 0 1px 0 var(--ink);
}
.diff-btn.selected .diff-emoji,
.diff-btn.selected .diff-sub { color: var(--ink); }
.diff-btn[data-diff="EASY"]    .diff-emoji { color: var(--mint); }
.diff-btn[data-diff="NORMAL"]  .diff-emoji { color: var(--sky); }
.diff-btn[data-diff="HARD"]    .diff-emoji { color: var(--red); }
.diff-btn[data-diff="MADNESS"] .diff-emoji { color: var(--grape); }

#screen-difficulty > p, #screen-test-intro > p { font-family: var(--font-head); font-weight: 400 !important; font-size: 1.2rem; letter-spacing: 0.03em; }

.timed-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 22px;
}
.timed-toggle .toggle-switch {
  width: 56px; height: 32px;
  border-radius: 999px;
  background: var(--slot);
  border: var(--edge);
  position: relative;
  flex-shrink: 0;
  transition: background var(--t);
}
.timed-toggle .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  transition: transform 0.2s var(--spring);
}
.timed-toggle.on .toggle-switch { background: var(--mint); }
.timed-toggle.on .toggle-switch::after { transform: translateX(24px); }
.timed-toggle .toggle-label { font-family: var(--font-head); font-size: 1.1rem; }
.timed-toggle .toggle-sub { font-size: 0.78rem; color: var(--text-lt); }

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screen-game { max-width: 940px; margin: 0 auto; padding: 0 20px 60px; }

.game-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}
.game-topbar-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.game-score-card {
  justify-self: end;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  text-align: right;
  min-width: 110px;
}
.game-score-card .sc-name {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-lt);
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.game-score-card .sc-name span:first-child { color: var(--mint); }
.game-score-card .sc-num {
  font-family: var(--font-head);
  font-size: 2.3rem;
  line-height: 1;
  color: var(--gold);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.game-score-card .sc-num.bump { animation: scoreBump 0.3s var(--spring); }
@keyframes scoreBump { 50% { transform: scale(1.35) rotate(-4deg); } }

.timer-wrap { position: relative; }
.timer-ring {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--slot);
  border: var(--edge);
  box-shadow: 0 4px 0 var(--ink);
}
.timer-ring svg { position: absolute; inset: -3px; width: 80px; height: 80px; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 7; }
.timer-ring circle.progress {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s;
}
.timer-ring circle.progress.danger { stroke: var(--red); }
.timer-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 1.9rem;
  color: var(--text);
}
.timer-num.danger { color: var(--red); animation: dangerPulse 0.5s ease-in-out infinite; }
@keyframes dangerPulse { 50% { transform: scale(1.18); } }

.game-level-pill {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 999px;
  border: var(--edge);
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2), 0 3px 0 var(--ink);
}
.game-progress-text { font-size: 0.78rem; color: var(--text-lt); font-weight: 800; }

/* The verb board */
.verb-table-wrap {
  padding: 10px;
  overflow-x: auto;
  margin-bottom: 22px;
}
.verb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 8px;
  table-layout: fixed;
}
.verb-table thead tr { background: none; }
.verb-table th {
  padding: 8px 6px;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border-radius: 999px;
  border: var(--edge) !important;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18);
}
.th-infinitive  { background: var(--sky); }
.th-past-simple { background: var(--red); }
.th-past-part   { background: var(--gold); }

.verb-table tbody tr { border: none; }
.verb-table tbody tr.row-correct td { animation: rowWin 0.5s var(--spring); }
.verb-table tbody tr.row-wrong { animation: shake 0.4s ease; }
@keyframes rowWin { 50% { transform: scale(1.04); } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}
.verb-table td { padding: 0; height: 64px; vertical-align: middle; border: none; }

.cell-given {
  height: 100%;
  min-height: 60px;
  border-radius: var(--radius-sm);
  border: var(--edge);
  background: #fff8e6;
  box-shadow: inset 0 -5px 0 #e3d5b4, 0 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.cell-given .given-word {
  font-family: var(--font-head);
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.cell-given .given-label { font-size: 0.58rem; font-weight: 900; letter-spacing: 0.08em; color: #8b7a55; }

.vtable-input {
  width: 100%;
  height: 60px;
  padding: 6px 8px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.45rem;
  color: var(--text);
  caret-color: var(--gold);
  background: var(--slot);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 4px 0 rgba(0,0,0,0.45);
  outline: none;
  transition: box-shadow var(--t), background var(--t);
}
.vtable-input::placeholder { color: #3d4a80; }
.vtable-input:focus { box-shadow: inset 0 4px 0 rgba(0,0,0,0.45), 0 0 0 3px var(--gold), 0 0 18px rgba(255,200,61,0.45); }
.vtable-input.inp-correct {
  background: var(--mint);
  color: var(--ink);
  box-shadow: inset 0 -5px 0 var(--mint-dk), 0 4px 0 var(--ink);
  animation: popIn 0.35s var(--spring);
}
.vtable-input.inp-wrong {
  background: #3a0f22;
  color: #ffb3c1;
  box-shadow: inset 0 4px 0 rgba(0,0,0,0.45), 0 0 0 3px var(--red);
}
.vtable-input:disabled { cursor: default; opacity: 1; -webkit-text-fill-color: currentColor; }
.vtable-input.reveal-answer {
  background: var(--red);
  color: #fff;
  box-shadow: inset 0 -5px 0 var(--red-dk), 0 4px 0 var(--ink);
  animation: revealPop 0.4s var(--spring);
}
@keyframes revealPop { from { transform: scale(0.7); } to { transform: scale(1); } }

.game-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.action-btn { padding: 12px 26px; font-size: 1.25rem; min-width: 150px; }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-next   { --b: var(--sky);  --b-dk: var(--sky-dk); }
.btn-finish { --b: var(--red);  --b-dk: var(--red-dk); --b-fg: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.btn-menu   { --b: var(--panel-hi); --b-dk: var(--panel); --b-fg: var(--text); }

.game-credit { text-align: center; margin-top: 22px; font-size: 0.74rem; color: var(--muted); font-style: italic; font-weight: 700; }

/* ============================================================
   VERB LIST MODAL
   ============================================================ */
.vl-modal-bg {
  position: fixed; inset: 0;
  background: rgba(5,8,24,0.78);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.vl-modal {
  width: 100%;
  max-width: 680px;
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  animation: popIn 0.3s var(--spring);
}
.vl-close {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: var(--edge);
  background: var(--red);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.1rem;
  box-shadow: inset 0 -3px 0 var(--red-dk), 0 3px 0 var(--ink);
  cursor: pointer;
}
.vl-title { font-size: 1.8rem; margin-bottom: 14px; padding-right: 40px; -webkit-text-stroke-width: 5px; }
.vl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.vl-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: var(--edge);
  background: var(--slot);
  color: var(--text-lt);
  font-family: var(--font-head);
  font-size: 0.9rem;
  cursor: pointer;
}
.vl-tab.active { color: var(--ink); }
.vl-tab:hover:not(.active) { background: var(--panel-hi); }
.vl-meta { font-size: 0.8rem; color: var(--text-lt); margin-bottom: 10px; }
#vl-table-wrap { overflow-y: auto; flex: 1; border-radius: var(--radius-sm); border: var(--edge); background: var(--slot); }
.vl-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.vl-table thead tr { color: var(--ink) !important; }
.vl-table th { padding: 9px 10px; text-align: left; font-family: var(--font-head); font-weight: 400; letter-spacing: 0.03em; position: sticky; top: 0; background: inherit; }
.vl-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.vl-table tr:last-child td { border-bottom: none; }
.vl-table tr:hover td { background: rgba(255,255,255,0.04); }
.vl-num { color: var(--muted); font-size: 0.72rem; width: 34px; }
.vl-new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--ink);
  vertical-align: middle;
}

/* ============================================================
   BONUS ROUND OVERLAY
   ============================================================ */
#bonus-round-overlay {
  position: fixed; inset: 0;
  z-index: 3000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  text-align: center;
  background:
    repeating-conic-gradient(from 0deg at 50% 45%, rgba(255,200,61,0.10) 0 9deg, transparent 9deg 18deg),
    radial-gradient(circle at 50% 45%, #2b3f96, #0a1230 70%);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.bonus-title { font-size: clamp(2.6rem, 9vw, 4.4rem); color: var(--gold); -webkit-text-stroke-width: 9px; text-shadow: 0 6px 0 var(--ink); animation: bonusBounce 0.6s var(--spring); }
@keyframes bonusBounce { from { transform: scale(0.3) rotate(-10deg); } to { transform: scale(1) rotate(0); } }
.bonus-sub { color: var(--text-lt); margin: 6px 0 22px; }
.bonus-verb-display {
  font-family: var(--font-head);
  font-size: 3.4rem;
  color: var(--ink);
  background: #fff8e6;
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 -6px 0 #e3d5b4, 0 6px 0 var(--ink);
  padding: 4px 34px;
  margin-bottom: 14px;
}
.bonus-verb-prompt { font-family: var(--font-head); font-size: 1.3rem; color: var(--sky); letter-spacing: 0.04em; margin-bottom: 16px; }
.bonus-input {
  width: min(340px, 100%);
  padding: 14px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--text);
  background: var(--slot);
  border: var(--edge);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 4px 0 rgba(0,0,0,0.45), 0 0 0 3px var(--gold);
  outline: none;
}
.bonus-input:focus { box-shadow: inset 0 4px 0 rgba(0,0,0,0.45), 0 0 0 3px var(--gold), 0 0 26px rgba(255,200,61,0.5); }
.bonus-input.correct { background: var(--mint); color: var(--ink); }
.bonus-timer { margin-top: 14px; font-family: var(--font-head); font-size: 1.5rem; color: var(--gold); }
.bonus-feedback { margin-top: 12px; min-height: 26px; font-weight: 800; }
.bonus-feedback--correct { color: var(--mint); }
.bonus-feedback--miss    { color: var(--text-lt); }

/* ============================================================
   FLOATING SCORES
   ============================================================ */
#float-container { position: fixed; inset: 0; pointer-events: none; z-index: 4000; }
.float-score {
  position: fixed;
  font-family: var(--font-head);
  font-size: 1.8rem;
  pointer-events: none;
  transform: translate(-50%, 0);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  animation: floatUp 1.2s ease-out forwards;
  z-index: 4000;
}
.float-score.correct  { color: var(--mint); }
.float-score.flawless { color: var(--gold); font-size: 2.4rem; }
.float-score.time     { color: var(--sky); }
.float-score.bonus    { color: var(--pink); font-size: 2.4rem; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  15%  { opacity: 1; transform: translate(-50%, -6px) scale(1.15); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -90px) scale(1); }
}

/* ============================================================
   RESULT CARDS
   ============================================================ */
.result-card {
  padding: 30px 26px 24px;
  text-align: center;
  position: relative;
  margin-top: 30px;
  animation: popIn 0.4s var(--spring);
}
.result-card.fail { background: linear-gradient(180deg, #5a2346, #33193f 50%); }
.result-emoji {
  width: 92px; height: 92px;
  margin: -76px auto 10px;
  border-radius: 50%;
  border: var(--edge);
  background: var(--gold);
  box-shadow: inset 0 -7px 0 var(--gold-dk), inset 0 4px 0 rgba(255,255,255,0.45), 0 5px 0 var(--ink);
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: var(--ink);
  line-height: 1;
}
.result-card.fail .result-emoji { background: var(--red); box-shadow: inset 0 -7px 0 var(--red-dk), 0 5px 0 var(--ink); color: #fff; }
.result-title { font-size: 2.3rem; margin-bottom: 14px; line-height: 1.05; }

.score-breakdown {
  background: var(--slot);
  border: var(--edge);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  margin-bottom: 18px;
  text-align: left;
}
.breakdown-row .ico { color: var(--muted); margin-right: 4px; }
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  font-size: 0.92rem;
  color: var(--text-lt);
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row.total { color: var(--text); font-family: var(--font-head); font-size: 1.15rem; }
.breakdown-row .pts { font-family: var(--font-head); font-size: 1.15rem; color: var(--gold); font-variant-numeric: tabular-nums; }

.round-pct-bar { height: 18px; border-radius: 999px; background: var(--slot); border: var(--edge); overflow: hidden; margin-bottom: 6px; }
.round-pct-fill { height: 100%; border-right: 3px solid var(--ink); transition: width 0.8s var(--spring); }
.round-pct-label { font-size: 0.82rem; color: var(--text-lt); margin-bottom: 18px; }

.level-verdict { padding: 12px 14px; border-radius: var(--radius-sm); border: var(--edge); font-size: 0.9rem; margin-bottom: 14px; line-height: 1.45; }
.verdict-pass { background: var(--green-lt); color: var(--text); }
.verdict-fail { background: var(--coral-lt); color: var(--text); }
.verdict-pct { font-family: var(--font-head); font-size: 1.3rem; color: var(--gold); }

.leaderboard-wrap { margin-top: 10px; }
.leaderboard-wrap h4 { font-family: var(--font-head); font-weight: 400; font-size: 1.2rem; margin-bottom: 8px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: var(--slot); border-radius: var(--radius-sm); overflow: hidden; }
.lb-table th { padding: 7px 6px; text-align: left; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.lb-table td { padding: 7px 6px; border-top: 1px solid rgba(255,255,255,0.06); }
.lb-table tr.me td { background: var(--green-lt); }
.lb-table .rank { font-family: var(--font-head); font-size: 1rem; text-align: center; width: 30px; }
.lb-table .rank-1 { color: var(--gold); }
.lb-table .rank-2 { color: #d6dcf2; }
.lb-table .rank-3 { color: #ff9d5c; }
.guest-upsell { margin-top: 10px; font-size: 0.82rem; color: var(--text-lt); text-align: center; }
.guest-upsell button { --b: var(--sky); --b-dk: var(--sky-dk); margin-top: 8px; padding: 8px 16px; font-size: 0.95rem; }

.advance-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 12px 14px;
  background: var(--slot); border: var(--edge); border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--text-lt);
}
.advance-footer strong { color: var(--gold); font-family: var(--font-head); font-size: 1.1rem; }
.advance-footer button { padding: 8px 16px; font-size: 1rem; }


/* ============================================================
   COUNTDOWN (race lights)
   ============================================================ */
#countdown-overlay {
  position: fixed; inset: 0;
  z-index: 3500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px;
  background: radial-gradient(circle at 50% 45%, #1d2c66, #050918 75%);
}
.race-lights {
  display: flex; gap: 18px;
  padding: 18px 22px;
  background: #0b0f22;
  border: var(--edge);
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--ink);
}
.race-light {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: #262b45;
  border: var(--edge);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.35);
  transition: background 0.1s, box-shadow 0.1s;
}
.race-light.red   { background: var(--red);  box-shadow: inset 0 -6px 0 var(--red-dk), 0 0 30px var(--red); }
.race-light.green { background: var(--mint); box-shadow: inset 0 -6px 0 var(--mint-dk), 0 0 30px var(--mint); }
.race-go {
  font-size: clamp(4rem, 16vw, 7rem);
  color: var(--mint);
  -webkit-text-stroke-width: 12px;
  text-shadow: 0 8px 0 var(--ink);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s, transform 0.3s var(--spring);
}
.race-go.show { opacity: 1; transform: scale(1); }

/* ============================================================
   GOD MODE
   ============================================================ */
.god-controls { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.god-btn { padding: 8px 14px; font-size: 0.9rem; }
.god-btn.autofill  { --b: var(--mint); --b-dk: var(--mint-dk); }
.god-btn.failround { --b: var(--red);  --b-dk: var(--red-dk); --b-fg: #fff; }

/* ============================================================
   MISC: spinner, loading, keyframes, toasts
   ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading { color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 3px solid rgba(7,11,31,0.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes springIn { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes popIn    { 0% { transform: scale(0.85); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
@keyframes burstOut { to { transform: scale(2); opacity: 0; } }
.anim-spring { animation: springIn 0.45s ease both; }

#toast-container {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 20px;
  border-radius: 999px;
  border: var(--edge);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 4px 0 var(--ink);
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--sky);
  animation: toastIn 0.35s var(--spring);
}
.toast.success { background: var(--mint); }
.toast.error   { background: var(--red); color: #fff; }
.toast.info    { background: var(--sky); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(20px) scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.9); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   LESSON (Daily Blast / Fix Mistakes) — phone first
   ============================================================ */
body.in-lesson #navbar { display: none; }
body.in-lesson #page { padding-top: 0; }

#screen-lesson {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: var(--night);
}

.ls-top {
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 6px;
}
.ls-quit {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 12px;
  color: var(--muted); font-size: 1.6rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ls-quit:hover { color: var(--text); background: var(--night-2); }

.ls-bar {
  flex: 1; height: 20px;
  background: var(--slot);
  border: var(--edge); border-radius: 999px;
  overflow: hidden;
}
.ls-fill {
  position: relative;
  height: 100%; width: 0;
  background: var(--mint);
  border-radius: 999px;
  box-shadow: inset 0 -4px 0 var(--mint-dk);
  transition: width 0.45s var(--spring);
}
.ls-fill::after {
  content: ''; position: absolute;
  left: 10px; right: 10px; top: 3px; height: 4px;
  border-radius: 4px; background: rgba(255,255,255,0.45);
}

.ls-hearts {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-family: var(--font-head); font-size: 1.35rem; color: var(--red);
}
.ls-hearts .ico { font-size: 1.7rem; filter: drop-shadow(0 2px 0 var(--ink)); }
.ls-hearts.empty { color: var(--muted); }
.ls-hearts.hit { animation: heartHit 0.5s ease; }
@keyframes heartHit { 30% { transform: scale(1.35); } 60% { transform: scale(0.9); } }

.ls-body {
  position: relative;
  flex: 1; overflow-y: auto;
  width: 100%; max-width: 640px; margin: 0 auto;
  padding: 18px 20px 24px;
  display: flex; flex-direction: column;
}

.ls-tag {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-size: 0.95rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--grape);
  margin-bottom: 8px;
}
.ls-tag.retry { color: var(--gold); }

.ls-prompt {
  font-family: var(--font-head); font-weight: 400;
  font-size: 1.75rem; line-height: 1.15;
  margin-bottom: 22px;
}
.ls-prompt em { font-style: normal; color: var(--sky); }

.ls-stage { flex: 1; display: flex; flex-direction: column; gap: 22px; }
.ls-stage > * { animation: fadeUp 0.3s ease both; }

/* The verb being asked about */
.ls-word {
  align-self: center;
  font-family: var(--font-head); font-size: 3.2rem; line-height: 1;
  color: var(--gold);
  padding: 22px 34px;
  background: var(--panel);
  border: var(--edge); border-radius: var(--radius);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 6px 0 var(--ink);
  text-shadow: 0 3px 0 var(--ink);
}

/* Tap answers */
.ls-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ls-options.ls-rows { grid-template-columns: 1fr; }
.ls-opt {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 68px; padding: 12px 14px;
  font-family: var(--font-head); font-size: 1.45rem; color: var(--text);
  background: var(--panel);
  border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.ls-opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.ls-opt.picked { background: #18456f; border-color: var(--sky); box-shadow: 0 5px 0 var(--sky-dk); color: #fff; }
.ls-opt.right  { background: #0f5a43; border-color: var(--mint); box-shadow: 0 5px 0 var(--mint-dk); animation: rowWin 0.35s ease; }
.ls-opt.wrong  { background: #5e1a2c; border-color: var(--red);  box-shadow: 0 5px 0 var(--red-dk);  animation: shake 0.4s ease; }
.ls-key {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: grid; place-items: center;
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 900;
  color: var(--muted); border: 2px solid var(--border); border-radius: 7px;
}
.ls-row { justify-content: space-around; padding-left: 44px; }
.ls-cell { flex: 1; text-align: center; font-size: 1.25rem; }
.ls-key + .ls-cell { color: var(--gold); }

/* base · past · participle line (type / build) */
.ls-line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ls-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 88px; padding: 10px 6px;
  background: var(--panel);
  border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 var(--ink);
  font: inherit; color: var(--text);
}
.ls-slot small {
  font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.ls-slot b { font-family: var(--font-head); font-weight: 400; font-size: 1.4rem; overflow-wrap: anywhere; text-align: center; }
.ls-slot.input, .ls-slot.drop { background: var(--slot); box-shadow: inset 0 4px 0 rgba(0,0,0,0.35); }
.ls-slot.drop { border-style: dashed; border-color: var(--border); cursor: pointer; }
.ls-slot.drop.full { border-style: solid; border-color: var(--sky); }
.ls-input {
  width: 100%; min-width: 0;
  background: none; border: none; outline: none;
  font-family: var(--font-head); font-size: 1.4rem; color: var(--text);
  text-align: center;
  caret-color: var(--sky);
}
.ls-slot.input:focus-within { border-color: var(--sky); }
.is-right .ls-slot.input, .is-right .ls-slot.drop { border-color: var(--mint); border-style: solid; }
.is-wrong .ls-slot.input, .is-wrong .ls-slot.drop { border-color: var(--red);  border-style: solid; animation: shake 0.4s ease; }

/* Word bank */
.ls-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ls-chip {
  padding: 12px 18px;
  font-family: var(--font-head); font-size: 1.3rem; color: var(--ink);
  background: #f6f3ff;
  border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 0 -4px 0 #c9c3e6, 0 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.ls-chip:active { transform: translateY(3px); }
.ls-chip.used { background: var(--slot); color: transparent; box-shadow: none; border-color: var(--night-2); cursor: default; }

/* Combo pop */
.ls-combo {
  position: absolute; top: 14px; right: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-head); font-size: 1.05rem; color: var(--ink);
  background: var(--gold); border: var(--edge); border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  pointer-events: none; opacity: 0;
}
.ls-combo.pop { animation: comboPop 1.6s ease both; }
@keyframes comboPop {
  0% { opacity: 0; transform: scale(0.5) rotate(-6deg); }
  15% { opacity: 1; transform: scale(1.1) rotate(3deg); }
  25%, 80% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* Bottom sheet: CHECK, then the green or red verdict */
.ls-foot {
  border-top: 2px solid var(--night-2);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transition: background 0.2s ease;
}
.ls-foot.ok  { background: #0d3b35; border-top-color: transparent; }
.ls-foot.bad { background: #3e1427; border-top-color: transparent; }
.ls-foot-in {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
}
.ls-feedback { display: none; align-items: center; gap: 12px; animation: fadeUp 0.25s ease both; }
.ls-foot.ok .ls-feedback, .ls-foot.bad .ls-feedback { display: flex; }
.ls-fb-icon { font-size: 2.6rem; line-height: 0; }
.ls-foot.ok  .ls-fb-icon, .ls-foot.ok  #ls-fb-title { color: var(--mint); }
.ls-foot.bad .ls-fb-icon, .ls-foot.bad #ls-fb-title { color: var(--red); }
#ls-fb-title { font-family: var(--font-head); font-weight: 400; font-size: 1.5rem; }
#ls-fb-text  { font-size: 1.05rem; color: var(--text); }
.ls-foot.ok #ls-fb-text { color: #b8f5dc; }
.ls-foot.bad #ls-fb-text { color: #ffc4cf; }

.ls-check {
  --b: var(--mint); --b-dk: var(--mint-dk);
  width: 100%; padding: 15px 20px;
  font-family: var(--font-head); font-size: 1.35rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); background: var(--b);
  border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 0 -6px 0 var(--b-dk), inset 0 3px 0 rgba(255,255,255,0.35), 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.ls-check:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: inset 0 -3px 0 var(--b-dk), inset 0 3px 0 rgba(255,255,255,0.35), 0 1px 0 var(--ink);
}
.ls-check:disabled { background: var(--night-2); color: var(--muted); border-color: var(--night-2); box-shadow: none; cursor: default; }
.ls-foot.bad .ls-check { --b: var(--red); --b-dk: var(--red-dk); color: #fff; }

/* Desktop: verdict on the left, button on the right */
@media (min-width: 720px) {
  .ls-top { padding-top: 28px; }
  .ls-body { padding-top: 40px; }
  .ls-prompt { font-size: 2.1rem; }
  .ls-foot { padding-top: 26px; padding-bottom: 26px; }
  .ls-foot-in { flex-direction: row; align-items: center; justify-content: space-between; }
  .ls-check { min-width: 220px; width: auto; white-space: nowrap; margin-left: auto; }
}
@media (hover: none) { .ls-key { display: none; } .ls-row { padding-left: 14px; } }
@media (max-width: 380px) {
  .ls-prompt { font-size: 1.5rem; }
  .ls-word { font-size: 2.6rem; padding: 18px 26px; }
  .ls-opt { font-size: 1.25rem; min-height: 60px; }
  .ls-slot b, .ls-input { font-size: 1.15rem; }
}

/* ============================================================
   LESSON COMPLETE
   ============================================================ */
.rr-wrap { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.rr-hero { text-align: center; }
.rr-badge {
  width: 112px; height: 112px; margin: 0 auto 14px;
  display: grid; place-items: center;
  font-size: 3.8rem; color: var(--ink);
  background: var(--gold);
  border: var(--edge); border-radius: 50%;
  box-shadow: inset 0 -8px 0 var(--gold-dk), inset 0 4px 0 rgba(255,255,255,0.4), 0 6px 0 var(--ink);
  animation: springIn 0.6s var(--spring) both;
}
.rr-title {
  font-family: var(--font-head); font-weight: 400; font-size: 2.4rem; line-height: 1.05;
  color: var(--gold); text-shadow: 0 3px 0 var(--ink);
}
.rr-sub { color: var(--text-lt); font-size: 0.98rem; margin-top: 8px; line-height: 1.45; }

.rr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rr-stat {
  --c: var(--gold);
  display: flex; flex-direction: column;
  background: var(--c);
  border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 var(--ink);
  overflow: hidden;
  animation: popIn 0.4s var(--spring) both;
}
.rr-stat.mint { --c: var(--mint); animation-delay: 0.1s; }
.rr-stat.sky  { --c: var(--sky);  animation-delay: 0.2s; }
.rr-stat-label {
  padding: 5px 4px 4px;
  font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; color: var(--ink);
}
.rr-stat-val {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin: 0 3px 3px; padding: 12px 4px;
  background: var(--night); border-radius: 10px;
  color: var(--c);
  font-family: var(--font-head); font-size: 1.5rem;
}
.rr-stat-val b { font-weight: 400; color: var(--text); }

.rr-streak-card {
  padding: 16px;
  background: var(--panel);
  border: var(--edge); border-radius: var(--radius);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 6px 0 var(--ink);
}
.rr-streak-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rr-flame { font-size: 2.8rem; line-height: 0; color: #ff9b3d; filter: drop-shadow(0 3px 0 var(--ink)); }
.rr-streak-num { display: block; font-family: var(--font-head); font-weight: 400; font-size: 1.6rem; color: #ff9b3d; }
.rr-streak-top small { color: var(--muted); font-size: 0.85rem; }
.rr-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.rr-day small { display: block; margin-top: 4px; font-size: 0.72rem; font-weight: 900; color: var(--muted); }
.rr-dot {
  width: 34px; height: 34px; margin: 0 auto;
  display: grid; place-items: center;
  background: var(--slot); border: 2px solid var(--night-2); border-radius: 50%;
  font-size: 1.1rem; color: var(--ink);
}
.rr-day.lit .rr-dot { background: #ff9b3d; border: var(--edge); box-shadow: inset 0 -3px 0 #c9620b; }
.rr-day.today small { color: var(--text); }

.rr-grid { display: flex; flex-direction: column; gap: 8px; }
.rr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: var(--edge);
  background: var(--slot);
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-align: left;
  animation: popIn 0.35s var(--spring) both;
}
.rr-row:nth-child(2) { animation-delay: 0.06s; } .rr-row:nth-child(3) { animation-delay: 0.12s; }
.rr-row:nth-child(4) { animation-delay: 0.18s; } .rr-row:nth-child(5) { animation-delay: 0.24s; }
.rr-row:nth-child(6) { animation-delay: 0.30s; }
.rr-sq {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px; border: var(--edge);
  font-size: 1rem; color: var(--ink);
}
.rr-row.rr-clean .rr-sq { background: var(--mint); box-shadow: inset 0 -4px 0 var(--mint-dk); }
.rr-row.rr-slip  .rr-sq { background: var(--gold); box-shadow: inset 0 -4px 0 var(--gold-dk); }
.rr-row.rr-miss  .rr-sq { background: var(--red);  box-shadow: inset 0 -4px 0 var(--red-dk); }
.rr-forms { overflow-wrap: anywhere; letter-spacing: 0.02em; }

.rr-invite {
  --c: var(--gold);
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 14px;
  margin: 16px 0; padding: 14px 16px; text-align: left;
  background: linear-gradient(120deg, #3a1a6e, #1f3170);
  border: 3px solid var(--c); border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 var(--ink), 0 0 24px color-mix(in srgb, var(--c) 40%, transparent);
  animation: popIn 0.45s var(--spring) 0.4s both;
}
.rr-inv-lv {
  width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-head); font-size: 1.4rem; color: var(--ink); background: var(--c);
  border: var(--edge); box-shadow: 0 4px 0 var(--ink);
}
.rr-inv-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rr-inv-tx b { font-family: var(--font-head); font-weight: 400; font-size: 1.25rem; line-height: 1.15; color: var(--c); }
.rr-inv-tx small { color: var(--text-lt); font-weight: 700; font-size: 0.88rem; line-height: 1.4; }
.rr-inv-go { grid-column: 1 / -1; --b: var(--gold); --b-dk: var(--gold-dk); --b-fg: var(--ink); }
.rr-next.alt { --b: var(--panel-hi); --b-dk: var(--ink); --b-fg: var(--text); }
.cert-card.ready { border-color: var(--gold); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow), 0 0 0 4px rgba(255,200,61,0.45); }
.cert-card.ready .mode-badge { background: var(--gold); color: var(--ink); animation: playPulse 1.8s ease-in-out infinite; }

.rr-actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.rr-actions .btn-ghost { align-self: center; }
.rr-share-text {
  width: 100%; padding: 10px;
  background: var(--slot); color: var(--text);
  border: var(--edge); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; resize: none;
}
#btn-rr-share { --b: var(--mint); --b-dk: var(--mint-dk); }
#btn-rr-review { --b: var(--grape); --b-dk: var(--grape-dk); --b-fg: #fff; background: var(--b) !important; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }

@media (max-width: 380px) {
  .rr-title { font-size: 2rem; }
  .rr-stat-val { font-size: 1.2rem; padding: 10px 2px; }
  .rr-dot { width: 30px; height: 30px; }
}

@media (max-width: 900px) {
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .cell-given .given-word { font-size: 1.3rem; }
  .vtable-input { font-size: 1.25rem; }
}

@media (max-width: 640px) {
  #navbar { padding: 0 12px; justify-content: flex-end; }
  #nav-title { font-size: 1.1rem; }
  #nav-logo-dots, #nav-logo.on-home { display: none; }
  #nav-logo { width: 38px; height: 38px; margin-right: auto; }
  #nav-version { display: none; }

  .auth-card { padding: 24px 18px; }
  .form-row { flex-direction: column; gap: 0; }

  .home-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hs-goal { grid-column: 1 / -1; order: 3; }
  .hs-item { padding-right: 12px; }

  .mode-cards { grid-template-columns: 1fr; }
  .mode-card.daily { grid-row: auto; padding: 22px 18px; }
  .mode-card.daily .mode-icon { width: 84px; height: 84px; font-size: 2.8rem; }
  .mode-card.daily h3 { font-size: 2.2rem; }
  .mode-card .mode-icon { width: 54px; height: 54px; font-size: 1.8rem; border-radius: 15px; }
  .mode-card h3 { font-size: 1.45rem; }

  .level-grid { gap: 12px; }
  .level-card { padding: 14px; }
  .level-card h3 { font-size: 1.2rem; }

  .diff-options { grid-template-columns: repeat(2, 1fr); }

  #screen-game { padding: 0 8px 40px; }
  .game-topbar { margin-bottom: 12px; }
  .timer-ring, .timer-ring svg { width: 66px; height: 66px; }
  .timer-num { font-size: 1.5rem; }
  .game-score-card { padding: 6px 12px; min-width: 0; }
  .game-score-card .sc-num { font-size: 1.8rem; }
  .verb-table-wrap { padding: 4px; }
  .verb-table { border-spacing: 5px; }
  .verb-table th { font-size: 0.72rem; padding: 6px 2px; }
  .verb-table td { height: 54px; }
  .cell-given { min-height: 50px; border-radius: 10px; }
  .cell-given .given-word { font-size: 1.05rem; }
  .cell-given .given-label { display: none; }
  .vtable-input { height: 50px; font-size: 1.05rem; padding: 4px; border-radius: 10px; }
  .action-btn { min-width: 0; flex: 1; font-size: 1.1rem; padding: 12px 14px; }

  .result-card { padding: 26px 16px 20px; }
  .result-title { font-size: 1.9rem; }
  .bonus-verb-display { font-size: 2.4rem; }
  .race-light { width: 48px; height: 48px; }
}

@media (max-width: 400px) {
  .level-grid { grid-template-columns: 1fr 1fr; }
  .hs-num { font-size: 1.4rem; }
  .hs-icon { width: 34px; height: 34px; font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   SECRET TEST MODE
   ============================================================ */
#bolt-right {
  padding: 8px 12px;
  margin: -8px -12px;
  cursor: default;
  display: inline-block;
}

/* ── Dark theme when secret mode is active ── */
body.secret-mode {
  --bg:        #080c0c;
  --card:      #0f1a1a;
  --border:    #1a3333;
  --text:      #e0f7f7;
  --text-lt:   #80b0b0;
  --muted:     #4a7070;
  --green:     #00bcd4;
  --green-lt:  rgba(0,188,212,0.12);
  --blue:      #00bcd4;
  --blue-lt:   rgba(0,188,212,0.08);
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.7);
}

body.secret-mode #navbar {
  background: #030808;
  border-bottom: 1px solid #1a3333;
}

body.secret-mode .verb-table-wrap { border-color: #1a3333; }
body.secret-mode .verb-table { background: #0c1818; }
body.secret-mode .verb-table thead tr { background: #0c1818; }
body.secret-mode .verb-table th { border-bottom-color: #1a3333 !important; border-right-color: #1a3333; color: #00e5ff; }
body.secret-mode .verb-table tbody tr { border-bottom-color: #1a3333; }
body.secret-mode .verb-table tbody tr:nth-child(even) { background: #0a1515; }
body.secret-mode .verb-table td { border-right-color: #1a3333; }

body.secret-mode .cell-given { background: rgba(0,188,212,0.1); }
body.secret-mode .cell-given .given-word  { color: #00e5ff; }
body.secret-mode .cell-given .given-label { color: #00bcd4; }

body.secret-mode .vtable-input {
  background: #0c1818;
  border-color: #1a4444;
  color: #e0f7f7;
}
body.secret-mode .vtable-input:focus {
  border-color: #00bcd4;
  background: #0f2020;
  box-shadow: 0 0 0 3px rgba(0,188,212,0.2);
}
body.secret-mode .vtable-input.inp-correct {
  border-color: #00bcd4;
  background: rgba(0,188,212,0.12);
  color: #00e5ff;
}

body.secret-mode .game-score-card {
  background: #0f1a1a;
  border-color: #1a3333;
  color: #e0f7f7;
}
body.secret-mode .game-score-card .sc-num { color: #00e5ff; }
body.secret-mode .game-progress-text { color: #4a7070; }

body.secret-mode #timer-circle { stroke: #00bcd4; }
body.secret-mode #timer-circle.danger { stroke: var(--coral); }
body.secret-mode .timer-num { color: #00e5ff; }
body.secret-mode .timer-num.danger { color: var(--coral); }

body.secret-mode .btn-menu { background: #0f1a1a; color: #e0f7f7; border-color: #1a3333; }
body.secret-mode .btn-finish { background: var(--coral); }

body.secret-mode #countdown-overlay { background: #030808; }
body.secret-mode .race-go { color: #00bcd4; }

/* ── Secret Intro Screen ── */
#screen-secret-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: 20px;
}

.secret-intro-wrap {
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.secret-orb {
  font-size: 4rem;
  animation: secretFloat 3s ease-in-out infinite;
  display: block;
  margin-bottom: 16px;
}

@keyframes secretFloat {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-12px); }
}

.secret-title {
  font-family: var(--font-head);
  font-size: 2.4rem;
  color: #00e5ff;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(0,229,255,0.4);
}

.secret-sub {
  color: #4a9090;
  font-size: 0.95rem;
  margin-bottom: 32px;
  font-style: italic;
}

.secret-rules-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  text-align: left;
}

.secret-rule {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0,188,212,0.07);
  border: 1px solid rgba(0,188,212,0.18);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.secret-rule-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.secret-rule strong {
  display: block;
  color: #00e5ff;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.secret-rule span {
  font-size: 0.78rem;
  color: #4a7070;
}

.btn-secret-enter {
  background: transparent;
  border: 2px solid #00bcd4;
  color: #00e5ff;
  font-family: var(--font-head);
  font-size: 1.15rem;
  padding: 14px 28px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 20px rgba(0,188,212,0.2);
  animation: secretGlow 2.5s ease-in-out infinite;
}

.btn-secret-enter:hover {
  background: rgba(0,188,212,0.12);
  box-shadow: 0 0 30px rgba(0,188,212,0.4);
  transform: translateY(-2px);
}

@keyframes secretGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(0,188,212,0.2); }
  50%       { box-shadow: 0 0 35px rgba(0,188,212,0.5); }
}

/* ── Secret Results Screen ── */
.secret-results-card {
  border-color: #00bcd4 !important;
  background: #0f1a1a !important;
  color: #e0f7f7 !important;
}

.secret-nota-wrap {
  background: rgba(0,188,212,0.08);
  border: 1px solid rgba(0,188,212,0.2);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.secret-nota-label {
  font-size: 0.82rem;
  color: #4a9090;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.secret-nota-num {
  font-family: var(--font-head);
  font-size: 3.5rem;
  color: #00e5ff;
  line-height: 1;
  animation: springIn 0.5s ease;
}

.secret-reco {
  background: rgba(107,207,159,0.1);
  border: 1px solid rgba(107,207,159,0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #80c8a0;
  line-height: 1.5;
}

.secret-reco strong { color: #6bcf9f; }

.secret-results-card .result-title { color: #00e5ff; }
.secret-results-card .btn-ghost { color: #4a9090; }
.secret-results-card .btn-ghost:hover { color: #00bcd4; }

/* ── Grade letter display (used everywhere notas appear) ── */
.grade-letter {
  display: block;
  font-family: var(--font-head);
  font-size: 3.5rem;
  line-height: 1;
}
.grade-chilean {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}

/* Secret results nota uses these too */
.secret-nota-num .grade-letter { color: #00e5ff; font-size: 3.5rem; }
.secret-nota-num .grade-chilean { color: #4a9090; }

/* Fail screen nota */
#fail-nota .grade-letter { font-size: 3rem; }

/* Test complete nota */
#final-nota-display .grade-letter { font-size: 3rem; }
#final-nota-display .grade-chilean { margin-top: 6px; }

/* ── Level grade card (level complete screen) ── */
.level-grade-card {
  background: var(--blue-lt);
  border: 2px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 10px 0;
  text-align: center;
}
.lgc-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.lgc-grade .grade-letter {
  font-size: 2rem;
  color: var(--blue);
}
.lgc-grade .grade-chilean {
  font-size: 0.72rem;
  margin-top: 2px;
}
.lgc-motivation {
  font-size: 0.82rem;
  color: var(--text-lt);
  margin-top: 8px;
  line-height: 1.4;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

body.secret-mode .level-grade-card {
  background: rgba(0,188,212,0.07);
  border-color: rgba(0,188,212,0.25);
}
body.secret-mode .lgc-grade .grade-letter { color: #00e5ff; }
body.secret-mode .lgc-motivation { color: #4a9090; border-top-color: #1a3333; }

/* ============================================================
   ARCADE MODE — neon stage, pixel HUD, chunky verb tiles
   ============================================================ */
:root {
  --arc-night:  #140a33;
  --arc-violet: #4a1f9e;
  --arc-pink:   #ff3fa4;
  --arc-pink-dk:#a01478;
  --arc-blue:   #3a7bff;
  --arc-blue-dk:#1d3fa0;
  --arc-green:  #22c55e;
  --arc-green-dk:#0f7a36;
  --font-arcade: 'Bungee', var(--font-head);
  --font-pixel:  'Press Start 2P', ui-monospace, monospace;
}

/* Home card */
.mode-card.arcade {
  grid-column: 1 / -1;
  --accent: var(--arc-pink); --accent-dk: var(--arc-pink-dk);
  background: radial-gradient(ellipse 80% 120% at 50% 0%, var(--arc-violet) 0%, #24105c 55%, var(--arc-night) 100%);
  padding: 20px 22px;
  grid-template-columns: auto 1fr;
  isolation: isolate;
}
.mode-card.arcade .mode-text { position: relative; z-index: 1; }
/* The whole card is the button: the joystick waggles to invite a tap */
.mode-card.arcade .mode-icon {
  position: relative; z-index: 1; color: #fff;
  width: 84px; height: 84px; border-radius: 22px; font-size: 2.8rem;
  box-shadow: inset 0 -7px 0 var(--accent-dk), inset 0 3px 0 rgba(255,255,255,0.4), 0 6px 0 var(--ink), 0 0 28px rgba(255,63,164,0.55);
  animation: arcWaggle 1.6s ease-in-out infinite;
}
.mode-card.arcade:hover .mode-icon { animation-duration: 0.6s; }
.mode-card.arcade:active .mode-icon { animation: none; transform: translateY(4px); box-shadow: inset 0 -4px 0 var(--accent-dk), 0 2px 0 var(--ink); }
@keyframes arcWaggle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  25%      { transform: rotate(6deg) scale(1.06); }
  50%      { transform: rotate(-4deg) scale(1); }
  75%      { transform: rotate(8deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .mode-card.arcade .mode-icon { animation: none; transform: rotate(-6deg); } }
.mode-card.arcade h3 {
  font-family: var(--font-arcade); font-weight: 400; font-size: 2.3rem;
  color: #ffd23f; -webkit-text-stroke-width: 0;
  text-shadow: 0 3px 0 #ff8a00, 0 6px 0 var(--arc-pink), 0 9px 0 var(--arc-pink-dk);
  margin-bottom: 10px;
}
.mode-card.arcade .mode-badge { color: #ffd23f; }
.arc-card-new {
  display: inline-block; margin-bottom: 6px; padding: 4px 8px 3px; border-radius: 6px;
  font-family: var(--font-pixel); font-size: 0.55rem; color: #fff; background: var(--arc-pink);
  box-shadow: 0 3px 0 var(--arc-pink-dk);
}
.arc-card-floor {
  position: absolute; left: -40%; right: -40%; bottom: -60px; height: 150px; z-index: 0;
  transform: perspective(240px) rotateX(60deg); transform-origin: bottom;
  background-image: linear-gradient(rgba(255,63,164,0.55) 2px, transparent 2px),
                    linear-gradient(90deg, rgba(255,63,164,0.55) 2px, transparent 2px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent);
          mask-image: linear-gradient(to top, #000 20%, transparent);
  animation: arFloor 1.6s linear infinite;
  pointer-events: none;
}
@media (max-width: 640px) {
  .mode-card.arcade .mode-icon { width: 72px; height: 72px; font-size: 2.4rem; border-radius: 19px; }
  .mode-card.arcade h3 { font-size: 1.9rem; }
}

/* Screen */
body.in-arcade { overflow: hidden; }
#screen-arcade, #screen-defense {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: var(--arc-night);
  overflow: hidden;
  color: #fff;
}
.ar-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(2px 2px at 12% 18%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 82% 12%, rgba(255,255,255,0.5), transparent),
    radial-gradient(3px 3px at 64% 30%, rgba(255,255,255,0.45), transparent),
    radial-gradient(2px 2px at 30% 40%, rgba(255,255,255,0.4), transparent),
    radial-gradient(ellipse 80% 60% at 50% 35%, var(--arc-violet) 0%, #24105c 45%, var(--arc-night) 85%);
}
.ar-floor {
  position: absolute; left: -50%; right: -50%; bottom: -10px; height: 42vh;
  transform: perspective(420px) rotateX(62deg); transform-origin: bottom;
  background-image: linear-gradient(rgba(255,63,164,0.6) 3px, transparent 3px),
                    linear-gradient(90deg, rgba(255,63,164,0.6) 3px, transparent 3px);
  background-size: 70px 70px;
  -webkit-mask-image: linear-gradient(to top, #000 45%, transparent);
          mask-image: linear-gradient(to top, #000 45%, transparent);
  animation: arFloor 1.2s linear infinite;
}
@keyframes arFloor { from { background-position: 0 0; } to { background-position: 0 70px; } }

/* HUD */
.ar-hud, .ar-timer, .ar-stage { position: relative; z-index: 1; }
.ar-hud {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  width: 100%; max-width: 980px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
  font-family: var(--font-pixel); font-size: 0.8rem;
}
.ar-hud b { font-weight: 400; color: #ffd23f; }
.ar-pause {
  width: 38px; height: 38px; border-radius: 10px; border: 2px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08); color: #fff; font-family: var(--font-pixel); font-size: 0.7rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ar-pause:hover { background: rgba(255,255,255,0.18); }
.ar-hearts { display: flex; gap: 4px; font-size: 1.25rem; }
.ar-hearts .on  { color: #ff4d6d; filter: drop-shadow(0 2px 0 #8a1230); }
.ar-hearts .off { color: rgba(255,255,255,0.18); }
.ar-hearts .on:last-of-type { animation: arBeat 1.2s ease-in-out infinite; }
@keyframes arBeat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } }

.ar-timer {
  width: calc(100% - 32px); max-width: 948px; margin: 0 auto;
  height: 16px; border-radius: 8px; background: rgba(255,255,255,0.13); overflow: hidden;
}
.ar-timer i {
  display: block; height: 100%; width: 66%;
  background: linear-gradient(90deg, #3ff0c4, #ffd23f);
  border-radius: 8px;
}
.ar-timer span {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-pixel); font-size: 0.55rem; color: #fff; text-shadow: 0 1px 0 #000;
}
.ar-timer.low i { background: linear-gradient(90deg, #ff3f6c, #ff8a00); animation: arBlink 0.5s steps(2) infinite; }
@keyframes arBlink { 50% { opacity: 0.55; } }

/* Stage */
.ar-stage {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(12px, 3vh, 26px);
  width: 100%; max-width: 980px; margin: 0 auto; padding: 12px 16px 20px;
}
.ar-stage.shake { animation: arShake 0.4s ease; }
@keyframes arShake { 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

.ar-logo {
  font-family: var(--font-arcade); font-size: clamp(2.6rem, 9vw, 5.5rem); line-height: 1;
  color: #ffd23f; transform: rotate(-3deg); white-space: nowrap;
  text-shadow: 0 3px 0 #ff8a00, 0 6px 0 var(--arc-pink), 0 9px 0 var(--arc-pink-dk), 0 14px 20px rgba(0,0,0,0.5);
}
@media (max-height: 720px) { .ar-logo { display: none; } }
.ar-hero { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 18px); }
.ar-dog { width: min(16vh, 24vw, 150px); flex-shrink: 0; }
@media (max-height: 560px) { .ar-dog { width: 64px; } }
.ar-tag {
  font-family: var(--font-pixel); font-size: 0.65rem; letter-spacing: 0.08em;
  color: #3ff0c4; padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,0.3);
}

.ar-combo {
  position: absolute; top: 14px; right: 16px; z-index: 3;
  font-family: var(--font-arcade); font-size: 1.5rem; color: #fff;
  background: var(--arc-pink); padding: 6px 16px; border-radius: 14px;
  box-shadow: 0 6px 0 var(--arc-pink-dk), 0 0 40px rgba(255,63,164,0.6);
  transform: rotate(6deg) scale(0); opacity: 0;
  transition: transform 0.2s var(--spring), opacity 0.2s;
}
.ar-combo.show { transform: rotate(6deg) scale(1); opacity: 1; }
.ar-combo.pop  { animation: arPop 0.35s var(--spring); }
.ar-combo[data-m="4"], .ar-combo[data-m="5"] { background: #ff8a00; box-shadow: 0 6px 0 #b45309, 0 0 50px rgba(255,138,0,0.7); }
@keyframes arPop { 0% { transform: rotate(6deg) scale(1.5); } 100% { transform: rotate(6deg) scale(1); } }

.ar-tiles {
  display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 22px);
  width: 100%;
}
.ar-tiles.enter .ar-tile { animation: arIn 0.35s var(--spring) both; }
.ar-tiles.enter .ar-tile:nth-of-type(2) { animation-delay: 0.05s; }
.ar-tiles.enter .ar-tile:nth-of-type(3) { animation-delay: 0.1s; }
@keyframes arIn { from { transform: translateY(30px) scale(0.85); opacity: 0; } }
.ar-arrow { font-family: var(--font-arcade); font-size: clamp(1.4rem, 4vw, 3rem); color: rgba(255,255,255,0.35); }

.ar-tile {
  --c: var(--arc-blue); --d: var(--arc-blue-dk);
  position: relative;
  flex: 1 1 0; max-width: 260px; min-width: 0;
  aspect-ratio: 2 / 1.1;
  container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px;
  border-radius: clamp(14px, 3vw, 26px);
  background: var(--c);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.25), 0 clamp(6px, 1.2vw, 12px) 0 var(--d), 0 18px 26px rgba(0,0,0,0.45);
  transition: transform 0.15s var(--spring);
}
.ar-tile small {
  font-family: var(--font-pixel); font-size: clamp(0.4rem, 1.3vw, 0.7rem);
  opacity: 0.85; margin-bottom: 6px; letter-spacing: 0.04em;
}
.ar-tile b {
  --len: 4;
  font-family: var(--font-arcade); font-weight: 400; line-height: 1;
  font-size: min(calc(118cqi / var(--len)), 34cqi);
  white-space: nowrap; color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
}
.ar-tile.blank { --c: #2b1a63; --d: #170c3d; box-shadow: inset 0 0 0 3px rgba(255,255,255,0.18), 0 8px 0 var(--d); }
.ar-tile.blank b { color: rgba(255,255,255,0.3); }
.ar-tile.active {
  --c: #3a2490; box-shadow: inset 0 0 0 3px #ffd23f, 0 8px 0 var(--d), 0 0 30px rgba(255,210,63,0.45);
  transform: translateY(-4px);
}
.ar-tile.active b { color: #ffd23f; animation: arBlink 0.8s steps(2) infinite; }
.ar-tile.ok   { --c: var(--arc-green); --d: var(--arc-green-dk); animation: arPopTile 0.3s var(--spring); }
.ar-tile.miss { --c: #e11d48; --d: #881337; }
.ar-tile.ok::after, .ar-tile.miss::after {
  position: absolute; top: -12px; right: -6px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; font-family: var(--font-body); font-weight: 900; font-size: 1.2rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.25);
}
.ar-tile.ok::after   { content: '✓'; color: #16a34a; }
.ar-tile.miss::after { content: '✕'; color: #e11d48; }
@keyframes arPopTile { 50% { transform: scale(1.08); } }
.ar-tiles.cleared .ar-tile { transform: translateY(-6px); }

/* Answer box */
.ar-entry {
  display: flex; gap: 10px; width: 100%; max-width: 560px;
}
.ar-input {
  flex: 1; min-width: 0;
  font-family: var(--font-body); font-weight: 900; font-size: 1.4rem; color: #fff;
  background: rgba(0,0,0,0.35); border: 3px solid rgba(255,255,255,0.3); border-radius: 16px;
  padding: 12px 16px; outline: none;
}
.ar-input::placeholder { color: rgba(255,255,255,0.4); font-weight: 700; font-size: 1rem; }
.ar-input:focus { border-color: #ffd23f; box-shadow: 0 0 0 4px rgba(255,210,63,0.2); }
.ar-fire {
  font-family: var(--font-arcade); font-size: 1.15rem; color: var(--arc-night);
  background: #ffd23f; border: none; border-radius: 16px; padding: 0 20px;
  box-shadow: 0 6px 0 #d98c00; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ar-fire:active { transform: translateY(4px); box-shadow: 0 2px 0 #d98c00; }
.ar-skip {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-family: var(--font-body); font-weight: 800; font-size: 0.85rem;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.ar-skip:hover { color: #fff; }

/* Banner (level up) */
.ar-banner {
  position: absolute; left: 50%; top: 38%; z-index: 5;
  font-family: var(--font-arcade); font-size: clamp(1.8rem, 7vw, 4rem); color: #ffd23f; white-space: nowrap;
  text-shadow: 0 4px 0 #ff8a00, 0 8px 0 var(--arc-pink), 0 12px 20px rgba(0,0,0,0.6);
  transform: translate(-50%, -50%) scale(0); pointer-events: none;
}
.ar-banner.go { animation: arBanner 1.4s ease forwards; }
@keyframes arBanner {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-8deg); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.15) rotate(-3deg); opacity: 1; }
  25%  { transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
  80%  { transform: translate(-50%, -50%) scale(1) rotate(-3deg); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(0.9) rotate(-3deg); opacity: 0; }
}

/* Overlays */
.ar-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; padding: 20px;
  background: rgba(10,4,30,0.72); backdrop-filter: blur(3px);
  overflow-y: auto;
}
.ar-overlay > * { margin: auto; }   /* centred, but scrolls from the top when taller than the screen */
.ar-count {
  font-family: var(--font-arcade); font-size: clamp(6rem, 30vw, 14rem); color: #ffd23f;
  text-shadow: 0 8px 0 #ff8a00, 0 16px 0 var(--arc-pink), 0 24px 40px rgba(0,0,0,0.6);
}
.ar-count.pop { animation: arCount 0.6s var(--spring); }
@keyframes arCount { from { transform: scale(2.2); opacity: 0; } }

.ar-panel {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.ar-big {
  font-family: var(--font-arcade); font-weight: 400; font-size: clamp(2.4rem, 11vw, 4rem); line-height: 1;
  color: #ffd23f; text-transform: uppercase; transform: rotate(-3deg); margin-bottom: 10px;
  text-shadow: 0 4px 0 #ff8a00, 0 8px 0 var(--arc-pink), 0 12px 0 var(--arc-pink-dk);
}
.ar-final-label { font-family: var(--font-pixel); font-size: 0.65rem; color: rgba(255,255,255,0.7); }
.ar-final { font-family: var(--font-pixel); font-size: clamp(2rem, 10vw, 3rem); color: #fff; text-shadow: 0 4px 0 var(--arc-pink-dk); }
.ar-best { font-family: var(--font-pixel); font-size: 0.65rem; color: #ffd23f; }
.ar-best-badge {
  font-family: var(--font-pixel); font-size: 0.7rem; color: var(--arc-night); background: #3ff0c4;
  padding: 8px 12px; border-radius: 8px; box-shadow: 0 4px 0 #14a368;
  animation: arBlink 0.6s steps(2) 6;
}
.ar-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; margin: 6px 0;
}
.ar-stats div {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: 12px; background: rgba(255,255,255,0.08);
}
.ar-stats b { font-family: var(--font-arcade); font-weight: 400; font-size: 1.4rem; color: #fff; }
.ar-stats span { font-size: 0.68rem; font-weight: 800; color: rgba(255,255,255,0.65); line-height: 1.15; }
.ar-missed { width: 100%; }
.ar-missed-title { font-family: var(--font-pixel); font-size: 0.6rem; color: #ff8fab; margin-bottom: 8px; }
.ar-missed-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ar-chip {
  font-weight: 800; font-size: 0.85rem; padding: 5px 10px; border-radius: 999px;
  background: rgba(225,29,72,0.2); border: 2px solid rgba(255,77,109,0.5); color: #ffd6de;
}
.ar-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-arcade); font-size: 1.2rem; padding: 14px 18px; border-radius: 16px;
  border: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}
.ar-btn.gold  { background: #ffd23f; color: var(--arc-night); box-shadow: 0 6px 0 #d98c00; }
.ar-btn.ghost { background: rgba(255,255,255,0.1); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3); font-size: 1rem; }
.ar-btn:active { transform: translateY(3px); }
.ar-row { display: flex; gap: 10px; width: 100%; }

/* Game over: results, then the Top 10 (side by side on wide screens) */
.ar-panel.ar-over { max-width: 440px; gap: 22px; padding: 10px 0 24px; }
.ar-over-main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ar-top {
  width: 100%; padding: 16px 14px; border-radius: 18px;
  background: rgba(0,0,0,0.35); box-shadow: inset 0 0 0 2px rgba(255,210,63,0.35);
}
.ar-top-title {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px;
  font-family: var(--font-pixel); font-weight: 400; font-size: 0.85rem; color: #ffd23f;
}
.ar-top-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ar-top-list li {
  display: grid; grid-template-columns: 2.2em 1fr auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,0.06);
  font-weight: 800; font-size: 0.95rem; text-align: left;
}
.ar-top-list li.me { background: rgba(63,240,196,0.18); box-shadow: inset 0 0 0 2px #3ff0c4; }
.ar-rank { font-family: var(--font-pixel); font-size: 0.7rem; color: rgba(255,255,255,0.6); }
.ar-top-list li:nth-child(1) .ar-rank { color: #ffd23f; }
.ar-top-list li:nth-child(2) .ar-rank { color: #d7e0f5; }
.ar-top-list li:nth-child(3) .ar-rank { color: #f0a46b; }
.ar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-class { font-size: 0.75rem; color: rgba(255,255,255,0.55); }
.ar-pts { font-family: var(--font-pixel); font-size: 0.7rem; color: #ffd23f; }
.ar-top-msg { margin-top: 10px; font-weight: 800; font-size: 0.85rem; color: rgba(255,255,255,0.75); }
.ar-top-msg:empty { display: none; }
.ar-top .ar-btn { margin-top: 12px; }
.ar-btn.pink { background: var(--arc-pink); color: #fff; box-shadow: 0 6px 0 var(--arc-pink-dk); font-size: 1rem; }
@media (min-width: 900px) and (min-height: 620px) {
  .ar-panel.ar-over { max-width: 900px; flex-direction: row; align-items: center; gap: 40px; }
  .ar-over-main, .ar-top { flex: 1; }
}

/* Desktop: bigger stage */
@media (min-width: 720px) {
  .ar-hud { font-size: 1.05rem; padding-top: 22px; }
  .ar-hearts { font-size: 1.6rem; }
  .ar-timer { height: 20px; }
  .ar-combo { font-size: 2.2rem; top: 10px; right: 40px; }
  .ar-input { font-size: 1.7rem; padding: 14px 20px; }
  .ar-fire { font-size: 1.4rem; padding: 0 30px; }
  .ar-tag { font-size: 0.8rem; }
}
/* Short screens (phone with keyboard open): tighten everything */
@media (max-height: 560px) {
  .ar-stage { justify-content: flex-start; gap: 10px; padding-top: 8px; }
  .ar-tag { display: none; }
  .ar-tile { aspect-ratio: 2 / 1; }
  .ar-combo { top: -6px; font-size: 1.1rem; }
}
@media (max-width: 400px) {
  .ar-hud { gap: 8px; font-size: 0.62rem; }
  .ar-hearts { font-size: 1.05rem; }
  .ar-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ar-floor, .arc-card-floor { animation: none; }
}

/* ============================================================
   BONK! — mascot moves and the hit effect
   ============================================================ */
.mascot { aspect-ratio: 1; }
.ls-dog { width: 130px; margin: 24px auto 0; }
@media (max-height: 640px) { .ls-dog { display: none; } }
.mascot .dog {
  width: 100%; height: 100%; display: block; object-fit: contain;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 6px 0 rgba(7, 11, 31, 0.45));
  animation: dogIdle 2.6s ease-in-out infinite;
}
/* Idle: a slow, smug breath */
@keyframes dogIdle { 50% { transform: scaleY(0.97) scaleX(1.025); } }

/* Right answer: lean back, then smash forward */
.mascot.swing .dog { animation: dogSwing 0.42s ease-out; }
@keyframes dogSwing {
  0%   { transform: none; }
  30%  { transform: rotate(-10deg) translateX(-4%) scale(1.04); }
  55%  { transform: rotate(12deg) translateX(6%) scaleY(0.9) scaleX(1.06); }
  75%  { transform: rotate(6deg) translateX(3%); }
  100% { transform: none; }
}
/* Wrong answer: the verb bonks back, he squashes and wobbles */
.mascot.ouch .dog { animation: dogOuch 0.7s ease-out; }
@keyframes dogOuch {
  12%  { transform: scaleY(0.78) scaleX(1.14); }
  30%  { transform: scaleY(1.04) rotate(-9deg); }
  50%  { transform: rotate(8deg); }
  70%  { transform: rotate(-4deg); }
  100% { transform: none; }
}
/* Level beaten: victory jumps and a spin */
.mascot.party .dog { animation: dogParty 1.5s ease-in-out; }
@keyframes dogParty {
  10%  { transform: scaleY(0.85) scaleX(1.1); }
  22%  { transform: translateY(-28%) rotate(-8deg); }
  34%  { transform: translateY(0) scaleY(0.9); }
  46%  { transform: translateY(-34%) rotate(180deg); }
  58%  { transform: translateY(-34%) rotate(360deg); }
  70%  { transform: translateY(0) rotate(360deg) scaleY(0.9); }
  84%  { transform: translateY(-12%) rotate(360deg); }
  100% { transform: rotate(360deg); }
}

/* The comic burst */
.bonk-fx {
  position: fixed; z-index: 9999; pointer-events: none;
  width: 150px; height: 104px; margin: -52px 0 0 -75px;
  display: grid; place-items: center;
  animation: bonkPop 0.75s cubic-bezier(.2,1.6,.4,1) forwards;
}
.bonk-fx.big { width: 220px; height: 152px; margin: -76px 0 0 -110px; }
.bonk-fx svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bonk-fx path { fill: #ffc83d; stroke: #070b1f; stroke-width: 8; stroke-linejoin: round; }
.bonk-fx.ouch path { fill: #ff5470; }
.bonk-fx b {
  position: relative; transform: rotate(-8deg);
  font-family: var(--font-head); font-weight: 400; font-size: 2rem; line-height: 1; color: #fff;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; white-space: nowrap;
}
.bonk-fx.big b { font-size: 2.9rem; }
@keyframes bonkPop {
  0%   { transform: rotate(var(--r)) scale(0.2); opacity: 1; }
  25%  { transform: rotate(var(--r)) scale(1.1); }
  70%  { transform: rotate(var(--r)) scale(1);   opacity: 1; }
  100% { transform: rotate(var(--r)) scale(0.9) translateY(-14px); opacity: 0; }
}

/* Whatever got hit squashes flat for a moment */
.bonked { animation: bonkSquish 0.32s ease-out !important; }
@keyframes bonkSquish {
  0%   { transform: scale(1); }
  30%  { transform: scaleY(0.72) scaleX(1.12); }
  60%  { transform: scaleY(1.06) scaleX(0.97); }
  100% { transform: scale(1); }
}
body.bonk-shake #page { animation: bonkShake 0.28s ease-out; }
@keyframes bonkShake {
  20% { transform: translate(-6px, 4px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 2px); }
  80% { transform: translate(2px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot .dog { animation: none; }
  body.bonk-shake #page { animation: none; }
}

/* ============================================================
   BONK DEFENSE — verbs fall, type the past form
   ============================================================ */
.mode-card.defense {
  background: radial-gradient(ellipse 80% 120% at 50% 0%, #0e6b7a 0%, #10305c 55%, var(--arc-night) 100%);
  --accent: #19c7d9; --accent-dk: #0d7f8c;
}
.mode-card.defense .mode-icon { box-shadow: inset 0 -7px 0 var(--accent-dk), inset 0 3px 0 rgba(255,255,255,0.4), 0 6px 0 var(--ink), 0 0 28px rgba(25,199,217,0.55); }
.mode-card.defense h3 { color: #7ff6ff; text-shadow: 0 3px 0 #0d7f8c, 0 6px 0 var(--arc-pink), 0 9px 0 var(--arc-pink-dk); }
.mode-card.defense .mode-badge { color: #7ff6ff; }

.df-field {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  width: 100%; max-width: 980px; margin: 0 auto; overflow: hidden;
}
.df-tag {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 2;
  font-family: var(--font-pixel); font-size: 0.6rem; letter-spacing: 0.08em; white-space: nowrap;
  color: #3ff0c4; padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,0.3);
}
.df-word {
  position: absolute; top: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px 7px; border-radius: 14px;
  background: #3b82f6; box-shadow: 0 5px 0 #1d3fa0, 0 0 0 3px var(--ink);
  color: #fff; white-space: nowrap; will-change: transform;
}
.df-word.pp { background: #a855f7; box-shadow: 0 5px 0 #6b21a8, 0 0 0 3px var(--ink); }
.df-word small { font-family: var(--font-pixel); font-size: 0.45rem; opacity: 0.85; }
.df-word b { font-family: var(--font-arcade); font-weight: 400; font-size: clamp(1.05rem, 4vw, 1.5rem); line-height: 1; }
.df-word .df-typed {
  font-style: normal; font-weight: 900; font-size: 0.85rem; color: var(--arc-night);
  background: #ffd23f; border-radius: 6px; padding: 0 6px; margin-top: 2px;
}
.df-word .df-typed:empty { display: none; }
.df-word.locked { box-shadow: 0 5px 0 #d98c00, 0 0 0 3px #ffd23f, 0 0 22px rgba(255,210,63,0.7); z-index: 2; }
.df-word.bonked-out { animation: dfOut 0.32s ease-in forwards; }
@keyframes dfOut { 30% { scale: 1.25 0.6; } 100% { scale: 0.2; opacity: 0; } }
.df-landed {
  position: absolute; bottom: 6px; transform: translateX(-50%); z-index: 2;
  font-weight: 900; font-size: 0.95rem; white-space: nowrap; color: #fff;
  background: #e11d48; padding: 4px 10px; border-radius: 999px; box-shadow: 0 3px 0 #881337;
  animation: dfLanded 1.6s ease forwards;
}
@keyframes dfLanded { 0% { transform: translate(-50%, 10px); opacity: 0; } 12%, 80% { transform: translate(-50%, 0); opacity: 1; } 100% { opacity: 0; } }

.df-base {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom));
}
.df-line {
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #ff3fa4 20%, #ff3fa4 80%, transparent);
  box-shadow: 0 0 14px #ff3fa4;
}
.df-dog { width: clamp(84px, 14vh, 130px); margin-top: -18px; }
.df-entry.shake { animation: arShake 0.4s ease; }

.df-bat {
  position: fixed; z-index: 9998; width: 22px; height: 66px; margin: -33px 0 0 -11px; pointer-events: none;
  transition: transform 0.17s linear;
}
.df-bat svg { width: 100%; height: 100%; display: block; }

@media (max-height: 560px) {
  .df-dog { width: 60px; margin-top: -10px; }
}

/* ============================================================
   CELEBRATION — a CEFR level bonked
   ============================================================ */
.celebrate-banner {
  position: fixed; left: 50%; top: 34%; z-index: 10000; pointer-events: none;
  font-family: var(--font-arcade, 'Bungee'), var(--font-head); font-style: italic;
  font-size: clamp(2.4rem, 11vw, 5.5rem); line-height: 1; white-space: nowrap;
  background: linear-gradient(#fff6a8 10%, #ffc83d 45%, #ff7a1a 70%, #ff3c8e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #2a0a4a;
  filter: drop-shadow(0 5px 0 #2a0a4a) drop-shadow(0 0 20px rgba(255, 90, 170, 0.8));
  animation: celebrateIn 2.3s ease forwards;
}
@keyframes celebrateIn {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-12deg); opacity: 0; }
  12%  { transform: translate(-50%, -50%) scale(1.25) rotate(-4deg); opacity: 1; }
  20%  { transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
  80%  { transform: translate(-50%, -50%) scale(1.05) rotate(-4deg); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.9) rotate(-4deg); opacity: 0; }
}

/* Privacy link under the home cards */
.home-legal { text-align: center; margin: 22px 0 6px; font-size: 0.8rem; font-weight: 800; }
.home-legal a { color: var(--text-lt); opacity: .7; text-decoration: underline; }

/* Google sign-in (public site) */
.home-account { margin: 22px auto 0; max-width: 520px; padding: 16px; border-radius: 18px; text-align: center;
  background: rgba(7,11,31,.55); border: 2px solid rgba(67,196,255,.3); }
.home-account p { margin: 0 0 12px; color: var(--text-lt); font-weight: 800; font-size: .92rem; }
.gsi-slot { display: flex; justify-content: center; min-height: 44px; }
.ar-top .gsi-slot { margin-top: 10px; }

/* ============================================================
   PLAYER LEVEL — nav pill + home strip
   ============================================================ */
.nav-lv {
  display: inline-flex; align-items: baseline; gap: 3px;
  padding: 1px 8px; border-radius: 999px;
  background: var(--gold); color: var(--ink); border: 2px solid var(--ink);
  font-family: var(--font-head); font-size: 0.72rem; letter-spacing: 0.04em; line-height: 1.3;
}
.nav-lv b { font-weight: 400; font-size: 0.95rem; }
#nav-me {
  flex-shrink: 0; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: var(--edge); box-shadow: 0 3px 0 var(--ink);
  color: var(--text); font-family: var(--font-body); font-weight: 800; font-size: 0.85rem;
  padding: 5px 12px 5px 6px; border-radius: 999px; cursor: pointer;
}
#nav-me.hidden { display: none; }
#nav-me:hover { background: var(--panel-hi); }
#nav-user-btn { padding-left: 6px; }

.home-level {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  width: 100%; max-width: 720px; margin: 0 auto 14px; padding: 8px 14px 8px 8px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 46%);
  border: var(--edge); border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 4px 0 var(--ink);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  animation: fadeUp 0.4s ease 0.1s both;
  transition: transform 0.18s var(--spring);
}
.home-level:hover { transform: translateY(-2px); }
.home-level:active { transform: translateY(2px); }
.hl-badge {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #fff2a8, var(--gold) 55%, var(--gold-dk));
  border: var(--edge); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18);
  color: var(--ink); line-height: 1;
}
.hl-badge small { font-size: 0.6rem; font-weight: 900; letter-spacing: 0.08em; }
.hl-badge b { font-family: var(--font-head); font-weight: 400; font-size: 1.55rem; }
.hl-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hl-top b { font-family: var(--font-head); font-weight: 400; font-size: 1.25rem; color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.hl-xp { font-size: 0.75rem; font-weight: 900; color: var(--text-lt); }
.hl-bar { display: block; height: 14px; border-radius: 999px; background: var(--slot); border: var(--edge); overflow: hidden; }
.hl-fill {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.22) 0 8px, transparent 8px 16px), linear-gradient(var(--sky), var(--sky-dk));
  border-right: 3px solid var(--ink);
  transition: width 0.8s var(--spring);
}
.hl-certs { display: flex; gap: 4px; }
.hl-medal {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 0.68rem; color: var(--muted);
  background: var(--slot); border: 2px dashed var(--border);
}
.hl-medal.got { background: var(--c); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.hl-go { font-size: 1.3rem; color: var(--text-lt); }

/* ============================================================
   GET CERTIFIED — home card
   ============================================================ */
.cert-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 210px 1fr auto; align-items: center; gap: 22px;
  max-width: 960px; margin: 0 auto 18px; padding: 18px 22px;
  border: var(--edge); border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 50%, rgba(255,200,61,0.35), transparent 45%),
    repeating-conic-gradient(from 0deg at 12% 50%, rgba(255,255,255,0.05) 0 8deg, transparent 8deg 16deg),
    linear-gradient(120deg, #3a1a6e, #1f3170 55%, #2a0f45);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow);
  cursor: pointer;
  animation: fadeUp 0.4s ease 0.2s both;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}
.cert-card:hover { transform: translateY(-4px) rotate(-0.3deg); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 10px 0 var(--ink); }
.cert-card:active { transform: translateY(3px); }
.cc-sheet {
  position: relative; aspect-ratio: 1.414; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 14px;
  background: linear-gradient(180deg, #1b0f3f, #0e1838);
  border: 4px solid var(--gold); outline: 2px solid var(--gold-dk); outline-offset: -9px;
  border-radius: 6px;
  box-shadow: 0 6px 0 var(--ink), 0 0 28px rgba(255,200,61,0.35);
  transform: rotate(-5deg);
  animation: sheetFloat 3.2s ease-in-out infinite;
}
@keyframes sheetFloat { 0%,100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-5px); } }
.cc-sheet-t { font-family: 'Bungee', var(--font-head); font-style: italic; font-size: 1.05rem; line-height: 1;
  background: linear-gradient(#fff, #ffd6f0 50%, #ff3fa4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cc-sheet-s { font-family: var(--font-head); font-size: 0.55rem; color: var(--sky); margin-top: 3px; }
.cc-sheet-n { font-family: 'Great Vibes', cursive; font-size: 1.3rem; color: #f6f3ff; margin-top: 8px; border-bottom: 2px solid var(--gold); padding: 0 14px; }
.cc-seal {
  position: absolute; bottom: -14px; right: -12px;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(#ffe66b, #ff7a59 55%, #ff3fa4);
  border: 3px solid var(--ink); box-shadow: 0 0 0 5px var(--gold), 0 4px 0 6px var(--ink);
  overflow: hidden; transform: rotate(10deg);
}
.cc-seal img { width: 100%; height: 100%; object-fit: cover; }
.cc-text { min-width: 0; }
.cc-kicker {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: #ff3fa4; color: #fff; border: 2px solid var(--ink);
  font-size: 0.7rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  transform: rotate(-2deg);
}
.cert-card h3 { font-size: 2.3rem; line-height: 1; margin: 6px 0 4px; color: var(--gold); -webkit-text-stroke-width: 6px; text-shadow: 0 4px 0 var(--ink); }
.cert-card p { font-size: 0.92rem; color: var(--text-lt); line-height: 1.4; max-width: 46ch; }
.cert-card .mode-badge {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--ink); color: var(--gold);
}
.cc-go {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-size: 1.2rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink); background: var(--gold); border: var(--edge);
  box-shadow: inset 0 -6px 0 var(--gold-dk), inset 0 3px 0 rgba(255,255,255,0.45), 0 5px 0 var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  animation: playPulse 1.8s ease-in-out infinite;
}

/* ============================================================
   PROFILE
   ============================================================ */
.pf-wrap, .cp-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.pf-hero {
  display: flex; align-items: center; gap: 18px; padding: 18px;
  background: radial-gradient(circle at 12% 40%, rgba(255,200,61,0.28), transparent 50%), linear-gradient(180deg, var(--panel-hi), var(--panel) 46%);
  border: var(--edge); border-radius: var(--radius);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow);
  animation: fadeUp 0.35s ease both;
}
.pf-badge {
  flex-shrink: 0; width: 104px; height: 104px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: radial-gradient(circle at 50% 35%, #fff2a8, var(--gold) 55%, var(--gold-dk));
  border: var(--edge); box-shadow: 0 0 0 6px var(--ink), 0 0 0 10px var(--gold), 0 8px 0 10px var(--ink);
  color: var(--ink);
  animation: springIn 0.6s var(--spring) both;
}
.pf-badge small { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.1em; }
.pf-badge b { font-family: var(--font-head); font-weight: 400; font-size: 2.9rem; }
.pf-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-who h2 { font-family: var(--font-head); font-weight: 400; font-size: 1.9rem; line-height: 1.05; text-shadow: 0 3px 0 var(--ink); overflow-wrap: anywhere; }
.pf-rank { font-family: var(--font-head); color: var(--gold); font-size: 1.15rem; }
.pf-next { color: var(--text-lt); font-size: 0.8rem; font-weight: 800; }
.pf-h { font-family: var(--font-head); font-weight: 400; font-size: 1.4rem; color: var(--text); text-shadow: 0 2px 0 var(--ink); margin-top: 8px; }
.pf-h-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.pf-exam { color: var(--gold); }
.pf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pf-stat {
  --c: var(--gold);
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--panel); border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: 0 4px 0 var(--ink);
  animation: popIn 0.35s var(--spring) both;
  min-width: 0;
}
.pf-stat.red { --c: var(--red); } .pf-stat.pink { --c: var(--pink); } .pf-stat.sky { --c: var(--sky); }
.pf-stat.grape { --c: var(--grape); } .pf-stat.mint { --c: var(--mint); }
.pf-stat-ic { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem;
  background: var(--c); color: var(--ink); border: 2px solid var(--ink); }
.pf-stat-tx { min-width: 0; display: flex; flex-direction: column; }
.pf-stat-tx b { font-family: var(--font-head); font-weight: 400; font-size: 1.35rem; line-height: 1.05; }
.pf-stat-tx small { font-size: 0.68rem; font-weight: 900; color: var(--text-lt); text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2; }

.pf-verbs { padding: 14px 16px; background: var(--panel); border: var(--edge); border-radius: var(--radius); box-shadow: 0 5px 0 var(--ink); display: flex; flex-direction: column; gap: 8px; }
.pf-verbs-total { color: var(--text-lt); font-size: 0.9rem; margin-bottom: 2px; }
.pf-verbs-total b { font-family: var(--font-head); font-weight: 400; font-size: 1.5rem; color: var(--gold); }
.pf-vrow { display: grid; grid-template-columns: 36px 1fr 64px; align-items: center; gap: 10px; }
.pf-vlv { font-family: var(--font-head); color: var(--c); font-size: 1rem; }
.pf-vbar { height: 12px; border-radius: 999px; background: var(--slot); border: 2px solid var(--ink); overflow: hidden; }
.pf-vfill { display: block; height: 100%; background: var(--c); transition: width 0.8s var(--spring); }
.pf-vnum { text-align: right; font-size: 0.8rem; color: var(--text-lt); font-weight: 900; }
.pf-account { padding: 16px; border-radius: 18px; text-align: center; background: rgba(7,11,31,.55); border: 2px solid rgba(67,196,255,.3); }
.pf-account p { color: var(--text-lt); font-weight: 800; font-size: 0.9rem; margin-bottom: 10px; overflow-wrap: anywhere; }
.pf-back { align-self: center; margin-top: 6px; }

/* Certificate tiles (profile wall + exam picker) */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cert-tile {
  --c: var(--gold);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px; min-height: 150px;
  background: var(--slot); border: 3px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: transform 0.18s var(--spring);
  animation: popIn 0.35s var(--spring) both;
}
.cert-tile:hover { transform: translateY(-3px) rotate(-0.6deg); }
.cert-tile.got {
  border: var(--edge);
  background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--c) 35%, transparent), transparent 55%), linear-gradient(180deg, #24185a, #141f48);
  box-shadow: 0 5px 0 var(--ink), 0 0 0 2px var(--c) inset;
}
.ct-lv {
  font-family: var(--font-head); font-size: 1.3rem; padding: 2px 12px; border-radius: 10px;
  background: var(--c); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.cert-tile:not(.got) .ct-lv { background: transparent; color: var(--c); border-color: var(--c); box-shadow: none; }
.ct-tx { display: flex; flex-direction: column; gap: 2px; }
.ct-tx b { font-family: var(--font-head); font-weight: 400; font-size: 1.15rem; line-height: 1.1; color: var(--c); }
.ct-tx small { font-size: 0.75rem; color: var(--text-lt); font-weight: 800; }
.ct-go { margin-top: auto; font-size: 0.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-lt); display: inline-flex; align-items: center; gap: 5px; }
.cert-tile.got .ct-go { color: var(--c); }

/* ============================================================
   GET CERTIFIED — level picker
   ============================================================ */
.cp-title, .cr-title {
  font-family: 'Bungee', var(--font-head); font-style: italic; font-weight: 400; text-align: center;
  font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #ffd6f0 45%, #ff3fa4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 var(--ink));
}
.cp-sub, .cr-sub { text-align: center; color: var(--text-lt); max-width: 52ch; margin: 0 auto; line-height: 1.45; }
.cp-rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 6px; }
.cp-rules span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel); border: 2px solid var(--ink); font-size: 0.82rem; font-weight: 800;
}
.cp-rules .ico { color: var(--gold); }
.cp-fine { text-align: center; font-size: 0.75rem; color: var(--muted); }

/* ============================================================
   CERTIFICATE — result / view
   ============================================================ */
.cr-wrap { --c: var(--gold); max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }
.cr-cert { display: flex; flex-direction: column; gap: 12px; }
.cr-frame { border-radius: 10px; overflow: hidden; border: var(--edge); box-shadow: 0 8px 0 var(--ink), 0 0 40px color-mix(in srgb, var(--c) 40%, transparent); animation: springIn 0.6s var(--spring) both; }
.cr-canvas { display: block; width: 100%; height: auto; }
.cr-id { text-align: center; font-size: 0.85rem; font-weight: 900; color: var(--muted); letter-spacing: 0.04em; }
.cr-id.ok { color: var(--mint); }
.cr-id.ok::before { content: '✔ VERIFIED · '; }
.cr-name-label { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-lt); }
.cr-name {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--slot); border: var(--edge); box-shadow: inset 0 4px 0 rgba(0,0,0,0.35);
  color: var(--text); font-family: var(--font-head); font-size: 1.3rem; outline: none;
}
.cr-name:focus { border-color: var(--sky); }
.cr-claim { display: flex; flex-direction: column; gap: 8px; }
.cr-claim.hidden, .cr-signin.hidden { display: none; }
.cr-signin { padding: 14px; border-radius: 16px; text-align: center; background: rgba(7,11,31,.55); border: 2px solid rgba(67,196,255,.35); }
.cr-signin p { color: var(--text-lt); font-weight: 800; font-size: 0.92rem; margin-bottom: 10px; }
.cr-share { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cr-share .btn-primary { font-size: 1.05rem; padding: 12px 14px; }
.cr-share .btn-primary.alt { --b: var(--sky); --b-dk: var(--sky-dk); }
.cr-share .btn-ghost { grid-column: 1 / -1; justify-self: center; }
.cr-share-h { grid-column: 1 / -1; margin-top: 6px; text-align: center; font-family: var(--font-head); font-size: 1.15rem; letter-spacing: 0.04em; color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.cr-share #cr-challenge { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 420px; margin-top: 6px; }
.cr-nets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cr-net, .cr-save {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 6px 10px; border-radius: var(--radius-sm); border: var(--edge); cursor: pointer;
  background: var(--n, #1f3170); color: #fff; font-family: var(--font-head); font-size: 0.95rem; letter-spacing: 0.02em;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.28), inset 0 3px 0 rgba(255,255,255,0.18), 0 5px 0 var(--ink);
}
.cr-net:active, .cr-save:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.28), 0 1px 0 var(--ink); }
.cr-net .ico { width: 34px; height: 34px; }
.cr-net.tiktok { --n: #111; }
.cr-net.tiktok .ico { filter: drop-shadow(-2px -1px 0 #25f4ee) drop-shadow(2px 1px 0 #fe2c55); }
.cr-net.insta  { --n: linear-gradient(45deg, #f9a825, #e1306c 45%, #833ab4); }
.cr-net.fb     { --n: #1877f2; }
.cr-net.reddit { --n: #ff4500; }
.cr-net.xcom   { --n: #000; }
.cr-net.wa     { --n: #25d366; color: #062b16; }
.cr-saves { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cr-save { --n: #1f3170; flex-direction: row; gap: 10px; padding: 12px 10px; font-size: 1.02rem; }
.cr-save small { font-family: var(--font-body, inherit); font-weight: 900; font-size: 0.75rem; color: var(--text-lt); }
.cr-shape { flex: none; border: 3px solid currentColor; border-radius: 4px; background: color-mix(in srgb, var(--c) 45%, transparent); }
.cr-shape.story { width: 16px; height: 28px; }
.cr-shape.post  { width: 20px; height: 25px; }
.cr-shape.cert  { width: 30px; height: 21px; }
.btn-li {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: #0a66c2; color: #fff; border: var(--edge);
  box-shadow: inset 0 -5px 0 #064786, inset 0 3px 0 rgba(255,255,255,0.25), 0 5px 0 var(--ink);
  font-family: var(--font-head); font-size: 1.05rem; letter-spacing: 0.03em; cursor: pointer;
}
.btn-li:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 #064786, 0 1px 0 var(--ink); }
.btn-li.ghost { background: #12305a; box-shadow: inset 0 -5px 0 #0b1f3d, 0 5px 0 var(--ink); }
.li-logo { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; background: #fff; color: #0a66c2; font-family: Arial, sans-serif; font-weight: 900; font-size: 0.95rem; }
.cr-share .hidden { display: none; }
.cr-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cr-actions .btn-primary { max-width: 420px; }

/* Failed exam: the suspects escaped (the cell is empty, the door is open) */
.cr-wrap.jail .cr-title { background: linear-gradient(180deg, #fff 0%, #ffc4cf 45%, var(--red) 100%); -webkit-background-clip: text; background-clip: text; }
.cr-jail { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cr-bars {
  position: relative; width: 220px; height: 220px; border-radius: 24px; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, #3e1427, #1a0b1e);
  border: var(--edge); box-shadow: 0 6px 0 var(--ink);
}
.cr-bars::after {
  content: ''; position: absolute; inset: 0;
  content: '💨'; display: grid; place-items: end start; padding: 0 0 18px 18px; font-size: 2.4rem;
}
.cr-jail-dog { position: absolute; inset: 22px 14px 6px; }
/* Officer Chems after the suspects escaped: tears, a frown and his own rain cloud */
.mascot.sad .dog { animation: dogSad 3.4s ease-in-out infinite; filter: saturate(0.75) brightness(0.92) drop-shadow(0 6px 0 rgba(7, 11, 31, 0.45)); }
@keyframes dogSad { 0%,100% { transform: rotate(-3deg) translateY(4%) scaleY(0.96); } 50% { transform: rotate(2deg) translateY(6%) scaleY(0.93); } }
.cr-cloud { position: absolute; top: 4px; left: 50%; translate: -50% 0; font-size: 2.6rem; line-height: 1; animation: cloudDrift 4s ease-in-out infinite; }
@keyframes cloudDrift { 50% { translate: -40% 0; } }
@media (prefers-reduced-motion: reduce) { .mascot.sad .dog, .cr-cloud { animation: none; } }
.cr-jail-h { font-weight: 900; color: var(--text-lt); }
.cr-missed { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Exam intro */
.ci-bg { position: fixed; inset: 0; z-index: 900; background: rgba(4,6,18,0.75); display: grid; place-items: center; padding: 16px; }
.ci-bg.hidden { display: none; }
.ci-modal {
  --c: var(--gold);
  width: 100%; max-width: 420px; padding: 24px 22px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 46%);
  border: var(--edge); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: springIn 0.4s var(--spring) both;
}
.ci-lv { font-family: var(--font-head); font-size: 2rem; padding: 4px 18px; border-radius: 14px; background: var(--c); color: var(--ink); border: var(--edge); box-shadow: 0 4px 0 var(--ink); }
.ci-modal h3 { font-family: var(--font-head); font-weight: 400; font-size: 1.8rem; color: var(--c); text-shadow: 0 3px 0 var(--ink); line-height: 1.1; }
.ci-kicker { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-lt); }
.ci-modal ul { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; color: var(--text-lt); font-size: 0.95rem; }
.ci-modal li::before { content: '🏏 '; }
.ci-modal li b { color: var(--text); }
.ci-again { font-size: 0.85rem; color: var(--gold); }

@media (max-width: 720px) {
  .home-level { grid-template-columns: auto 1fr auto; border-radius: 22px; }
  .hl-certs { grid-column: 1 / -1; justify-content: center; }
  .hl-go { grid-row: 1; grid-column: 3; }
  .cert-card { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 14px; padding: 22px 18px; }
  .cc-sheet { width: 200px; }
  .cert-card p { margin: 0 auto; }
  .pf-stats { grid-template-columns: 1fr 1fr; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .cr-share { grid-template-columns: 1fr; }
  .cr-nets { grid-template-columns: repeat(3, 1fr); }
  .cr-save { flex-direction: column; gap: 6px; }
  .pf-hero { flex-direction: column; text-align: center; }
  .pf-badge { width: 92px; height: 92px; }
}
@media (max-width: 420px) {
  .nav-me-txt { display: none; }
  #nav-me { padding-right: 6px; }
  .pf-stat { padding: 8px; gap: 8px; }
  .pf-stat-ic { width: 30px; height: 30px; font-size: 1rem; }
  .cert-tile { min-height: 132px; padding: 12px; }
}
@media (max-width: 420px) {
  body.public-mode #nav-username { display: none; }
}

/* Certification exam clock (drains; right verbs add time) */
.ls-clock {
  position: relative; width: calc(100% - 32px); max-width: 688px; margin: 2px auto 0;
  height: 22px; border-radius: 999px; background: var(--slot); border: var(--edge); overflow: hidden;
}
.ls-clock i {
  display: block; height: 100%; width: 60%;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.2) 0 8px, transparent 8px 16px), linear-gradient(90deg, #3ff0c4, #ffd23f);
  transition: width 0.12s linear;
}
.ls-clock span {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-head); font-size: 0.95rem; color: #fff; text-shadow: 0 2px 0 var(--ink);
}
.ls-clock b { font-weight: 400; }
.ls-clock.low i { background: linear-gradient(90deg, #ff3f6c, #ff8a00); animation: arBlink 0.5s steps(2) infinite; }
.ls-clock.bump { animation: clockBump 0.4s var(--spring); }
@keyframes clockBump { 40% { transform: scale(1.04); box-shadow: 0 0 0 4px rgba(62,224,156,0.5); } }

.cert-tile.locked { opacity: 0.55; filter: grayscale(0.6); cursor: not-allowed; }
.cert-tile.locked:hover { transform: none; }

/* A friend's dare (?beat=) */
.beat-banner {
  --c: var(--gold);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  max-width: 720px; margin: 0 auto 14px; padding: 12px 14px;
  background: linear-gradient(120deg, #4a1450, #1f3170);
  border: var(--edge); border-radius: var(--radius);
  box-shadow: 0 0 0 3px var(--c) inset, 0 5px 0 var(--ink);
  cursor: pointer; animation: springIn 0.5s var(--spring) both;
}
.beat-lv { font-family: var(--font-head); font-size: 1.5rem; padding: 4px 12px; border-radius: 12px; background: var(--c); color: var(--ink); border: 2px solid var(--ink); }
.beat-banner b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 1.15rem; line-height: 1.15; }
.beat-banner small { color: var(--text-lt); font-size: 0.85rem; }
.beat-go {
  padding: 10px 14px; border-radius: var(--radius-sm); white-space: nowrap;
  font-family: var(--font-head); text-transform: uppercase; color: var(--ink); background: var(--gold); border: var(--edge);
  box-shadow: inset 0 -4px 0 var(--gold-dk), 0 4px 0 var(--ink);
  display: inline-flex; align-items: center; gap: 6px; animation: playPulse 1.8s ease-in-out infinite;
}
.cr-share .btn-primary.alt2 { --b: #ff3fa4; --b-dk: #c22a7c; --b-fg: #fff; }
@media (max-width: 520px) {
  .beat-banner { grid-template-columns: auto 1fr; }
  .beat-go { grid-column: 1 / -1; justify-content: center; }
}

/* ============================================================
   VERB GANGS — home card, path, verb card, crib sheet
   ============================================================ */
.gangs-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  max-width: 960px; margin: 0 auto 18px; padding: 18px 22px;
  border: var(--edge); border-radius: var(--radius);
  background:
    radial-gradient(circle at 10% 50%, rgba(62,224,156,0.35), transparent 45%),
    linear-gradient(120deg, #0f4a5a, #1f3170 60%, #16234d);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow);
  cursor: pointer;
  animation: fadeUp 0.4s ease 0.15s both;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}
.gangs-card:hover { transform: translateY(-4px) rotate(-0.3deg); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 10px 0 var(--ink); }
.gangs-card:active { transform: translateY(3px); }
.gc-crew { display: flex; }
.gc-crew span {
  width: 64px; height: 64px; display: grid; place-items: center; font-size: 2.1rem;
  background: var(--slot); border: var(--edge); border-radius: 50%; box-shadow: 0 4px 0 var(--ink);
  margin-left: -14px; animation: crewBob 2.4s ease-in-out infinite;
}
.gc-crew span:first-child { margin-left: 0; }
.gc-crew span:nth-child(2) { animation-delay: 0.3s; transform: translateY(-6px); }
.gc-crew span:nth-child(3) { animation-delay: 0.6s; }
@keyframes crewBob { 0%,100% { translate: 0 0; } 50% { translate: 0 -5px; } }
/* Mugshots: verbs posing in front of the height chart */
.gc-crew .gc-mug {
  width: 72px; height: 88px; border-radius: 8px; margin-left: -10px; padding: 6px 4px 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background:
    repeating-linear-gradient(180deg, transparent 0 13px, rgba(255,255,255,0.28) 13px 15px),
    linear-gradient(180deg, #3b4a7a, #26305a);
  rotate: -4deg;
}
.gc-crew .gc-mug:nth-child(2) { rotate: 2deg; z-index: 1; }
.gc-crew .gc-mug:nth-child(3) { rotate: 6deg; }
.gc-mug b { font-family: var(--font-head); font-weight: 400; font-size: 1.35rem; line-height: 1; color: #fff; margin-top: 14px;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.gc-mug small { position: relative; z-index: 2; width: 100%; padding: 1px 0; border-radius: 3px; background: #f3dfb0; color: var(--ink); border: 2px solid var(--ink);
  font-size: 0.55rem; font-weight: 900; letter-spacing: 0.04em; text-align: center; }
/* Prisoners: orange jumpsuit, and one of them in cuffs */
.gc-crew .gc-mug { position: relative; overflow: hidden; }
.gc-mug b { position: relative; z-index: 1; }
.gc-suit {
  position: absolute; left: 7px; right: 7px; bottom: -4px; height: 40px; z-index: 0;
  background: #ff7a1a; border: 2px solid var(--ink); border-radius: 16px 16px 0 0;
}
.gc-suit::before { content: ''; position: absolute; left: 50%; top: -2px; width: 14px; height: 12px; margin-left: -7px;
  background: #3b4a7a; border: 2px solid var(--ink); border-top: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.gc-cuffs { position: absolute; left: 50%; bottom: 17px; width: 50px; margin-left: -25px; z-index: 3; line-height: 0; }
.gc-cuffs svg { width: 100%; height: auto; }
/* Hall of Fame */
.hof-card {
  max-width: 960px; margin: 18px auto 0; padding: 18px 20px; border: var(--edge); border-radius: var(--radius);
  background: radial-gradient(circle at 90% 0%, rgba(255,210,26,0.22), transparent 50%), linear-gradient(160deg, #2a2160, #1a1f48);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), var(--shadow);
}
.hof-head { display: flex; align-items: center; gap: 14px; }
.hof-trophy { font-size: 2.6rem; filter: drop-shadow(0 3px 0 var(--ink)); }
.hof-card h3 { font-family: var(--font-head); font-size: 2rem; line-height: 1; color: var(--gold); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; font-weight: 400; }
.hof-card p { font-size: 0.88rem; color: var(--text-lt); margin-top: 4px; }
.hof-tabs { display: flex; gap: 8px; margin: 14px 0 10px; }
.hof-tab { flex: 1; padding: 8px 10px; font: inherit; font-weight: 900; font-size: 0.85rem; color: var(--text-lt); cursor: pointer;
  background: var(--slot); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.hof-tab.on { color: var(--ink); background: var(--gold); }
.hof-list { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.hof-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(0,0,0,0.35); border-radius: 12px; }
.hof-row:first-child { background: rgba(255,210,26,0.16); border-color: var(--gold); }
.hof-row.me { outline: 3px solid var(--mint); }
.hof-rank { font-size: 1.4rem; text-align: center; font-weight: 900; color: var(--text-lt); }
.hof-name { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-score { font-family: var(--font-head); font-size: 1.2rem; color: var(--gold); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.hof-empty { text-align: center; color: var(--text-lt); font-weight: 800; padding: 10px; }
.gc-kicker { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mint); }
.gc-kicker b { color: var(--text); }
.gangs-card h3 { font-size: 2.3rem; line-height: 1; margin: 6px 0 4px; color: var(--mint); -webkit-text-stroke-width: 6px; text-shadow: 0 4px 0 var(--ink); }
.gangs-card p { font-size: 0.92rem; color: var(--text-lt); line-height: 1.4; max-width: 46ch; }
.gangs-card .mode-badge {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--ink); color: var(--mint);
}
.gc-go {
  padding: 12px 28px; font-family: var(--font-head); font-size: 1.5rem; letter-spacing: 0.04em; color: var(--ink);
  background: var(--mint); border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 0 -6px 0 var(--mint-dk), inset 0 3px 0 rgba(255,255,255,0.45), 0 5px 0 var(--ink);
  display: inline-flex; align-items: center; gap: 8px; animation: playPulse 1.8s ease-in-out infinite;
}

/* Path */
.gang-list { display: flex; flex-direction: column; gap: 10px; }
.gang-tile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px 14px; text-align: left; color: var(--text); font: inherit; cursor: pointer;
  background: var(--panel); border: var(--edge); border-radius: var(--radius-sm); box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.18s var(--spring);
  animation: popIn 0.35s var(--spring) both;
}
.gang-tile:hover { transform: translateY(-2px); }
.gang-tile.next { border-color: var(--mint); box-shadow: 0 5px 0 var(--mint-dk), 0 0 0 3px rgba(62,224,156,0.25); }
.gang-tile.done { background: linear-gradient(90deg, #17405a, var(--panel)); }
.gang-tile.locked { opacity: 0.55; background: var(--slot); box-shadow: none; }
.gt-emoji { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.8rem; background: var(--slot); border: 2px solid var(--ink); border-radius: 50%; }
.gang-tile.locked .gt-emoji { filter: grayscale(1); }
.gt-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gt-tx b { font-family: var(--font-head); font-weight: 400; font-size: 1.2rem; line-height: 1.1; }
.gt-rule { color: var(--gold); font-weight: 900; font-size: 0.8rem; }
.gt-verbs { color: var(--text-lt); font-size: 0.78rem; font-weight: 700; overflow-wrap: anywhere; }
.gt-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.gt-stars { color: var(--gold); letter-spacing: 2px; font-size: 1rem; }
.gt-go { font-size: 0.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mint); display: inline-flex; align-items: center; gap: 4px; }
.gang-tile.locked .gt-go { color: var(--muted); }

/* Lesson: gang tag, crib sheet, verb card, recruit */
.ls-tag b { color: var(--gold); }
.ls-gang-emoji { font-size: 1.1em; }
.ls-es { display: block; font-family: var(--font-body); font-size: 0.9rem; font-weight: 800; color: var(--text-lt); margin-top: 4px; }
.ls-roster {
  display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; padding: 10px 12px;
  background: rgba(7,11,31,0.55); border: 2px dashed var(--border); border-radius: var(--radius-sm);
  transition: filter 0.3s ease;
}
.lr-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-weight: 900; font-size: 0.95rem; }
.lr-cell { text-align: center; }
.lr-cell:not(:first-child) { color: var(--mint); }
.lr-row.fresh { animation: popIn 0.4s var(--spring) both; }
.ls-roster.hiding .lr-cell:not(:first-child) { color: var(--muted); }
.ls-roster.hiding { border-color: var(--red); }

.vc { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.vc-es { padding: 4px 14px; border-radius: 999px; background: var(--slot); border: 2px solid var(--ink); color: var(--text-lt); font-weight: 900; }
.vc-forms { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vc-form {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 6px; cursor: pointer;
  color: var(--text); font: inherit; background: var(--panel-hi); border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: 0 6px 0 var(--ink); animation: vcPulse 1.6s ease-in-out infinite;
}
.vc-form:nth-child(2) { animation-delay: 0.2s; } .vc-form:nth-child(3) { animation-delay: 0.4s; }
.vc-form small { font-size: 0.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lt); }
.vc-form b { font-family: var(--font-head); font-weight: 400; font-size: 1.6rem; overflow-wrap: anywhere; text-align: center; }
.vc-form[data-hit] { animation: none; background: #0f5a43; border-color: var(--mint); box-shadow: 0 6px 0 var(--mint-dk); }
.vc-form.hit { animation: rowWin 0.35s ease; }
@keyframes vcPulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.vc-ex { display: block; font-size: 1.05rem; font-weight: 700; color: var(--text-lt); text-align: center; line-height: 1.6; }
.vc-ex .vc-say { display: inline-block; vertical-align: middle; margin-right: 8px; }
.vc-ex mark, .ls-ex mark { background: none; color: var(--gold); font-weight: 900; }
.vc-say { background: var(--slot); border: 2px solid var(--ink); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; flex-shrink: 0; }
.ls-ex { display: block; margin-top: 4px; font-size: 0.9rem; opacity: 0.9; }
.ls-foot.bad.soft { background: #3a2a14; }
.ls-foot.bad.soft .ls-fb-icon, .ls-foot.bad.soft #ls-fb-title { color: var(--gold); }
.ls-foot.bad.soft #ls-fb-text { color: #ffe3a8; }
.ls-foot.bad.soft .ls-check { --b: var(--gold); --b-dk: var(--gold-dk); color: var(--ink); }
.rr-gang { font-size: 3rem; line-height: 1; }
.rr-next { --b: var(--mint); --b-dk: var(--mint-dk); }

@media (max-width: 720px) {
  .gangs-card { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 12px; padding: 20px 16px; }
  .gangs-card p { margin: 0 auto; }
}
@media (max-width: 420px) {
  .vc-form b { font-size: 1.25rem; }
  .gt-emoji { width: 42px; height: 42px; font-size: 1.4rem; }
  .lr-row { font-size: 0.85rem; }
}
.ls-slot.input.ok { border-color: var(--mint); background: #0f3f35; }

/* ============================================================
   OFFICER BONK — cops and verb criminals
   ============================================================ */
.gp-story {
  display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--panel); border: var(--edge); border-radius: var(--radius-sm); box-shadow: 0 5px 0 var(--ink);
}
.gp-cop { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 3px 0 var(--ink)); }
.gp-story b { font-family: var(--font-head); font-weight: 400; font-size: 1.2rem; color: var(--sky); }
.gp-story p { color: var(--text-lt); font-size: 0.9rem; line-height: 1.45; margin-top: 2px; }
.gp-story em { font-style: normal; font-weight: 900; color: var(--text); }
.gp-jail { align-self: center; }
.gt-case { font-size: 0.68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sky); }
.gang-tile.done .gt-case { color: var(--mint); }

/* Mugshot */
.vc-shot {
  width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 12px 16px; border: var(--edge); border-radius: var(--radius-sm); box-shadow: 0 6px 0 var(--ink);
  background:
    repeating-linear-gradient(180deg, transparent 0 21px, rgba(255,255,255,0.10) 21px 23px),
    linear-gradient(180deg, #2b3f7d, #1a2758);
}
.vc-plate { font-family: var(--font-head); font-size: 0.85rem; letter-spacing: 0.08em; padding: 3px 12px; background: var(--ink); color: var(--gold); border-radius: 6px; }
.vc-name { font-family: 'Bungee', var(--font-head); font-weight: 400; font-size: clamp(2.2rem, 10vw, 3.2rem); line-height: 1; text-shadow: 0 4px 0 var(--ink); }
.vc-aka { font-size: 0.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lt); }
.vc-seen { color: var(--sky); font-weight: 900; white-space: nowrap; }
.lr-head { font-size: 0.68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sky); margin-bottom: 2px; }
.ls-roster.hiding .lr-head { color: var(--red); }

/* Lineup: height-chart stripes behind the suspects */
.ls-lineup .ls-row {
  background-image: repeating-linear-gradient(180deg, transparent 0 15px, rgba(255,255,255,0.06) 15px 16px);
}

/* Handcuffs on a bust */
.cuffs-fx {
  position: fixed; z-index: 60; pointer-events: none; font-size: 3.4rem; transform: translate(-50%, -50%);
  animation: cuffSnap 0.9s var(--spring) both; filter: drop-shadow(0 4px 0 var(--ink));
}
@keyframes cuffSnap {
  0% { transform: translate(-50%, -160%) rotate(-40deg) scale(0.6); opacity: 0; }
  35% { transform: translate(-50%, -50%) rotate(8deg) scale(1.2); opacity: 1; }
  70% { transform: translate(-50%, -50%) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* WANTED posters on the home card */
.mode-card .mode-icon.wanted-posters { width: auto; min-width: 64px; height: 64px; padding: 0 6px; background: none; box-shadow: none; border: none; display: flex; align-items: center; }
.wp {
  width: 46px; height: 58px; margin-left: -12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #f3dfb0; color: #3a2410; border: 2px solid var(--ink); border-radius: 4px; box-shadow: 0 3px 0 var(--ink);
  transform: rotate(var(--t, 0deg));
}
.wp:first-child { margin-left: 0; }
.wp small { font-family: var(--font-head); font-size: 0.5rem; letter-spacing: 0.04em; color: #b3261e; }
.wp b { font-family: var(--font-head); font-weight: 400; font-size: 0.72rem; overflow-wrap: anywhere; text-align: center; line-height: 1; }
.wp.empty { font-size: 1.8rem; background: var(--grape); }

/* Grammar Jail card on home: the student's prisoners, behind bars */
.jail-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 960px; margin: 0 auto 18px; padding: 16px 18px 18px;
  border: var(--edge); border-radius: var(--radius);
  background:
    radial-gradient(circle at 92% 0%, rgba(255,200,61,0.22), transparent 40%),
    linear-gradient(135deg, #3a2160, #1d1b48 55%, #121838);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), var(--shadow);
  cursor: pointer;
  animation: fadeUp 0.4s ease 0.1s both;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}
.jail-card:hover { transform: translateY(-4px) rotate(0.3deg); box-shadow: inset 0 2px 0 rgba(255,255,255,0.14), 0 10px 0 var(--ink); }
.jail-card:active { transform: translateY(3px); }
.jc-top { display: flex; flex-direction: column; }
.jc-kicker { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); }
.jc-kicker b { color: var(--text); }
.jail-card h3 { font-family: var(--font-head); font-weight: 400; letter-spacing: 0.02em; font-size: 2.1rem; line-height: 1; margin: 4px 0 0; color: var(--gold); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.jc-cell {
  position: relative; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px;
  min-height: 92px; padding: 14px 12px;
  background: linear-gradient(180deg, #0b1030, #141a44);
  border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 0 6px 0 rgba(0,0,0,0.35);
}
/* the bars, with a crossbar */
.jc-cell::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(205,214,240,0.8) 0 6px, transparent 6px calc(100% - 6px), rgba(205,214,240,0.8) calc(100% - 6px)),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(205,214,240,0.7) 26px 31px);
  opacity: 0.5;
}
.jc-con {
  position: relative; z-index: 0;
  padding: 6px 12px; border-radius: 10px;
  font-family: var(--font-head); font-size: 1.15rem; line-height: 1.1; color: var(--ink);
  background: #ff9a3d; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  background-image: repeating-linear-gradient(180deg, transparent 0 7px, rgba(7,11,31,0.18) 7px 10px);
  animation: popIn 0.35s var(--spring) both;
}
.jc-con.new { background-color: var(--gold); box-shadow: 0 3px 0 var(--ink), 0 0 0 3px rgba(255,200,61,0.45); }
.jc-con.new::before {
  content: 'NEW'; position: absolute; top: -9px; right: -6px;
  padding: 0 5px; border-radius: 6px; font-size: 0.6rem; letter-spacing: 0.05em;
  color: #fff; background: var(--red); border: 2px solid var(--ink);
}
.jc-con.more { background: var(--slot); color: var(--text); background-image: none; }
.jc-con.ghost { background: var(--slot); color: var(--muted); background-image: none; box-shadow: none; border-style: dashed; min-width: 52px; text-align: center; }
.jail-card .mode-badge {
  align-self: flex-start; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--ink); color: var(--gold);
}
@media (min-width: 721px) {
  .jail-card { display: grid; grid-template-columns: minmax(180px, auto) 1fr; grid-template-areas: "top cell" "badge cell"; align-items: center; column-gap: 20px; row-gap: 8px; padding: 18px 22px; }
  .jc-top { grid-area: top; align-self: end; }
  .jail-card .mode-badge { grid-area: badge; align-self: start; }
  .jc-cell { grid-area: cell; }
  .jail-card h3 { font-size: 2.3rem; }
}

/* Grammar Jail: escaped verbs and how to catch them */
.jl-alert {
  margin: 0 0 14px; padding: 14px 16px; text-align: center;
  background: #f3dfb0; color: #3a2410; border: var(--edge); border-radius: var(--radius-sm); box-shadow: 0 5px 0 var(--ink);
  animation: popIn 0.35s var(--spring) both;
}
.jl-alert-h { font-family: var(--font-head); font-size: 1.5rem; color: #b3261e; margin: 0 0 4px; }
.jl-alert-how { font-weight: 700; line-height: 1.45; margin: 0 auto 12px; max-width: 46ch; }
.jl-alert-how b { color: #b3261e; }
.jl-wanted { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.jl-w {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; padding: 6px 10px;
  background: #fff6de; border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink);
}
.jl-w b { font-family: var(--font-head); font-weight: 400; font-size: 1.1rem; }
.jl-w small { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: #b3261e; }
.jl-catch { width: 100%; max-width: 320px; }

/* Grammar Jail */
.jl-blocks { display: flex; flex-direction: column; gap: 12px; }
.jl-block { padding: 12px 14px; background: var(--panel); border: var(--edge); border-radius: var(--radius-sm); box-shadow: 0 5px 0 var(--ink); animation: popIn 0.35s var(--spring) both; }
.jl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.jl-head span { font-family: var(--font-head); font-size: 1.1rem; }
.jl-head small { color: var(--text-lt); font-weight: 900; }
.jl-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.jl-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 6px; border-radius: 10px; border: 2px solid var(--ink); background: var(--slot); overflow: hidden;
}
.jl-cell b { font-family: var(--font-head); font-weight: 400; font-size: 1.05rem; position: relative; z-index: 1; }
.jl-cell small { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); position: relative; z-index: 1; }
.jl-cell.in { background: #20305f; }
.jl-cell.in::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(200,210,240,0.55) 10px 13px);
}
.jl-cell.in small { color: var(--mint); }
.jl-cell.boss.in { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.jl-cell.boss.in small { color: var(--gold); }
.jl-cell.out { background: #f3dfb0; color: #3a2410; }
.jl-cell.out small { color: #b3261e; }
.jl-cell.empty b { color: var(--muted); }

/* Case files: a police dossier for each gang (briefing at the start of a case, and in Grammar Jail) */
.dos {
  --paper: #fbf5e6; --typed: #2a2622; --manila: #d8ad62; --manila-dk: #b88a3f; --stamp: #c8283c;
  position: relative; width: 100%; padding: 22px 10px 12px; margin-top: 10px;
  background: linear-gradient(160deg, #e2bb74, var(--manila) 45%, #c99a4c);
  border-radius: 6px 14px 14px 14px; box-shadow: 0 14px 30px -12px rgba(0,0,0,0.6), 0 2px 0 var(--manila-dk);
  text-align: left; animation: dosIn 0.5s var(--spring) both;
}
.dos-tab {
  position: absolute; left: 0; top: -18px; padding: 4px 16px 6px; border-radius: 8px 8px 0 0;
  background: #e2bb74; font: 400 0.8rem 'Special Elite', monospace; letter-spacing: 0.12em; color: #5a3d14;
}
.dos-paper {
  position: relative; padding: 18px 18px 16px; color: var(--typed); transform: rotate(-0.6deg);
  background:
    radial-gradient(circle at 88% 92%, transparent 26px, rgba(120,72,24,0.13) 27px, rgba(120,72,24,0.05) 31px, transparent 32px),
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.7), transparent 60%),
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(70,110,170,0.09) 27px 28px),
    var(--paper);
  border-radius: 3px; box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 8px 18px -8px rgba(60,35,5,0.55);
}
.dos-clip {
  position: absolute; top: -14px; right: 34px; width: 16px; height: 46px; border: 3px solid #8e98a8; border-radius: 9px;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.15); transform: rotate(6deg);
}
.dos-clip::after { content: ''; position: absolute; left: 2px; right: 2px; top: 8px; bottom: -3px; border: 3px solid #b3bccb; border-top: none; border-radius: 0 0 7px 7px; }
.dos-top {
  display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; margin-bottom: 12px; padding-right: 48px;
  border-bottom: 2px solid var(--typed); font: 400 0.68rem 'Special Elite', monospace; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8;
}
.dos-head { display: flex; gap: 14px; align-items: flex-start; }
.dos-photo {
  position: relative; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 82px;
  padding: 6px 6px 4px; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.25); transform: rotate(-4deg);
}
.dos-photo::before {
  content: ''; position: absolute; top: -8px; left: 50%; width: 46px; height: 16px; margin-left: -23px;
  background: rgba(255,240,180,0.75); box-shadow: 0 1px 2px rgba(0,0,0,0.1); transform: rotate(3deg);
}
.dos-emoji {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; font-size: 2.4rem;
  background: repeating-linear-gradient(180deg, #d9dde4 0 9px, #c7ccd6 9px 10px); filter: saturate(0.85);
}
.dos-photo small { font: 400 0.68rem 'Special Elite', monospace; color: #444; }
.dos-fields { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: baseline; min-width: 0; }
.dos-fields dt { font: 400 0.7rem 'Special Elite', monospace; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.dos-fields dd { margin: 0; font: 700 1rem/1.25 'Courier Prime', monospace; overflow-wrap: anywhere; }
.dos-fields dd:first-of-type { font-size: 1.15rem; }
.dos-stamp {
  position: absolute; top: 46px; right: 10px; padding: 3px 10px; border: 3px solid var(--stamp); border-radius: 4px;
  color: var(--stamp); font: 400 1rem 'Special Elite', monospace; letter-spacing: 0.12em; text-transform: uppercase;
  transform: rotate(-12deg); opacity: 0.78; mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,0.55) 61%, #000 75%);
          mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,0.55) 61%, #000 75%);
  animation: dosStamp 0.45s 0.35s cubic-bezier(.2,1.6,.4,1) both;
}
.dos-story { margin: 16px 0 14px; font: 400 1.02rem/1.6 'Courier Prime', 'Courier New', monospace; min-height: 4.8em; }
.dos-story mark {
  color: inherit; font-weight: 700; padding: 0 0.2em; margin: 0 -0.05em; border-radius: 0.6em 0.2em;
  background: linear-gradient(100deg, rgba(255,214,10,0) 0.9%, rgba(255,214,10,0.75) 2.4%, rgba(255,214,10,0.5) 5.8%, rgba(255,214,10,0.25) 93%, rgba(255,214,10,0.7) 96%, rgba(255,214,10,0) 98%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.dos.typing .dos-story::after { content: '▌'; animation: dosCaret 0.7s steps(1) infinite; }
.dos-tag {
  position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px 10px; padding: 10px 14px 10px 30px;
  background: #fff3b0; border: 1px solid rgba(0,0,0,0.12); border-radius: 4px 10px 10px 4px;
  font: 700 0.95rem/1.4 'Courier Prime', monospace; transform: rotate(0.8deg); box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}
.dos-tag::before { content: ''; position: absolute; left: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px #b9a24a; }
.dos-tag::after { content: ''; position: absolute; left: -16px; top: 50%; width: 30px; height: 2px; background: #9b7b3a; transform: rotate(-20deg); }
.dos-tag small { font: 400 0.68rem 'Special Elite', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stamp); }
.dos-lineup { display: flex; flex-wrap: wrap; gap: 6px; }
.dos-lineup span {
  padding: 3px 8px; border: 1px solid rgba(42,38,34,0.35); border-radius: 3px; background: rgba(255,255,255,0.5);
  font: 400 0.82rem 'Special Elite', monospace; letter-spacing: 0.04em;
}
.dos-lineup span:first-child { border-color: var(--stamp); color: var(--stamp); }
.dos-sign { display: block; margin-top: 10px; text-align: right; font: 400 1.5rem 'Great Vibes', cursive; color: #1d3c8a; transform: rotate(-3deg); }
.dos-sign::before { content: '— '; }
@keyframes dosIn { from { opacity: 0; transform: translateY(16px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
@keyframes dosStamp { 0% { opacity: 0; transform: rotate(-12deg) scale(2.4); } 60% { opacity: 0.9; } 100% { opacity: 0.78; transform: rotate(-12deg) scale(1); } }
@keyframes dosCaret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dos, .dos-stamp { animation: none; } }
@media (max-width: 420px) {
  .dos-paper { padding: 16px 13px 14px; }
  .dos-photo { width: 70px; }
  .dos-emoji { font-size: 2rem; }
  .dos-stamp { top: auto; bottom: 18px; right: auto; left: 14px; font-size: 0.85rem; }
  .dos-sign { margin-top: 14px; }
  .dos-story { font-size: 0.93rem; }
  .dos-fields dd { font-size: 0.92rem; }
  .dos-fields dd:first-of-type { font-size: 1rem; }
  .dos-head { gap: 10px; }
  .dos-top span:last-child { display: none; }
}

.jl-file { margin-top: 10px; border-top: 2px solid rgba(255,255,255,0.08); padding-top: 8px; }
.jl-file summary { cursor: pointer; font-weight: 900; color: var(--sky); list-style: none; }
.jl-file summary::-webkit-details-marker { display: none; }
.jl-file summary.locked { color: var(--muted); }
.jl-file[open] summary { margin-bottom: 26px; }
.jl-file .dos { animation: none; }
.jl-file .dos-stamp { animation: none; }
.jl-file-lock { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ============================================================
   JAILBREAK — breaking news overlay
   ============================================================ */
.jb-bg {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 56px 16px; background: rgba(4,6,18,0.86);
  animation: jbFlash 0.5s steps(1) infinite;
}
.jb-bg.hidden { display: none; }
@keyframes jbFlash { 0% { background-color: rgba(70,0,20,0.88); } 50% { background-color: rgba(0,20,80,0.88); } }
.jb-siren {
  position: absolute; left: 0; right: 0; height: 40px;
  background: repeating-linear-gradient(90deg, #ff2a4a 0 25%, #1d6bff 25% 50%);
  background-size: 200% 100%;
  animation: jbSiren 0.5s linear infinite;
  box-shadow: 0 0 30px 6px rgba(255,42,74,0.6);
}
.jb-siren.top { top: 0; }
.jb-siren.bottom { bottom: 0; animation-direction: reverse; }
@keyframes jbSiren { to { background-position: 100% 0; } }
.jb-tv {
  position: relative; width: 100%; max-width: 460px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 16px 18px; text-align: center;
  background: linear-gradient(180deg, #101a46, #0a1030);
  border: var(--edge); border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--ink), 0 0 0 4px #ff2a4a;
  animation: jbShake 0.45s ease-in-out 3, popIn 0.35s var(--spring) both;
}
@keyframes jbShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-1deg); } 75% { transform: translateX(6px) rotate(1deg); } }
.jb-bar { width: 100%; display: flex; justify-content: space-between; font-weight: 900; font-size: 0.75rem; letter-spacing: 0.08em; }
.jb-live { color: #ff2a4a; animation: jbBlink 1s steps(1) infinite; }
.jb-ch { color: var(--text-lt); }
@keyframes jbBlink { 50% { opacity: 0; } }
.jb-alarm { font-size: 4rem; line-height: 1; filter: drop-shadow(0 0 18px #ff2a4a); animation: jbAlarm 0.5s ease-in-out infinite alternate; }
@keyframes jbAlarm { from { transform: scale(0.9) rotate(-8deg); filter: drop-shadow(0 0 6px #ff2a4a); } to { transform: scale(1.15) rotate(8deg); filter: drop-shadow(0 0 26px #1d6bff); } }
.jb-break {
  padding: 4px 18px; transform: skewX(-12deg);
  font-family: var(--font-head); font-size: 2rem; letter-spacing: 0.04em; color: #fff;
  background: #e0102f; border: var(--edge); box-shadow: 0 4px 0 var(--ink);
  animation: jbBreak 0.5s steps(1) infinite;
}
@keyframes jbBreak { 50% { background: #1d6bff; } }
.jb-studio { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; width: 100%; text-align: left; }
.jb-reporter { position: relative; width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle, #2a4190, #121a44); border: var(--edge); animation: jbPanic 0.25s ease-in-out infinite alternate; }
.jb-face { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.2rem; }
.jb-mic { position: absolute; right: -8px; bottom: -4px; font-size: 1.8rem; transform: rotate(-20deg); }
@keyframes jbPanic { from { transform: translate(-2px, 1px) rotate(-3deg); } to { transform: translate(2px, -1px) rotate(3deg); } }
.jb-say { margin: 0; padding: 10px 12px; min-height: 4.4em; font-weight: 900; font-size: 1.02rem; line-height: 1.35; color: var(--ink); background: #fff; border: var(--edge); border-radius: 14px 14px 14px 4px; }
.jb-say.in { animation: popIn 0.3s var(--spring) both; }
.jb-lower { width: 100%; display: flex; align-items: stretch; text-align: left; border: var(--edge); border-radius: 8px; overflow: hidden; }
.jb-lower b { padding: 6px 10px; font-family: var(--font-head); font-weight: 400; letter-spacing: 0.04em; color: #fff; background: #e0102f; }
.jb-lower span { flex: 1; padding: 6px 10px; font-weight: 900; color: var(--ink); background: var(--gold); }
.jb-ticker { width: 100%; overflow: hidden; white-space: nowrap; background: var(--ink); color: var(--gold); font-weight: 900; font-size: 0.8rem; padding: 4px 0; border-radius: 6px; }
.jb-ticker span { display: inline-block; padding-left: 100%; animation: jbTicker 12s linear infinite; }
@keyframes jbTicker { to { transform: translateX(-100%); } }
.jb-go { margin-top: 4px; --b: var(--red); --b-dk: var(--red-dk); --b-fg: #fff; animation: playPulse 1.2s ease-in-out infinite; }
.jb-later { align-self: center; }
@media (prefers-reduced-motion: reduce) {
  .jb-bg, .jb-siren, .jb-tv, .jb-alarm, .jb-break, .jb-live, .jb-reporter, .jb-ticker span, .jb-go { animation: none; }
}

/* Catch the aliases: the boss's three forms run around a street, Officer Bonk bonks the one you tap */
.vc-chase { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.vc-alley {
  position: relative; height: 200px; overflow: hidden; touch-action: manipulation;
  border: var(--edge); border-radius: var(--radius-sm); box-shadow: inset 0 6px 0 rgba(0,0,0,0.25);
  background:
    repeating-linear-gradient(90deg, rgba(255,214,90,0.55) 0 26px, transparent 26px 52px) center / 100% 4px no-repeat,
    linear-gradient(180deg, #31396a 0 14px, #1b2147 14px calc(100% - 14px), #31396a calc(100% - 14px));
}
.vc-alley.clear {
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, #59627f 34px 42px, #2b3150 42px 46px, transparent 46px 80px),
    linear-gradient(180deg, #31396a 0 14px, #1b2147 14px calc(100% - 14px), #31396a calc(100% - 14px));
  animation: popIn 0.35s var(--spring);
}
.vc-alley.clear::before {
  content: 'GRAMMAR JAIL · DO NOT CROSS · GRAMMAR JAIL · DO NOT CROSS · GRAMMAR JAIL'; position: absolute; left: -10%; right: -10%; top: 50%;
  padding: 5px 0; margin-top: -16px; transform: rotate(-6deg); overflow: hidden; white-space: nowrap; text-align: center;
  font: 400 0.95rem/1.3 'Bungee', var(--font-head); color: var(--ink); letter-spacing: 0.04em;
  background: #ffd21a; border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
}
.vc-run {
  position: absolute; left: 0; top: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 12px 9px; min-width: 84px; min-height: 64px;
  color: var(--text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: #7b2238; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink);
}
.vc-run small { font-size: 0.62rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: #ffb4c2; }
.vc-run b { font-family: var(--font-head); font-weight: 400; font-size: 1.35rem; line-height: 1.05; white-space: nowrap; animation: runBob 0.28s ease-in-out infinite alternate; }
/* Two little legs, pedalling */
.vc-legs { position: absolute; left: 50%; bottom: -13px; width: 26px; height: 12px; margin-left: -13px; }
.vc-legs::before, .vc-legs::after {
  content: ''; position: absolute; top: 0; width: 5px; height: 12px; border-radius: 3px; background: var(--ink); transform-origin: top center;
  animation: runLeg 0.28s ease-in-out infinite alternate;
}
.vc-legs::before { left: 5px; }
.vc-legs::after  { right: 5px; animation-direction: alternate-reverse; }
.vc-dust { position: absolute; left: -22px; bottom: -4px; font-size: 1rem; opacity: 0.8; animation: dustPuff 0.5s ease-out infinite; }
.vc-run.left .vc-dust { left: auto; right: -22px; transform: scaleX(-1); }
.vc-run.still b, .vc-run.still .vc-legs::before, .vc-run.still .vc-legs::after, .vc-run.still .vc-dust { animation: none; }
.vc-run.caught { cursor: default; z-index: 5; }
.vc-run.caught b, .vc-run.caught .vc-legs::before, .vc-run.caught .vc-legs::after { animation: none; }
.vc-run.caught .vc-dust { display: none; }
.vc-run.squash { box-shadow: 0 2px 0 var(--ink); background: #4a1726; }
.vc-run.squash small, .vc-run.squash b { display: inline-block; animation: runSquash 0.5s ease-out forwards; }
.vc-run.gone { transition: opacity 0.25s ease, scale 0.25s ease; opacity: 0; scale: 0.4; }
@keyframes runBob  { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes runLeg  { from { transform: rotate(-35deg); } to { transform: rotate(35deg); } }
@keyframes dustPuff { from { opacity: 0.9; translate: 0 0; } to { opacity: 0; translate: -10px -4px; } }
@keyframes runSquash { 0% { transform: scale(1); } 30% { transform: scaleY(0.6) scaleX(1.15) translateY(4px); } 100% { transform: scaleY(0.85) scaleX(1.05) translateY(2px) rotate(-6deg); } }

.vc-form.empty { animation: none; cursor: default; opacity: 0.55; border-style: dashed; box-shadow: none; }
.vc-form.empty b { color: var(--muted); }

/* Officer Bonk swings the bat, like the meme */
.ob-hit { position: fixed; z-index: 10000; width: 0; height: 0; pointer-events: none; }
.ob-hit img {
  position: absolute; width: 150px; height: 150px; left: -160px; top: -118px; object-fit: contain;
  transform-origin: 70% 85%; filter: drop-shadow(0 4px 0 rgba(7,11,31,0.6));
  animation: obIn 1.1s ease-out forwards;
}
.ob-word {
  position: absolute; left: -70px; top: -96px; transform: rotate(-32deg);
  font: italic 900 1.5rem/1 'Courier Prime', 'Courier New', monospace; color: #fff; white-space: nowrap;
  -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill;
  animation: obWord 1.1s ease-out forwards;
}
/* On the right side of the screen he comes from the other side */
.ob-hit.flip img { left: 10px; transform: scaleX(-1); transform-origin: 30% 85%; animation-name: obInFlip; }
.ob-hit.flip .ob-word { left: -10px; transform: rotate(32deg); }
@keyframes obIn {
  0%   { opacity: 0; translate: -40px 10px; rotate: -10deg; }
  15%  { opacity: 1; translate: 0 0; rotate: -24deg; }
  22%  { rotate: 22deg; }
  32%  { rotate: 14deg; }
  80%  { opacity: 1; rotate: 14deg; }
  100% { opacity: 0; translate: -20px 0; rotate: 14deg; }
}
@keyframes obInFlip {
  0%   { opacity: 0; translate: 40px 10px; rotate: 10deg; }
  15%  { opacity: 1; translate: 0 0; rotate: 24deg; }
  22%  { rotate: -22deg; }
  32%  { rotate: -14deg; }
  80%  { opacity: 1; rotate: -14deg; }
  100% { opacity: 0; translate: 20px 0; rotate: -14deg; }
}
@keyframes obWord { 0%, 18% { opacity: 0; scale: 0.4; } 26% { opacity: 1; scale: 1.2; } 36% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 420px) {
  .vc-alley { height: 190px; }
  .vc-run { min-width: 76px; padding: 6px 10px 8px; }
  .vc-run b { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { .ob-hit img, .ob-word { animation-duration: 0.01s; animation-delay: 0s; } }

/* Handcuffs on every caught verb */
.vc-form { position: relative; }
.vc-cuffs { position: absolute; right: -8px; top: -16px; width: 46px; transform: rotate(10deg); animation: cuffsSnap 0.45s var(--spring) both; }
.vc-cuffs svg { display: block; width: 100%; }
@keyframes cuffsSnap { 0% { opacity: 0; transform: rotate(60deg) scale(2); } 100% { opacity: 1; transform: rotate(10deg) scale(1); } }

/* Grammar jail: police tape across the screen, a flashing light, the cuffs */
.gj-scene { position: fixed; inset: 0; z-index: 9997; pointer-events: none; overflow: hidden; }
.gj-scene::before { content: ''; position: absolute; inset: 0; animation: gjFlash 0.5s steps(1) 4; }
.gj-tape {
  position: absolute; left: -20%; width: 140%; height: 52px; overflow: hidden;
  background: #ffd21a; border-top: 5px solid var(--ink); border-bottom: 5px solid var(--ink);
  box-shadow: 0 8px 18px rgba(0,0,0,0.45);
}
.gj-tape > div { display: flex; align-items: center; gap: 18px; height: 100%; white-space: nowrap; width: max-content; animation: gjScroll 6s linear infinite; }
.gj-tape span { font: 400 1.35rem/1 'Bungee', var(--font-head); color: var(--ink); letter-spacing: 0.03em; }
/* Black chevrons between the words, like real tape */
.gj-tape i { flex: none; width: 54px; height: 100%; background: repeating-linear-gradient(-55deg, var(--ink) 0 9px, transparent 9px 18px); }
.gj-tape.a { top: 34%; transform: rotate(-9deg); animation: gjTapeA 0.45s cubic-bezier(.2,1.3,.4,1) both; }
.gj-tape.b { top: 54%; transform: rotate(7deg);  animation: gjTapeB 0.45s 0.15s cubic-bezier(.2,1.3,.4,1) both; }
.gj-tape.b > div { animation-direction: reverse; }
.gj-light {
  position: absolute; left: 50%; top: 12%; width: 74px; height: 64px; margin-left: -37px;
  border-radius: 38px 38px 8px 8px; border: 5px solid var(--ink); background: #ff2d4a; overflow: hidden;
  box-shadow: 0 8px 0 var(--ink); animation: gjLight 0.5s steps(1) infinite, popIn 0.35s var(--spring) both;
}
.gj-light::after { content: ''; position: absolute; left: -6px; right: -6px; bottom: -5px; height: 14px; background: #2b3150; border-top: 5px solid var(--ink); }
.gj-light span { position: absolute; left: 14px; top: 10px; width: 16px; height: 20px; border-radius: 50%; background: rgba(255,255,255,0.75); }
.gj-badge {
  position: absolute; left: 50%; top: 21%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 22px 10px; background: rgba(7,11,31,0.88); border: 4px solid #ffd21a; border-radius: 18px; box-shadow: 0 6px 0 var(--ink);
  animation: gjBadge 0.6s 0.35s var(--spring) both;
}
.gj-badge svg { width: 120px; filter: drop-shadow(0 5px 0 rgba(7,11,31,0.7)); }
.gj-badge b { font-family: var(--font-head); font-size: 1.3rem; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; white-space: nowrap; }
.gj-scene.out { transition: opacity 0.45s ease; opacity: 0; }
@keyframes gjTapeA { from { transform: translateX(-110%) rotate(-9deg); } to { transform: translateX(0) rotate(-9deg); } }
@keyframes gjTapeB { from { transform: translateX(110%) rotate(7deg); } to { transform: translateX(0) rotate(7deg); } }
@keyframes gjScroll { to { transform: translateX(-50%); } }
@keyframes gjLight { 0% { background: #ff2d4a; box-shadow: 0 8px 0 var(--ink), 0 0 60px 24px rgba(255,45,74,0.7); } 50% { background: #2d7bff; box-shadow: 0 8px 0 var(--ink), 0 0 60px 24px rgba(45,123,255,0.7); } }
@keyframes gjFlash { 0% { background: rgba(255,45,74,0.16); } 50% { background: rgba(45,123,255,0.16); } }
@keyframes gjBadge { 0% { opacity: 0; transform: translateX(-50%) scale(2.2) rotate(-20deg); } 100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(0); } }
.gj-scene.still *, .gj-scene.still::before { animation: none !important; }

/* Hiding spots in the street: verbs run in front of them, and duck behind them to hide */
.vc-cover {
  position: absolute; z-index: 3; width: 92px; height: 80px; margin: -40px 0 0 -46px; padding: 0;
  display: grid; place-items: center; font-size: 66px; line-height: 1; background: none; border: 0; cursor: pointer;
  filter: drop-shadow(0 5px 0 rgba(7,11,31,0.6)); -webkit-tap-highlight-color: transparent;
}
.vc-cover.shake { animation: coverShake 0.35s ease; }
.vc-run.hiding { z-index: 0; }
.vc-run.hiding .vc-dust { display: none; }
.vc-run.hiding b, .vc-run.hiding .vc-legs::before, .vc-run.hiding .vc-legs::after { animation-duration: 0.12s; }
.vc-alley.clear .vc-cover { display: none; }
@keyframes coverShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }

/* Bad hits on the hiding spots: three and the verbs escape */
.vc-strikes { position: absolute; left: 8px; bottom: 3px; z-index: 6; display: flex; align-items: center; gap: 4px; pointer-events: none; }
.vc-strikes small { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lt); margin-right: 2px; }
.vc-strikes i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font: 900 10px/1 sans-serif; font-style: normal; color: #fff; }
.vc-strikes i.on { background: var(--red); border-color: var(--ink); animation: popIn 0.3s var(--spring); }
.vc-strikes i.on::after { content: '✕'; }
.vc-alley.clear .vc-strikes { display: none; }
.vc-haha {
  position: absolute; left: 50%; top: -30px; transform: translateX(-50%) rotate(-6deg); z-index: 5; white-space: nowrap; pointer-events: none;
  padding: 2px 8px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 12px;
  font-family: var(--font-head); font-size: 0.95rem; animation: hahaPop 1.1s ease-out forwards;
}
.vc-run.hiding .vc-haha { z-index: 6; }
@keyframes hahaPop { 0% { opacity: 0; scale: 0.4; } 15% { opacity: 1; scale: 1.15; } 25%, 45%, 65% { translate: 0 -3px; scale: 1; } 35%, 55% { translate: 0 2px; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -10px; } }
.vc-run.fleeing .vc-dust { animation-duration: 0.2s; }
.vc-escaped {
  position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; text-align: center; background: rgba(7,11,31,0.86); animation: popIn 0.35s var(--spring);
}
.vc-escaped b { font-family: var(--font-head); font-weight: 400; font-size: 1.6rem; color: var(--red); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.vc-escaped p { margin: 0; max-width: 300px; color: var(--text-lt); font-weight: 700; font-size: 0.92rem; line-height: 1.35; }
.vc-again {
  margin-top: 4px; padding: 10px 18px; cursor: pointer; font-family: var(--font-head); font-size: 1.1rem; color: var(--ink);
  background: var(--gold); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink);
}

/* Officer Bonk says it */
.gj-cop { position: absolute; left: 4%; bottom: 13%; width: 150px; animation: gjCop 0.5s 0.25s var(--spring) both; }
.gj-cop img { width: 150px; height: 150px; object-fit: contain; display: block; filter: drop-shadow(0 6px 0 rgba(7,11,31,0.6)); }
.gj-say {
  position: absolute; left: 118px; top: -14px; width: max-content; max-width: 52vw; padding: 12px 16px;
  background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 5px 0 var(--ink);
  font-family: var(--font-head); font-size: 1.35rem; line-height: 1.1; animation: gjSay 0.4s 0.55s var(--spring) both;
}
/* The tail of the speech cloud, pointing at him */
.gj-say::before, .gj-say::after { content: ''; position: absolute; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
.gj-say::before { width: 18px; height: 18px; left: -14px; bottom: -14px; }
.gj-say::after  { width: 10px; height: 10px; left: -30px; bottom: -28px; }
@keyframes gjCop { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes gjSay { from { opacity: 0; scale: 0.3; } to { opacity: 1; scale: 1; } }

/* Police lineup: a height-chart wall, suspects holding numbered plates */
.cuffs-fx svg { width: 120px; display: block; }
.lu-wall {
  position: relative; padding: 14px 10px 12px 34px; border: var(--edge); border-radius: var(--radius-sm); box-shadow: 0 6px 0 var(--ink);
  background:
    repeating-linear-gradient(180deg, transparent 0 23px, rgba(255,255,255,0.10) 23px 25px),
    repeating-linear-gradient(180deg, transparent 0 11px, rgba(255,255,255,0.04) 11px 12px),
    linear-gradient(180deg, #5b6788, #3a4566);
}
.lu-ft { position: absolute; left: 8px; font: 400 0.75rem 'Special Elite', monospace; color: rgba(255,255,255,0.55); }
.lu-ft:nth-child(1) { top: 10px; } .lu-ft:nth-child(2) { top: 34%; } .lu-ft:nth-child(3) { top: 58%; } .lu-ft:nth-child(4) { top: 82%; }
.lu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; }
.lu-sus {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 0; min-width: 0; cursor: pointer;
  color: var(--text); font: inherit; background: #1d2547; border: 3px solid var(--ink); border-radius: 14px 14px 6px 6px; box-shadow: 0 5px 0 var(--ink);
  animation: luIn 0.4s var(--spring) both;
}
.lu-sus:nth-child(2) { margin-bottom: 6px; } /* not all the same height, like real people */
.lu-name { font-family: var(--font-head); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.lu-forms { display: grid; justify-items: center; gap: 1px; width: 100%; }
.lu-forms small { font-size: 0.58rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lt); margin-top: 3px; }
.lu-forms span { font-family: var(--font-head); font-weight: 400; font-size: 1.15rem; color: var(--gold); overflow-wrap: anywhere; text-align: center; line-height: 1.1; letter-spacing: 0.02em; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.lu-plate {
  width: calc(100% + 8px); margin: 4px -4px 0; padding: 4px 0 6px; display: grid; justify-items: center;
  background: #111; border-top: 3px solid var(--ink); border-radius: 0 0 4px 4px; color: #fff;
}
.lu-plate small { font: 400 0.5rem 'Special Elite', monospace; letter-spacing: 0.08em; opacity: 0.7; }
.lu-plate b { font: 400 1.5rem/1 'Special Elite', monospace; }
.lu-sus.picked { background: #18456f; border-color: var(--sky); box-shadow: 0 5px 0 var(--sky-dk), 0 0 0 4px rgba(84,180,255,0.35), 0 -30px 40px rgba(255,255,220,0.25); transform: translateY(-4px); }
.lu-sus.right { background: #0f5a43; border-color: var(--mint); }
.lu-sus.wrong { background: #5e1a2c; border-color: var(--red); }
@keyframes luIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }

/* Officer Bonk asks, the witness answers in a chain of oval speech bubbles.
   The outlines sit in one layer under all the white fills, so touching
   bubbles merge into one shape, like in a comic */
.lu-scene { display: grid; gap: 6px; margin-top: 14px; cursor: pointer; }
.lu-ask, .lu-witness { display: flex; align-items: flex-start; gap: 10px; }
.lu-ask { justify-content: flex-end; }
.lu-who { flex: none; display: grid; justify-items: center; gap: 2px; width: 70px; text-align: center; }
.lu-face { position: relative; overflow: hidden; width: 58px; height: 58px; display: grid; place-items: center; font-size: 2.3rem; background: var(--panel-hi); border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 4px 0 var(--ink); }
.lu-face.cop img { width: 52px; height: 52px; object-fit: contain; margin-top: 6px; }
.lu-who small { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-lt); line-height: 1.15; }
.lu-who em { font-style: normal; font-size: 0.58rem; font-weight: 900; text-transform: uppercase; color: #ff6b81; }
/* Witness protection: a dark silhouette behind the blinds */
.lu-witness.protected .lu-face > span { filter: brightness(0) blur(0.6px); }
.lu-witness.protected .lu-face { background: #3b4a7a; }
.lu-bar { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(150,170,220,0.55) 0 5px, transparent 5px 9px); }
.lu-bubs { position: relative; isolation: isolate; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 3px 3px 3px 12px; }
.lu-ask .lu-bubs { align-items: flex-end; padding: 3px 12px 3px 3px; }
.lu-bub {
  position: relative; max-width: 86%; padding: 14px 24px; border-radius: 50%; background: #fff; color: var(--ink);
  text-align: center; font-weight: 800; font-size: 0.92rem; line-height: 1.25; animation: bubIn 0.22s ease-out;
}
.lu-bub::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 50%; background: var(--ink); }
.lu-bub + .lu-bub { margin-top: -8px; }
.lu-witness .lu-bub:nth-child(2) { align-self: center; }
.lu-witness .lu-bub:nth-child(3) { align-self: flex-end; }
.lu-bub b { color: #b8122f; }
.lu-bub.cop { background: #e9f1ff; }
/* The tail points at whoever is talking */
.lu-tail { position: absolute; left: 4px; top: 50%; }
.lu-tail::before, .lu-tail::after { content: ''; position: absolute; width: 0; height: 0; border-style: solid; }
.lu-tail::after  { left: -18px; top: -7px;  border-width: 7px 22px 7px 0;  border-color: transparent #fff transparent transparent; }
.lu-tail::before { left: -24px; top: -11px; border-width: 11px 30px 11px 0; border-color: transparent var(--ink) transparent transparent; z-index: -1; }
.cop .lu-tail { left: auto; right: 4px; }
.cop .lu-tail::after  { left: auto; right: -18px; border-width: 7px 0 7px 22px;  border-color: transparent transparent transparent #e9f1ff; }
.cop .lu-tail::before { left: auto; right: -24px; border-width: 11px 0 11px 30px; border-color: transparent transparent transparent var(--ink); }
@keyframes bubIn { from { transform: scale(0.5); opacity: 0; } }
@media (max-width: 420px) {
  .lu-bub { font-size: 0.85rem; padding: 12px 18px; }
  .lu-who { width: 58px; }
  .lu-face { width: 50px; height: 50px; font-size: 1.9rem; }
  .lu-face.cop img { width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .lu-wall { padding-left: 26px; }
  .lu-name { font-size: 1.1rem; }
  .lu-forms span { font-size: 1rem; }
}

/* ============================================================
   HOME — profile photo, and the quick buttons under the profile
   ============================================================ */
.hl-avatar { position: relative; width: 58px; height: 58px; flex: none; }
.hl-avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  background: radial-gradient(circle at 50% 35%, #fff2a8, var(--gold) 55%, var(--gold-dk)); border: var(--edge);
}
.hl-avatar:not(.google) img { object-fit: contain; padding: 3px; }
.hl-lv {
  position: absolute; right: -6px; bottom: -4px; padding: 1px 6px; border-radius: 999px; white-space: nowrap;
  background: var(--gold); color: var(--ink); border: 2px solid var(--ink); font-size: 0.6rem; font-weight: 900; line-height: 1.3;
}
.hl-lv b { font-family: var(--font-head); font-weight: 400; font-size: 0.85rem; }

.home-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 720px; margin: 22px auto 16px; animation: fadeUp 0.4s ease 0.15s both; }
.hq-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px 10px; min-width: 0;
  color: var(--text); font: inherit; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), 0 5px 0 var(--ink); transition: transform 0.15s var(--spring);
}
.hq-btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), 0 2px 0 var(--ink); }
.hq-icon {
  width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.9rem; color: #fff; border-radius: 16px;
  border: var(--edge); box-shadow: inset 0 -5px 0 rgba(0,0,0,0.22), 0 4px 0 var(--ink);
}
.hq-arcade .hq-icon  { background: #ff4f9a; }
.hq-defense .hq-icon { background: #19c7d9; }
.hq-jail .hq-icon { background: none; border: 0; box-shadow: none; width: 62px; height: 58px; }
.hq-jail .hq-icon svg { width: 62px; height: 62px; filter: drop-shadow(0 3px 0 rgba(7,11,31,0.6)); }
.hq-name { font-family: var(--font-head); font-weight: 400; font-size: 1.05rem; line-height: 1.1; }
.hq-jail .hq-name { color: var(--gold); }
.hq-sub { font-size: 0.66rem; font-weight: 800; color: var(--text-lt); line-height: 1.25; }
/* The jail says its name in a little speech cloud */
.hq-say {
  position: absolute; left: 52%; top: -16px; z-index: 1; padding: 3px 8px; white-space: nowrap;
  background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 2px 0 var(--ink);
  font-family: var(--font-head); font-size: 0.72rem; transform: rotate(4deg);
}
.hq-say::before { content: ''; position: absolute; left: 6px; bottom: -9px; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.hq-alert {
  position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); padding: 1px 8px; white-space: nowrap;
  background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 999px; font-size: 0.62rem; font-weight: 900;
  animation: hqPulse 1.2s ease-in-out infinite;
}
@keyframes hqPulse { 50% { transform: translateX(-50%) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .hq-alert { animation: none; } }

/* Sign in after the first round */
.gate-bg { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px; background: rgba(7,11,31,0.78); }
.gate-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 20px 16px; text-align: center;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: var(--edge); border-radius: 22px; box-shadow: 0 8px 0 var(--ink);
  animation: popIn 0.35s var(--spring);
}
.gate-dog { width: 110px; height: 110px; object-fit: contain; margin-top: -60px; filter: drop-shadow(0 5px 0 rgba(7,11,31,0.6)); }
.gate-card h3 { margin: 0; font-family: var(--font-head); font-weight: 400; font-size: 1.6rem; color: var(--gold); text-shadow: 0 3px 0 var(--ink); }
.gate-card p { margin: 0; color: var(--text-lt); font-weight: 700; line-height: 1.4; }
.gate-google {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 9px; cursor: pointer;
  background: #202124; color: #fff; border: 1px solid #5f6368; border-radius: 999px; font: 500 0.95rem/1 Roboto, Arial, sans-serif;
}
.gg-g { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #4285f4; font: 700 1rem Arial, sans-serif; }
.gate-later { background: none; border: 0; color: var(--text-lt); font: inherit; font-weight: 800; font-size: 0.85rem; text-decoration: underline; cursor: pointer; padding: 4px; }

/* Home side block: sign in + quick buttons. Under the profile on phones,
   top right under the Profile pill on wide screens */
.home-side { width: 100%; max-width: 720px; margin: 0 auto; }
.home-side .home-account { margin: 14px auto 0; max-width: none; padding: 12px; }
.home-side .home-account p { margin-bottom: 8px; font-size: 0.85rem; }
@media (min-width: 1240px) {
  .home-side {
    position: fixed; top: 64px; right: 16px; z-index: 50; width: 176px; margin: 0;
    display: flex; flex-direction: column; gap: 10px;
  }
  .home-side .home-account { order: 2; margin: 0; padding: 10px; border-radius: 14px; overflow: hidden; }
  .home-side .home-account p { font-size: 0.72rem; margin-bottom: 6px; }
  .home-side .gsi-slot { transform: scale(0.8); transform-origin: top center; min-height: 36px; }
  .home-quick { order: 1; grid-template-columns: 1fr; gap: 8px; margin: 0; }
  .hq-btn { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px 10px; padding: 7px 10px; text-align: left; }
  .hq-icon { width: 36px; height: 36px; font-size: 1.2rem; border-radius: 11px; grid-row: span 2; }
  .hq-jail .hq-icon { width: 38px; height: 36px; }
  .hq-jail .hq-icon svg { width: 40px; height: 40px; }
  .hq-btn > .hq-icon { flex: none; }
  .hq-name { font-size: 0.9rem; }
  .hq-sub { font-size: 0.6rem; width: calc(100% - 50px); margin-left: 46px; margin-top: -4px; }
  .hq-name { width: calc(100% - 50px); }
  .hq-say { left: auto; right: -6px; top: -14px; font-size: 0.62rem; }
  .hq-alert { left: auto; right: 6px; bottom: -9px; transform: none; }
}

/* The order to catch them in */
.vc-order { text-align: center; font-size: 0.85rem; font-weight: 800; color: var(--text-lt); }
.vc-order b { color: var(--gold); }
.vc-run.next { background: #1f9e62; box-shadow: 0 5px 0 var(--ink), 0 0 0 3px var(--mint), 0 0 18px rgba(62,224,156,0.65); }
.vc-run.next small { color: #d4ffe9; }
.vc-cover.deal { animation: coverDeal 0.35s var(--spring); }
@keyframes coverDeal { from { scale: 0.2; opacity: 0; } to { scale: 1; opacity: 1; } }

/* Case file column heads: base, past simple, past participle */
.lr-cols .lr-cell { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lt) !important; }

/* Practice is the only card left in the old two-column grid: give it the
   same full width and size as Verb Gangs and Get Certified */
.mode-cards { grid-template-columns: 1fr; max-width: 960px; margin: 0 auto; }
.mode-card.practice { grid-template-columns: auto 1fr auto; gap: 20px; padding: 18px 22px; min-height: 150px; border-radius: var(--radius); }
.mode-card.practice .mode-icon { width: 96px; height: 96px; font-size: 3rem; border-radius: 26px; transform: rotate(-6deg); }
.mode-card.practice h3 { font-size: 2rem; }
@media (max-width: 720px) {
  .mode-card.practice { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 20px 16px; }
  .mode-card.practice .mode-icon { width: 84px; height: 84px; font-size: 2.6rem; }
}
