/* Dango Words: one column app. Header with tabs, then the current view (word grid, clip player, quiz, progress). */
:root {
  --page: #eef4f3;
  --card: #ffffff;
  --ink: #15302e;
  --muted: #557370;
  --line: #d3e2df;
  --chip: #d5e5e2;
  --brand: #0f5c57;
  --brand-ink: #f4fbf9;
  --sun: #ffc94a;
  --sun-ink: #2a2100;
  --good: #2f9a62;
  --good-bg: #dff3e7;
  --bad: #c2453f;
  --bad-bg: #fbe3e1;
  --display: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page:#0c1716; --card:#132321; --ink:#e3efed; --muted:#9fb7b3; --line:#22403c; --chip:#1e3331; --brand:#5fc2b6; --brand-ink:#08201e; --good:#6fd39b; --good-bg:#14352a; --bad:#f08a84; --bad-bg:#3a1c1a; color-scheme: dark; }
}
:root[data-theme="dark"] { --page:#0c1716; --card:#132321; --ink:#e3efed; --muted:#9fb7b3; --line:#22403c; --chip:#1e3331; --brand:#5fc2b6; --brand-ink:#08201e; --good:#6fd39b; --good-bg:#14352a; --bad:#f08a84; --bad-bg:#3a1c1a; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--body); font-variant-ligatures: no-common-ligatures; line-height: 1.45; }
.wrap { max-width: 960px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 48px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
button { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--brand); }
.tabs a, .btn, .brand, .back { color: var(--ink); }
.btn.primary { color: var(--brand-ink); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 6px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 44px; transform: rotate(-18deg); }
.brand-mark .dango { display: block; }
.tabs { display: flex; gap: 4px; background: var(--chip); padding: 4px; border-radius: 12px; }
.tabs a { text-decoration: none; color: var(--ink); font-weight: 700; padding: 8px 14px; border-radius: 9px; font-size: .95rem; }
.tabs a[aria-current="page"] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.mode { font-size: .8rem; color: var(--muted); }

/* summary strip */
.summary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-block: 4px 18px; }
.stat { background: var(--card); border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); min-width: 0; }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat .v { font-family: var(--display); font-weight: 900; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.meter { height: 10px; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 99px; transition: width .4s; }
@media (max-width: 620px) { .summary { grid-template-columns: 1fr 1fr; } .summary .stat:first-child { grid-column: 1 / -1; } }

/* word grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wcard p.def { flex: 1; }
.wcard.known { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.wcard h3 { margin: 0; font-size: 1.5rem; font-weight: 900; }
.wcard .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.tone { font-weight: 700; border-radius: 99px; padding: 1px 8px; font-size: .75rem; }
.tone.p { background: var(--good-bg); color: var(--good); }
.tone.n { background: var(--bad-bg); color: var(--bad); }
.wcard p.def { margin: 0; font-size: .95rem; }
.wcard .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.views { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--chip); color: var(--ink); font-size: .95rem; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.sun { background: var(--sun); color: var(--sun-ink); }

/* word page */
.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 700; margin-bottom: 10px; }
.player { display: grid; gap: 12px; }
.details { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-top: 14px; }
.details .stat p { margin: 6px 0 0; }
@media (max-width: 680px) { .details { grid-template-columns: 1fr; } }

