/* ENGAGE BRAIN DOJO — "midnight dojo arcade"
   Layout: one centered column; characters on stage, HUD bars like a fighting game.
   Engage brand: midnight navy + near-black, green→teal→blue streak gradient,
   gold gradient for rewards, Montserrat (display) + Cabin (body).
   One committed dark look, so colors are set explicitly for every theme. */
:root {
  color-scheme: dark;
  --night: #090203;
  --bg: #0D1830;
  --midnight: #1A2C45;
  --surface: #13223D;
  --surface-2: #1C3050;
  --mat: #0F1D35;
  --ink: #F4F4F4;
  --muted: #A3B4CE;
  --line: #2A4268;
  --green: #65D94A;
  --teal: #5CBFC1;
  --blue: #4F6CEE;
  --sky: #6CB0F9;
  --aqua: #BFFAF5;
  --gold-1: #A6802E;
  --gold-2: #E0BA77;
  --gold-3: #EEDAA7;
  --streak: linear-gradient(100deg, var(--green), var(--teal) 50%, var(--blue));
  --gold: linear-gradient(120deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3) 60%, var(--gold-2) 80%, var(--gold-1));
  --accent: var(--green);
  --accent-ink: #06121F;
  --good: #65D94A;
  --good-bg: rgba(101, 217, 74, .14);
  --bad: #FF5C6E;
  --bad-bg: rgba(255, 92, 110, .14);
  --warn: #F2B544;
  --warn-bg: rgba(242, 181, 68, .14);
  --cap: var(--sky);
  --punct: #9C8CFF;
  --spell: var(--gold-2);
  --grammar: var(--teal);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .04);
  --font-display: "Montserrat", "Arial Black", system-ui, sans-serif;
  --font-body: "Cabin", "Trebuchet MS", system-ui, sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 700px at 50% -120px, #23406A 0%, var(--bg) 60%) no-repeat, linear-gradient(180deg, var(--bg) 0%, #0A1224 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
/* faint ring pattern from the Engage brand cover */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: radial-gradient(circle, transparent 54%, rgba(108, 176, 249, .07) 56%, transparent 59%);
  background-size: 64px 64px;
}
.bg-streaks { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-streaks i { position: absolute; height: 34px; border-radius: 999px; background: var(--streak); opacity: .16; filter: blur(.5px); }
.bg-streaks i:nth-child(1) { width: 320px; top: 90px; right: -60px; }
.bg-streaks i:nth-child(2) { width: 220px; top: 140px; right: -20px; opacity: .10; }
.bg-streaks i:nth-child(3) { width: 280px; bottom: 120px; left: -80px; opacity: .12; }
.bg-streaks i:nth-child(4) { width: 180px; bottom: 70px; left: -30px; opacity: .08; }

[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 7vw, 3rem); font-weight: 900; font-style: italic; text-transform: uppercase; }
h2 { font-size: 1.45rem; font-weight: 900; text-transform: uppercase; font-style: italic; }
h3 { font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow, .label {
  font-family: var(--font-display); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--teal);
}

.app {
  position: relative; z-index: 1;
  max-width: 920px; margin: 0 auto;
  padding-block: 10px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 6px 18px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: var(--ink); }
.brand-mark { width: 48px; height: auto; filter: drop-shadow(0 2px 6px rgba(224, 186, 119, .35)); }
.brand-words { display: grid; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 1.35rem; line-height: .95; text-transform: uppercase; letter-spacing: -.01em; text-align: left; }
.brand-words small { font-size: .62rem; font-style: normal; letter-spacing: .32em; color: var(--gold-2); font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink);
  padding: 10px 18px; font-family: var(--font-display); font-weight: 800; font-size: .95rem; min-height: 46px;
  transition: transform .08s ease, border-color .15s ease, filter .15s ease;
}
.btn:hover { border-color: var(--sky); }
.btn:active { transform: translateY(2px); }
.btn small { font-weight: 600; color: var(--muted); font-family: var(--font-body); }
.btn-primary {
  background: var(--streak); border: 0; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .02em;
  box-shadow: 0 5px 0 #1E3F8C, 0 10px 24px -10px rgba(79, 108, 238, .8);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { box-shadow: 0 1px 0 #1E3F8C; transform: translateY(4px); }
.btn-quiet { background: transparent; }
.btn-small { min-height: 38px; padding: 6px 12px; font-size: .82rem; }
.btn-big { font-size: 1.05rem; min-height: 56px; padding-inline: 26px; font-style: italic; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.danger { color: var(--bad); }
.btn-small.danger { border-color: var(--bad); }

/* ---------- avatars & belts ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--av, var(--blue)); color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 1.1rem;
  overflow: hidden; box-shadow: 0 0 0 3px var(--ring, var(--line));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; background: radial-gradient(circle at 50% 30%, #2F5A92, var(--midnight)); }
.avatar.sm { width: 30px; height: 30px; font-size: .9rem; box-shadow: 0 0 0 2px var(--ring, var(--line)); }
.avatar.lg { width: 86px; height: 86px; font-size: 2rem; }
.belt-swatch { display: inline-block; width: 26px; height: 10px; border-radius: 3px; background: var(--belt); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.belt-panel { margin-block: 12px; }
.belt-row {
  display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(28, 48, 80, .9), rgba(15, 29, 53, .9)); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.belt { position: relative; flex: none; width: 110px; height: 24px; border-radius: 6px; background: var(--belt); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35), inset 0 -6px 0 rgba(0, 0, 0, .12); }
.belt-knot { position: absolute; left: 50%; top: 50%; width: 28px; height: 32px; transform: translate(-50%, -50%) rotate(8deg); background: var(--belt); border-radius: 8px; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35); }
.belt-knot::before, .belt-knot::after { content: ""; position: absolute; top: 24px; width: 13px; height: 28px; background: var(--belt); border-radius: 3px; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .3); }
.belt-knot::before { left: -2px; transform: rotate(18deg); }
.belt-knot::after { right: -2px; transform: rotate(-12deg); }
.belt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.belt-text strong { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.25rem; }
.belt-text span { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.xp-track { height: 14px; background: #0A1426; border-radius: 999px; overflow: hidden; margin-top: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.xp-fill { height: 100%; background: var(--gold); border-radius: 999px; box-shadow: 0 0 14px rgba(224, 186, 119, .6); transition: width .8s ease; }

/* opening title card (also what link thumbnails capture) */
.on-players .brand { visibility: hidden; }
.title-card { display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 14px; border-radius: 22px;
  background: radial-gradient(80% 120% at 0% 0%, rgba(224, 186, 119, .16), transparent 60%), linear-gradient(160deg, var(--surface-2), var(--mat)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.title-card img { width: clamp(70px, 18vw, 120px); height: auto; filter: drop-shadow(0 6px 14px rgba(224, 186, 119, .35)); }
.title-name { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(2.2rem, 10vw, 4rem); line-height: .9; letter-spacing: -.02em; }
.title-by { margin-top: 6px; font-family: var(--font-display); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: clamp(.95rem, 3.6vw, 1.4rem);
  background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- hero areas with characters ---------- */
.hero { padding-block: 10px 6px; display: grid; gap: 6px; }
.host-hero { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 12px; margin-bottom: 8px; }
.host-img { width: clamp(110px, 26vw, 170px); height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)); animation: bob 3.2s ease-in-out infinite; }
.host-text { display: grid; gap: 8px; padding-bottom: 14px; min-width: 0; }
.host-text h1, .home-hud h1 { font-size: clamp(1.55rem, 6.4vw, 3rem); overflow-wrap: anywhere; }
.say {
  position: relative; justify-self: start; max-width: 34ch; padding: 10px 14px; border-radius: 16px; border-bottom-left-radius: 4px;
  background: var(--ink); color: #0B1426; font-weight: 700;
}
.say:empty { display: none; }
.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.home-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; }
.fighter-stage {
  position: relative; border: 0; padding: 0; background: none; display: grid; justify-items: center;
  width: clamp(110px, 28vw, 180px);
}
.fighter-stage::before {
  content: ""; position: absolute; bottom: 4px; left: 8%; right: 8%; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(101, 217, 74, .55), transparent 70%);
}

.fighter-change {
  position: relative; margin-top: 4px; font-family: var(--font-display); font-weight: 800; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--teal); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--mat);
}
.home-hud { display: grid; gap: 6px; min-width: 0; padding-bottom: 28px; }

/* coach speech row */
.coach-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.coach-face {
  flex: none; width: 58px; height: 58px; border-radius: 50%; object-fit: cover;
  background: radial-gradient(circle at 50% 30%, #2F5A92, var(--midnight)); box-shadow: 0 0 0 3px var(--gold-2);
}
.coach-say {
  position: relative; display: grid; gap: 2px; padding: 9px 14px; border-radius: 16px; border-top-left-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--line); min-width: 0; max-width: 46ch;
}
.coach-name { font-family: var(--font-display); font-weight: 800; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); }
.coach-say p { font-weight: 700; }
.coach-row.compact { margin-bottom: 10px; }
.coach-row.compact .coach-face { width: 48px; height: 48px; }
.pop { animation: pop .35s ease; }

