/* ---------- 🖌️ The Writing Desk, shared (docs/DESIGN.md) ----------
   One token set for every kid screen (Home, menus, sheets), so a color theme later changes them all at once,
   and a few shared pieces the menu screens build from: the soft round header button, the brush title,
   paper cards, the red main button, chips, a segmented switch, a 44px checkbox.
   Screens restyled so far (Justin said yes to the canvas https://claude.ai/artifact/9Pg9D2pE8j48rFVyVpsbeA):
   their own CSS uses these names; nothing here changes a screen that doesn't opt in. */
:root {
  --a-bg: #f8f3ea; --a-fg: #1d2233; --a-mute: #7b7266; --a-title: #7b7266; --a-card: #fffdf8; --a-today: #fffdf8;
  --a-grid: rgba(224, 54, 44, .07); --a-go: #e0362c; --a-go-fg: #fff; --a-go-sh: #9e2219; --a-xp: #e0362c;
  --a-word-bg: #f6efe2; --a-env-bg: #fbf3e6; --a-bar-bg: #ece2d0; --a-test-bg: #fff0ec; --a-test-fg: #b1281f;
  --a-well: #f1e8d8; --a-dash: #d8c9ae; --a-ok: #2b8a57;
  --a-sh: 0 1px 0 rgba(29, 34, 51, .05), 0 12px 26px -14px rgba(80, 50, 20, .38);
  --a-sh-sm: 0 1px 0 rgba(29, 34, 51, .05), 0 6px 14px -10px rgba(80, 50, 20, .5);
  --a-sh-big: 0 18px 40px -18px rgba(80, 50, 20, .5);
  --c-write: #5a48d6; --c-dict: #d9437a; --c-words: #e89a1c; --c-inv: #1d7fc0; --c-duel: linear-gradient(105deg, #e2553f 50%, #2f74e8 50%);
  --c-lab: #8d45cf; --c-paws: #ec7d43; --c-glab: #353b56; --c-spin: #0e94a0;
  --f-kai: "Kaiti SC", "STKaiti", "KaiTi", "Kai", serif;   /* characters a kid reads or writes */
  --f-brush: "Ma Shan Zheng", "Kaiti SC", "STKaiti", "KaiTi", serif;   /* decoration only: title glyphs */
  --f-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --f-body: "Nunito", -apple-system, "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

/* a desk screen: paper with the faint red grid, ink text */
.desk-screen {
  background-color: var(--a-bg);
  background-image: linear-gradient(var(--a-grid) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--a-grid) 1.5px, transparent 1.5px);
  background-size: 84px 84px; background-attachment: local;
  color: var(--a-fg); font-family: var(--f-body);
}

/* the header: a soft round Home button and a brush title (排 Leaderboard) */
.desk-screen .game-head .icon-btn, .dk-round {
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: var(--a-card); color: var(--a-fg); box-shadow: var(--a-sh); cursor: pointer; font-size: 22px;
  transition: transform .12s ease-out;
}
.desk-screen .game-head .icon-btn:active, .dk-round:active { transform: translateY(2px); box-shadow: var(--a-sh-sm); }
.desk-screen .game-head .icon-btn svg.ic, .dk-round svg { width: 26px; height: 26px; }
.desk-screen .screen-title { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 400; color: var(--a-fg); }
.dk-hz { font-family: var(--f-brush); font-weight: 400; color: var(--a-go); line-height: 1; font-size: 1em; }

/* section label: 字 MY WORDS */
.dk-label { display: flex; align-items: center; gap: 10px; margin: 0; }
.dk-label .dk-hz { font-size: 26px; }
.dk-label b, .dk-label h2 { margin: 0; font: 900 13px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--a-title); }

/* paper card */
.dk-card { background: var(--a-card); border: 0; border-radius: 20px; box-shadow: var(--a-sh); }

/* the one main button: seal red with its own hard drop */
.dk-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px;
  border: 0; border-radius: 16px; background: var(--a-go); color: var(--a-go-fg); cursor: pointer;
  font: 400 24px/1 var(--f-display); letter-spacing: .4px; box-shadow: 0 6px 0 var(--a-go-sh);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.dk-go:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--a-go-sh); }
.dk-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border: 0; border-radius: 16px; background: var(--a-well); color: var(--a-fg); cursor: pointer; font: 900 18px/1 var(--f-body);
}
.dk-ghost:active { transform: translateY(2px); }

/* chips (one row) and a segmented switch */
.dk-chips { display: flex; gap: 8px; }
.dk-chip {
  flex: none; min-height: 44px; padding: 0 15px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--a-card); color: #4c4a57; box-shadow: var(--a-sh-sm); font: 900 15.5px/1 var(--f-body); white-space: nowrap;
}
.dk-chip.on, .dk-chip[aria-selected="true"] { background: var(--a-fg); color: #fff; }
.dk-seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--a-card); box-shadow: var(--a-sh-sm); }
.dk-seg > button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: #6f675c; font: 900 16px/1 var(--f-body); cursor: pointer; white-space: nowrap; }
.dk-seg > button.on, .dk-seg > button[aria-selected="true"] { background: var(--a-fg); color: #fff; }
.dk-seg.sunk { background: var(--a-well); box-shadow: none; }

/* a 44px checkbox of its own (so ticking never also opens the thing it sits on) */
.dk-check { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; display: grid; place-items: center; cursor: pointer; background: #fff; box-shadow: inset 0 0 0 3px var(--a-dash); color: #fff; font: 900 24px/1 var(--f-body); }
.dk-check[aria-checked="true"], .dk-check.on { background: var(--a-ok); box-shadow: none; }

/* bars use the Brain level color */
.dk-bar { height: 12px; border-radius: 99px; background: var(--a-bar-bg); overflow: hidden; }
.dk-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--a-xp); }

/* a close ✕ on a sheet: 46px, soft */
.dk-close { width: 46px; height: 46px; }

@media (prefers-reduced-motion: reduce) { .dk-go, .dk-round, .desk-screen .game-head .icon-btn { transition: none; } }