/* quiz */
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 14px; max-width: 720px; }
.qtop { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.qprompt { font-size: 1.1rem; margin: 0; }
.qdir { display: grid; gap: 2px; font-size: .9rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
.qdir b { color: var(--ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.qword { font-family: var(--display); font-weight: 900; font-size: 2.4rem; margin: 0; letter-spacing: .01em; }
.qsent { font-size: 1.3rem; margin: 0; line-height: 1.5; }
.qsent .blank { letter-spacing: .05em; white-space: nowrap; }
.qopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .qopts { grid-template-columns: 1fr; } }
.qopt { text-align: left; border: 2px solid var(--line); background: var(--page); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 1.05rem; cursor: pointer; }
.qopt b { margin-right: 8px; color: var(--muted); }
.qopt:hover:not(:disabled) { border-color: var(--brand); }
.qopt.right { background: var(--good-bg); border-color: var(--good); }
.qopt.wrong { background: var(--bad-bg); border-color: var(--bad); }
.qopt:disabled { cursor: default; }
.feedback { border-radius: 12px; padding: 12px 14px; }
.feedback.ok { background: var(--good-bg); }
.feedback.no { background: var(--bad-bg); }
.feedback p { margin: 4px 0 0; }
.qbar { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--brand); transition: width .3s; }

/* progress */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
/* On phones the word table drops "Last activity" (Recent activity below covers it) so the rest fits without scrolling. */
@media (max-width: 600px) { th, td { padding: 9px 6px; } th:first-child, td:first-child { padding-left: 10px; } th { letter-spacing: .04em; } table { font-size: .88rem; } th.last, td.last { display: none; } }
.pill2 { border-radius: 99px; padding: 2px 9px; font-size: .78rem; font-weight: 700; }
.pill2.yes { background: var(--good-bg); color: var(--good); }
.pill2.no { background: var(--chip); color: var(--muted); }
.pill2.warn { background: var(--bad-bg); color: var(--bad); }
.section-h { font-size: 1.15rem; margin: 22px 0 10px; }
.empty { color: var(--muted); }
.gate { max-width: 420px; margin: 40px auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: grid; gap: 12px; }
.gate input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--page); color: var(--ink); }
.err { color: var(--bad); font-size: .9rem; margin: 0; }
.note { color: var(--muted); font-size: .88rem; }