/* ---------- player select ---------- */
.player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-block: 18px; }
.player-card {
  display: grid; justify-items: center; gap: 8px; padding: 20px 12px 16px; border-radius: var(--radius); color: var(--ink);
  background: linear-gradient(180deg, var(--surface-2), var(--mat)); border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.player-card:hover { transform: translateY(-4px); border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 16px 30px -16px rgba(101, 217, 74, .7); }
.pc-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.pc-belt { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.empty-note { grid-column: 1 / -1; }
.add-player { background: rgba(15, 29, 53, .85); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.add-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { display: grid; gap: 4px; font-weight: 700; font-size: .85rem; color: var(--muted); flex: 1 1 160px; min-width: 0; }
.field input, .field select {
  min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--night); color: var(--ink);
  padding: 8px 12px; font-size: 1.05rem; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--sky); outline: none; }

/* fighter picker */
.fighter-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.fighter-opt {
  display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--mat); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: .78rem; text-transform: uppercase;
}
.fighter-opt img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 50% 30%, #2F5A92, var(--midnight)); }
.fighter-opt[aria-checked="true"] { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 18px rgba(101, 217, 74, .45); }
.fighter-group { grid-column: 1 / -1; margin: 4px 0 -2px; font-family: var(--font-display); font-weight: 800; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); }
.fighter-pick.big { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.fighter-pick.big .fighter-opt img { width: auto; height: 124px; border-radius: 0; background: none; object-fit: contain; }
.fighter-pick.big .fighter-opt { font-size: .7rem; }

/* custom fighter + builder */
.fighter-art { position: relative; display: block; width: 100%; }
.fighter-art > img, .fighter-art > svg { width: 100%; height: auto; max-height: 260px; object-fit: contain; display: block; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); animation: bob 3.4s ease-in-out infinite; }
.fighter-art > .champ { filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); animation: bob 3.4s ease-in-out infinite; }
/* champion = white-belt art + belt tinted to the earned belt color */
.champ { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; isolation: isolate; }
.champ img { display: block; max-width: 100%; height: auto; max-height: 260px; width: auto; }
.champ-belt { position: absolute; inset: 0; background: var(--belt); mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.fighter-pick.big .champ img { height: 124px; width: auto; }
.grad-champ .champ img { max-height: 300px; }
.avatar svg { width: 100%; height: 100%; display: block; }
.build-art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 30%, #2F5A92, var(--midnight)); }
.build-art svg { width: 100%; height: 100%; }
.fighter-pick.big .build-art { width: auto; height: 124px; border-radius: 0; background: none; }
.fighter-pick.big .build-art svg { width: auto; height: 124px; }
.build-opt { border-style: dashed; border-color: var(--gold-2); }
.edit-icon { font-size: 2rem; color: var(--gold-2); }
.builder-grid { display: grid; gap: 14px; }
.builder-preview {
  display: grid; place-items: center; border-radius: 18px; padding: 10px; position: sticky; top: 0; z-index: 1;
  background: radial-gradient(70% 60% at 50% 90%, rgba(101, 217, 74, .35), transparent 70%), linear-gradient(160deg, #1E3F8C, #0B1E3D);
}
.builder-preview svg { height: 210px; width: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.builder-opts { display: grid; gap: 12px; }
.opt-group { display: grid; gap: 6px; }
.opt-group .chip { min-height: 36px; font-size: .78rem; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); background: var(--sw); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 3px var(--green); }
.builder-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 640px) {
  .builder-grid { grid-template-columns: 220px 1fr; align-items: start; }
  .builder-preview svg { height: 300px; }
}

/* ---------- home ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; margin-top: 8px; }
.game-card {
  background: linear-gradient(180deg, var(--surface-2), var(--mat)); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: flex; flex-direction: column;
}
.game-art {
  position: relative; height: 190px; overflow: hidden;
  background: radial-gradient(80% 90% at 30% 100%, rgba(101, 217, 74, .35), transparent 60%), linear-gradient(140deg, #1E3F8C, #0B1E3D 70%);
}
.game-art::after { content: ""; position: absolute; left: -20px; right: 40%; bottom: 18px; height: 22px; border-radius: 999px; background: var(--streak); opacity: .35; }
.game-coach { position: absolute; z-index: 1; bottom: -54px; left: 14px; height: 250px; width: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
.art-chips { position: absolute; z-index: 2; right: 12px; top: 16px; display: grid; gap: 8px; justify-items: end; }
.art-chips span {
  font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 1.3rem; color: var(--ink);
  background: rgba(9, 2, 3, .55); border: 1px solid rgba(255, 255, 255, .15); padding: 4px 12px; border-radius: 10px; transform: rotate(-3deg);
}
.art-chips span:nth-child(2) { background: var(--gold); color: #1B1205; transform: rotate(3deg); }
.sent-art { background: radial-gradient(80% 90% at 30% 100%, rgba(92, 191, 193, .45), transparent 60%), linear-gradient(140deg, #0F5E66, #0B1E3D 70%); }
.sent-art s { opacity: .55; }
.sent-art b { color: #0B1426; background: var(--ink); border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.read-art { background: radial-gradient(80% 90% at 30% 100%, rgba(156, 140, 255, .45), transparent 60%), linear-gradient(140deg, #3B2C8F, #0B1E3D 70%); }
.read-art span { font-size: 1.05rem; }
.game-body { padding: 16px 18px 20px; display: grid; gap: 10px; align-content: start; flex: 1; }
.game-body .btn { justify-self: stretch; margin-top: 4px; }
.coach-tag { font-family: var(--font-display); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); }
.game-body > p:not(.eyebrow):not(.coach-tag) { color: var(--muted); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border-radius: 999px; border: 2px solid var(--line); background: var(--mat); color: var(--ink); padding: 6px 13px;
  font-family: var(--font-display); font-weight: 800; font-size: .82rem; min-height: 40px; display: inline-flex; align-items: center; gap: 8px;
}
.chip.on { background: var(--streak); border-color: transparent; color: var(--accent-ink); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.op-sym { font-family: var(--font-display); font-size: 1.25rem; line-height: 1; }

/* ---------- math setup ---------- */
.setup-block { display: grid; gap: 10px; margin-bottom: 22px; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mode-card {
  text-align: left; display: grid; gap: 6px; padding: 20px; border-radius: var(--radius); color: var(--ink);
  background: linear-gradient(160deg, var(--surface-2), var(--mat)); border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--green); }
.mode-card strong { font-family: var(--font-display); font-size: 1.45rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.mode-card span { color: var(--muted); }

/* ---------- play HUD ---------- */
.playbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 10px;
  border-radius: 16px; background: rgba(9, 2, 3, .45); border: 1px solid var(--line); font-weight: 700;
}
.meter { font-variant-numeric: tabular-nums; font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; }
.meter.hurry { color: var(--bad); animation: pulse .8s ease-in-out infinite; }
.streak { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score {
  margin-left: auto; font-variant-numeric: tabular-nums; font-family: var(--font-display); font-weight: 900;
  background: var(--gold); color: #1B1205; padding: 5px 12px; border-radius: 999px; box-shadow: 0 0 14px rgba(224, 186, 119, .35);
}
.tag { color: var(--muted); }
.grade-select select {
  min-height: 38px; border-radius: 999px; border: 2px solid var(--teal); background: var(--night); color: var(--ink);
  font-family: var(--font-display); font-weight: 800; padding: 4px 12px; font-size: .85rem; cursor: pointer;
}

.flashcard {
  position: relative; border-radius: 26px; padding: 34px 20px 24px; text-align: center; display: grid; gap: 8px; justify-items: center;
  background: linear-gradient(180deg, #172B4C, #0C1830) padding-box, var(--streak) border-box; border: 3px solid transparent;
  box-shadow: 0 0 40px -12px rgba(92, 191, 193, .55), var(--shadow);
}
.problem { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.6rem, 12vw, 4.6rem); line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.dots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; max-width: 360px; }
.dots span { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 150px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(224, 186, 119, .5); }
.dots i.b { background: var(--teal); box-shadow: 0 0 8px rgba(92, 191, 193, .5); }
.dots i.gone { background: transparent; box-shadow: inset 0 0 0 3px var(--bad); position: relative; }
.dots i.gone::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 3px; background: var(--bad); transform: rotate(-45deg); }
.dots b { font-family: var(--font-display); font-size: 1.6rem; }
.answer { min-width: 3ch; padding: 2px 18px; border-bottom: 4px solid var(--teal); font-family: var(--font-display); font-weight: 900; font-size: clamp(2.4rem, 11vw, 4rem); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--aqua); }
.answer.empty { color: var(--line); }
.card-feedback { min-height: 1.6em; font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; }
.flashcard.is-right { background: linear-gradient(180deg, #17402E, #0C1830) padding-box, linear-gradient(var(--good), var(--good)) border-box; box-shadow: 0 0 46px -6px rgba(101, 217, 74, .7); }
.flashcard.is-right .card-feedback { color: var(--good); }
.flashcard.is-wrong { background: linear-gradient(180deg, #4A1A26, #0C1830) padding-box, linear-gradient(var(--bad), var(--bad)) border-box; box-shadow: 0 0 46px -6px rgba(255, 92, 110, .6); animation: shake .35s; }
.flashcard.is-wrong .card-feedback { color: var(--bad); font-size: 1.5rem; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px auto 0; max-width: 420px; }
.key {
  min-height: 62px; border-radius: 16px; border: 1px solid #335282; color: var(--ink);
  background: linear-gradient(180deg, #24406A, #172B4C); font-family: var(--font-display); font-size: 1.8rem; font-weight: 900;
  box-shadow: 0 5px 0 #0A1426, inset 0 1px 0 rgba(255, 255, 255, .12);
}
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 #0A1426; }
.key-back, .key-minus { font-size: 1.4rem; color: var(--muted); }
.key-minus[hidden] { display: block !important; visibility: hidden; }
.key-go {
  grid-column: 1 / -1; background: var(--streak); color: var(--accent-ink); border: 0; font-style: italic; text-transform: uppercase;
  box-shadow: 0 5px 0 #1E3F8C, 0 10px 24px -10px rgba(79, 108, 238, .8); font-size: 1.35rem;
}

/* ---------- sentence ---------- */
.sent-card, .q-card, .explain-panel, .lesson, .report {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.sent-card { padding: 20px; display: grid; gap: 14px; }
.sent-original {
  font-size: clamp(1.2rem, 4.5vw, 1.55rem); font-weight: 700; padding: 12px 16px; border-radius: 12px;
  background: var(--night); border-left: 6px solid var(--gold-2); overflow-wrap: anywhere;
}
.mistakes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mistake-count { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.05rem; margin-right: 4px; }
.fix-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: var(--font-display); font-weight: 800; font-size: .76rem; color: #08131F; background: var(--muted); white-space: nowrap; }
.fix-cap { background: var(--cap); }
.fix-punct { background: var(--punct); }
.fix-spell { background: var(--spell); }
.fix-grammar { background: var(--grammar); }
.sent-input, .read-input {
  width: 100%; border-radius: 14px; border: 2px solid var(--line); background: var(--night); color: var(--ink);
  padding: 12px 14px; font-weight: 700; line-height: 1.5;
}
.sent-input { resize: none; overflow: hidden; font-size: clamp(1.2rem, 4.5vw, 1.55rem); }
.sent-input:focus, .read-input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(92, 191, 193, .25); }
.sent-input[readonly], .read-input[readonly] { background: var(--mat); color: var(--muted); }
.sent-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tries { margin-left: auto; color: var(--muted); font-weight: 700; }
.sent-actions .btn-primary { min-width: 140px; }
.hints { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hints li, .explain li { display: flex; gap: 10px; align-items: baseline; }
.hints:empty { display: none; }
.sent-feedback:empty { display: none; }
.sent-feedback { border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; font-weight: 600; }
.sent-feedback.try-again { background: var(--bad-bg); border: 1px solid rgba(255, 92, 110, .35); }
.sent-feedback.solved { background: var(--good-bg); border: 1px solid rgba(101, 217, 74, .35); }
.sent-feedback.revealed { background: var(--mat); border: 1px solid var(--line); }
.win-line { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.35rem; color: var(--good); }
.answer-line { font-size: 1.25rem; font-weight: 800; }
.marked { font-size: 1.2rem; font-weight: 700; line-height: 1.8; overflow-wrap: anywhere; }
.w-bad { color: var(--bad); text-decoration: underline wavy var(--bad); text-underline-offset: 5px; }
.explain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.shake { animation: shake .35s; }

/* ---------- reading ---------- */
.passage {
  border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 10px; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #F7F2E4, #EFE6CF); color: #1A2236; border-top: 8px solid var(--gold-1);
}
.passage h2 { font-size: 1.35rem; color: #1A2C45; }
.passage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.listen-btn { background: #1A2C45; color: #F4F4F4; border-color: #1A2C45; }
.passage p { font-size: 1.15rem; line-height: 1.75; max-width: 65ch; font-weight: 600; }
.q-card { margin-top: 16px; padding: 18px; display: grid; gap: 12px; }
.q-type { justify-self: start; padding: 3px 12px; border-radius: 999px; font-family: var(--font-display); font-weight: 800; font-size: .76rem; color: #08131F; background: var(--muted); }
.q-main { background: var(--punct); }
.q-detail { background: var(--sky); }
.q-infer { background: var(--teal); }
.q-vocab { background: var(--gold-2); }
.q-text { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.25; }
.read-input { resize: vertical; font-size: 1.12rem; min-height: 6em; }
.read-feedback:empty { display: none; }
.read-feedback { border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; font-weight: 600; background: var(--mat); border: 1px solid var(--line); }
.read-feedback.v2 { background: var(--good-bg); border-color: rgba(101, 217, 74, .35); }
.read-feedback.v1 { background: var(--warn-bg); border-color: rgba(242, 181, 68, .35); }
.read-feedback.v0, .read-feedback.try-again { background: var(--bad-bg); border-color: rgba(255, 92, 110, .35); }
.read-feedback.thinking { color: var(--muted); font-style: italic; }
.verdict { font-family: var(--font-display); font-size: 1.35rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.verdict.v2 { color: var(--good); }
.verdict.v1 { color: var(--warn); }
.verdict.v0 { color: var(--bad); }
.xp-line { font-family: var(--font-display); font-weight: 900; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; justify-self: start; }
.model { border-left: 5px solid var(--gold-2); padding: 6px 12px; background: var(--night); border-radius: 8px; }
.model p { margin-top: 2px; }

/* ---------- Spanish + Spelling ---------- */
.spell-art { background: radial-gradient(80% 90% at 30% 100%, rgba(224, 186, 119, .45), transparent 60%), linear-gradient(140deg, #7A5A1E, #0B1E3D 70%); }
.spanish-art { background: radial-gradient(80% 90% at 30% 100%, rgba(255, 92, 110, .4), transparent 60%), linear-gradient(140deg, #8C2F3B, #0B1E3D 70%); }
.word-card {
  padding: 22px 20px; display: grid; gap: 12px; justify-items: center; text-align: center; border-radius: 24px;
  background: linear-gradient(180deg, #172B4C, #0C1830) padding-box, var(--gold) border-box; border: 3px solid transparent; box-shadow: var(--shadow);
}
.word-prompt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 9vw, 3.4rem); line-height: 1.1; overflow-wrap: anywhere; }
.word-prompt.small { font-size: clamp(1.15rem, 5vw, 1.6rem); font-style: italic; text-transform: uppercase; color: var(--gold-2); }
.word-prompt .pic { font-size: 1.15em; }
.big-swatch { display: inline-block; width: 56px; height: 56px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .25), 0 0 0 3px var(--ink); }
.big-swatch.sm { width: 26px; height: 26px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), 0 0 0 2px var(--ink); }
.word-sub { color: var(--muted); font-weight: 700; font-size: 1.1rem; max-width: 40ch; }
.word-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 520px; }
.choice {
  min-height: 62px; border-radius: 16px; border: 1px solid #335282; color: var(--ink); padding: 8px 10px;
  background: linear-gradient(180deg, #24406A, #172B4C); font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 5px 0 #0A1426; display: inline-flex; align-items: center; justify-content: center; gap: 10px; overflow-wrap: anywhere;
}
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 #0A1426; }
.choice.is-right { background: linear-gradient(180deg, #2E7D3A, #17402E); border-color: var(--good); box-shadow: 0 0 20px rgba(101, 217, 74, .5); }
.choice.is-wrong { background: linear-gradient(180deg, #7A2433, #4A1A26); border-color: var(--bad); }
.choice:disabled { cursor: default; }
.word-type { display: grid; gap: 10px; width: 100%; max-width: 520px; }
.word-input {
  width: 100%; min-height: 58px; border-radius: 14px; border: 2px solid var(--line); background: var(--night); color: var(--ink);
  padding: 8px 14px; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; text-align: center; letter-spacing: .06em;
}
.word-input:focus { border-color: var(--gold-2); outline: none; box-shadow: 0 0 0 3px rgba(224, 186, 119, .25); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile {
  min-width: 48px; min-height: 52px; border-radius: 12px; border: 0; background: var(--gold); color: #1B1205;
  font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; box-shadow: 0 4px 0 var(--gold-1);
}
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-1); }
.tile-back { background: var(--surface-2); color: var(--muted); box-shadow: 0 4px 0 #0A1426; }
.word-feedback:empty { display: none; }
.word-feedback { width: 100%; max-width: 520px; border-radius: 14px; padding: 12px 16px; display: grid; gap: 6px; font-weight: 600; }
.word-feedback.try-again { background: var(--bad-bg); border: 1px solid rgba(255, 92, 110, .35); }
.word-feedback.solved { background: var(--good-bg); border: 1px solid rgba(101, 217, 74, .35); }
.word-feedback.revealed { background: var(--mat); border: 1px solid var(--line); }
.letters { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; letter-spacing: .14em; }
.l-ok { color: var(--good); }
.l-bad { color: var(--bad); text-decoration: underline; }
#wordNext { min-width: 180px; }

/* ---------- belt rank, stripes, graduation ---------- */
.rank-card {
  display: grid; gap: 10px; padding: 18px; border-radius: 22px; box-shadow: var(--shadow);
  background: radial-gradient(90% 70% at 50% 0%, rgba(224, 186, 119, .14), transparent 60%), linear-gradient(180deg, var(--surface-2), var(--mat)); border: 1px solid var(--line);
}
.rank-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rank-top .grade-select { display: grid; gap: 4px; }
.rank-xp { font-family: var(--font-display); font-weight: 800; color: var(--muted); font-size: .85rem; }
.rank-xp strong { color: var(--gold-3); font-size: 1.1rem; }
.rank-belt, .stripe-belt { display: grid; place-items: center; }
button.rank-belt { background: none; border: 0; padding: 4px; border-radius: 16px; color: var(--muted); gap: 2px; }
button.rank-belt:hover .belt-svg { transform: scale(1.03); }
.belt-svg { transition: transform .15s ease; }
.rank-tap { font-family: var(--font-display); font-weight: 800; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.bd-grades { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.bd-grade { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--mat); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: .78rem; }
.bd-grade.on { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(224, 186, 119, .35); }
.bd-belt { display: grid; place-items: center; }
.bd-name { text-align: center; font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.3rem; }
.bd-next, .bd-xp { text-align: center; }
.bd-xp strong { color: var(--gold-3); }
.bd-table td small { display: block; margin-top: 3px; }
.bd-table .got { color: var(--good); font-weight: 800; }
.bonus { font-style: normal; font-size: .68rem; color: var(--gold-2); }
.bd-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bd-ladder li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--mat); border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--muted); }
.bd-ladder li.done { color: var(--ink); }
.bd-ladder li.done::after { content: "✓"; margin-left: auto; color: var(--good); font-weight: 900; }
.bd-ladder li.now { color: var(--ink); border-color: var(--gold-2); box-shadow: 0 0 12px rgba(224, 186, 119, .35); }
.belt-svg { width: min(360px, 100%); height: auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.rank-name { text-align: center; font-size: clamp(1.25rem, 5vw, 1.7rem); }
.rank-note { text-align: center; color: var(--muted); font-weight: 600; }
.rank-note.mastered { color: var(--gold-3); font-weight: 800; }
.stripe-list { display: grid; gap: 8px; margin-top: 4px; }
.stripe-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px;
  background: rgba(9, 2, 3, .35); border: 1px solid var(--line);
}
.stripe-row.optional { border-style: dashed; border-color: var(--gold-1); }
.stripe-chip { width: 26px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .12); border: 1px dashed rgba(255, 255, 255, .35); }
.stripe-row.earned .stripe-chip { background: #fff; border: 1px solid #5A5A66; box-shadow: 0 0 10px rgba(255, 255, 255, .5); }
.stripe-row.optional.earned .stripe-chip { background: var(--gold-2); }
.sr-main { display: grid; gap: 3px; min-width: 0; }
.sr-main strong { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; }
.sr-main em { font-style: normal; font-size: .7rem; color: var(--gold-2); letter-spacing: .08em; }
.sr-sub { color: var(--muted); font-size: .82rem; font-weight: 600; }
.mini-track { display: block; height: 6px; border-radius: 999px; background: #0A1426; overflow: hidden; }
.mini-track i { display: block; height: 100%; background: var(--gold); }
.stripe-row.earned .mini-track i { background: var(--streak); }
.sr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sr-actions .btn { min-height: 36px; padding: 5px 10px; font-size: .75rem; }
@media (max-width: 480px) {
  .stripe-row { grid-template-columns: auto 1fr; }
  .sr-actions { grid-column: 1 / -1; justify-content: stretch; }
  .sr-actions .btn { flex: 1; }
}
.mode-banner {
  margin: 0 0 10px; padding: 8px 14px; border-radius: 12px; text-align: center; font-family: var(--font-display); font-weight: 900;
  font-style: italic; text-transform: uppercase; letter-spacing: .04em; background: var(--gold); color: #1B1205;
}
.testing .grade-select, .testing .sensei-btn { display: none !important; }
.no-hints [data-test-hide], .no-hints .sensei-btn { display: none !important; }
.stripe-xp .btn { justify-self: start; margin-top: 8px; }
.stripe-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; text-align: center; padding: 10px 0 16px; }
.stripe-score { font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; color: var(--gold-3); }
.stripe-new { animation: stripeIn 1s ease .3s both; }
@keyframes stripeIn { 0% { opacity: 0; transform: translateY(-14px) scale(1.6); } 70% { opacity: 1; transform: scale(1.15); } 100% { transform: none; } }
.belt-summary { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0; }
.belt-summary span { display: inline-flex; align-items: center; gap: 6px; }
.grad-stage {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: center; text-align: center; padding: 26px 14px 20px; border-radius: 26px; overflow: hidden;
  background: radial-gradient(70% 55% at 50% 100%, rgba(224, 186, 119, .4), transparent 70%), radial-gradient(90% 60% at 50% 0%, #2A4C7E, #0B1426 75%);
  border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 60px rgba(224, 186, 119, .35);
}
.grad-eyebrow { color: var(--gold-2); }
.grad-title { font-size: clamp(2.1rem, 10vw, 5rem); max-width: 100%; overflow-wrap: anywhere; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .7s ease; }
.grad-cast { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.grad-zumi { width: clamp(100px, 26vw, 150px); filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); animation: bob 2.4s ease-in-out infinite; }
.grad-champ { width: clamp(110px, 30vw, 170px); }
.grad-line { font-size: 1.15rem; font-weight: 700; max-width: 34ch; overflow-wrap: anywhere; }
.grad-stage .say { max-width: 100%; justify-self: center; }
.grad-belt .belt-svg { width: min(420px, 100%); animation: pop .8s ease .2s both; }
.grad-xp { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-actions { justify-content: center; }

/* ---------- results ---------- */
.results-hero .host-img { width: clamp(120px, 28vw, 190px); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.stat { background: linear-gradient(180deg, var(--surface-2), var(--mat)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: grid; }
.stat-val { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { color: var(--muted); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.promo {
  display: grid; gap: 2px; padding: 16px 18px; margin-bottom: 12px; border-radius: var(--radius);
  background: var(--gold); color: #1B1205; border-left: 16px solid var(--belt); box-shadow: 0 0 30px rgba(224, 186, 119, .45); animation: pop .5s ease;
}
.promo strong { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.5rem; }
.promo-eyebrow { font-family: var(--font-display); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.level-up {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--radius);
  border: 2px dashed var(--green); background: var(--good-bg); font-weight: 700; margin-bottom: 16px;
}
.res-list { margin: 8px 0 20px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.res-list li { background: var(--mat); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }

/* ---------- learning help ---------- */
.sensei-btn { display: none; }
.has-sensei .sensei-btn:not([hidden]) { display: inline-flex; }
.sensei-btn { border-color: var(--gold-2); color: var(--gold-3); }
.redo-note {
  display: grid; gap: 6px; padding: 14px 16px; margin-block: 12px; border-radius: var(--radius);
  background: var(--warn-bg); border: 2px solid var(--warn); font-weight: 600;
}
.redo-note strong { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.15rem; color: var(--warn); }
.redo-note .btn { justify-self: start; }
.redo-note.big strong { font-size: 1.4rem; }
.passed-note { padding: 12px 16px; border-radius: var(--radius); background: var(--good-bg); color: var(--good); font-weight: 800; margin-block: 12px; }
.coach-note { padding: 12px 16px; border-radius: var(--radius); background: var(--mat); border: 1px solid var(--line); font-weight: 700; margin-block: 12px; }
.explain-panel { margin-top: 16px; padding: 18px; display: grid; gap: 10px; border-top: 6px solid var(--sky); }
.explain-panel h2 { font-size: 1.3rem; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; font-size: 1.06rem; font-weight: 600; }
.steps li::marker { color: var(--gold-2); font-family: var(--font-display); font-weight: 900; }
.explain-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.lesson { padding: 18px; display: grid; gap: 14px; margin-bottom: 18px; }
.tip h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.tip ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
.worked { border: 1px solid var(--line); background: var(--mat); border-radius: 12px; padding: 10px 14px; }
.worked + .worked { margin-top: 8px; }
.worked summary { cursor: pointer; font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; }
.worked .steps { margin-top: 10px; }

/* ---------- Sensei's plan ---------- */
.plan { display: grid; gap: 4px; margin-block: 16px 6px; }
.plan .coach-row { margin-bottom: 4px; align-items: center; }
.plan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.plan-item {
  text-align: left; display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); color: var(--ink);
  background: linear-gradient(180deg, var(--surface-2), var(--mat)); border: 1px solid var(--line); border-left: 8px solid var(--sky);
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.plan-item:hover { transform: translateY(-2px); }
.plan-item strong { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.02rem; }
.plan-item span { color: var(--muted); font-size: .9rem; }
.plan-mathRetry, .plan-sentRetry, .plan-readRetry { border-left-color: var(--warn); }
.plan-mathUp, .plan-sentUp, .plan-readUp { border-left-color: var(--green); }
.plan-sentFocus, .plan-readFocus { border-left-color: var(--teal); }
.plan-text { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- parent ---------- */
.report { padding: 20px; margin-top: 18px; display: grid; gap: 12px; }
.report-head { display: flex; gap: 14px; align-items: center; }
.report-head h3 { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.45rem; }
.report h4 { margin: 8px 0 0; }
.table-wrap { overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.grid th[scope="row"] { text-align: left; font-weight: 700; }
.grid th.indent { padding-left: 22px; font-weight: 600; color: var(--muted); }
.grid td small { display: block; color: var(--muted); font-size: .72rem; }
.recent td { text-align: left; }
.tricky { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tricky li { background: var(--bad-bg); border: 1px solid rgba(255, 92, 110, .35); border-radius: 8px; padding: 4px 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.confirm { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 700; }

/* ---------- sheets ---------- */
.sheet-lock { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(4, 8, 18, .72); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(640px, 100%); max-height: 88vh; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--bg)); color: var(--ink); border: 1px solid var(--line); border-radius: 24px 24px 0 0;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); overflow-y: auto;
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sensei-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sensei-who .coach-face { width: 46px; height: 46px; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.sheet-body > * { flex-shrink: 0; }
.sheet-context { font-weight: 800; font-size: 1.1rem; padding: 10px 14px; border-radius: 12px; background: var(--night); overflow-wrap: anywhere; }
.sensei-log { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 120px; flex: 1; }
.bubble { margin: 0; padding: 10px 14px; border-radius: 16px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }
.bubble.sensei { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.kid { background: var(--streak); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 700; }
.bubble.thinking { color: var(--muted); font-style: italic; }
.sensei-chips .chip { font-size: .8rem; min-height: 36px; }
.sensei-form { display: flex; gap: 8px; }
.sensei-form input { flex: 1; min-width: 0; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--night); color: var(--ink); padding: 8px 12px; font-size: 1.05rem; }

/* ---------- footer ---------- */
.footer { margin-top: 40px; display: grid; justify-items: center; gap: 12px; }
.footer-logo { width: 110px; height: auto; opacity: .9; }
.sync-status { font-size: .82rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.sync-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync-status[data-state="synced"]::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.sync-status[data-state="saving"]::before, .sync-status[data-state="connecting"]::before { background: var(--sky); }
.sync-status[data-state="offline"]::before, .sync-status[data-state="readonly"]::before { background: var(--warn); }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

/* screens slide in like a game menu */
.screen:not([hidden]) { animation: enter .28s ease; }

@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
  .belt { width: 78px; }
  .key { min-height: 56px; }
  .sent-actions .btn { flex: 1 1 auto; }
  .tries { margin-left: 0; width: 100%; order: -1; }
  .brand-words { font-size: 1.1rem; }
  .game-art { height: 170px; }
  .game-coach { height: 220px; }
  .home-hero { gap: 8px; }
}

/* Spelling challenge styles */
.word-audio { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.word-audio:not(:has(> :not([hidden]))) { display: none; }
#wordQuiet[aria-pressed="true"] { border-color: var(--gold-2); color: var(--gold-2); }
.spell-word { letter-spacing: .04em; }
.spell-blank { display: inline-block; min-width: 1.1em; margin: 0 .08em; padding: 0 .12em; border-bottom: .12em solid var(--gold-2); color: var(--gold-2); text-align: center; }
.word-sub .spell-u { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold-2); text-decoration-thickness: 3px; text-underline-offset: 4px; font-weight: 900; }

/* Backup and restore */
.backup-code { width: 100%; min-height: 110px; border-radius: 12px; border: 2px solid var(--line); background: var(--night); color: var(--ink); padding: 10px; font: 600 .8rem/1.35 ui-monospace, Menlo, monospace; word-break: break-all; resize: vertical; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { cursor: pointer; }
.restore-card { display: grid; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.restore-bad { color: #FFB4A8; }
.restore-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; text-align: center; margin: 14px 0 0; }

/* Read-aloud speaker button on every game card */
.flashcard, .sent-card, .q-card, .word-card { position: relative; }
.say-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--gold-2); background: rgba(10, 20, 38, .85); color: var(--gold-2); cursor: pointer; padding: 0;
}
.say-btn svg { width: 22px; height: 22px; }
.say-btn:active { transform: scale(.94); }
body.no-speech .say-btn { display: none; }

/* Start training + streak */
.start-btn { display: grid; gap: 2px; justify-items: center; width: 100%; max-width: 420px; padding-top: 14px; padding-bottom: 14px; }
.start-main { font-size: clamp(1.15rem, 5vw, 1.6rem); white-space: nowrap; }
.start-sub { font-family: var(--font-body, inherit); font-style: normal; text-transform: none; font-weight: 700; font-size: .92rem; letter-spacing: 0; opacity: .9; max-width: 100%; line-height: 1.25; text-wrap: balance; }
.start-sub:empty { display: none; }
.streak-line { margin: 0; font-weight: 800; color: var(--muted); }
.streak-line.lit { color: var(--gold-2); }
.streak-line .flame { filter: grayscale(1); opacity: .6; }
.streak-line.lit .flame { filter: none; opacity: 1; }

/* Certificate */
.cert-img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.bd-grads li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grad-actions { display: grid; gap: 10px; justify-items: center; }

/* Gear locker */
.gear-btn { display: grid; justify-items: center; gap: 6px; margin-top: 8px; background: none; border: 0; color: var(--gold-2); cursor: pointer; font-family: var(--font-display); font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.gear-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 180px; }
.gear-rack img { width: 34px; height: 34px; object-fit: contain; border-radius: 10px; background: rgba(224,186,119,.12); border: 1px solid rgba(224,186,119,.35); padding: 2px; }
.gear-rack:empty { display: none; }
.locker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.locker-item { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 10px 8px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(180deg, #1B3256, #102240); color: var(--ink); cursor: pointer; font: inherit; }
.locker-item img { width: 88px; height: 88px; object-fit: contain; }
.locker-item strong { font-family: var(--font-display); font-size: .9rem; line-height: 1.1; }
.locker-badge { font-size: .8rem; color: var(--muted); line-height: 1.25; }
.locker-item.locked { cursor: default; opacity: .75; }
.locker-item.locked img { filter: grayscale(1) brightness(.35); }
.locker-item.on { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(224,186,119,.35); }
.locker-state { font-family: var(--font-display); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.locker-item.on .locker-state { color: var(--gold-2); }
.unlock { display: grid; justify-items: center; text-align: center; gap: 8px; }
.unlock-img { width: 180px; height: 180px; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); animation: pop .5s ease-out; }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.stage-col { display: grid; justify-items: center; min-width: 0; }

/* Parent dashboard */
.pd { display: grid; gap: 2px; margin: 12px 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.pd-row { display: grid; grid-template-columns: 7.2em 1fr; gap: 10px; padding: 10px 12px; background: rgba(13, 24, 48, .6); align-items: baseline; line-height: 1.35; }
.pd-k { font-family: var(--font-display); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.pd-recap { background: linear-gradient(90deg, rgba(224,186,119,.22), rgba(13,24,48,.6)); }
.pd-recap .pd-k { color: var(--gold-2); }
.pd-tip { background: rgba(101, 217, 74, .08); }
.pd-streak { color: var(--gold-2); white-space: nowrap; }
.pd-row .belt-swatch { display: inline-block; width: 22px; height: 10px; border-radius: 3px; background: var(--belt); vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.report-more { margin: 8px 0 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.report-more > summary { cursor: pointer; font-family: var(--font-display); font-weight: 800; color: var(--gold-2); padding: 8px 0; list-style-position: inside; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-2); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.pin-row { display: flex; gap: 10px; align-items: center; }
.pin-input { width: 9ch; min-height: 54px; border-radius: 14px; border: 2px solid var(--line); background: var(--night); color: var(--ink); text-align: center; font: 800 1.6rem/1 var(--font-display); letter-spacing: .3em; }
.pin-msg { color: #FFB4A8; min-height: 1.2em; margin: 6px 0 0; }
/* gear icons are black: give them a soft light behind */
.locker-item img, .gear-rack img, .unlock-img { background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,0) 70%); border-radius: 50%; }
@media (max-width: 420px) { .pd-row { grid-template-columns: 1fr; gap: 2px; } }

/* Dojo Challenge */
.dojo-card { display: grid; gap: 8px; width: 100%; margin: 14px 0; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(224,186,119,.45); background: linear-gradient(120deg, #1C2F52, #13213D); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.dojo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dojo-title { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; }
.dojo-num { font-family: var(--font-display); font-weight: 800; color: var(--gold-2); }
.dojo-bar { height: 12px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; }
.dojo-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #65D94A, #5CBFC1, #4F6CEE); }
.dojo-sub { margin: 0; font-size: .92rem; color: var(--muted); }
.dojo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: dl; }
.dojo-list li { counter-increment: dl; display: grid; grid-template-columns: 2em 26px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(13,24,48,.6); }
.dojo-list li::before { content: counter(dl); font-weight: 800; color: var(--muted); }
.dojo-list li.me { outline: 2px solid var(--gold-2); }
.dojo-list .belt-swatch { display: inline-block; width: 24px; height: 10px; border-radius: 3px; background: var(--belt); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.dl-name { font-weight: 800; } .dl-belt { color: var(--muted); font-size: .85rem; } .dl-n { font-family: var(--font-display); font-weight: 800; color: var(--gold-2); }

/* Younger champions stand shorter */
.champ.age-0 img { max-height: 200px; } .champ.age-1 img { max-height: 222px; } .champ.age-2 img { max-height: 244px; }
.fighter-pick.big .champ.age-0 img { height: 96px; } .fighter-pick.big .champ.age-1 img { height: 106px; } .fighter-pick.big .champ.age-2 img { height: 116px; }
.grad-champ .champ.age-0 img { max-height: 230px; } .grad-champ .champ.age-1 img { max-height: 255px; } .grad-champ .champ.age-2 img { max-height: 280px; }
.home-hero { grid-template-columns: auto minmax(0, 1fr); }
.stage-col { max-width: 46vw; }
.gear-btn { max-width: 150px; text-align: center; line-height: 1.2; }
.home-hud h1 { overflow-wrap: anywhere; }
.start-btn { min-width: 0; max-width: 100%; box-sizing: border-box; }
.start-main { white-space: normal; }
.home-hud { min-width: 0; }

/* Scratch paper */
.scratch-btn { display: flex; margin: 14px auto 0; gap: 8px; }
.scratch-sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #0C1830; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); gap: 8px; }
.scratch-sheet[hidden] { display: none; }
.scratch-head { display: flex; align-items: center; gap: 10px; }
.scratch-problem { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 6vw, 2.2rem); color: var(--ink); }
.scratch-answer { margin: 0; min-width: 2.6em; text-align: center; padding: 4px 10px; border-radius: 12px; border: 2px solid var(--gold-2); font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; color: var(--gold-2); }
.scratch-canvas { flex: 1; min-height: 160px; width: 100%; border-radius: 16px; touch-action: none; cursor: crosshair;
  background-color: #FDFDF8; background-image: linear-gradient(rgba(79,108,238,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(79,108,238,.16) 1px, transparent 1px); background-size: 24px 24px; }
.scratch-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.scratch-tools .sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); background: var(--c); cursor: pointer; }
.scratch-tools .sw.on { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(224,186,119,.35); }
.scratch-tools .tool { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #172B4C; color: var(--ink); font-weight: 800; cursor: pointer; }
.scratch-tools .tool.on { border-color: var(--gold-2); color: var(--gold-2); }
.scratch-tools .tool:disabled { opacity: .45; cursor: default; }
.scratch-keys .keypad { margin: 0 auto; gap: 6px; }
.scratch-keys .key { min-height: 46px; font-size: 1.4rem; }
.scratch-keys .key-go { font-size: 1.1rem; }

/* Gear on the champion */
.champ .g-layer, .champ .g-beltart, .champ .g-face { position: absolute; display: block; max-width: none; max-height: none; pointer-events: none; }
.champ .g-layer { object-fit: fill; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.champ .g-layer.flip { transform: scaleX(-1); }
.champ .g-beltart, .champ .g-face { left: 0; top: 0; width: 100%; height: 100%; mask-size: 100% 100%; -webkit-mask-size: 100% 100%; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; }
.champ .champ-belt { z-index: 0; }
.locker-model { display: grid; justify-items: center; padding: 8px 0 4px; }
.locker-model .champ img:first-child { max-height: 220px; }
.locker-model > svg { height: 220px; width: auto; max-width: 100%; }
.champ img.g-layer { max-width: none !important; max-height: none !important; }
.champ img.g-beltart, .champ img.g-face { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; }
.champ .g-layer.mg { opacity: .92; filter: none; }

/* Champion beside every game */
.mini-champ { position: relative; margin-left: auto; flex: 0 0 auto; width: 64px; height: 92px; display: flex; align-items: flex-end; justify-content: center; }
.mini-champ .mini-body { display: block; transform-origin: 50% 100%; }
.mini-champ .champ img:first-child, .mini-champ .champ.age-0 img:first-child, .mini-champ .champ.age-1 img:first-child, .mini-champ .champ.age-2 img:first-child { max-height: 92px; }
.mini-champ svg { height: 92px; width: auto; }
.mini-say { position: absolute; top: -6px; right: -6px; padding: 2px 7px; border-radius: 10px; background: var(--gold-2); color: #1A1406; font-family: var(--font-display); font-weight: 900; font-size: .72rem; white-space: nowrap; opacity: 0; transform: scale(.6); pointer-events: none; }
.mini-champ.kick .mini-body { animation: miniKick .55s ease-out; }
.mini-champ.oops .mini-body { animation: miniOops .5s ease-in-out; }
.mini-champ.bow .mini-body { animation: miniBow 1.2s ease-in-out; }
.mini-champ.kick .mini-say, .mini-champ.oops .mini-say, .mini-champ.bow .mini-say { animation: miniSay 1.1s ease-out; }
.mini-champ.oops .mini-say { background: #FFB4A8; }
@keyframes miniKick { 0% { transform: none; } 25% { transform: translateX(-4px) rotate(-8deg); } 50% { transform: translateX(10px) rotate(14deg) scale(1.12); } 75% { transform: translateX(4px) rotate(4deg); } 100% { transform: none; } }
@keyframes miniOops { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes miniBow { 0%, 100% { transform: none; } 35%, 65% { transform: rotate(18deg) translateY(4px); } }
@keyframes miniSay { 0% { opacity: 0; transform: scale(.6) translateY(4px); } 20% { opacity: 1; transform: scale(1.1); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .mini-champ .mini-body, .mini-champ .mini-say { animation: none !important; } }
.res-mini { margin: 0 auto 4px; width: 90px; height: 120px; }
.res-mini .champ img:first-child, .res-mini .champ.age-0 img:first-child, .res-mini .champ.age-1 img:first-child, .res-mini .champ.age-2 img:first-child, .res-mini svg { max-height: 120px; height: 120px; }

/* Home: boss + duel cards */
.fun-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; margin: 14px 0 0; }
.boss-card, .duel-card { display: flex; align-items: center; gap: 10px; min-height: 84px; padding: 10px 12px; border-radius: 18px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.boss-card { border: 1px solid rgba(255, 92, 110, .55); background: linear-gradient(120deg, #3A1730, #1A1F3D); }
.duel-card { border: 1px solid rgba(92, 191, 193, .55); background: linear-gradient(120deg, #13344A, #1A1F3D); }
.boss-thumb { width: 58px; height: 70px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.boss-txt { display: grid; gap: 1px; min-width: 0; }
.boss-k { font-family: var(--font-display); font-weight: 800; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #FF8C9A; margin: 0; }
.boss-card strong, .duel-card strong { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1.05; }
.boss-sub { display: block; font-size: .8rem; color: var(--muted); line-height: 1.25; }
.duel-icon { font-size: 1.8rem; }
@media (max-width: 380px) { .fun-row { grid-template-columns: 1fr; } }
/* Boss ladder sheet */
.boss-intro { display: flex; gap: 14px; align-items: center; }
.boss-intro img { width: 110px; height: 150px; object-fit: contain; }
.boss-quote { font-style: italic; color: var(--gold-2); margin: 6px 0 0; }
.boss-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.boss-ladder li { display: grid; grid-template-columns: 26px 40px 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 12px; background: rgba(13,24,48,.6); }
.boss-ladder li img { width: 40px; height: 44px; object-fit: contain; }
.boss-ladder li.locked img { filter: brightness(0) opacity(.5); }
.boss-ladder li.now { outline: 2px solid var(--gold-2); }
.boss-ladder li.beat em { color: var(--good); }
.boss-ladder .belt-swatch { display: inline-block; width: 24px; height: 10px; border-radius: 3px; background: var(--belt); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
/* Boss arena */
.boss-arena { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; padding: 12px 10px 8px; border-radius: 22px; min-height: 230px;
  background: radial-gradient(120% 80% at 50% 100%, rgba(224,186,119,.22), transparent 60%), linear-gradient(180deg, #24133A, #101B36); border: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.ba-side { display: grid; justify-items: center; gap: 6px; }
.ba-hearts { display: flex; gap: 2px; font-size: 1.3rem; color: rgba(255,255,255,.18); }
.ba-hearts .on { color: #FF5C6E; text-shadow: 0 0 8px rgba(255,92,110,.6); }
.ba-champ { width: 110px; height: 160px; margin: 0; }
.ba-champ .champ img:first-child, .ba-champ .champ.age-0 img:first-child, .ba-champ .champ.age-1 img:first-child, .ba-champ .champ.age-2 img:first-child, .ba-champ svg { max-height: 160px; height: 160px; }
.ba-name { margin: 0; font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: .85rem; text-align: center; line-height: 1.05; }
.ba-hp { position: relative; width: 120px; height: 14px; border-radius: 99px; background: rgba(0,0,0,.45); overflow: hidden; border: 1px solid rgba(255,255,255,.2); }
.ba-hp i { display: block; height: 100%; background: linear-gradient(90deg, #FF5C6E, #FFB04F); transition: width .35s ease; }
.ba-hp span { position: absolute; inset: 0; font-size: .65rem; font-weight: 800; text-align: center; line-height: 14px; }
.ba-boss-img { height: 165px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0,0,0,.6)); }
.ba-say { grid-column: 1 / -1; margin: 4px 0 0; text-align: center; font-weight: 700; color: var(--gold-2); min-height: 1.3em; }
.ba-pop-wrap { align-self: center; width: 0; position: relative; }
.boss-pop { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; opacity: 0; }
.boss-pop.dmg { color: #FFE27A; text-shadow: 0 2px 0 #7A2433; }
.boss-pop.hurt { color: #FF5C6E; }
.boss-pop.go { animation: popUp 1s ease-out; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 25% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -30px) scale(1); } }
.boss-hit .ba-boss-img { animation: bossHit .5s ease-out; }
.boss-strike .ba-boss-img { animation: bossStrike .6s ease-in-out; }
@keyframes bossHit { 0% { transform: none; filter: none; } 30% { transform: translateX(12px) rotate(6deg); filter: brightness(2) drop-shadow(0 0 12px #FFE27A); } 100% { transform: none; } }
@keyframes bossStrike { 0% { transform: none; } 40% { transform: translateX(-40px) scale(1.1); } 100% { transform: none; } }
.qq-card { position: relative; margin-top: 12px; padding: 16px 14px; border-radius: 20px; background: linear-gradient(180deg, #172B4C, #0C1830); border: 1px solid rgba(224,186,119,.35); display: grid; gap: 8px; text-align: center; }
.qq-label { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.qq-prompt { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.2rem, 5.4vw, 1.7rem); line-height: 1.15; padding: 0 30px; }
.qq-art { font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 9vw, 2.8rem); }
.qq-art .pic { font-size: 1em; }
.qq-sub { margin: 0; color: var(--muted); font-weight: 700; }
.qq-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qq-choices.long { grid-template-columns: 1fr; }
.qq-choices.long .qq-choice { font-family: var(--font-body); font-weight: 700; font-size: .98rem; text-align: left; justify-content: flex-start; min-height: 52px; }
.boss-over { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: rgba(7,13,28,.9); }
.boss-over[hidden] { display: none; }
.boss-over h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(1.6rem, 7vw, 2.4rem); }
.boss-prize { font-size: 1.2rem; font-weight: 800; color: #FFE27A; margin: 0; }
/* Dojo duel */
.duel-arena { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: 1fr auto 1fr; background: #0C1830; }
.duel-half { position: relative; display: grid; align-content: start; gap: 8px; padding: 12px 12px 14px; overflow: hidden; }
.duel-half.p1 { background: linear-gradient(180deg, #13344A, #0C1830); }
.duel-half.p2 { background: linear-gradient(0deg, #3A1730, #0C1830); }
.duel-arena.flip .duel-half.p1 { transform: rotate(180deg); }
.duel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.duel-name { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; }
.duel-score { font-family: var(--font-display); font-weight: 900; color: var(--gold-2); font-size: 1.2rem; }
.duel-bar { height: 10px; border-radius: 99px; background: rgba(0,0,0,.4); overflow: hidden; }
.duel-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #65D94A, #5CBFC1); transition: width .3s; }
.duel-q { display: grid; gap: 6px; text-align: center; }
.duel-q .qq-prompt { font-size: clamp(1.05rem, 4.6vw, 1.45rem); padding: 0; }
.duel-q .qq-art { font-size: clamp(1.6rem, 7vw, 2.2rem); }
.duel-q .choice { min-height: 50px; }
.duel-freeze { position: absolute; inset: 0; display: none; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 2rem; color: #BEE7FF; background: rgba(120,190,255,.25); backdrop-filter: blur(2px); }
.duel-half.frozen .duel-freeze { display: grid; }
.duel-half.good { animation: duelGood .45s ease-out; }
@keyframes duelGood { 0% { box-shadow: inset 0 0 0 0 rgba(101,217,74,.0); } 40% { box-shadow: inset 0 0 0 6px rgba(101,217,74,.7); } 100% { box-shadow: inset 0 0 0 0 rgba(101,217,74,0); } }
.duel-mid { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: #1A1F3D; font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; }
.duel-over { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; background: rgba(7,13,28,.92); }
.duel-over[hidden] { display: none; }
.duel-over h2 { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(1.6rem, 7vw, 2.4rem); }
.duel-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.duel-pick select, .duel-pick input { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--night); color: var(--ink); padding: 0 10px; font: inherit; }
.duel-guest { display: flex; gap: 6px; }
.duel-guest[hidden] { display: none; }
.duel-tag { font-family: var(--font-display); font-weight: 900; font-size: .75rem; text-transform: uppercase; min-width: 70px; }
.duel-tag.p1 { color: var(--teal); } .duel-tag.p2 { color: #FF8C9A; }
.duel-face { display: flex; gap: 8px; align-items: center; margin: 8px 0; color: var(--muted); }
body.duel-on .topbar, body.duel-on .footer { visibility: hidden; }
.fun-row { margin: 14px 0; }

/* Secret boss: Final Boss Master Young */
.boss-arena.ultimate { background: radial-gradient(120% 80% at 50% 100%, rgba(150,80,255,.35), transparent 60%), linear-gradient(180deg, #1A0B2E, #0A0F22); box-shadow: inset 0 0 40px rgba(150,80,255,.35); }
.boss-arena.ultimate .ba-hp i { background: linear-gradient(90deg, #9B5CFF, #FF5CD6); }
.boss-ladder li.secret { background: linear-gradient(90deg, rgba(150,80,255,.25), rgba(13,24,48,.6)); }
.boss-over.twist #bossAgain { background: linear-gradient(100deg, #9B5CFF, #FF5CD6); color: #fff; animation: twistPulse 1s ease-in-out infinite; }
@keyframes twistPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.boss-morph { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: radial-gradient(circle, #2A0E4A, #05060F 70%); overflow: hidden; }
.boss-morph[hidden] { display: none; }
.boss-morph img { position: absolute; height: min(60vh, 420px); width: auto; filter: drop-shadow(0 0 30px rgba(155,92,255,.8)); }
.boss-morph .bm-to { opacity: 0; }
.boss-morph .bm-text, .boss-morph .bm-name { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; }
.boss-morph .bm-text { top: 8%; color: #D8C2FF; font-size: 1.1rem; }
.boss-morph .bm-name { bottom: 8%; font-size: clamp(2rem, 9vw, 3.2rem); color: #fff; text-shadow: 0 0 24px #9B5CFF; opacity: 0; }
.boss-morph.go .bm-from { animation: morphOut 3.2s ease-in forwards; }
.boss-morph.go .bm-to { animation: morphIn 3.2s ease-out forwards; }
.boss-morph.go .bm-name { animation: morphName 3.2s ease-out forwards; }
@keyframes morphOut { 0% { opacity: 1; transform: none; } 30% { transform: translateX(-6px); filter: brightness(1.5) drop-shadow(0 0 30px #9B5CFF); } 40% { transform: translateX(6px); } 50% { opacity: 1; transform: scale(1.05); filter: brightness(4); } 60%, 100% { opacity: 0; transform: scale(1.2); } }
@keyframes morphIn { 0%, 50% { opacity: 0; transform: scale(.7); filter: brightness(4); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; filter: drop-shadow(0 0 30px rgba(155,92,255,.8)); } }
@keyframes morphName { 0%, 65% { opacity: 0; transform: scale(1.6); } 80%, 100% { opacity: 1; transform: none; } }

/* Welcome: Start here / Resume my training */
.welcome-cta { display: grid; gap: 10px; margin: 18px 0 8px; justify-items: stretch; }
.cta-main { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 88px; padding: 14px 18px; text-align: left; font-size: 1rem; }
.cta-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cta-title { font-family: var(--font-display); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(1.5rem, 7vw, 2.1rem); line-height: 1; }
.cta-sub { font-family: var(--font-body); font-style: normal; text-transform: none; font-weight: 700; font-size: .95rem; opacity: .9; }
.cta-arrow { font-size: 1.6rem; }
.cta-main .avatar { flex: 0 0 auto; }
.cta-start { min-height: 100px; animation: ctaPulse 2.2s ease-in-out infinite; }
@keyframes ctaPulse { 0%, 100% { transform: none; } 50% { transform: scale(1.025); } }
@media (prefers-reduced-motion: reduce) { .cta-start { animation: none; } }
.cta-new { justify-self: center; }
.switch-label { margin: 14px 0 6px; }
.avatar.md { width: 58px; height: 58px; font-size: 1.4rem; }
.duel-card { gap: 8px; padding: 10px; }
.duel-card > span:last-child { min-width: 0; }
.duel-card strong { display: block; font-size: clamp(.78rem, 3.4vw, 1rem); overflow-wrap: anywhere; }
.duel-icon { font-size: 1.35rem; flex: 0 0 auto; }
/* Partner Challenge card: icon on top, whole words only */
.duel-card { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 10px 8px; }
.duel-card > span:last-child { display: grid; gap: 2px; justify-items: center; }
.duel-card strong { overflow-wrap: normal; word-break: keep-all; hyphens: none; font-size: clamp(.82rem, 3.6vw, 1.05rem); line-height: 1.05; }
.duel-card .boss-sub { font-size: .78rem; }
.duel-icon { font-size: 1.5rem; line-height: 1; }

/* Outfits */
.outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 8px; }
.outfit { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(180deg, #1B3256, #102240); color: var(--ink); font: inherit; cursor: pointer; text-align: center; }
.outfit strong { font-family: var(--font-display); font-size: .85rem; line-height: 1.1; }
.outfit-art { display: block; height: 130px; }
.outfit-art .champ img:first-child, .outfit-art .champ.age-0 img:first-child, .outfit-art .champ.age-1 img:first-child, .outfit-art .champ.age-2 img:first-child, .outfit-art svg { max-height: 130px; height: 130px; width: auto; }
.outfit.on { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(224,186,119,.35); }
.outfit.locked { cursor: default; }
.outfit.locked .outfit-art { filter: grayscale(1) brightness(.45); }
.outfit .locker-state { font-size: .7rem; }
.outfit.locked .locker-state { color: var(--muted); text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 700; }
.outfit-need { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.unlock-outfit { display: grid; justify-items: center; gap: 6px; }
.unlock-outfit .champ img:first-child { max-height: 200px; }
.unlock-outfit > svg { height: 200px; width: auto; }

/* ---------- School words ---------- */
.school-box { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 10px 0; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.school-box > div { flex: 1 1 260px; min-width: 0; }
.school-box p { margin: 4px 0 0; }
.school-words { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: .85rem; background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.sw.ok { background: var(--good-bg); border-color: var(--good); color: #CFF7C2; }
.sw.go { background: var(--warn-bg); border-color: var(--warn); color: #FBE3B0; }
.sw.bad { background: var(--bad-bg); border-color: var(--bad); color: #FFC9CF; }
.school-in { width: 100%; box-sizing: border-box; border-radius: 14px; border: 1px solid var(--line); background: var(--mat); color: var(--ink); padding: 12px; font: inherit; font-size: 1.05rem; resize: vertical; }
.school-photo { margin-top: 10px; }
.school-cta { margin: 4px 0 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(224,186,119,.5); background: rgba(224,186,119,.08); }
.school-cta .eyebrow { margin: 0 0 8px; color: var(--gold-2); }
.school-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-gold { background: var(--gold); color: var(--accent-ink); border: 0; font-weight: 800; }

/* ---------- Daily quest + Adventure Map ---------- */
.quest-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin: 0 0 12px; }
@media (max-width: 560px) { .quest-row { grid-template-columns: 1fr; } }
.quest-card, .map-card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(120deg, #1F3358, #172846); color: var(--ink); cursor: pointer; font: inherit; min-width: 0; }
.quest-card:hover, .map-card:hover { border-color: var(--teal); }
.quest-card.ready { border-color: var(--gold-2); background: linear-gradient(120deg, #4A3A14, #2B2410); animation: questGlow 1.6s ease-in-out infinite; }
.quest-card.claimed { opacity: .85; }
@keyframes questGlow { 50% { box-shadow: 0 0 0 4px rgba(224,186,119,.25), 0 0 24px rgba(224,186,119,.35); } }
.quest-icon { font-size: 2rem; flex: none; }
.quest-card.ready .quest-icon { animation: chestShake 1.2s ease-in-out infinite; display: inline-block; }
.quest-txt { display: grid; gap: 3px; min-width: 0; }
.quest-txt strong { font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 1rem; line-height: 1.15; }
.quest-bar { display: block; height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.quest-bar span { display: block; height: 100%; background: var(--streak); border-radius: inherit; }
.map-mini { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: linear-gradient(180deg, var(--sky) 55%, var(--ground) 55%); border: 1px solid rgba(255,255,255,.18); }
@media (prefers-reduced-motion: reduce) { .quest-card.ready, .quest-card.ready .quest-icon, .chest { animation: none !important; } }

.map { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 18px; position: relative; }
.map::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; border-left: 4px dashed rgba(224,186,119,.35); transform: translateX(-2px); }
.region { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border-radius: 18px; overflow: hidden; border: 2px solid rgba(255,255,255,.12); background: var(--surface); }
.region.here { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(224,186,119,.25); }
.region.locked { filter: saturate(.25) brightness(.6); }
.region-scene { position: relative; min-height: 130px; background: linear-gradient(180deg, var(--sky) 0 62%, var(--ground) 62%); }
.region-icon { position: absolute; left: 10px; top: 8px; font-size: 1.6rem; }
.region-boss { position: absolute; right: 6px; bottom: 4px; height: 108px; width: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.region.locked .region-boss { filter: brightness(0) drop-shadow(0 0 1px rgba(255,255,255,.5)); }
.region-champ { position: absolute; left: 14px; bottom: 4px; height: 112px; display: block; }
.region-champ .champ, .region-champ svg { height: 112px; width: auto; display: block; }
.region-champ .champ img:first-child { max-height: 112px; height: 112px; width: auto; }
.region-trophy { position: absolute; right: 8px; top: 6px; font-size: 1.3rem; }
.region-info { display: grid; align-content: center; gap: 6px; padding: 10px 12px; }
.region-info strong { font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; line-height: 1.1; }
.region-sub { color: var(--muted); font-size: .85rem; }
.map-dots { display: flex; gap: 6px; }
.map-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--belt); background: transparent; }
.map-dot.on { background: var(--gold-2); border-color: var(--gold-2); box-shadow: 0 0 8px rgba(224,186,119,.6); }
.region-info .btn { justify-self: start; }
.map-done { text-align: center; font-weight: 800; color: var(--gold-2); }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin: 8px 0; }
.sticker { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; font-size: 1.5rem; background: rgba(255,255,255,.05); border: 1px dashed var(--line); color: var(--muted); }
.sticker.got { background: rgba(224,186,119,.12); border: 1px solid var(--gold-2); }

.chest-wrap { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 8px 0; }
.chest { font-size: 6rem; line-height: 1; background: none; border: 0; cursor: pointer; animation: chestShake 1.1s ease-in-out infinite; }
@keyframes chestShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg) scale(1.05); } 40% { transform: rotate(8deg) scale(1.05); } 60% { transform: rotate(-4deg); } }
.chest-prize { font-size: 5rem; line-height: 1; animation: pop .5s ease-out; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.chest-xp { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; color: var(--gold-2); margin: 0; }

/* ---------- Parent sign-up ---------- */
.lead-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--gold-2); background: linear-gradient(120deg, rgba(224,186,119,.16), rgba(224,186,119,.04)); }
.lead-card > div { flex: 1 1 220px; min-width: 0; }
.lead-card p { margin: 4px 0 0; }
.lead-icon { font-size: 2rem; }
.lead-owner { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--line); font-size: .9rem; }
.lead-link { display: block; margin: 18px auto 0; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(224,186,119,.5); background: rgba(224,186,119,.08); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; text-align: center; max-width: 100%; }
.lead-link strong { color: var(--gold-2); }
.lead-form { display: grid; gap: 12px; }
.lead-form p { margin: 0; }
.lf { display: grid; gap: 5px; font-weight: 700; }
.lf input { width: 100%; box-sizing: border-box; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--mat); color: var(--ink); padding: 10px 12px; font: inherit; font-size: 1rem; }
.lf input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.lf.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lf-set { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lf-set legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.lf-chip, .lf-check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.lf-check { flex: 1 1 100%; }
.lf-chip input, .lf-check input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.lf-adult { border-color: rgba(224,186,119,.5); }
.lf-msg { min-height: 1.2em; color: var(--bad); font-weight: 700; }
.lf-msg.good { color: var(--teal); }
.unlock-report { max-width: 640px; margin: 0 auto 18px; padding: 18px; border-radius: 22px; border: 1px solid var(--gold-2); background: linear-gradient(160deg, rgba(224,186,119,.14), rgba(19,34,61,.9) 45%); }
.ur-head { display: flex; gap: 14px; align-items: flex-start; }
.ur-head h2 { margin: 0 0 6px; font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: clamp(1.2rem, 4.6vw, 1.6rem); line-height: 1.1; }
.ur-head p { margin: 0; }
.ur-icon { font-size: 2.4rem; flex: none; }
.ur-gets { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; font-weight: 700; }
.lf-adult span { line-height: 1.35; }
.lf-fine { line-height: 1.45; }
.center { text-align: center; }
.ur-manage { max-width: 640px; margin: 0 auto; }
.ur-manage .report-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.terms h4 { margin: 14px 0 4px; }
.terms p { margin: 0; line-height: 1.5; }
.terms a { color: var(--teal); }
.xp-warn { margin: 10px 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--warn); background: var(--warn-bg); }
.xp-warn p { margin: 6px 0 0; }

/* ---------- Daily Flashcards ---------- */
.flash-block { border: 1px solid rgba(224,186,119,.55); border-radius: 18px; padding: 14px; background: linear-gradient(140deg, rgba(224,186,119,.12), rgba(19,34,61,.6)); }
.flash-block .muted { margin: 0 0 10px; }
.flash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .flash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.flash-btn { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.flash-btn:hover:not(:disabled) { border-color: var(--gold-2); transform: translateY(-1px); }
.flash-btn .op-sym { font-family: var(--font-display); font-weight: 900; font-size: 2.2rem; line-height: 1; color: var(--gold-2); }
.flash-name { font-weight: 800; font-size: .95rem; }
.flash-state { font-size: .75rem; color: var(--teal); font-weight: 700; text-align: center; }
.flash-btn.done { border-color: var(--good); background: var(--good-bg); }
.flash-btn.done .flash-state { color: #CFF7C2; }
.flash-btn:disabled { opacity: .45; cursor: not-allowed; }
.family-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--teal); background: linear-gradient(120deg, rgba(92,191,193,.16), rgba(92,191,193,.04)); }
.family-card > div { flex: 1 1 220px; min-width: 0; }
.family-card p { margin: 4px 0 0; }
.family-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 auto !important; }
.family-link { border-color: rgba(92,191,193,.6); background: rgba(92,191,193,.1); }
.family-link strong { color: var(--teal); }
.family-link.linked { cursor: default; opacity: .9; }
.code-input { letter-spacing: .3em; width: 9.5em; }
.welcome-cta + .family-link { margin: 12px auto 4px; }
