/* ============================================================
   华文词语大挑战 — ink night, paper light
   Every learning surface is paper; the world around it is ink.
   Red is reserved for the teacher: marks and seals.
   ============================================================ */

:root {
  --ink-0: #0c1320;
  --ink-1: #142035;
  --ink-2: #1c2b46;
  --ink-line: rgba(201, 214, 240, 0.12);
  --text: #eef2fa;
  --mist: #93a0bc;
  --paper: #fbf6ea;
  --paper-2: #f3ecdb;
  --paper-ink: #1f2533;
  --paper-mute: #6b6552;
  --grid: rgba(214, 88, 64, 0.55);
  --grid-soft: rgba(214, 88, 64, 0.28);
  --cinnabar: #e3432b;
  --jade: #22b184;
  --jade-deep: #148a66;
  --gamboge: #f5b324;
  --azurite: #4a90e2;
  --violet: #9b72e0;
  --gold: #d8b46a;
  --lvl: var(--azurite);
  --font-brush: 'Ma Shan Zheng', 'LXGW WenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
  --font-kai: 'LXGW WenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', 'Noto Serif SC', serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--ink-0);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(74, 144, 226, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 60% at 90% 100%, rgba(34, 177, 132, 0.12), transparent 60%);
  color: var(--text);
  font-family: var(--font-kai);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gamboge); outline-offset: 3px; border-radius: 10px; }