/* ---------- clip player ---------- */
.screen { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: #0f5c57; container-type: inline-size; }
.screen.paused *, .screen.paused *::before { animation-play-state: paused !important; }
.screen:not(.started) .walk, .screen:not(.started) .walkIn, .screen:not(.started) .runIn { animation: none !important; }
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.scene.on { opacity: 1; }
.scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene svg text { font-family: var(--body); }
.scene svg .disp { font-family: var(--display); }
.ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 2cqw; padding: 6cqw 7cqw; color: #f4fbf9; }
.ov.right { padding-left: 44cqw; padding-right: 4cqw; }
.ov .big { font-family: var(--display); font-weight: 900; font-size: 10cqw; line-height: 1; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }
.ov .big.fit { font-size: 8.4cqw; }
.ov .h { font-family: var(--display); font-weight: 900; font-size: 4.4cqw; line-height: 1.1; margin: 0; }
.ov .t { font-size: 3cqw; line-height: 1.35; margin: 0; }
.ov .s { font-size: 2.2cqw; margin: 0; opacity: .85; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.ov .pron { font-size: 3.6cqw; margin: 0; }
.ov .pron b { color: #ffc94a; }
.ov .pill { align-self: flex-start; display: inline-flex; gap: 1cqw; align-items: center; background: rgba(255,255,255,.15); border-radius: 99px; padding: .7cqw 2cqw; font-size: 2.1cqw; font-weight: 700; }
.ov .pos { background: #8fe3b4; color: #0b2a1a; border-radius: 99px; padding: 0 1.2cqw; }
.ov .neg { background: #f4a7a2; color: #3a0d0a; border-radius: 99px; padding: 0 1.2cqw; }
.ov .hl { white-space: nowrap; background: #ffc94a; color: #2a2100; border-radius: .8cqw; padding: 0 .8cqw; }
.chips { display: flex; flex-wrap: wrap; gap: 1.4cqw; }
.chips span { font-size: 2.8cqw; font-weight: 700; padding: 1cqw 2.2cqw; border-radius: 99px; }
.chips.yes span { background: #8fe3b4; color: #0b2a1a; }
.chips.no span { border: .3cqw solid rgba(255,255,255,.5); text-decoration: line-through; text-decoration-thickness: .25cqw; color: #f4fbf9; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4cqw; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqw; }
.opt { font-size: 3.2cqw; padding: 1.4cqw 2.4cqw; border-radius: 1.4cqw; background: rgba(255,255,255,.13); color: #f4fbf9; }
.opt b { margin-right: 1.2cqw; }
.answer .opt { opacity: .35; }
.answer .opt.right { opacity: 1; background: #ffc94a; color: #2a2100; }
.think { position: absolute; left: 0; right: 0; bottom: 0; height: .7cqw; background: rgba(255,255,255,.08); opacity: 0; transition: opacity .3s; }
.think i { position: absolute; inset: 0; background: rgba(255,201,74,.75); transform-origin: left; }
.hold .scene.on .think { opacity: 1; }
.hold .scene.on .think i { animation: count 5s linear forwards; }
@keyframes count { to { transform: scaleX(0); } }
.think-label { position: absolute; right: 3cqw; bottom: 1.8cqw; margin: 0; font-size: 1.9cqw; color: rgba(244,251,249,.6); opacity: 0; transition: opacity .3s; font-variant-numeric: tabular-nums; }
.hold .scene.on .think-label { opacity: 1; }
.start { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,40,38,.45); border: 0; cursor: pointer; padding: 0; z-index: 5; }
.start span { display: inline-flex; align-items: center; gap: 12px; background: #ffc94a; color: #2a2100; font: 800 clamp(1rem, 3cqw, 1.6rem) var(--display); padding: 14px 26px; border-radius: 99px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.cap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; font-size: 1.1rem; line-height: 1.45; min-height: 3.2em; }
.cap mark { background: var(--sun); color: var(--sun-ink); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
button.b { font: 700 .95rem var(--body); border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; background: var(--chip); color: var(--ink); }
button.b.primary { background: var(--brand); color: var(--brand-ink); }
.bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; flex: 1 1 300px; min-width: 0; }
.seg { height: 26px; background: var(--chip); border: 0; border-radius: 6px; position: relative; overflow: hidden; padding: 0; cursor: pointer; container-type: inline-size; }
/* The label is drawn twice: dark on the empty track, and a white copy inside the fill that is clipped as the fill grows. */
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--brand); overflow: hidden; font-style: normal; }
.seg span { position: absolute; inset: 0 auto 0 0; width: 100cqw; display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.seg i span { color: var(--brand-ink); }
@media (max-width: 600px) { .seg span { display: none; } .seg { height: 12px; } .cap { font-size: 1rem; } }

/* timed entrances */
.pop, .fade { opacity: 0; }
.scene.on .pop { animation: pop .5s cubic-bezier(.2,1.4,.4,1) forwards; animation-delay: var(--d, 0s); }
.scene.on .fade { animation: fade .5s ease forwards; animation-delay: var(--d, 0s); }
.scene.on .out { animation: fadeout .4s ease forwards; animation-delay: var(--d, 0s); }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }
.pop, .fade, .out, .walk, .walkIn, .runIn, .walkOut, .bob, .bounce, .jump, .stomp, .laugh, .shiver, .float, .slideR, .fall, .snowfall, .fall2, .drip, .rise, .ballMiss, .ballSwish { transform-box: fill-box; transform-origin: 50% 100%; }
.scene.on .walk { animation: walk 3s ease-out forwards; }
.scene.on .walkIn { animation: walkIn 1.4s ease-out forwards; }
.scene.on .runIn { animation: runIn 1.6s ease-in forwards; }
.scene.on .walkOut { animation: walkOut 2s ease-in forwards; animation-delay: var(--d, 0s); }
@keyframes walk { from { transform: translateX(-900px); } to { transform: none; } }
@keyframes walkIn { from { transform: translateX(-500px); } to { transform: none; } }
@keyframes runIn { from { transform: translateX(-700px); } to { transform: none; } }
@keyframes walkOut { to { transform: translateX(-900px); } }
.scene.on .bob { animation: bob .5s ease-in-out 6 alternate; }
@keyframes bob { to { transform: translateY(-14px); } }
.scene.on .bounce { animation: bounce .45s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes bounce { to { transform: translateY(-26px) rotate(2deg); } }
.scene.on .jump { animation: jump 1.1s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes jump { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-60px); } }
.scene.on .stomp { animation: stomp .5s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes stomp { 0%, 100% { transform: none; } 40% { transform: translateY(-16px) rotate(-3deg); } 60% { transform: translateY(4px) rotate(2deg); } }
.wave { transform-box: fill-box; transform-origin: 50% 6% !important; }
.scene.on .wave { animation: wave .45s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes wave { from { transform: rotate(-150deg); } to { transform: rotate(-115deg); } }
.scene.on .laugh { animation: laugh .35s ease-in-out infinite alternate; }
@keyframes laugh { to { transform: translateY(-10px) rotate(-1.5deg); } }
.scene.on .shiver { animation: shiver .15s linear infinite alternate; }
@keyframes shiver { to { transform: translateX(4px); } }
.scene .float { opacity: 0; }
.scene.on .float { animation: float 2.4s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes float { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-160px) scale(1.1); } }
.scene .slideR { transform: translateX(900px); }
.scene.on .slideR { animation: slideR .7s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes slideR { to { transform: none; } }
.twinkle { transform-box: fill-box; transform-origin: center !important; }
.scene.on .twinkle { animation: tw 1.2s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes tw { from { transform: scale(.5) rotate(0); opacity: .3; } to { transform: scale(1.1) rotate(30deg); opacity: 1; } }
.scene.on .fall { animation: fall 3s linear infinite; animation-delay: var(--d, 0s); }
@keyframes fall { to { transform: translateY(1000px) rotate(200deg); } }
.scene.on .snowfall { animation: fall 5s linear infinite; animation-delay: var(--d, 0s); }
.scene.on .fall2 { animation: fall2 2.4s linear infinite; animation-delay: var(--d, 0s); }
@keyframes fall2 { to { transform: translateY(240px); } }
.scene .drip { opacity: 0; }
.scene.on .drip { animation: drip 1.4s ease-in infinite; animation-delay: var(--d, 0s); }
@keyframes drip { 0% { opacity: 0; transform: none; } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(120px); } }
.scene .flash { opacity: 0; }
.scene.on .flash { animation: flash .6s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .95; } 100% { opacity: 0; } }
.scene .rise { opacity: 0; }
.scene.on .rise { animation: rise 3s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes rise { 0% { opacity: 0; transform: translateY(160px) scale(.3); } 25% { opacity: 1; } 100% { opacity: 1; transform: translateY(-120px) scale(1); } }
.spin { transform-box: fill-box; transform-origin: center !important; }
.scene.on .spin { animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.burst { transform-box: fill-box; transform-origin: center !important; opacity: 0; }
.scene.on .burst { animation: burst 1s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes burst { from { opacity: 0; transform: scale(.1); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
.scene .ballMiss, .scene .ballSwish { opacity: 0; }
.scene.on .ballMiss { animation: ballMiss 1.6s ease-in-out forwards; animation-delay: var(--d, 0s); }
@keyframes ballMiss { 0% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(380px, -260px); } 70% { transform: translate(470px, -140px); } 100% { opacity: 1; transform: translate(300px, 300px); } }
.scene.on .ballSwish { animation: ballSwish 1.4s ease-in-out forwards; animation-delay: var(--d, 0s); }
@keyframes ballSwish { 0% { opacity: 1; transform: none; } 55% { opacity: 1; transform: translate(360px, -260px); } 75% { transform: translate(480px, -120px); } 100% { opacity: 1; transform: translate(490px, 260px); } }
.scene.on .rainfall { animation: rain .9s linear infinite; animation-delay: var(--d, 0s); }
.scene.on .drizzlefall { animation: rain 2s linear infinite; animation-delay: var(--d, 0s); }
@keyframes rain { to { transform: translate(-60px, 1800px); } }
.scene .fly { opacity: 0; }
.scene.on .fly { animation: fly 2.2s ease-out forwards; animation-delay: var(--d, 0s); }
@keyframes fly { 0% { opacity: 1; transform: none; } 100% { opacity: 1; transform: translate(-520px, -150px); } }
.flicker { transform-box: fill-box; transform-origin: 50% 100%; }
.scene.on .flicker { animation: flicker .4s ease-in-out infinite alternate; }
@keyframes flicker { to { transform: scaleY(.9) scaleX(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .scene.on .walk, .scene.on .walkIn, .scene.on .runIn, .scene.on .bob, .scene.on .bounce, .scene.on .jump, .scene.on .stomp, .scene.on .wave, .scene.on .laugh, .scene.on .shiver, .scene.on .twinkle, .scene.on .spin, .scene.on .fall, .scene.on .snowfall, .scene.on .fall2, .scene.on .rainfall, .scene.on .drizzlefall, .scene.on .flicker { animation: none; }
  .scene.on .slideR { animation-duration: .01s; }
}

/* compact word list */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 6px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: .88rem; cursor: pointer; }
.fchip .n { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; margin-left: 2px; }
.fchip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.fchip[aria-pressed="true"] .n { color: var(--brand-ink); opacity: .8; }
.search { font: inherit; flex: 1 1 220px; max-width: 320px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.letter { font-size: .8rem; letter-spacing: .1em; color: var(--muted); margin: 16px 0 6px 4px; font-weight: 900; }
.wlist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 48px; border-top: 1px solid var(--line); }
.wrow:first-child { border-top: 0; }
.wrow:hover { background: color-mix(in srgb, var(--chip) 45%, transparent); }
.wlink { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); padding: 12px 0; }
.ww { font-family: var(--display); font-weight: 900; font-size: 1.08rem; flex: none; }
.wpos { color: var(--muted); font-size: .8rem; flex: none; display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.p { background: var(--good); } .dot.n { background: var(--bad); }
.wdef { color: var(--muted); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--ink); flex: none; }
.play:hover { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 560px) { .wlink { flex-wrap: wrap; row-gap: 0; padding: 8px 0; } .wdef { flex-basis: 100%; font-size: .85rem; } .search { max-width: none; } }
.sync { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--ink); font-size: .92rem; }
.screen .loadmsg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: #f4fbf9; font-weight: 700; }

/* Today */
.qcard.today { position: relative; gap: 10px; }
.qcard.today h2 { margin: 0; font-size: 1.8rem; padding-right: 96px; }
.lede { margin: 0; font-size: 1.15rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.btn.big { font-size: 1.15rem; padding: 14px 30px; border-radius: 12px; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.streak { position: absolute; top: 18px; right: 18px; display: grid; justify-items: center; background: var(--sun); color: var(--sun-ink); border-radius: 14px; padding: 6px 12px; line-height: 1.1; }
.streak b { font-family: var(--display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.streak span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.done-stats { display: flex; gap: 12px; }
.done-stats div { background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; display: grid; }
.done-stats b { font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.done-stats span { color: var(--muted); font-size: .85rem; }
.qtop .stop { color: var(--muted); font-weight: 700; }
.kicker { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.kicker b { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .95rem; }
.qopts.wide { grid-template-columns: 1fr; }
.recall .qword { font-size: 2.8rem; }
.rpos { margin: -10px 0 0; color: var(--muted); font-style: italic; }
.hint { color: var(--muted); font-size: .85rem; margin-left: 6px; }
.meaning { background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.meaning .def { margin: 0; font-size: 1.2rem; font-weight: 700; }
.meaning .ex { margin: 6px 0 0; color: var(--muted); }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.grade { display: grid; padding: 12px 10px; font-size: 1.05rem; border: 2px solid transparent; }
.grade small { font-weight: 400; font-size: .8rem; color: var(--muted); }
.grade.again { background: var(--bad-bg); }
.grade.hard { background: var(--chip); }
.grade.good { background: var(--good-bg); }
.grade:hover:not(:disabled) { border-color: var(--brand); }
.grade:disabled { opacity: .55; cursor: default; }
.newhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.newhead h2 { margin: 2px 0 0; font-size: 2rem; }
.pill.new { display: inline-block; background: var(--sun); color: var(--sun-ink); border-radius: 99px; padding: 2px 10px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.btn.pulse { animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 30%, transparent); } }
@media (max-width: 560px) { .qcard { padding: 16px; } .qcard.today h2 { font-size: 1.5rem; } .grades { gap: 6px; } .grade { padding: 10px 4px; font-size: .95rem; } .recall .qword { font-size: 2.2rem; } }

/* stage badges */
.stage { flex: none; font-size: .74rem; font-weight: 800; border-radius: 99px; padding: 3px 9px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.s-new { background: var(--chip); color: var(--muted); }
.s-learning { background: color-mix(in srgb, var(--sun) 35%, var(--card)); color: var(--ink); }
.s-mastered { background: var(--good-bg); color: var(--good); }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.pips i.on { background: var(--ink); }
@media (max-width: 560px) { .stage { font-size: .68rem; padding: 2px 7px; } }

/* replay */
.modal { position: fixed; inset: 0; background: rgba(8, 20, 19, .66); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-card { background: var(--card); border-radius: 18px; padding: 16px; width: min(900px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 12px; }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.3rem; }

/* progress */
.section-h.first { margin-top: 4px; }
.stagebar-card { margin-bottom: 12px; }
.stagebar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; background: var(--chip); }
.stagebar i, .legend i { display: block; }
.stagebar .m, .legend .m { background: var(--good); }
.stagebar .l, .legend .l { background: var(--sun); }
.stagebar .n, .legend .n { background: color-mix(in srgb, var(--ink) 14%, var(--card)); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .9rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .of { color: var(--muted); }
.summary.three { grid-template-columns: repeat(3, 1fr); margin: 0 0 12px; }
@media (max-width: 620px) { .summary.three { grid-template-columns: repeat(3, 1fr); } .summary.three .stat:first-child { grid-column: auto; } .summary.three .stat { padding: 12px; } .summary.three .v { font-size: 1.35rem; } }
.stat .sub { color: var(--muted); font-size: .85rem; }
.pace p { margin: 6px 0 0; font-size: 1.05rem; }
.pace.behind { border-color: var(--bad); }
.pace .warn { color: var(--bad); font-size: .95rem; }
.struggling { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.settings { display: grid; gap: 14px; max-width: 520px; }
.settings label { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; }
.settings input, .settings select { font: inherit; font-weight: 400; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--page); color: var(--ink); }
.settings .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.recent td:first-child { width: 8.5rem; color: var(--muted); }
.recent td:nth-child(2) { width: 11rem; font-weight: 700; }
@media (max-width: 600px) { .recent td:first-child { width: 6.5rem; } .recent td:nth-child(2) { width: auto; } }

/* Dango mascots */
.dango { display: block; flex: none; overflow: visible; }
.hero { display: flex; align-items: center; gap: 18px; padding-right: 96px; }
.hero .dango { width: 52px; height: auto; }
.hero-text { display: grid; gap: 8px; min-width: 0; }
.qcard.today .hero h2 { padding-right: 0; }
.gate-mark { display: flex; justify-content: center; }
.fb-head { display: flex; align-items: center; gap: 8px; }
.dg-bounce .dg-b0 { animation: dg-hop 1.8s ease-in-out infinite; }
.dg-bounce .dg-b1 { animation: dg-hop 1.8s ease-in-out .15s infinite; }
.dg-bounce .dg-b2 { animation: dg-hop 1.8s ease-in-out .3s infinite; }
@keyframes dg-hop { 0%, 60%, 100% { transform: none; } 25% { transform: translateY(-5px); } }
@media (max-width: 560px) { .hero { gap: 12px; padding-right: 84px; } .hero .dango { width: 40px; } }
@media (prefers-reduced-motion: reduce) { .dg-bounce .dg-b0, .dg-bounce .dg-b1, .dg-bounce .dg-b2 { animation: none; } }

/* ---------- sign-in and the learner picker ---------- */
.gate h2 { margin: 0; text-align: center; }
.gate > p { margin: 0; }
.gate .note { text-align: center; }
.stack { display: grid; gap: 8px; }
.stack > p { margin: 0 0 4px; }
.stack label, .gate > label { font-weight: 700; font-size: .92rem; }
.gate .btn { padding: 11px 16px; }
.btn.google { background: var(--card); border: 2px solid var(--line); color: var(--ink); }
.btn.google:hover { border-color: var(--brand); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.otp { font-family: var(--display); font-weight: 900; font-size: 1.6rem; letter-spacing: .35em; text-align: center; }
.learners { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.learner { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--page); color: var(--ink); font: inherit; font-family: var(--display); font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.learner:hover { border-color: var(--brand); }
.learner span { overflow-wrap: anywhere; }
.avatars { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); justify-items: center; gap: 2px; }
.avatars legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: 6px; }
.avatar { display: inline-flex; padding: 3px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.avatar input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar:has(input:checked) { border-color: var(--brand); background: var(--chip); }
.avatar:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 2px; }
.gate .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- parent area ---------- */
.top .row { display: flex; gap: 8px; }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.kid { display: grid; gap: 10px; align-content: start; }
.kid h3 { margin: 0; font-size: 1.25rem; }
.kid .note { margin: 0; }
.kid-top { display: flex; gap: 12px; align-items: center; }
.kid .row, .account .row { display: flex; gap: 8px; flex-wrap: wrap; }
.kid .settings { max-width: none; }
.kid .settings h3 { margin: 0; }
.account p { margin: 0 0 10px; }
.account .err:empty, .kid .err:empty { display: none; }

/* ---------- plain pages (privacy) ---------- */
.doc { max-width: 720px; }
.doc h1 { font-size: 2rem; margin: 8px 0 4px; }
.doc h2 { margin: 28px 0 8px; font-size: 1.25rem; }
.doc p, .doc li { line-height: 1.6; }
.doc ul { padding-left: 1.2em; }
.avatars { max-width: 340px; }
#addbox { margin-top: 12px; }
