/* HOOPERS Dil. Brand tokens from ui.css: one strong red, warm creams, ink. Everything is round. */
:root {
  --red: #d91414; --red-deep: #b40e0e; --red-tint: #fff0ed; --red-soft: #f0c2ba;
  --cream: #fbf9f5; --beige: #f4efe6; --white: #fff; --ink: #1a1a1a; --ink-soft: #46413b; --muted: #6b645b; --line: #e4ddcf;
  --on: #fbf9f5; --slab: #1a1a1a;
  --good: #1f9d5b; --good-tint: #e8f7ee; --good-deep: #157a45; --gold: #f2a900; --ice: #3aa0e8;
  --font-display: "Modak", cursive; --font-head: "Space Grotesk", system-ui, sans-serif; --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 22px; --shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(60, 30, 10, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.dil { margin: 0; background: var(--cream); color: var(--ink); font: 15.5px/1.6 var(--font-body); min-height: 100dvh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .4em; }
p { margin: 0 0 .6em; }
kbd { font: 600 11px var(--font-head); color: var(--muted); border: 1.5px solid var(--line); border-radius: 6px; padding: 0 5px; min-width: 20px; display: inline-grid; place-items: center; }
@media (pointer: coarse) { kbd { display: none !important; } }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.noscript { padding: 40px; text-align: center; }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; background: var(--red); display: grid; place-items: center; place-content: center; gap: 18px; color: var(--on); transition: opacity .5s var(--ease), visibility .5s; }
.splash span { font: 400 46px/1 var(--font-display); }
.splash-ring { width: 84px; height: 84px; border-radius: 50%; border: 14px solid var(--cream); border-right-color: transparent; animation: spin .9s linear infinite; }
body.ready .splash { opacity: 0; visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn { --b: var(--white); --c: var(--ink); --e: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 16px; background: var(--b); color: var(--c); border: 2px solid var(--e); box-shadow: 0 4px 0 var(--e); font: 700 15px var(--font-head); letter-spacing: .02em; text-decoration: none; transition: transform .12s, box-shadow .12s, filter .2s; user-select: none; }
.btn:hover { filter: brightness(1.03); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--e); }
.btn:disabled { --b: var(--beige); --c: #a59d92; --e: var(--line); cursor: default; }
.btn.primary { --b: var(--red); --c: var(--on); --e: var(--red-deep); }
.btn.ghost { --b: transparent; --e: transparent; box-shadow: none; color: var(--muted); }
.btn.danger { color: var(--red-deep); }
.btn.danger:not(.ghost) { --b: var(--red-tint); --e: var(--red-soft); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 13px; }
.btn.big { min-height: 56px; padding: 0 34px; font-size: 16.5px; width: min(100%, 360px); }
.btn.block { width: 100%; }
.btn small { opacity: .8; font-weight: 600; }
.link { color: var(--red-deep); font: 700 14px var(--font-head); text-decoration: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.side, .rail { display: none; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1.5px solid var(--line); }
.brand-m { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.brand-m img { height: 26px; width: auto; }
.brand-dil { font: 400 26px/1 var(--font-display); color: var(--red); transform: translateY(1px); }
.stats { display: flex; gap: 2px; align-items: center; }
.stat { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 12px; font: 700 15px var(--font-head); transition: background .2s; }
.stat:hover { background: var(--beige); }
.flag { font-size: 22px; line-height: 1; filter: saturate(1.1); }
.streak-btn b { color: #b3aaa0; }
.streak-btn.lit b { color: #e86100; }
.flame { fill: #cfc7bc; transition: fill .3s; }
.flame .flame-in { fill: #e9e3da; }
.flame.lit { fill: #ff7a00; animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.flame.lit .flame-in { fill: #ffd23f; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.05, .97) rotate(-2deg); } 60% { transform: scale(.97, 1.04) rotate(2deg); } }
.xp-btn b { color: var(--ink); }
.heart-ic { color: var(--red); font-size: 19px; line-height: 1; }
.heart-btn b { color: var(--red); }
.heart-btn.empty .heart-ic { color: #cfc7bc; }
.ring-bg { fill: none; stroke: var(--line); }
.ring-fg { fill: none; stroke: var(--red); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-fg.full { stroke: var(--gold); }
.view { padding: 18px 16px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; outline: none; }
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--white); border-top: 1.5px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a { display: grid; place-items: center; gap: 1px; padding: 8px 0 7px; color: #a59d92; text-decoration: none; font: 700 10.5px var(--font-head); letter-spacing: .04em; text-transform: uppercase; }
.tabbar a.on { color: var(--red); }
.tabbar a.on svg { animation: pop .4s var(--spring); }
body.in-lesson .tabbar, body.onboarding .tabbar, body.onboarding .topbar .stats { display: none; }

@media (min-width: 900px) {
  .app { grid-template-columns: 236px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px; border-right: 1.5px solid var(--line); }
  .brand { display: flex; align-items: center; gap: 8px; padding: 6px 12px 22px; text-decoration: none; }
  .brand img { height: 32px; width: auto; }
  .brand .brand-dil { font-size: 32px; }
  #side-nav { display: grid; gap: 4px; }
  #side-nav a { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 16px; border: 2px solid transparent; color: var(--ink-soft); text-decoration: none; font: 700 14px var(--font-head); letter-spacing: .06em; text-transform: uppercase; transition: background .2s; }
  #side-nav a:hover { background: var(--beige); }
  #side-nav a.on { color: var(--red); background: var(--red-tint); border-color: var(--red-soft); }
  .side-back { margin-top: auto; padding: 10px 14px; color: var(--muted); font-size: 13px; text-decoration: none; }
  .side-back.side-legal { margin-top: 0; padding-top: 0; font-size: 12px; }
  .tabbar { display: none; }
  .brand-m { visibility: hidden; }
  .view { padding: 26px 28px 80px; }
  .topbar { justify-content: flex-end; border-bottom: 0; background: transparent; backdrop-filter: none; padding: 16px 28px 0; position: static; }
}
@media (min-width: 1240px) {
  .app { grid-template-columns: 256px minmax(0, 1fr) 360px; }
  .rail { display: grid; align-content: start; gap: 16px; position: sticky; top: 0; height: 100dvh; overflow: auto; padding: 78px 26px 26px 6px; }
  .mobile-top { display: none; }
}

/* ---------- Panels ---------- */
.panel { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { font-size: 17px; }
.goal-panel { display: flex; gap: 16px; align-items: center; }
.goal-panel h3 { margin: 0 0 2px; }
.goal-panel p { margin: 0; color: var(--muted); font-size: 14px; }
.goal-ring { position: relative; flex: none; display: grid; place-items: center; }
.goal-n { position: absolute; font: 700 18px var(--font-head); }
.goal-n small { font-size: 11px; color: var(--muted); }
.quests { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.quests li { display: grid; grid-template-columns: 30px 1fr 26px; gap: 10px; align-items: center; }
.quests p { margin: 0 0 4px; font: 600 14px var(--font-head); }
.q-ic { font-size: 22px; }
.q-chest { font-size: 20px; }
.quests li.done .q-chest { animation: pop .5s var(--spring); }
.qbar { position: relative; height: 16px; border-radius: 99px; background: var(--beige); overflow: hidden; }
.qbar i { position: absolute; inset: 0 auto 0 0; background: var(--gold); border-radius: 99px; transition: width .8s var(--ease); }
.qbar span { position: relative; display: block; text-align: center; font: 700 11px/16px var(--font-head); color: var(--ink-soft); }
.quests li.done .qbar i { background: var(--good); }
.login-panel { display: flex; gap: 12px; align-items: flex-start; background: var(--red-tint); border-color: var(--red-soft); }
.login-panel p { font-size: 13.5px; color: var(--ink-soft); }
.lvl-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.lvl-chip { font: 700 13px var(--font-head); padding: 5px 10px; border-radius: 99px; background: var(--beige); color: var(--muted); }
.lvl-chip.cert { background: var(--good-tint); color: var(--good-deep); }
.lvl-chip.me { background: var(--red); color: var(--on); }

/* ---------- Path ---------- */
.mobile-top .goal-panel { margin-bottom: 18px; }
.section { margin-bottom: 26px; }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; margin: 4px 0 18px; }
.sec-level { grid-row: span 2; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--slab); color: var(--on); font: 700 20px var(--font-head); }
.sec-head h2 { font-size: 22px; margin: 0; }
.sec-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.sec-bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--beige); overflow: hidden; margin-top: 6px; }
.sec-bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.unit { margin-bottom: 30px; --tone: hsl(calc(358 + var(--hue) * 0), 84%, calc(46% - (var(--hue) * 0.12%))); }
.unit-banner { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--red); color: var(--on); box-shadow: 0 5px 0 var(--red-deep); overflow: hidden; }
.unit:nth-child(3n+2) .unit-banner { background: var(--slab); box-shadow: 0 5px 0 #000; }
.unit:nth-child(3n+3) .unit-banner { background: var(--red-deep); box-shadow: 0 5px 0 #7d0909; }
.unit-banner::after { content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; border: 2px dashed rgba(251, 249, 245, .25); pointer-events: none; }
.unit.locked .unit-banner { background: #c9c1b6; box-shadow: 0 5px 0 #aea596; }
.ub-kicker { font: 700 11.5px var(--font-head); letter-spacing: .16em; text-transform: uppercase; opacity: .85; margin: 0 0 4px; }
.unit-banner h3 { font-size: 20px; margin: 0 0 3px; }
.ub-goal { font-size: 13.5px; opacity: .9; margin: 0; }
.ub-actions { display: grid; gap: 6px; align-content: start; flex: none; position: relative; z-index: 1; }
.ub-btn { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 13px; border: 2px solid rgba(251, 249, 245, .35); font: 700 13px var(--font-head); color: var(--on); background: rgba(255, 255, 255, .08); }
.ub-btn:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 420px) { .ub-btn span { display: none; } }
.path { position: relative; display: grid; justify-items: center; gap: 22px; padding: 26px 0 6px; }
.node-wrap { position: relative; transform: translateX(var(--x)); display: grid; justify-items: center; }
.node { position: relative; width: 74px; height: 70px; border-radius: 50%; display: grid; place-items: center; font: 700 26px var(--font-head); color: var(--on); background: var(--red); box-shadow: 0 7px 0 var(--red-deep); transition: transform .12s, box-shadow .12s; }
.node:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--red-deep); }
.node.done { background: var(--gold); box-shadow: 0 7px 0 #c48800; }
.node.done.gold { background: linear-gradient(135deg, #ffcf3f, #f2a900); }
.node.locked { background: #ddd6cb; color: #a99f92; box-shadow: 0 7px 0 #c3baad; font-size: 22px; }
.node.trophy { width: 84px; height: 78px; font-size: 32px; background: var(--beige); color: inherit; box-shadow: 0 7px 0 var(--line); border: 2px solid var(--line); }
.node.trophy.open { background: var(--gold); box-shadow: 0 7px 0 #c48800; border-color: transparent; animation: bob 2s ease-in-out infinite; }
.node.trophy.done { background: var(--slab); box-shadow: 0 7px 0 #000; border-color: transparent; }
.node.current { animation: bob 2.2s ease-in-out infinite; }
.node-ring { position: absolute; inset: -11px; width: calc(100% + 22px); height: calc(100% + 22px); overflow: visible; }
.node-ring circle { fill: none; stroke: var(--red-soft); stroke-width: 6; stroke-dasharray: 10 9; animation: spin 12s linear infinite; transform-origin: 50% 50%; }
.node-tip { position: absolute; top: -40px; white-space: nowrap; background: var(--white); color: var(--red); border: 2px solid var(--line); border-radius: 12px; padding: 4px 12px; font: 700 13px var(--font-head); letter-spacing: .08em; text-transform: uppercase; animation: bob 2.2s ease-in-out infinite; z-index: 2; }
.node-tip::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: var(--white); border: 2px solid var(--line); border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
.path-hoop { position: absolute; right: 2%; top: 38%; pointer-events: none; }
@media (max-width: 480px) { .path-hoop { right: -10px; } .path-hoop svg { width: 84px; height: 84px; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.pop { position: absolute; z-index: 15; top: calc(100% + 14px); width: 250px; padding: 16px; border-radius: 18px; background: var(--red); color: var(--on); box-shadow: 0 16px 34px -12px rgba(120, 10, 10, .55); opacity: 0; transform: translateY(-6px) scale(.96); transition: opacity .2s, transform .25s var(--spring); }
.pop.in { opacity: 1; transform: none; }
.pop::before { content: ""; position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.pop.done { background: var(--gold); color: var(--ink); }
.pop.locked { background: var(--beige); color: var(--ink-soft); border: 2px solid var(--line); }
.pop h4 { font-size: 17px; margin: 0 0 2px; }
.pop p { margin: 0 0 12px; font-size: 13.5px; opacity: .9; }
.pop .btn:not(.primary) { --b: var(--white); }
.pop .btn.primary { --b: var(--on); --c: var(--red); --e: #e8d9cf; }
.pop-lock { margin: 0 !important; }

/* ---------- Hoop ---------- */
.hoop { overflow: visible; display: block; }
.hp-shadow { fill: rgba(60, 30, 10, .12); }
.hp-ring { fill: var(--red); }
.hp-ring-shine { fill: none; stroke: rgba(255, 255, 255, .25); stroke-width: 4; stroke-dasharray: 40 240; stroke-dashoffset: -150; stroke-linecap: round; }
.hp-face { fill: var(--cream); }
.hp-cheek { fill: var(--red-soft); }
.hp-mouth { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; }
.hp-mouth-open { fill: var(--red-deep); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.hp-arm { fill: none; stroke: var(--red-deep); stroke-width: 7; stroke-linecap: round; }
.hp-z { font: 700 16px var(--font-head); fill: var(--muted); animation: zz 2s ease-in-out infinite; }
.hp-z2 { animation-delay: .6s; font-size: 12px; }
.hp-eyes { animation: blink 4.5s infinite; transform-origin: 60px 52px; }
.hp-body { transform-origin: 60px 104px; }
.hoop.float .hp-body, .hoop.idle .hp-body { animation: breathe 3.2s ease-in-out infinite; }
.hoop.float { animation: float 4s ease-in-out infinite; }
.hoop.jump .hp-body { animation: jump .6s var(--spring); }
.hoop.jump-big .hp-body { animation: jumpBig 1.1s var(--spring) infinite; }
.hoop.talk .hp-body { animation: talk .5s ease-in-out 3; }
.hp-wave { animation: wave 1.2s ease-in-out infinite; transform-origin: 103px 62px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes jump { 0% { transform: scale(1.1, .85); } 40% { transform: translateY(-14px) scale(.95, 1.06); } 100% { transform: none; } }
@keyframes jumpBig { 0%, 100% { transform: scale(1.08, .9); } 35% { transform: translateY(-26px) scale(.95, 1.06) rotate(-4deg); } 65% { transform: translateY(-4px) rotate(3deg); } }
@keyframes talk { 50% { transform: scale(1.04, .96) rotate(-2deg); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 4px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -8px); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- Onboarding ---------- */
.v-onboard { max-width: 560px; padding-top: 30px; }
.onb { display: grid; justify-items: center; text-align: center; gap: 10px; }
.onb.enter { animation: rise .55s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.onb h2 { font-size: clamp(24px, 6vw, 32px); }
.onb-welcome p { color: var(--ink-soft); max-width: 420px; }
.display { font: 400 clamp(64px, 18vw, 104px)/.82 var(--font-display); color: var(--red); letter-spacing: 0; margin: 0 0 6px; }
.onb-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 16px; }
.onb-facts span { padding: 6px 12px; border-radius: 99px; background: var(--white); border: 2px solid var(--line); font-size: 13px; color: var(--ink-soft); }
.onb-facts b { color: var(--red); font-family: var(--font-head); }
.group-l { margin: 12px 0 4px; font: 700 12px var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; width: 100%; }
.course-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); text-align: left; transition: transform .12s, border-color .2s, box-shadow .12s; }
.course-card:hover, .course-card.on { border-color: var(--red-soft); background: var(--red-tint); }
.course-card:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.cc-flag { font-size: 38px; line-height: 1; }
.course-card b { display: block; font: 700 17px var(--font-head); }
.course-card small { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 18px; }
.chip { padding: 10px 16px; border-radius: 99px; background: var(--white); border: 2px solid var(--line); font: 600 14.5px var(--font-head); transition: all .2s var(--ease); }
.chip.on { background: var(--red); color: var(--on); border-color: var(--red); transform: scale(1.04); }
.big-choices { display: grid; gap: 12px; width: 100%; }
.choice-card { display: grid; justify-items: start; gap: 2px; padding: 20px; border-radius: 22px; text-align: left; background: var(--white); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); transition: transform .12s, border-color .2s; }
.choice-card:hover { border-color: var(--red-soft); }
.choice-card:active { transform: translateY(5px); box-shadow: none; }
.cc-e { font-size: 34px; }
.choice-card b { font: 700 18px var(--font-head); }
.choice-card small { color: var(--muted); font-size: 14px; }
.goal-list { display: grid; gap: 10px; width: 100%; }
.goal-o { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 16px 20px; border-radius: 18px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); text-align: left; }
.goal-o b { font: 700 17px var(--font-head); }
.goal-o span { font: 600 14px var(--font-head); color: var(--ink-soft); }
.goal-o small { color: var(--muted); }
.goal-o.rec { border-color: var(--red-soft); background: var(--red-tint); }
.goal-o:active { transform: translateY(4px); box-shadow: none; }

/* ---------- Lesson ---------- */
body.in-lesson { overflow: hidden; }
.lesson, .result { position: fixed; inset: 0; z-index: 50; background: var(--cream); display: grid; grid-template-rows: auto 1fr auto; animation: rise .35s var(--ease); }
.lesson.out, .result.out { opacity: 0; transition: opacity .25s; }
.ls-top { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); max-width: 1000px; width: 100%; margin: 0 auto; }
.ls-x { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #a59d92; }
.ls-x:hover { background: var(--beige); color: var(--ink); }
.ls-bar { position: relative; height: 18px; border-radius: 99px; background: var(--beige); }
.ls-bar i { position: absolute; inset: 0 auto 0 0; width: 3%; border-radius: 99px; background: var(--red); transition: width .5s var(--ease), background .4s; overflow: hidden; }
.ls-bar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 9px; background: rgba(255, 255, 255, .35); }
.ls-bar.hot i { background: linear-gradient(90deg, var(--red), #ff7a00, var(--gold)); }
.ls-bar.timer i { transition: width .2s linear; }
.ls-combo { position: absolute; right: 6px; top: -26px; font: 700 13px var(--font-head); color: #e86100; opacity: 0; transform: translateY(6px); transition: all .3s var(--spring); }
.ls-combo.on { opacity: 1; transform: none; }
.ls-hearts { display: flex; align-items: center; gap: 5px; font: 700 17px var(--font-head); color: var(--red); }
.ls-hearts.off { visibility: hidden; }
.ls-hearts.hit { animation: shake .5s; }
.ex-count { font: 700 15px var(--font-head); color: var(--muted); min-width: 44px; text-align: right; }
.ls-stage { overflow-y: auto; padding: 8px 16px 24px; width: 100%; max-width: 660px; margin: 0 auto; }
.ls-stage.enter .ex { animation: slideIn .45s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.ls-foot { border-top: 2px solid var(--line); padding: 14px 16px calc(14px + var(--safe-b)); background: var(--cream); transition: opacity .2s; }
.ls-foot.hide { opacity: 0; pointer-events: none; }
.ls-foot-in { max-width: 660px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; }
.ls-check { min-width: 170px; flex: 1; max-width: 260px; margin-left: auto; }
@media (max-width: 560px) { .ls-check { max-width: none; } .ls-skip { padding: 0 10px; } }
.ls-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 18px 16px calc(18px + var(--safe-b)); animation: sheetUp .35s var(--ease); }
.ls-sheet[hidden] { display: none; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.ls-sheet-in { max-width: 660px; margin: 0 auto; display: grid; gap: 14px; }
.ls-sheet.good { background: var(--good-tint); color: var(--good-deep); }
.ls-sheet.bad { background: var(--red-tint); color: var(--red-deep); }
.ls-sheet.neutral { background: var(--beige); }
.ls-sheet .btn.ls-next { width: 100%; }
.ls-sheet.good .ls-next { --b: var(--good); --c: #fff; --e: var(--good-deep); }
.ls-sheet.bad .ls-next { --b: var(--red); --c: var(--on); --e: var(--red-deep); }
.ls-sheet.neutral .ls-next { --b: var(--slab); --c: var(--on); --e: #000; }
.vd-row { display: flex; gap: 12px; align-items: flex-start; }
.vd-row .hoop { flex: none; }
.vd-row h3 { font-size: 21px; margin: 4px 0 4px; }
.vd-row p { margin: 0 0 3px; color: var(--ink-soft); }
.vd-row .sol { font: 600 17px var(--font-head); color: var(--red-deep); }
.vd-row .mean { font-size: 14px; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.ex-head { margin: 6px 0 16px; }
.ex-kind { display: inline-block; font: 700 11.5px var(--font-head); letter-spacing: .16em; color: #7a3fd1; background: #f1eaff; padding: 3px 10px; border-radius: 99px; margin-bottom: 8px; }
.ex-exam .ex-kind { color: var(--red-deep); background: var(--red-tint); }
.ex-title { font-size: clamp(21px, 5.2vw, 27px); margin: 0; }
.prompt { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 18px; }
.prompt-hoop { flex: none; }
@media (max-width: 420px) { .prompt-hoop svg { width: 72px; height: 72px; } }
.bubble { position: relative; flex: 1; display: flex; gap: 10px; align-items: center; padding: 14px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--white); }
.bubble::before { content: ""; position: absolute; left: -9px; bottom: 18px; width: 14px; height: 14px; background: var(--white); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.prompt-text { margin: 0; font: 500 18.5px/1.5 var(--font-body); }
.hint-w { position: relative; padding: 0; font: inherit; border-bottom: 2px dashed #c9c1b6; border-radius: 0; }
.hint-w:hover, .hint-w.open { border-bottom-color: var(--red); }
.hint-pop { position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) scale(.9); opacity: 0; pointer-events: none; min-width: 90px; padding: 8px 12px; border-radius: 12px; background: var(--slab); color: var(--on); font: 600 14px/1.4 var(--font-head); white-space: nowrap; transition: all .18s var(--spring); }
.hint-w.open .hint-pop { opacity: 1; transform: translateX(-50%); }
.spk { display: flex; gap: 8px; align-items: center; flex: none; }
.spk-btn { width: 46px; height: 46px; border-radius: 14px; background: var(--ice); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 #1f7cc0; transition: transform .1s, box-shadow .1s; font-size: 20px; }
.spk-btn:active { transform: translateY(4px); box-shadow: none; }
.spk-btn.slow { width: 38px; height: 38px; font-size: 18px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.spk-btn.playing .w1, .spk-btn.playing .w2 { animation: waves .8s ease-in-out infinite; }
.spk-btn.playing .w2 { animation-delay: .15s; }
@keyframes waves { 50% { opacity: .2; } }
.spk.big .spk-btn { width: 112px; height: 112px; border-radius: 30px; box-shadow: 0 8px 0 #1f7cc0; }
.spk.big .spk-btn svg { width: 54px; height: 54px; }
.spk.big .spk-btn.slow { width: 70px; height: 70px; border-radius: 22px; font-size: 30px; box-shadow: 0 6px 0 var(--line); }
.listen-box { display: grid; place-items: center; padding: 18px 0 26px; }

.answer-line { min-height: 118px; padding: 8px 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; background-image: repeating-linear-gradient(transparent 0 55px, var(--line) 55px 57px); }
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.tile { padding: 9px 14px; border-radius: 13px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font: 500 17px var(--font-body); transition: transform .12s; }
.tile:active { transform: translateY(3px); box-shadow: none; }
.bank .tile.used { background: var(--beige); color: transparent; box-shadow: none; pointer-events: none; }
.tile.pop { animation: pop .3s var(--spring); }
.typebox, .build.typing .answer-line, .build.typing .bank { display: none; }
.build.typing .typebox { display: block; }
.typebox textarea { width: 100%; min-height: 128px; resize: vertical; padding: 14px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--white); font: 500 18px/1.5 var(--font-body); color: var(--ink); outline: none; }
.typebox textarea:focus { border-color: var(--ice); }
.special { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sp-k { min-width: 38px; height: 38px; border-radius: 10px; background: var(--white); border: 2px solid var(--line); font: 600 16px var(--font-body); }
.mode-toggle { display: block; margin: 14px auto 0; padding: 6px 12px; border-radius: 10px; color: var(--muted); font: 700 13px var(--font-head); }
.mode-toggle:hover { background: var(--beige); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.card-o { position: relative; display: grid; justify-items: center; gap: 10px; padding: 22px 10px 16px; border-radius: 20px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform .12s, border-color .15s, background .15s; }
.card-o:active { transform: translateY(4px); box-shadow: none; }
.card-e { font-size: 58px; line-height: 1; }
.card-t { font: 600 17px var(--font-head); }
.card-o kbd { position: absolute; right: 10px; bottom: 10px; }
.opts { display: grid; gap: 10px; }
.opts.row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.opt { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); text-align: left; font: 500 16.5px/1.4 var(--font-body); transition: transform .12s, border-color .15s, background .15s; }
.opt:active { transform: translateY(4px); box-shadow: none; }
.sel { border-color: #8fc9f2 !important; background: #eaf5fd !important; box-shadow: 0 4px 0 #8fc9f2 !important; }
.right { border-color: #8bd3ac !important; background: var(--good-tint) !important; box-shadow: 0 4px 0 #8bd3ac !important; color: var(--good-deep); }
.bad { border-color: var(--red-soft) !important; background: var(--red-tint) !important; box-shadow: 0 4px 0 var(--red-soft) !important; color: var(--red-deep); animation: shake .4s; }
.fill-sent { font: 500 21px/2.1 var(--font-body); margin: 10px 0 6px; }
.gap { display: inline-block; min-width: 92px; border-bottom: 3px solid var(--ink); text-align: center; color: var(--ice); font-weight: 700; line-height: 1.4; }
.fill-mean { color: var(--muted); margin-bottom: 22px; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mcol { display: grid; gap: 10px; align-content: start; }
.mt { position: relative; min-height: 58px; padding: 10px 12px 10px 34px; border-radius: 16px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font: 500 16px/1.3 var(--font-body); text-align: center; transition: transform .12s, opacity .4s, border-color .15s, background .15s; }
.mt kbd { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); }
@media (pointer: coarse) { .mt { padding-left: 12px; } }
.mt.ok { border-color: #8bd3ac; background: var(--good-tint); box-shadow: none; opacity: .45; color: var(--good-deep); animation: pop .3s var(--spring); }
.mt.no { border-color: var(--red-soft); background: var(--red-tint); animation: shake .35s; }
.speak-mean { color: var(--muted); text-align: center; }
.mic { position: relative; display: grid; justify-items: center; gap: 10px; margin: 20px auto 8px; padding: 22px 30px; border-radius: 26px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); color: var(--ice); }
.mic-l { font: 700 14px var(--font-head); color: var(--ink-soft); letter-spacing: .04em; }
.mic-ring { position: absolute; top: 20px; width: 40px; height: 40px; border-radius: 50%; }
.mic.on { color: var(--red); border-color: var(--red-soft); }
.mic.on .mic-ring { animation: ripple 1.2s ease-out infinite; }
@keyframes ripple { from { box-shadow: 0 0 0 0 rgba(217, 20, 20, .45); } to { box-shadow: 0 0 0 30px rgba(217, 20, 20, 0); } }
.heard { text-align: center; color: var(--ink-soft); min-height: 1.6em; font-style: italic; }
.passage { padding: 16px 18px; border-radius: 18px; background: var(--white); border: 2px solid var(--line); font: 400 16.5px/1.7 var(--font-body); margin-bottom: 14px; }
.ex-q { font: 600 clamp(19px, 4.6vw, 23px)/1.45 var(--font-body); letter-spacing: 0; margin: 4px 0 18px; }

/* ---------- Results ---------- */
.result { grid-template-rows: 1fr auto; opacity: 0; transition: opacity .3s; }
.result.in { opacity: 1; }
.res-in { display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 24px 16px; animation: rise .5s var(--ease); overflow-y: auto; }
.res-title { font-size: clamp(28px, 7vw, 40px); color: var(--red); margin: 6px 0; }
.res-perfect { font: 700 14px var(--font-head); letter-spacing: .3em; color: var(--gold); }
.res-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 120px)); gap: 10px; margin: 10px 0; }
.res-card { border-radius: 18px; border: 2px solid var(--gold); overflow: hidden; background: var(--white); animation: pop .5s var(--spring) backwards; }
.res-card:nth-child(2) { border-color: var(--good); animation-delay: .12s; }
.res-card:nth-child(3) { border-color: var(--ice); animation-delay: .24s; }
.res-card p { margin: 0; padding: 4px; background: var(--gold); color: #fff; font: 700 11px var(--font-head); letter-spacing: .14em; text-transform: uppercase; }
.res-card.acc p { background: var(--good); }
.res-card.time p { background: var(--ice); }
.res-card b { display: block; padding: 10px 4px; font: 700 26px var(--font-head); }
.res-goal { font: 700 15px var(--font-head); color: var(--good-deep); }
.res-foot { padding: 14px 16px calc(16px + var(--safe-b)); border-top: 2px solid var(--line); display: grid; place-items: center; }
.res-foot .btn { width: min(100%, 420px); }
.streak-big { position: relative; display: grid; place-items: center; }
.fl.huge svg { width: 170px; height: 170px; }
.streak-big.small .fl.huge svg { width: 110px; height: 110px; }
.streak-n { position: absolute; bottom: 14px; font: 400 70px/1 var(--font-display); color: var(--on); text-shadow: 0 3px 0 #c45000; }
.streak-big b:not(.streak-n) { font: 700 30px var(--font-head); color: #e86100; }
.week-dots { display: flex; gap: 10px; margin-top: 8px; }
.week-dots span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--beige); font: 700 12px var(--font-head); color: var(--muted); }
.week-dots span.on { background: #ff7a00; color: #fff; animation: pop .5s var(--spring) backwards; }
.badge-big { font-size: 96px; animation: pop .7s var(--spring); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .15)); }
.kicker { font: 700 12px var(--font-head); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* ---------- Dialogs, toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(26, 26, 26, .45); opacity: 0; transition: opacity .25s; }
.modal.in { opacity: 1; }
.modal-card { position: relative; width: min(100%, 440px); max-height: 88dvh; overflow-y: auto; padding: 26px 22px 20px; border-radius: 26px; background: var(--cream); text-align: center; transform: translateY(16px) scale(.97); transition: transform .35s var(--spring); }
.modal.in .modal-card { transform: none; }
.modal.wide .modal-card { width: min(100%, 620px); text-align: left; }
.modal-x { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; color: var(--muted); }
.modal-x:hover { background: var(--beige); }
.modal-card h2 { font-size: 23px; }
.modal-actions { display: grid; gap: 8px; margin-top: 18px; }
.modal-actions:empty { display: none; }
.dlg-mascot { display: grid; place-items: center; margin-bottom: 4px; }
.big-num { font: 400 64px/1 var(--font-display); color: var(--red); margin: 8px 0; }
.hearts-row { display: flex; justify-content: center; gap: 6px; font-size: 34px; color: #d9d2c7; margin-bottom: 8px; }
.hearts-row .on { color: var(--red); animation: pop .4s var(--spring) backwards; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 16px; background: var(--slab); color: var(--on); font: 600 14.5px var(--font-head); transition: all .3s var(--spring); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--good-deep); }
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; width: 100vw; height: 100vh; }
.guide .kicker { margin-bottom: 12px; }
.tip { padding: 14px 16px; border-radius: 18px; background: var(--white); border: 2px solid var(--line); margin-bottom: 10px; }
.tip h3 { font-size: 17px; margin-bottom: 4px; }
.tip p { color: var(--ink-soft); font-size: 14.5px; }
.tip-ex { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 12px; background: var(--beige); margin-top: 6px; }
.tip-ex span[lang] { font: 600 15.5px var(--font-head); }
.tip-ex small { grid-column: 2; color: var(--muted); }
.spk-mini { grid-row: span 2; align-self: center; }
.guide-words { font-size: 16px; margin-top: 16px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { padding: 7px 12px; border-radius: 99px; background: var(--white); border: 2px solid var(--line); font-size: 14px; }
.wchip small { color: var(--muted); }

/* ---------- Pages ---------- */
.page-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(25px, 6vw, 32px); margin: 0 0 2px; }
.page-head p { margin: 0; color: var(--muted); }
.back { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-size: 22px; background: var(--white); border: 2px solid var(--line); flex: none; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 30px 10px; color: var(--ink-soft); }
.empty.small { padding: 14px; }
.pr-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pr-tile { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 22px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); text-align: left; text-decoration: none; transition: transform .12s, border-color .2s; }
.pr-tile:hover { border-color: var(--red-soft); }
.pr-tile:active { transform: translateY(5px); box-shadow: none; }
.pr-tile.hero { grid-column: 1 / -1; background: var(--red); color: var(--on); border-color: var(--red); box-shadow: 0 5px 0 var(--red-deep); }
.pr-tile.hero small { color: rgba(251, 249, 245, .85); }
.pr-ic { font-size: 34px; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--beige); flex: none; }
.pr-tile.hero .pr-ic { background: rgba(255, 255, 255, .16); }
.pr-tile b { display: block; font: 700 17px var(--font-head); }
.pr-tile small { color: var(--muted); font-size: 13.5px; }
.word-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.word-list li { display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--white); border: 2px solid var(--line); }
.word-list b { display: block; font: 600 16px var(--font-head); }
.word-list small { color: var(--muted); }
.wl-say { width: 38px; height: 38px; border-radius: 12px; background: var(--beige); }
.wl-e { font-size: 24px; min-width: 28px; }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.bars i { width: 6px; border-radius: 3px; background: var(--line); }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 55%; } .bars i:nth-child(3) { height: 78%; } .bars i:nth-child(4) { height: 100%; }
.bars.s1 i:nth-child(-n+1), .bars.s2 i:nth-child(-n+2), .bars.s3 i:nth-child(-n+3), .bars.s4 i { background: var(--gold); }
.bars.s1 i:nth-child(1) { background: var(--red); }
.lvl-hero { display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: 24px; background: var(--slab); color: var(--on); margin-bottom: 18px; }
.lvl-hero p { color: rgba(251, 249, 245, .8); font-size: 14px; }
.lvl-hero .kicker { color: rgba(251, 249, 245, .6); }
.lvl-badge { flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: var(--red); color: var(--on); font: 700 32px var(--font-head); box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .2); }
.lvl-hero .lvl-badge { margin: 0; }
.lvl-badge.xl { width: 140px; height: 140px; font-size: 50px; animation: pop .7s var(--spring); }
@media (max-width: 520px) { .lvl-hero { flex-direction: column; text-align: center; } }
.lvl-ladder { display: grid; gap: 10px; }
.lvl-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px 16px; border-radius: 20px; background: var(--white); border: 2px solid var(--line); }
.lvl-card.cert { border-color: #8bd3ac; background: var(--good-tint); }
.lvl-tag { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--beige); font: 700 18px var(--font-head); color: var(--red); }
.lvl-card.cert .lvl-tag { background: var(--good); color: #fff; }
.lvl-body h3 { font-size: 17px; margin: 0; }
.lvl-body p { margin: 0; color: var(--muted); font-size: 13.5px; }
.lvl-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.lvl-actions .btn { flex: 1; }
@media (min-width: 620px) { .lvl-card { grid-template-columns: auto 1fr auto; } .lvl-actions { grid-column: auto; } .lvl-actions .btn { flex: none; } }
.lvl-result { text-align: center; }
.pl-bars { display: grid; gap: 7px; margin-top: 14px; text-align: left; }
.pl-bar { display: grid; grid-template-columns: 34px 1fr 44px; gap: 10px; align-items: center; font: 700 13px var(--font-head); }
.pl-bar i { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--red) calc(var(--v) * 100%), var(--beige) 0); }
.pl-bar small { color: var(--muted); text-align: right; }
.league-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 600 14px var(--font-head); color: var(--ink-soft); margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: var(--beige); margin-bottom: 12px; }
.tab { flex: 1; padding: 9px; border-radius: 12px; font: 700 14px var(--font-head); color: var(--muted); }
.tab.on { background: var(--white); color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.league { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.league li { display: grid; grid-template-columns: 34px 42px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 16px; background: var(--white); border: 2px solid var(--line); }
.league li.me { border-color: var(--red-soft); background: var(--red-tint); }
.league .rank { font: 700 17px var(--font-head); text-align: center; }
.league img, .league .av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--red); color: var(--on); display: grid; place-items: center; font: 700 17px var(--font-head); }
.lg-name { text-decoration: none; font: 600 15px var(--font-head); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-name small { display: block; color: var(--muted); font: 500 12px var(--font-body); }
.lg-streak { font-size: 13px; color: #e86100; font-weight: 700; }
.league b { font: 700 14px var(--font-head); }
@media (max-width: 420px) { .lg-streak { display: none; } .league li { grid-template-columns: 30px 38px 1fr auto; } }
.profile-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 18px; }
.profile-head h1 { font-size: 26px; margin: 0; }
.profile-head p { margin: 0; color: var(--muted); font-size: 14px; }
.pf-av { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--beige); flex: none; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pf-tags span { padding: 3px 10px; border-radius: 99px; background: var(--white); border: 2px solid var(--line); font-size: 13px; }
.pf-tags .lvl { background: var(--red); border-color: var(--red); color: var(--on); font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sg { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); }
.sg span { grid-row: span 2; font-size: 24px; }
.sg b { font: 700 20px var(--font-head); }
.sg small { color: var(--muted); font-size: 12.5px; }
.xp-chart { width: 100%; height: auto; overflow: visible; }
.xp-chart rect { fill: var(--red-soft); transform-box: fill-box; transform-origin: bottom; animation: grow .8s var(--ease) backwards; animation-delay: calc(var(--i) * 60ms); }
.xp-chart .hit rect { fill: var(--red); }
.xp-chart .today rect { stroke: var(--ink); stroke-width: 2; }
@keyframes grow { from { transform: scaleY(0); } }
.bar-v { font: 700 10px var(--font-head); fill: var(--ink-soft); text-anchor: middle; }
.bar-l { font: 600 10px var(--font-head); fill: var(--muted); text-anchor: middle; }
.goal-line { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 4; }
.goal-t { font: 700 9px var(--font-head); fill: #b07a00; }
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-bottom: 10px; }
.hm { aspect-ratio: 1; border-radius: 4px; background: var(--beige); }
.hm.l1 { background: #f8cfc5; } .hm.l2 { background: #ef8a7a; } .hm.l3 { background: var(--red); } .hm.l4 { background: var(--red-deep); }
.hm.lf { background: #cde7fa; } .hm.l-1 { background: transparent; }
.hm.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.flag-svg { display: block; border-radius: 4px; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .08); }
.cl-item small .flag-svg, .lg-name .flag-svg, .course-card small .flag-svg { display: inline-block; vertical-align: -2px; }
.cl-item span .flag-svg { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 18px; border: 2px dashed var(--line); filter: grayscale(1); opacity: .5; }
.badge.got { filter: none; opacity: 1; border-style: solid; background: #fff8e6; border-color: #f6d98a; }
.badge span { font-size: 32px; }
.badge b { font: 700 13px var(--font-head); }
.badge small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.course-list { display: grid; gap: 8px; }
.cl-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); text-align: left; }
.cl-item.on { border-color: var(--red-soft); background: var(--red-tint); }
.cl-item span { font: 700 15px var(--font-head); }
.cl-item small { color: var(--muted); text-align: right; }
.cl-bar { height: 8px; border-radius: 99px; background: var(--beige); overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: var(--red); }
.cl-item b { font: 700 13px var(--font-head); color: var(--muted); }
.cl-item.add { grid-template-columns: 1fr; font: 700 14px var(--font-head); color: var(--red-deep); border-style: dashed; }
.settings { display: grid; gap: 4px; }
.sw { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1.5px solid var(--beige); font-weight: 600; cursor: pointer; }
.sw select { padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--white); font: 600 14px var(--font-head); }
.sw input[type=range] { accent-color: var(--red); width: 140px; }
.sw input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-ui { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--line); transition: background .25s; flex: none; }
.sw-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); transition: transform .3s var(--spring); }
.sw input:checked + .sw-ui { background: var(--good); }
.sw input:checked + .sw-ui::after { transform: translateX(20px); }
.sw input:focus-visible + .sw-ui { outline: 3px solid var(--red); outline-offset: 2px; }
.settings .btn { margin-top: 12px; justify-self: start; }

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

/* ---------- Real voices ---------- */
.pr-tile.real { border-color: #9cc9ee; background: #eef6fd; }
.lvl-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 14px 0; }
.lvl-pick .btn small { color: var(--muted); }
.credits { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.credits li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--white); border: 2px solid var(--line); font-size: 14px; }
.credits span { color: var(--muted); font-size: 13px; }
.credits a { color: var(--red-deep); font-size: 12.5px; margin-right: 8px; }

/* =====================================================================
   HOOPERS street theme: the site's own language. Modak numerals, pill
   buttons, thin ink lines, tilted stickers, red marquee bands, dashed
   spinning hoops and film grain. Layered last so it wins over the base.
   ===================================================================== */
:root { --lift: 0 18px 34px -20px rgba(26, 26, 26, .45); --press: cubic-bezier(.3, 1.6, .5, 1); }
body.dil::after { content: ""; position: fixed; inset: 0; z-index: 120; pointer-events: none; opacity: .045; background-size: 260px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E"); }
.ic { display: block; flex: none; }

/* Buttons: pills that lift, squash on press. */
.btn { border-radius: 999px; border-width: 1.5px; box-shadow: none; letter-spacing: .05em; text-transform: uppercase; font-size: 13.5px; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .3s, color .3s; }
.btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--lift); filter: none; }
.btn:active:not(:disabled) { transform: scale(.96); box-shadow: none; transition-duration: .08s; }
.btn.primary { --e: var(--red); }
.btn.primary:hover:not(:disabled) { --b: var(--slab); --e: var(--ink); }
.btn.big { min-height: 58px; }
.btn .ic { margin: -2px 0; }

/* Tap feedback: a hoop that rings out from the finger. */
.fx-host { position: relative; overflow: hidden; isolation: isolate; }
.fx-ring { position: absolute; z-index: -1; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2.5px solid currentColor; opacity: .35; pointer-events: none; animation: fxRing .55s var(--ease) forwards; }
@keyframes fxRing { to { transform: scale(var(--s, 14)); opacity: 0; border-width: .5px; } }

/* Top bar + navigation */
.topbar { border-bottom: 1px solid var(--line); }
.stat { border-radius: 999px; padding: 6px 10px; }
.stat .ic { width: 22px; height: 22px; }
.flame { display: grid; color: #c9c1b6; }
.flame.lit { color: #ff6a00; animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.heart-ic { display: grid; color: var(--red); }
.heart-btn.empty .heart-ic { color: #cfc7bc; }
.tabbar { background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { position: relative; color: #a59d92; letter-spacing: .1em; font-size: 10px; }
.tabbar a.on { color: var(--red); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--red); animation: barIn .4s var(--ease); }
@keyframes barIn { from { width: 0; } }
.tabbar a.on svg { animation: hop .5s var(--press); }
@keyframes hop { 40% { transform: translateY(-5px) scale(1.1); } }
@media (min-width: 900px) {
  #side-nav a { border-radius: 999px; border: 1.5px solid transparent; letter-spacing: .12em; font-size: 12.5px; transition: background .25s, color .25s, padding .35s var(--ease); }
  #side-nav a:hover { background: transparent; color: var(--red); padding-left: 22px; }
  #side-nav a.on { background: var(--red); color: var(--on); border-color: var(--red); }
}
.panel { border: 1px solid var(--line); border-radius: 24px; }

/* ---------- Path ---------- */
.sec-head { position: relative; display: block; margin: 8px -16px 26px; padding: 0; overflow: hidden; }
.sec-band { background: var(--red); color: var(--on); transform: rotate(-2deg); margin: 18px -12px 14px; padding: 11px 0; overflow: hidden; }
.sec-band.done { background: var(--slab); }
.sec-track { display: flex; width: max-content; animation: marquee 32s linear infinite; font: 700 15px var(--font-head); letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }
.sec-track span { display: inline-flex; align-items: center; gap: 22px; padding-right: 22px; }
.sec-track b { font: 400 30px/1 var(--font-display); letter-spacing: 0; }
.sec-track i { font-style: normal; opacity: .6; }
@keyframes marquee { to { transform: translateX(-50%); } }
.sec-meta { display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.sec-meta p { margin: 0; color: var(--muted); font: 600 13px var(--font-head); letter-spacing: .06em; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.sec-meta .sec-bar { flex: 1; margin: 0; height: 6px; }

.unit-banner { border-radius: 26px; box-shadow: none; padding: 20px 20px 18px; min-height: 128px; }
.unit-banner::after { right: -60px; top: -70px; width: 220px; height: 220px; border: 2px dashed rgba(251, 249, 245, .28); animation: spin 40s linear infinite; }
.unit:nth-child(3n+2) .unit-banner, .unit:nth-child(3n+3) .unit-banner { box-shadow: none; }
.unit.locked .unit-banner { background: var(--beige); color: var(--ink-soft); box-shadow: none; border: 1.5px dashed #cfc6b8; }
.unit.locked .unit-banner::after { border-color: #d7cfc2; }
.unit.locked .ub-btn { color: var(--ink-soft); border-color: #cfc6b8; }
.ub-num { position: absolute; right: 14px; bottom: -22px; font: 400 118px/1 var(--font-display); color: rgba(251, 249, 245, .14); pointer-events: none; }
.unit.locked .ub-num { color: rgba(26, 26, 26, .06); }
.ub-kicker { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(251, 249, 245, .16); transform: rotate(-2deg); letter-spacing: .2em; font-size: 10.5px; }
.unit.locked .ub-kicker { background: rgba(26, 26, 26, .06); }
.unit-banner h3 { font-size: 23px; margin: 8px 0 4px; letter-spacing: -.03em; }
.ub-btn { border-radius: 999px; border-width: 1.5px; text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; transition: transform .3s var(--ease), background .2s; }
.ub-btn:hover { transform: translateY(-2px); }
.ub-actions { z-index: 2; }

.path { gap: 26px; padding: 34px 0 10px; }
.node { width: 78px; height: 78px; border-radius: 50%; color: var(--red); background: var(--cream); border: 9px solid var(--red); box-shadow: 0 10px 22px -12px rgba(160, 10, 10, .55); transition: transform .35s var(--press), box-shadow .3s; }
.node:hover { transform: translateY(-4px) rotate(-6deg); }
.node:active { transform: scale(.92); box-shadow: none; }
.node .ic { width: 28px; height: 28px; }
.node.done { background: var(--red); color: var(--on); border-color: var(--red); }
.node.done .ic { stroke-width: 3; }
.node.done.gold { background: var(--slab); border-color: var(--ink); color: var(--gold); }
.node.locked { background: transparent; color: #b3aa9d; border: 3px dashed #cfc6b8; box-shadow: none; }
.node.locked .ic { width: 24px; height: 24px; }
.node.current { background: var(--red); color: var(--on); animation: bob 2.2s ease-in-out infinite; }
.node.current .ic { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-14deg); } 86% { transform: rotate(10deg); } 94% { transform: rotate(-4deg); } }
.node-ring { inset: -22px; width: calc(100% + 44px); height: calc(100% + 44px); }
.node-ring circle { stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 7; opacity: .55; }
.node-tip { top: -50px; background: var(--slab); color: var(--on); border: 0; border-radius: 999px; padding: 6px 14px; letter-spacing: .16em; font-size: 12px; rotate: -5deg; animation: tipBob 2.2s ease-in-out infinite; }
.node-tip::after { background: var(--slab); border: 0; bottom: -5px; width: 10px; height: 10px; }
@keyframes tipBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.node.trophy { width: 88px; height: 88px; border: 2px dashed #cfc6b8; background: transparent; color: #b3aa9d; box-shadow: none; }
.node.trophy.open { background: var(--gold); border: 0; color: var(--ink); animation: bob 2s ease-in-out infinite; box-shadow: 0 0 0 8px rgba(242, 169, 0, .2); }
.node.trophy.done { background: var(--slab); border: 0; color: var(--gold); }
.node.trophy .ic { width: 34px; height: 34px; }
.pop { border-radius: 24px; }
.pop .btn.primary { --b: var(--on); --c: var(--red); --e: var(--on); }
.pop.done { background: var(--slab); color: var(--on); }

/* ---------- Cards everywhere: thin lines, lift on hover, squash on press ---------- */
.course-card, .choice-card, .goal-o, .chip, .pr-tile, .lvl-card, .cl-item, .tip, .word-list li, .league li, .sg, .credits li { border-width: 1.5px; box-shadow: none; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s, background .25s; }
.course-card:hover, .choice-card:hover, .goal-o:hover, .pr-tile:hover { transform: translateY(-4px); box-shadow: var(--lift); border-color: var(--ink); }
.course-card:active, .choice-card:active, .goal-o:active, .pr-tile:active { transform: scale(.97); box-shadow: none; }
.course-card, .choice-card, .goal-o { border-radius: 24px; }
.cc-e { color: var(--red); display: grid; width: 60px; height: 60px; place-items: center; border-radius: 50%; background: var(--red-tint); }
.chip.on { transform: rotate(-3deg) scale(1.04); }

/* ---------- Lesson ---------- */
.ls-x { color: var(--muted); }
.ls-bar { height: 14px; }
.ls-bar i::after { top: 3px; height: 3px; }
.ls-bar.hot i { background: linear-gradient(90deg, var(--red), #ff6a00); box-shadow: 0 0 18px rgba(255, 106, 0, .45); }
.ls-combo { display: flex; align-items: center; gap: 3px; top: -24px; padding: 2px 9px; border-radius: 999px; background: var(--slab); color: #ffb26b; transform: rotate(4deg) translateY(6px); }
.ls-combo.on { transform: rotate(4deg); }
.ls-foot { border-top: 1px solid var(--line); }
.ex-kind { color: var(--on); background: var(--slab); border-radius: 999px; padding: 4px 12px; transform: rotate(-3deg); letter-spacing: .2em; font-size: 10.5px; }
.ex-exam .ex-kind { color: var(--on); background: var(--red); }
.ex-title { font-size: clamp(22px, 5.6vw, 30px); letter-spacing: -.035em; }
.bubble, .passage, .typebox textarea { border-width: 1.5px; border-radius: 22px; }
.bubble::before { border-width: 1.5px; }
.hint-pop { border-radius: 999px; padding: 7px 14px; background: var(--red); }
.spk-btn { border-radius: 50%; background: var(--red); color: var(--on); box-shadow: 0 10px 22px -12px rgba(160, 10, 10, .6); transition: transform .3s var(--press); }
.spk-btn:hover { transform: scale(1.06); }
.spk-btn:active { transform: scale(.92); box-shadow: none; }
.spk-btn.slow { background: var(--cream); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.spk-btn.playing { animation: speakPulse 1s ease-out infinite; }
@keyframes speakPulse { from { box-shadow: 0 0 0 0 rgba(217, 20, 20, .4); } to { box-shadow: 0 0 0 18px rgba(217, 20, 20, 0); } }
.spk.big .spk-btn { width: 118px; height: 118px; border-radius: 50%; box-shadow: 0 0 0 10px var(--red-tint), 0 20px 34px -16px rgba(160, 10, 10, .6); }
.spk.big .spk-btn svg { width: 50px; height: 50px; }
.spk.big .spk-btn.slow { width: 64px; height: 64px; border-radius: 50%; box-shadow: none; }
.spk.big .spk-btn.slow svg { width: 30px; height: 30px; }

/* Word bank: every tile has the same height, so rows sit exactly on the ruled lines. */
.answer-line { --row: 46px; --gap: 12px; min-height: calc(2 * (var(--row) + var(--gap))); padding: 0; gap: var(--gap) 8px; align-content: flex-start;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row) + 4px), var(--line) calc(var(--row) + 4px) calc(var(--row) + 6px), transparent calc(var(--row) + 6px) calc(var(--row) + var(--gap))); }
.tile { height: 46px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line); font: 600 17px var(--font-body); background: var(--white); transition: transform .3s var(--press), border-color .2s, box-shadow .2s; touch-action: manipulation; }
.tile:hover { border-color: var(--ink); transform: translateY(-2px); }
.tile:active { transform: scale(.94); box-shadow: none; }
.answer-line .tile { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.bank { gap: 12px 8px; margin-top: 26px; }
.bank .tile.used { background: var(--beige); border-color: var(--beige); box-shadow: none; color: transparent; transform: none; }
.mode-toggle { display: flex; align-items: center; gap: 6px; border-radius: 999px; letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; }

/* Choices: thin-lined cards; the picked one tilts like a sticker. */
.card-o, .opt, .mt { border-width: 1.5px; box-shadow: none; border-radius: 24px; transition: transform .35s var(--press), border-color .2s, background .2s, box-shadow .3s var(--ease); }
.card-o:hover, .opt:hover, .mt:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--lift); }
.card-o:active, .opt:active, .mt:active { transform: scale(.96); box-shadow: none; }
.card-e { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: var(--beige); font-size: 52px; transition: transform .4s var(--press), background .2s; }
.card-e .ic { color: var(--muted); }
.card-o:hover .card-e { transform: rotate(-8deg) scale(1.06); }
.opt { border-radius: 20px; }
.opt kbd, .card-o kbd, .mt kbd { border-radius: 999px; }
.sel { border-color: var(--ink) !important; background: var(--white) !important; box-shadow: 0 0 0 2px var(--ink) inset, var(--lift) !important; transform: translateY(-3px) rotate(-1deg) !important; }
.sel .card-e { background: var(--red-tint); transform: rotate(-8deg) scale(1.08); }
.right { border-color: var(--good) !important; background: var(--good-tint) !important; box-shadow: 0 0 0 2px var(--good) inset !important; transform: none !important; }
.bad { border-color: var(--red) !important; background: var(--red-tint) !important; box-shadow: 0 0 0 2px var(--red) inset !important; transform: none; }
.mt.ok { box-shadow: none; }
.gap { color: var(--red); border-bottom-color: var(--red); }
.mic { border-radius: 999px; border-width: 1.5px; box-shadow: none; color: var(--red); padding: 18px 34px; }
.mic.on { background: var(--red); color: var(--on); }
.mic.on .mic-l { color: var(--on); }

/* Feedback: the verdict is stamped onto an ink (right) or red (wrong) sheet. */
.ls-sheet { border-radius: 28px 28px 0 0; overflow: hidden; }
.ls-sheet.good { background: var(--slab); color: var(--on); }
.ls-sheet.bad { background: var(--red); color: var(--on); }
.ls-sheet.neutral { background: var(--beige); color: var(--ink); }
.ls-sheet.good .vd-row p, .ls-sheet.bad .vd-row p { color: rgba(251, 249, 245, .82); }
.ls-sheet.bad .vd-row .sol { color: var(--on); font-size: 19px; }
.ls-sheet.good .ls-next { --b: var(--good); --c: #fff; --e: var(--good); }
.ls-sheet.bad .ls-next { --b: var(--on); --c: var(--red-deep); --e: var(--on); }
.ls-sheet.good .ls-next:hover, .ls-sheet.bad .ls-next:hover { --b: var(--white); --c: var(--ink); --e: var(--white); }
.vd-row h3 { font: 400 clamp(34px, 9vw, 44px)/.9 var(--font-display); letter-spacing: .01em; margin: 2px 0 8px; transform: rotate(-3deg); transform-origin: left; animation: stamp .45s var(--press) backwards; }
.ls-sheet.good .vd-row h3 { color: #7ee2a8; }
.ls-sheet.bad .vd-row h3 { color: var(--on); }
@keyframes stamp { 0% { transform: rotate(-12deg) scale(2.2); opacity: 0; } 60% { transform: rotate(-2deg) scale(.94); opacity: 1; } 100% { transform: rotate(-3deg) scale(1); } }
.stamp-burst { position: fixed; z-index: 70; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid var(--good); pointer-events: none; animation: burst .7s var(--ease) forwards; }
.stamp-burst.b2 { animation-delay: .08s; border-style: dashed; }
.stamp-burst.no { border-color: var(--red); }
@keyframes burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(7); opacity: 0; } }

/* ---------- Results ---------- */
.result { overflow: hidden; }
.result::before, .result::after { content: ""; position: absolute; border-radius: 50%; border: 2px dashed rgba(217, 20, 20, .22); pointer-events: none; animation: spin 50s linear infinite; }
.result::before { width: 520px; height: 520px; right: -200px; top: -200px; }
.result::after { width: 320px; height: 320px; left: -140px; bottom: 40px; animation-direction: reverse; }
.res-in { position: relative; z-index: 1; }
.res-title { font: 400 clamp(52px, 14vw, 86px)/.85 var(--font-display); letter-spacing: .01em; color: var(--red); transform: rotate(-3deg); animation: stamp .6s var(--press) .15s backwards; }
.res-perfect { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--slab); color: var(--gold); letter-spacing: .2em; transform: rotate(2deg); }
.res-card { border: 1.5px solid var(--ink); border-radius: 22px; }
.res-card:nth-child(2), .res-card:nth-child(3) { border-color: var(--ink); }
.res-card p { background: var(--slab); color: var(--on); letter-spacing: .18em; }
.res-card.acc p { background: var(--red); }
.res-card.time p { background: var(--good-deep); }
.res-card b { font: 400 40px/1 var(--font-display); padding: 12px 4px 10px; }
.res-goal { display: inline-flex; gap: 6px; align-items: center; }
.res-foot { border-top: 1px solid var(--line); position: relative; z-index: 1; background: var(--cream); }
.streak-big .fl.huge svg { width: 170px; height: 170px; }
.streak-big.small .fl.huge svg { width: 110px; height: 110px; }
.streak-n { color: var(--on); text-shadow: 0 3px 0 #b84a00; bottom: 22px; }
.week-dots span { border: 1.5px dashed #cfc6b8; background: transparent; }
.week-dots span.on { background: #ff6a00; border: 0; }
.badge-big { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--ink); box-shadow: 0 0 0 10px rgba(242, 169, 0, .22); rotate: -6deg; filter: none; }
.badge-big svg { width: 78px; height: 78px; }

/* ---------- Pages ---------- */
.page-head h1 { font-size: clamp(28px, 7vw, 38px); letter-spacing: -.04em; }
.back { border-width: 1.5px; transition: transform .3s var(--ease), background .2s, color .2s; }
.back:hover { transform: translateX(-3px); background: var(--slab); color: var(--on); }
.pr-tile { border-radius: 26px; }
.pr-ic { border-radius: 50%; color: var(--red); background: var(--red-tint); }
.pr-tile.hero { box-shadow: none; position: relative; overflow: hidden; }
.pr-tile.hero::after { content: ""; position: absolute; right: -50px; top: -60px; width: 180px; height: 180px; border-radius: 50%; border: 2px dashed rgba(251, 249, 245, .3); animation: spin 40s linear infinite; }
.pr-tile.hero .pr-ic { color: var(--on); }
.pr-tile.real { border-color: var(--line); background: var(--white); }
.wl-say { display: grid; place-items: center; border-radius: 50%; color: var(--red); background: var(--red-tint); }
.q-ic, .q-chest, .sg span { display: grid; color: var(--red); }
.q-chest { color: var(--gold); }
.quests li.done .q-chest { color: var(--good); }
.badge span { color: var(--red); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--red-tint); }
.badge.got span { background: var(--gold); color: var(--ink); rotate: -6deg; }
.badge.got { background: var(--white); border-color: var(--ink); border-width: 1.5px; }
.league .rank svg { margin: auto; color: var(--gold); }
.league li:nth-child(2) .rank svg { color: #a8a39b; }
.league li:nth-child(3) .rank svg { color: #c27a3a; }
.lg-streak { display: inline-flex; align-items: center; gap: 2px; color: #ff6a00; }
.lvl-badge { font: 400 40px/1 var(--font-display); box-shadow: 0 0 0 8px var(--red-tint); }
.lvl-badge.xl { font-size: 72px; }
.lvl-tag { font: 400 24px/1 var(--font-display); }
.hearts-row { color: #d9d2c7; }
.tip-ex .spk-mini { color: var(--red); }
.splash span { letter-spacing: .02em; animation: splashIn .8s var(--press) both; }
@keyframes splashIn { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sec-track, .unit-banner::after, .result::before, .result::after, .pr-tile.hero::after { animation: none; } .fx-ring, .stamp-burst { display: none; } }
.ls-sheet.bad { background: var(--red) !important; color: var(--on) !important; border: 0 !important; box-shadow: none !important; animation: sheetUp .35s var(--ease) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.node.done, .node.done.gold, .node.current { box-shadow: 0 10px 22px -12px rgba(160, 10, 10, .55); }
.path { gap: 34px; }
.sec-head { padding: 12px 0 2px; margin-top: 0; }
.ls-sheet.bad .hp-ring, .ls-sheet.bad .hp-arm { fill: var(--cream); stroke: var(--cream); }
.ls-sheet.bad .hp-arm { fill: none; }
.stamp-burst.no { border-color: var(--cream); }

/* UI audit fixes */
html, body.dil { overflow-x: clip; }
.node-wrap:has(.pop) { z-index: 16; }
.node-wrap:has(.node-tip) { margin-top: 18px; }
.card-o.good .card-e, .card-o.bad .card-e { background: var(--white); }
.ls-combo { top: -32px; }
.onb-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 360px; margin-inline: auto; }
.onb-facts span { text-align: center; }
.week-dots { justify-content: center; gap: 6px; flex-wrap: nowrap; }
.week-dots span { width: 40px; height: 40px; font-size: 11px; }
.week-dots span.today:not(.on) { border-color: #ff7a00; border-style: solid; color: #e86100; }
.week-dots span.later { opacity: .45; }
@media (max-width: 420px) {
  .topbar { padding-inline: 10px; gap: 4px; }
  .brand-m img { height: 22px; }
  .brand-dil { font-size: 22px; }
  .stats { gap: 0; }
  .stat { padding: 6px 6px; font-size: 14px; gap: 3px; }
  .stat .ic { width: 19px; height: 19px; }
  .stat .flag svg, .stat .flag img { width: 26px; height: auto; }
}
.pr-tile.locked { border-style: dashed; background: transparent; opacity: .75; }
.pr-tile.locked .pr-ic { background: var(--beige); color: var(--muted); }
.pr-tile.hero.locked { background: var(--slab); border-color: var(--ink); border-style: solid; opacity: 1; }
.pr-tile.hero.locked .pr-ic { background: rgba(255, 255, 255, .12); color: var(--on); }
.node-wrap:has(.node-tip) { margin-top: 30px; }

/* ---------- Night mode: follows the phone, or the choice in settings ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --red: #e8231f; --red-deep: #a80f0f; --red-tint: #3a1715; --red-soft: #7c2c25;
    --cream: #14110f; --beige: #262019; --white: #1d1916; --ink: #f2ede5; --ink-soft: #d5cdc1; --muted: #a39a8e; --line: #3a322a;
    --slab: #2a241f; --good-tint: #12301f; --shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --red: #e8231f; --red-deep: #a80f0f; --red-tint: #3a1715; --red-soft: #7c2c25;
  --cream: #14110f; --beige: #262019; --white: #1d1916; --ink: #f2ede5; --ink-soft: #d5cdc1; --muted: #a39a8e; --line: #3a322a;
  --slab: #2a241f; --good-tint: #12301f; --shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(0, 0, 0, .7);
}
/* Night-mode details: the mascot keeps its light face, buttons on red stay light. */
.hp-face { fill: #fbf9f5; }
.hp-cheek { fill: #f0c2ba; }
.hp-mouth { stroke: #1a1a1a; }
.hp-mouth-open { stroke: #1a1a1a; }
.ls-sheet.bad .hp-ring { fill: var(--on); stroke: var(--on); }
.ls-sheet.bad .hp-arm { stroke: var(--on); }
.ls-sheet.good .ls-next:hover, .ls-sheet.bad .ls-next:hover { --b: var(--on); --c: #1a1a1a; --e: var(--on); }
:root[data-theme="dark"] .node.locked, :root[data-theme="dark"] .node.trophy:not(.open):not(.done) { border-color: #4a4138; color: #6f665b; }
:root[data-theme="dark"] .link { color: #ff6b5e; }
:root[data-theme="dark"] .card-o.bad, :root[data-theme="dark"] .opt.bad { color: #ff8a80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .node.locked, :root:not([data-theme="light"]) .node.trophy:not(.open):not(.done) { border-color: #4a4138; color: #6f665b; }
  :root:not([data-theme="light"]) .link { color: #ff6b5e; }
  :root:not([data-theme="light"]) .card-o.bad, :root:not([data-theme="light"]) .opt.bad { color: #ff8a80; }
}