/* ---------- world layers ---------- */
#ink {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block; pointer-events: none;
  transition: opacity 0.6s;
}
.no-ink #ink { opacity: 0; }
#grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app {
  position: relative; z-index: 2; height: 100%;
  width: 100%; max-width: 600px; margin: 0 auto;
}
#app.shake { animation: appShake 0.32s; }
@keyframes appShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
}
#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-t)) 18px calc(18px + var(--safe-b));
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen[hidden] { display: none; }
/* children keep their natural height; the screen scrolls instead of squashing them */
.screen > * { flex-shrink: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; margin-bottom: 6px; flex-shrink: 0;
}
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ink-line);
  color: var(--text); transition: background 0.2s, transform 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ink-line);
  font-size: 14px; color: var(--mist);
}
.pill b { color: var(--text); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 12px 22px; border-radius: 16px;
  font-size: 20px; font-weight: 700; letter-spacing: 0.06em;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn:disabled:active { opacity: 0.45; filter: saturate(0.5); transform: none; box-shadow: none; }
.btn-gold {
  background: linear-gradient(180deg, #ffc94a, var(--gamboge));
  color: #2a1d02;
  box-shadow: 0 6px 0 #b9800f, 0 14px 30px rgba(245, 179, 36, 0.28);
}
.btn-gold:active { box-shadow: 0 2px 0 #b9800f, 0 8px 18px rgba(245, 179, 36, 0.25); transform: translateY(4px); }
.btn-paper {
  background: var(--paper); color: var(--paper-ink);
  box-shadow: 0 5px 0 #cfc4a8, 0 12px 26px rgba(0, 0, 0, 0.3);
}
.btn-paper:active { box-shadow: 0 1px 0 #cfc4a8; transform: translateY(4px); }
.btn-ghost {
  min-height: 48px; font-size: 17px; font-weight: 400; color: var(--mist);
  border: 1px solid var(--ink-line); background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 田字格 practice grid ---------- */
.tzg {
  --s: 64px;
  position: relative; width: var(--s); height: var(--s);
  display: inline-grid; place-items: center; vertical-align: middle;
  background:
    repeating-linear-gradient(90deg, var(--grid-soft) 0 5px, transparent 5px 9px) center / 100% 1.5px no-repeat,
    repeating-linear-gradient(0deg, var(--grid-soft) 0 5px, transparent 5px 9px) center / 1.5px 100% no-repeat,
    var(--paper);
  border: 2px solid var(--grid);
  font-family: var(--font-kai); font-weight: 700;
  font-size: calc(var(--s) * 0.7); line-height: 1; color: var(--paper-ink);
}
.tzg-row { display: inline-flex; }
.tzg-row .tzg + .tzg { border-left-width: 0; }

/* ---------- HOME ---------- */
#scr-home { align-items: stretch; }
.home-hero { text-align: center; margin: 4px 0 6px; position: relative; }
.logo {
  font-family: var(--font-brush); font-weight: 400;
  font-size: clamp(64px, 20vw, 104px); line-height: 0.95; letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}
.logo .ln { display: block; }
.logo .ch { display: inline-block; }
.logo .seal-mini {
  display: inline-grid; place-items: center; vertical-align: top;
  width: 0.42em; height: 0.42em; margin-left: 0.1em; margin-top: 0.1em;
  background: var(--cinnabar); color: var(--paper); border-radius: 0.06em;
  box-shadow: inset 0 0 0 0.03em var(--cinnabar), inset 0 0 0 0.045em rgba(255, 247, 234, 0.85);
  font-size: 1em; line-height: 1; transform: rotate(-6deg);
  filter: url(#seal-soft);
}
.logo .seal-mini span { font-size: 0.3em; }
.tagline { margin-top: 10px; font-size: 16px; color: var(--mist); letter-spacing: 0.12em; }

.enso-wrap {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 18px auto 20px; padding: 10px 18px 10px 12px;
}
.enso { width: 96px; height: 96px; flex-shrink: 0; }
.enso .track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 7; }
.enso .brush { fill: none; stroke: var(--text); stroke-width: 8; stroke-linecap: round; filter: url(#brush-rough); transition: stroke-dashoffset 1.4s var(--ease-out); }
.enso-text { text-align: left; }
.enso-text .n { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.enso-text .of { font-size: 15px; color: var(--mist); margin-top: 6px; }
.enso-text .of b { color: var(--text); font-weight: 400; }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lvl-card {
  --c: var(--azurite);
  position: relative; text-align: left;
  padding: 12px 12px 12px; border-radius: 18px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--ink-line);
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
  transition: transform 0.18s var(--ease-out), border-color 0.2s, background 0.2s;
}
.lvl-card:hover { border-color: rgba(255, 255, 255, 0.3); border-color: color-mix(in srgb, var(--c) 60%, transparent); background: linear-gradient(170deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)); }
.lvl-card:active { transform: scale(0.96); }
.lvl-card .num {
  font-family: var(--font-brush); font-size: 58px; line-height: 0.9; color: var(--c);
  height: 56px; display: flex; align-items: center;
}
.lvl-card .grade { font-size: 18px; font-weight: 700; }
.lvl-card .meta { font-size: 13px; color: var(--mist); white-space: nowrap; }
.nw { white-space: nowrap; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--c, var(--jade)); transition: width 1s var(--ease-out); }

.wuji-card {
  position: relative; margin-top: 10px; width: 100%; text-align: left;
  padding: 18px 18px 16px; border-radius: 20px; overflow: hidden;
  background:
    radial-gradient(circle at 88% 40%, rgba(216, 180, 106, 0.22), transparent 55%),
    linear-gradient(160deg, #1b1a1f, #0f1017);
  border: 1px solid rgba(216, 180, 106, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center;
  transition: transform 0.18s var(--ease-out), border-color 0.2s;
}
.wuji-card:hover { border-color: rgba(216, 180, 106, 0.8); }
.wuji-card:active { transform: scale(0.98); }
.wuji-card .ring {
  position: absolute; right: -34px; top: 50%; width: 170px; height: 170px; margin-top: -85px;
  opacity: 0.55; pointer-events: none;
  animation: spin 40s linear infinite;
}
.wuji-card .ring circle { fill: none; stroke: var(--gold); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 420 80; filter: url(#brush-rough); }
@keyframes spin { to { transform: rotate(360deg); } }
.wuji-card .title { font-family: var(--font-brush); font-size: 60px; line-height: 1; color: var(--gold); grid-row: span 3; }
.wuji-card .sub { font-size: 18px; font-weight: 700; color: #f4e6c6; position: relative; }
.wuji-card .desc { font-size: 14px; color: #b9ac8e; position: relative; }
.wuji-card .bar { position: relative; --c: var(--gold); max-width: 220px; }
.wuji-examples {
  grid-column: 1 / -1; margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; position: relative;
}
.wuji-examples span {
  font-size: 14px; padding: 3px 9px; border-radius: 999px;
  color: #f4e6c6; background: rgba(216, 180, 106, 0.12); border: 1px solid rgba(216, 180, 106, 0.28);
}
.home-foot { margin-top: auto; padding-top: 18px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- CATEGORY ---------- */
.page-title { font-family: var(--font-brush); font-size: 48px; line-height: 1; color: var(--lvl); }
.page-sub { font-size: 15px; color: var(--mist); margin-top: 6px; }
.page-head { margin: 4px 2px 16px; }
.cat-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.cat-row {
  width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--ink-line);
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center;
  transition: transform 0.15s var(--ease-out), background 0.2s, border-color 0.2s;
}
.cat-row:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); border-color: color-mix(in srgb, var(--lvl) 55%, transparent); }
.cat-row:active { transform: scale(0.98); }
.cat-row .name { font-size: 19px; font-weight: 700; }
.cat-row .count { font-size: 14px; color: var(--mist); font-variant-numeric: tabular-nums; }
.cat-row .hint { grid-column: 1 / -1; font-size: 14px; color: var(--mist); margin-top: -4px; }
.cat-row .bar { grid-column: 1 / -1; --c: var(--lvl); margin-top: 0; }
.cat-row.all {
  background: rgba(255, 255, 255, 0.08);
  background: linear-gradient(120deg, color-mix(in srgb, var(--lvl) 22%, transparent), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.3);
  border-color: color-mix(in srgb, var(--lvl) 45%, transparent);
}
.cat-row.all .name { font-size: 21px; }
.cat-foot { margin-top: auto; padding-top: 8px; display: grid; gap: 10px; }

/* ---------- COUNTDOWN ---------- */
#scr-count { align-items: center; justify-content: center; }
.count-num {
  font-family: var(--font-brush); font-size: min(46vw, 260px); line-height: 1; color: var(--text);
  text-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}
.count-num.go { color: var(--gamboge); font-size: min(34vw, 190px); }
.count-hint { margin-top: 10px; color: var(--mist); font-size: 16px; min-height: 24px; text-align: center; }

/* ---------- PLAY: HUD ---------- */
#scr-play { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(12px + var(--safe-b)); }
.hud { display: grid; grid-template-columns: 44px 1fr auto 1fr; align-items: center; gap: 10px; flex-shrink: 0; }
.hud .score { text-align: left; }
.hud .lab { font-size: 12px; color: var(--mist); display: block; line-height: 1.1; }
.hud .val { font-size: 26px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; display: inline-block; }
.hud .right { text-align: right; }
.streak {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px 5px 9px; border-radius: 999px; min-width: 64px; justify-content: center;
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06); color: var(--mist); border: 1px solid var(--ink-line);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.streak svg { width: 18px; height: 18px; }
.streak.on { background: linear-gradient(135deg, #ff7a3d, var(--gamboge)); color: #2a1100; border-color: transparent; box-shadow: 0 0 22px rgba(255, 140, 50, 0.45); }
.streak.hot { background: linear-gradient(135deg, var(--cinnabar), #ff9a3d); color: #fff; box-shadow: 0 0 30px rgba(227, 67, 43, 0.6); }

.timer { position: relative; height: 10px; margin: 12px 2px 0; flex-shrink: 0; }
.timer .track { position: absolute; inset: 2px 0; border-radius: 6px; background: rgba(255, 255, 255, 0.07); }
.timer .fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background: linear-gradient(90deg, var(--jade), #6fd8b2);
  border-radius: 8px 3px 3px 8px; filter: url(#brush-rough);
  transform-origin: left center;
}
.timer .fill.warn { background: linear-gradient(90deg, var(--cinnabar), #ff8a5c); animation: warnPulse 0.5s infinite alternate; }
@keyframes warnPulse { to { opacity: 0.55; } }
.timer.hide { visibility: hidden; }

.pips { display: flex; justify-content: center; gap: 6px; margin: 12px 0 0; flex-shrink: 0; min-height: 10px; }
.pips i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); transition: background 0.3s, transform 0.3s; }
.pips i.now { background: var(--gold); transform: scaleY(1.4); }
.pips i.ok { background: var(--jade); }
.pips i.bad { background: var(--cinnabar); }

.modebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-shrink: 0; min-height: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  padding: 5px 12px; border-radius: 999px; font-size: 15px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--text);
  background: color-mix(in srgb, var(--lvl) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--lvl) 40%, transparent);
  color: color-mix(in srgb, var(--lvl) 55%, white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.mult { font-size: 16px; font-weight: 700; color: var(--gamboge); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mult small { font-size: 13px; opacity: 0.7; margin-right: 2px; }

/* questions anchor near the top so the sentence never jumps when the explanation opens below it */
.stage {
  flex: 1 0 auto; position: relative;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: clamp(14px, 6vh, 64px) 0 4px;
}
.stage > .set-intro { margin: auto 0; }
.q-wrap { display: flex; flex-direction: column; gap: 16px; }

/* ---------- paper cards ---------- */
.paper {
  position: relative; color: var(--paper-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 40%),
    var(--paper);
  border-radius: 6px 18px 8px 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 0 0 1px rgba(80, 60, 20, 0.08),
    0 24px 50px rgba(0, 0, 0, 0.42),
    0 6px 14px rgba(0, 0, 0, 0.25);
  padding: 22px 20px 20px;
}
.paper::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.2 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23p)'/%3E%3C/svg%3E");
}
.paper .corner-tag {
  position: absolute; top: 12px; left: 16px; font-size: 13px; color: var(--paper-mute); letter-spacing: 0.08em;
}
.paper .say {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--paper-mute); z-index: 2;
  transition: background 0.2s, color 0.2s;
}
.paper .say:hover { background: rgba(0, 0, 0, 0.06); color: var(--paper-ink); }
.paper .say svg { width: 20px; height: 20px; }
.paper .say.speaking { color: var(--jade-deep); }
.paper .say[hidden] { display: none; }
.mark { position: absolute; width: 58px; height: 58px; pointer-events: none; z-index: 3; }
.mark path { fill: none; stroke: var(--cinnabar); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; filter: url(#brush-rough); }
.mark.draw path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: drawStroke 0.38s var(--ease-out) forwards; }
.mark.draw path:nth-child(2) { animation-delay: 0.16s; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }

.word-card { text-align: center; padding-top: 46px; padding-bottom: 22px; }
.pinyin { font-size: 18px; color: #3b6fb0; letter-spacing: 0.06em; margin-bottom: 10px; min-height: 1em; font-family: var(--font-kai); }
.word-card .tzg-row .tzg { --s: clamp(58px, 17vw, 76px); }
.word-card .word-plain { font-size: clamp(30px, 8vw, 40px); font-weight: 700; line-height: 1.3; }
.stars { margin-top: 12px; display: flex; justify-content: center; gap: 4px; }
.stars svg { width: 18px; height: 18px; }
.stars .on { fill: var(--gamboge); }
.stars .off { fill: rgba(31, 37, 51, 0.14); }

.sentence {
  font-size: clamp(21px, 5.6vw, 26px); line-height: 1.85; font-weight: 400; text-align: left;
  letter-spacing: 0.02em; padding-top: 16px;
}
.sentence .blank {
  display: inline-flex; vertical-align: middle; margin: 0 3px; position: relative; top: -2px;
}
.blank .tzg { --s: 1.5em; font-size: 1em; color: var(--jade-deep); }
.blank .tzg.empty { background-color: #fffdf6; }
.blank .tzg.active { box-shadow: 0 0 0 3px rgba(245, 179, 36, 0.55); animation: blankBreath 1.4s ease-in-out infinite; }
@keyframes blankBreath { 50% { box-shadow: 0 0 0 5px rgba(245, 179, 36, 0.25); } }
.blank .tzg.bad { color: var(--cinnabar); }
.blank .tzg.bad::after {
  content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 3px; background: var(--cinnabar);
  transform: rotate(-18deg); border-radius: 2px;
}
.blank .fix { font-size: 0.8em; color: var(--jade-deep); font-weight: 700; margin-left: 4px; align-self: center; }
.slotword {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  min-width: 4.2em; height: 1.55em; margin: 0 4px; padding: 0 8px; position: relative; top: -2px;
  border-bottom: 3px solid var(--grid); background: rgba(214, 88, 64, 0.06);
  border-radius: 6px 6px 0 0; color: var(--jade-deep); font-weight: 700;
}
.slotword.active { background: rgba(245, 179, 36, 0.16); border-color: var(--gamboge); }
.slotword.bad { color: var(--cinnabar); text-decoration: line-through; text-decoration-thickness: 3px; }

/* ---------- options ---------- */
.opts { display: grid; gap: 10px; }
.opts.list { grid-template-columns: 1fr; }
.opts.grid { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; min-height: 58px; padding: 12px 16px 12px 44px;
  border-radius: 14px; text-align: left;
  background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: var(--text); font-size: 18px; line-height: 1.4;
  transition: transform 0.14s var(--ease-out), background 0.2s, border-color 0.2s, opacity 0.3s;
}
.opts.grid .opt { padding-left: 16px; text-align: center; font-size: 22px; font-weight: 700; min-height: 64px; }
.opt .key {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  font-size: 13px; color: var(--mist); border: 1px solid var(--ink-line);
}
.opts.grid .opt .key { top: 8px; left: 8px; transform: none; width: 18px; height: 18px; font-size: 11px; }
.opt:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.opt:active { transform: scale(0.97); }
.opt.ok { background: rgba(34, 177, 132, 0.26); background: color-mix(in srgb, var(--jade) 26%, transparent); border-color: var(--jade); color: #d9fff0; }
.opt.bad { background: rgba(227, 67, 43, 0.24); background: color-mix(in srgb, var(--cinnabar) 24%, transparent); border-color: var(--cinnabar); color: #ffe0da; animation: nope 0.36s; }
.opt.dim { opacity: 0.35; }
@keyframes nope { 20% { transform: translateX(-7px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }

/* 无极 tiles — each option is a practice square */
.tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.tile {
  position: relative; padding: 0; border-radius: 4px;
  transition: transform 0.14s var(--ease-out), filter 0.2s, opacity 0.3s;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 14px 26px rgba(0, 0, 0, 0.3);
}
.tile .tzg { --s: clamp(66px, 19vw, 84px); }
.tile .tzg-row .tzg { --s: clamp(46px, 13vw, 58px); }
.tiles.n5 .tile .tzg { --s: clamp(54px, 15.5vw, 72px); }
.tile .tp {
  position: absolute; left: 0; right: 0; bottom: -24px; text-align: center;
  font-size: 13px; color: var(--mist); opacity: 0; transition: opacity 0.3s;
}
.tiles.reveal .tile .tp { opacity: 1; }
.tiles.reveal { margin-bottom: 18px; }
.tile .key {
  position: absolute; top: -8px; left: -8px; z-index: 2; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; background: var(--ink-2); color: var(--mist); border: 1px solid var(--ink-line);
}
.tile:hover { transform: translateY(-3px); }
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 8px 16px rgba(0, 0, 0, 0.3); }
.tile.ok .tzg { background-color: #e8fbf2; border-color: var(--jade); color: var(--jade-deep); }
.tile.ok { box-shadow: 0 0 0 4px rgba(34, 177, 132, 0.45), 0 14px 26px rgba(0, 0, 0, 0.3); }
.tile.bad .tzg { background-color: #fff0ec; border-color: var(--cinnabar); color: var(--cinnabar); }
.tile.bad { animation: nope 0.36s; }
.tile.dim { opacity: 0.35; }
.tile:disabled { cursor: default; }

/* explanation strip */
.explain {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start;
  margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed rgba(107, 101, 82, 0.35);
  font-size: 17px; line-height: 1.55; color: var(--paper-ink);
}
.explain .big {
  grid-row: span 2; font-family: var(--font-kai); font-weight: 700; font-size: 34px; line-height: 1;
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 10px;
  background: #e8fbf2; color: var(--jade-deep); border: 2px solid var(--jade);
}
.explain .big.long { width: auto; padding: 0 10px; font-size: 22px; }
.explain .rule { font-size: 15px; color: var(--paper-mute); }
.explain .rule b { color: var(--paper-ink); }
.explain.bad .big { background: #fff0ec; color: var(--cinnabar); border-color: var(--cinnabar); }
.next-row { display: flex; gap: 10px; margin-top: 14px; }
.next-row .btn { min-height: 52px; font-size: 18px; }

/* set intro */
.set-intro { text-align: center; padding: 10px 0; }
.set-intro .no { font-size: 16px; color: var(--mist); letter-spacing: 0.2em; }
.set-intro .cat { font-family: var(--font-brush); font-size: 44px; color: var(--gold); line-height: 1.1; margin: 4px 0 18px; }
.set-intro .tiles { pointer-events: none; }
.set-intro .goal { margin-top: 22px; font-size: 18px; color: var(--text); }
.set-intro .goal small { display: block; font-size: 14px; color: var(--mist); margin-top: 4px; }

/* spot the wrong character */
.spot {
  font-size: clamp(24px, 6.4vw, 30px); line-height: 1.9; padding-top: 16px;
  display: flex; flex-wrap: wrap; gap: 2px 0;
}
.spot .ch {
  position: relative; min-width: 1.15em; padding: 0 1px; border-radius: 8px; text-align: center;
  color: var(--paper-ink); transition: background 0.15s, color 0.2s;
}
.spot button.ch:hover { background: rgba(245, 179, 36, 0.22); }
.spot .ch.found { color: var(--cinnabar); }
.spot .ch.found::before {
  content: ''; position: absolute; inset: 2px -3px; border: 3px solid var(--cinnabar); border-radius: 50%;
  animation: ringIn 0.35s var(--ease-out);
}
.spot .ch.fixed { color: var(--jade-deep); font-weight: 700; }
.spot .ch.miss { background: rgba(227, 67, 43, 0.14); animation: nope 0.36s; }
@keyframes ringIn { from { transform: scale(1.6); opacity: 0; } }
.prompt-line { font-size: 15px; color: var(--mist); text-align: center; }

/* ---------- passage ---------- */
.passage { max-height: 52vh; overflow-y: auto; padding-top: 18px; }
.passage h3 { font-family: var(--font-brush); font-weight: 400; font-size: 30px; text-align: center; margin-bottom: 8px; color: var(--paper-ink); }
.passage .text { font-size: 19px; line-height: 2; text-indent: 2em; }
.pslot {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: baseline;
  min-width: 4.4em; min-height: 1.6em; padding: 0 6px; margin: 0 3px;
  border-bottom: 3px solid var(--grid); background: rgba(214, 88, 64, 0.06); border-radius: 6px 6px 0 0;
  font-weight: 700; color: var(--jade-deep); text-indent: 0; line-height: 1.4;
  transition: background 0.2s, border-color 0.2s;
}
.pslot .n { font-size: 12px; color: var(--paper-mute); font-weight: 400; margin-right: 4px; }
.pslot.active { background: rgba(245, 179, 36, 0.2); border-color: var(--gamboge); }
.pslot.over { background: rgba(245, 179, 36, 0.35); }
.pslot.ok { background: #e8fbf2; border-color: var(--jade); }
.pslot.bad { background: #fff0ec; border-color: var(--cinnabar); color: var(--cinnabar); }
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bchip {
  padding: 9px 14px; border-radius: 12px; font-size: 18px; font-weight: 700;
  background: var(--paper); color: var(--paper-ink); touch-action: none;
  box-shadow: 0 4px 0 #cfc4a8, 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.14s, opacity 0.2s;
}
.bchip:active { transform: translateY(3px); box-shadow: 0 1px 0 #cfc4a8; }
.bchip.used { opacity: 0.22; pointer-events: none; }
.bchip.lift { opacity: 0.4; }
.drag-ghost {
  position: fixed; z-index: 80; pointer-events: none; left: 0; top: 0;
  padding: 9px 14px; border-radius: 12px; font-size: 18px; font-weight: 700;
  background: var(--gamboge); color: #2a1d02; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- FIX-IT (订正) ---------- */
.fix-head { text-align: center; margin: 4px 0 14px; }
.fix-head .t { font-family: var(--font-brush); font-size: 46px; line-height: 1; color: var(--jade); }
.fix-head .s { color: var(--mist); font-size: 15px; margin-top: 6px; }
.fix-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.fix-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.fix-dots i.done { background: var(--jade); }
.fix-dots i.now { background: var(--gamboge); box-shadow: 0 0 10px var(--gamboge); }
.fix-body { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.study .mean { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(34, 177, 132, 0.1); border: 1px solid rgba(34, 177, 132, 0.35); font-size: 19px; font-weight: 700; color: var(--jade-deep); text-align: left; }
.study .mean small { display: block; font-size: 13px; font-weight: 400; color: var(--paper-mute); margin-bottom: 2px; }
.study .ex { margin-top: 12px; font-size: 18px; line-height: 1.7; text-align: left; }
.study .ex b, .lib-ex b, .rv-ctx b { color: #b8321f; font-weight: 700; background: rgba(227, 67, 43, 0.1); padding: 0 3px; border-radius: 4px; }
.rules { display: grid; gap: 8px; margin-top: 6px; text-align: left; }
.rule-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 8px 10px; border-radius: 12px; }
.rule-row .tzg { --s: 46px; grid-row: span 2; }
.rule-row .tzg-row .tzg { --s: 38px; }
.rule-row .w-p { font-size: 13px; color: #3b6fb0; }
.rule-row .w-r { font-size: 17px; font-weight: 700; line-height: 1.35; }
.rule-row .w-eg { grid-column: 2; font-size: 14px; color: var(--paper-mute); }
.rule-row.hl { background: rgba(245, 179, 36, 0.2); box-shadow: inset 0 0 0 2px rgba(245, 179, 36, 0.7); }
.tipline { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--paper-2); font-size: 16px; line-height: 1.55; text-align: left; }
.tipline::before { content: '口诀'; font-size: 12px; color: #fff; background: var(--cinnabar); border-radius: 4px; padding: 1px 6px; margin-right: 8px; vertical-align: 2px; }
.fix-msg { text-align: center; min-height: 24px; font-size: 17px; font-weight: 700; }
.fix-msg.ok { color: var(--jade); }
.fix-msg.bad { color: #ff8a73; }
.fix-foot { padding-top: 10px; }
.fix-done { text-align: center; }
.fix-done .t { font-family: var(--font-brush); font-size: 56px; color: var(--jade); }
.fix-done .s { font-size: 20px; color: var(--gamboge); margin-top: 4px; }

/* ---------- RESULTS ---------- */
.res-head { text-align: center; margin-top: 6px; }
.res-title { font-family: var(--font-brush); font-size: 64px; line-height: 1; }
.res-sub { color: var(--mist); font-size: 16px; margin-top: 6px; }
.newbest { display: inline-block; margin-bottom: 8px; padding: 4px 14px; border-radius: 6px; background: var(--cinnabar); color: #fff; font-size: 15px; letter-spacing: 0.1em; filter: url(#seal-soft); transform: rotate(-3deg); }
.newbest[hidden] { display: none; }
.res-score { text-align: center; margin: 14px 0 16px; }
.res-score .n { font-size: 68px; font-weight: 700; line-height: 1; color: var(--gamboge); font-variant-numeric: tabular-nums; text-shadow: 0 8px 30px rgba(245, 179, 36, 0.28); }
.res-score .l { color: var(--mist); font-size: 14px; margin-top: 4px; }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.res-stat { text-align: center; padding: 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--ink-line); }
.res-stat .v { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-stat .l { font-size: 13px; color: var(--mist); margin-top: 2px; }
.res-block { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--ink-line); }
.res-block h4 { font-size: 15px; font-weight: 400; color: var(--mist); margin-bottom: 10px; }
.seal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seal-sm {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px;
  background: var(--cinnabar); color: var(--paper); font-family: var(--font-brush); font-size: 30px; line-height: 1;
  box-shadow: inset 0 0 0 3px var(--cinnabar), inset 0 0 0 4.5px rgba(255, 247, 234, 0.85);
  filter: url(#seal-soft); transform: rotate(-6deg);
}
.seal-sm:nth-child(even) { transform: rotate(5deg); }
.mastered-words { font-size: 18px; line-height: 1.8; }
.mastered-words span { display: inline-block; margin: 0 10px 0 0; }
.mastered-words span::after { content: ' ★★★'; color: var(--gamboge); font-size: 13px; }
.radar svg { display: block; width: 100%; max-width: 420px; margin: 0 auto; }
.radar-sub { text-align: center; font-size: 14px; color: var(--mist); margin-top: 4px; }
.xp-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--mist); margin-bottom: 8px; }
.xp-line b { color: var(--violet); }
.xp-bar { --c: var(--violet); height: 10px; border-radius: 5px; }
.res-actions { display: grid; gap: 10px; margin-top: 18px; }

/* ---------- REVIEW ---------- */
.rv-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.rv-card { padding: 14px 16px 14px; }
.rv-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rv-card .w { font-size: 26px; font-weight: 700; }
.rv-card .src { font-size: 12px; color: var(--paper-mute); border: 1px solid rgba(107, 101, 82, 0.35); border-radius: 999px; padding: 1px 8px; flex-shrink: 0; }
.rv-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 16px; line-height: 1.45; margin-top: 6px; }
.rv-row .i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; margin-top: 2px; }
.rv-row.ok .i { background: var(--jade); }
.rv-row.bad .i { background: var(--cinnabar); }
.rv-row.bad .t { color: var(--paper-mute); text-decoration: line-through; }
.rv-ctx { margin-top: 10px; padding-top: 10px; border-top: 1.5px dashed rgba(107, 101, 82, 0.3); font-size: 17px; line-height: 1.7; }
.rv-empty { text-align: center; color: var(--mist); padding: 40px 10px; font-size: 18px; }

/* ---------- LIBRARY ---------- */
.lib-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.lib-list[hidden] { display: none; }
.lib-search {
  display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 0 14px;
  height: 50px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ink-line);
  color: var(--mist);
}
.lib-search:focus-within { border-color: var(--lvl); background: rgba(255, 255, 255, 0.09); }
.lib-search svg { width: 20px; height: 20px; flex-shrink: 0; }
.lib-search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none;
  font: inherit; font-size: 18px; color: var(--text); -webkit-user-select: text; user-select: text;
}
.lib-search input::placeholder { color: var(--mist); opacity: 0.8; }
.cat-row .hint.note { color: #f4e6c6; color: color-mix(in srgb, var(--lvl) 60%, white); }
.lib-group { border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--ink-line); overflow: hidden; }
.lib-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; text-align: left; }
.lib-head .name { font-size: 19px; font-weight: 700; }
.lib-head .count { font-size: 14px; color: var(--mist); display: flex; align-items: center; gap: 8px; }
.lib-head .arrow { transition: transform 0.25s; color: var(--mist); }
.lib-group.open > .lib-head .arrow { transform: rotate(180deg); }
.lib-items { display: none; padding: 0 10px 12px; flex-direction: column; gap: 8px; }
.lib-group.open > .lib-items { display: flex; }
.lib-item { border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.lib-item > button.row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; text-align: left; }
.lib-item .lw { font-size: 20px; font-weight: 700; }
.lib-item .lp { font-size: 13px; color: var(--mist); margin-left: 8px; font-weight: 400; }
.lib-item .stars { margin: 0; }
.lib-item .stars .off { fill: rgba(255, 255, 255, 0.14); }
.lib-item .stars svg { width: 14px; height: 14px; }
.lib-item.mastered { box-shadow: inset 0 0 0 1px rgba(245, 179, 36, 0.4); }
.lib-detail { display: none; padding: 4px 12px 14px; }
.lib-item.open .lib-detail { display: block; }
.lib-detail .paper { padding: 14px 14px 14px; }
.lib-def { font-size: 17px; font-weight: 700; color: var(--jade-deep); }
.lib-ex { font-size: 17px; line-height: 1.7; margin-top: 6px; display: flex; gap: 8px; align-items: flex-start; }
.lib-ex .say-sm { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--paper-mute); margin-top: 1px; }
.lib-ex .say-sm:hover { background: rgba(0, 0, 0, 0.06); }
.lib-ex .say-sm svg { width: 17px; height: 17px; }
.set-mem { display: inline-flex; gap: 4px; }

/* ---------- SHEET (settings / pause) ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 70; background: rgba(5, 8, 14, 0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-back[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 520px; margin: 0 10px calc(10px + var(--safe-b));
  padding: 20px 18px 18px; border-radius: 24px;
  background: linear-gradient(180deg, #1b2842, #131d31);
  border: 1px solid var(--ink-line); box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
}
.sheet h3 { font-family: var(--font-brush); font-weight: 400; font-size: 40px; line-height: 1; text-align: center; margin-bottom: 14px; }
.sheet .opts-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--ink-line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .tl { font-size: 18px; }
.toggle-row .tl small { display: block; font-size: 13px; color: var(--mist); }
.switch { position: relative; width: 54px; height: 32px; flex-shrink: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease-out); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.switch[aria-checked="true"] { background: var(--jade); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.sheet .stack { gap: 10px; }

/* ---------- FX ---------- */
.particle { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform, opacity; }
.floaty {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform, opacity;
  font-size: 30px; font-weight: 700; color: var(--gamboge);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 22px rgba(245, 179, 36, 0.5);
}
.floaty.bad { color: #ff8a73; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.seal {
  position: absolute; left: 50%; top: 40%;
  width: 136px; height: 136px; margin: -68px 0 0 -68px;
  display: grid; place-items: center;
  background: var(--cinnabar); color: #fff7ea; border-radius: 16px;
  box-shadow: inset 0 0 0 7px var(--cinnabar), inset 0 0 0 10px rgba(255, 247, 234, 0.9);
  font-family: var(--font-brush); font-size: 96px; line-height: 1;
  filter: url(#seal-rough);
}
.seal-cap {
  position: absolute; left: 50%; top: calc(40% + 84px); transform: translateX(-50%);
  white-space: nowrap; font-family: var(--font-kai); font-size: 20px; font-weight: 700; color: var(--text);
  padding: 4px 14px; border-radius: 999px; background: rgba(12, 19, 32, 0.72);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.seal-wrap { position: absolute; inset: 0; }

.toast {
  position: fixed; left: 50%; top: calc(16px + var(--safe-t)); z-index: 90; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; font-size: 16px;
  background: var(--ink-2); border: 1px solid var(--ink-line); color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); pointer-events: none;
  animation: toastIn 2.4s var(--ease-out) forwards;
}
@keyframes toastIn { 0% { opacity: 0; transform: translate(-50%, -12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 380px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .levels { gap: 8px; }
  .lvl-card { padding: 10px; }
  .lvl-card .num { font-size: 48px; height: 48px; }
  .lvl-card .grade { font-size: 16px; }
  .paper { padding: 18px 16px 16px; }
  .opt { font-size: 17px; }
}
@media (min-width: 700px) {
  .screen { padding-left: 24px; padding-right: 24px; }
}
@media (max-height: 700px) {
  .word-card { padding-top: 26px; padding-bottom: 16px; }
  .stage { padding-top: 10px; }
  .q-wrap { gap: 12px; }
  .passage { max-height: 44vh; }
}

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

/* ---------- 短文找错 ---------- */
.cat-row.dw { border-style: dashed; }
.dw-paper { padding-top: 34px; }
.dw-paper h3 { font-family: var(--font-brush); font-weight: 400; font-size: 30px; text-align: center; margin-bottom: 6px; color: var(--paper-ink); }
.dw-text { font-size: clamp(20px, 5.3vw, 23px); line-height: 2.05; letter-spacing: 0.02em; text-indent: 2em; }
.dwc { position: relative; display: inline; cursor: pointer; border-radius: 6px; transition: background 0.15s, color 0.2s; }
.dwc:hover { background: rgba(245, 179, 36, 0.22); }
.dwc.miss { background: rgba(227, 67, 43, 0.18); animation: nope 0.36s; }
.dwc.missed { background: none; text-decoration: underline dotted rgba(107, 101, 82, 0.5); text-underline-offset: 5px; }
.dwerr { position: relative; white-space: nowrap; }
.dwerr.found .dww, .dwerr.revealed .dww { color: var(--cinnabar); text-decoration: line-through; text-decoration-thickness: 2px; }
.dwerr.found .dww { border: 2.5px solid var(--cinnabar); border-radius: 50%; padding: 0 2px; animation: ringIn 0.35s var(--ease-out); }
.dwerr.revealed .dww { background: rgba(227, 67, 43, 0.12); border-radius: 6px; }
.dwerr .dwa { color: var(--jade-deep); font-weight: 700; font-size: 0.82em; margin-left: 2px; }
.dwerr.revealed .dwa { color: #b8321f; }
.dw-notes { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.dw-notes li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--ink-line); font-size: 16px; }
.dw-notes li.ok { border-color: rgba(34, 177, 132, 0.45); }
.dw-notes li.bad { border-color: rgba(227, 67, 43, 0.5); }
.dw-notes .pair { font-size: 19px; white-space: nowrap; }
.dw-notes .pair s { color: #ff8a73; }
.dw-notes .pair b { color: #7ee2bd; }
.dw-notes .why { color: var(--mist); line-height: 1.45; }
