/* ============================================================
   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=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 {
  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 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  user-select: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-logo-img { height: 30px; width: auto; display: block; filter: brightness(0) invert(1); }

#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 { width: 220px; 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-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, #nav-logo-dots { display: none; }
  #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; }
}
