/* Doodle Dash — a school notebook on a desk: ruled paper, a red margin,
   masking tape, crayon colours. Everything procedural; no images. */

:root {
  --desk: #2f3a4a;
  --desk-2: #263040;
  --paper: #fffdf6;
  --rule: rgba(74, 132, 196, .22);
  --margin: rgba(222, 74, 74, .45);
  --ink: #23262e;
  --ink-soft: #5b6170;
  --accent: #ff7a3d;
  --accent-2: #2e86de;
  --good: #2f9e5b;
  --warn: #d7263d;
  --tape: rgba(255, 228, 140, .78);
  --vvh: 100dvh;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(255, 255, 255, .06), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 140px),
    var(--desk);
  color: var(--ink);
  font-family: "Comic Neue", "Segoe Print", "Chalkboard SE", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }

/* ── ruled paper, reused by the card and the side panel ─────────────── */
.ruled {
  background:
    linear-gradient(90deg, transparent 38px, var(--margin) 38px 40px, transparent 40px),
    repeating-linear-gradient(180deg, transparent 0 25px, var(--rule) 25px 26px),
    var(--paper);
}

/* ── game layout ────────────────────────────────────────────────────── */
#game {
  position: fixed; left: 0; right: 0; top: 0;
  height: var(--vvh);
  display: flex; flex-direction: column;
  padding: calc(6px + env(safe-area-inset-top)) 10px calc(6px + env(safe-area-inset-bottom));
  gap: 8px;
}
.topbar {
  flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: var(--paper); border-radius: 12px; padding: 6px 12px;
  box-shadow: 0 3px 0 rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.25);
}
.tb-round { font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
.tb-round b { color: var(--ink); font-size: 18px; }
.tb-word {
  justify-self: center; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 4px 14px; min-height: 34px; align-items: center;
}
.tb-word .w { display: inline-flex; gap: 5px; }
.tb-word .ch {
  width: 22px; text-align: center; font-size: 24px; font-weight: 700; line-height: 1;
  border-bottom: 3px solid var(--ink); padding-bottom: 2px; color: var(--ink);
  text-transform: uppercase;
}
.tb-word .ch.sym { border-bottom-color: transparent; }
.tb-word .ch.known { color: var(--good); }
.tb-word .msg { font-size: 18px; color: var(--ink-soft); }
.tb-word .lens { font-size: 13px; color: var(--ink-soft); margin-left: 4px; align-self: flex-end; }
.tb-word .diff {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; color: #fff;
  align-self: center; letter-spacing: .04em; text-transform: uppercase;
}
.diff.easy { background: #3bb273; } .diff.medium { background: #ff8c42; } .diff.hard { background: #d7263d; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-timer {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: var(--ink);
  background: conic-gradient(var(--accent) var(--pct, 100%), #e8e3d6 0);
  position: relative;
}
.tb-timer::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.tb-timer span { position: relative; }
.tb-timer.warn { animation: shake .5s ease-in-out infinite; }
.tb-timer.warn span { color: var(--warn); }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.tb-btn {
  border: 2px solid var(--ink); background: #fff; border-radius: 10px; padding: 6px 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}

.stage { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; }
.sheet-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.drawer-banner {
  flex: none; font-size: 15px; color: #f3f0e6; min-height: 20px; text-align: center;
}
.drawer-banner .who { font-weight: 800; }
.sheet {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
  container-type: size;
}
#board {
  display: block; background: #fff; border-radius: 4px;
  width: min(100cqw, calc(100cqh * 4 / 3)); height: auto; aspect-ratio: 4 / 3;
  box-shadow: 0 2px 0 rgba(0,0,0,.1), 0 14px 30px rgba(0,0,0,.35);
  touch-action: none; cursor: crosshair;
}
#board.no-draw { cursor: default; }
.tape {
  position: absolute; top: 0; width: 90px; height: 22px; background: var(--tape);
  box-shadow: 0 1px 2px rgba(0,0,0,.15); pointer-events: none; z-index: 2;
}
.tape-l { left: 50%; transform: translate(-50%, -8px) rotate(-3deg); }
.tape-r { display: none; }
.sheet-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 3;
}
.sheet-overlay .panel {
  pointer-events: auto; background: rgba(255, 253, 246, .97); border-radius: 14px;
  padding: 16px 20px; text-align: center; max-width: min(92%, 520px);
  box-shadow: 0 3px 0 rgba(0,0,0,.18), 0 16px 40px rgba(0,0,0,.3);
  border: 2px solid var(--ink);
}
.panel h3 { margin: 0 0 10px; font-size: 22px; }
.panel .sub { color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.choice {
  border: 2px solid var(--ink); background: #fff; border-radius: 12px; padding: 10px 16px;
  font-size: 19px; font-weight: 700; cursor: pointer; min-width: 120px;
  box-shadow: 0 3px 0 var(--ink); transition: transform .08s;
}
.choice:hover { transform: translateY(-2px); }
.choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.choice .diff { display: block; margin: 6px auto 0; width: max-content; font-size: 11px; padding: 2px 8px; border-radius: 999px; color: #fff; }
.gains { list-style: none; padding: 0; margin: 8px 0 0; font-size: 15px; text-align: left; }
.gains li { display: flex; justify-content: space-between; gap: 18px; padding: 2px 0; }
.gains .plus { color: var(--good); font-weight: 800; }
.gains .zero { color: var(--ink-soft); }
.reveal-word { font-size: 30px; font-weight: 800; color: var(--accent-2); }

/* tools */
.toolbar {
  flex: none; width: min(100%, 860px); background: var(--paper); border-radius: 12px;
  padding: 6px 8px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
}
.tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool {
  width: 40px; height: 40px; border-radius: 10px; border: 2px solid #c9c2b0; background: #fff;
  font-size: 19px; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.tool.on { border-color: var(--ink); background: #fff3cf; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.tool.danger:hover { border-color: var(--warn); }
.tb-sep { width: 1px; height: 28px; background: #d9d2c0; margin: 0 2px; }
.sizes { display: flex; gap: 4px; }
.size { width: 40px; height: 40px; border-radius: 10px; border: 2px solid #c9c2b0; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.size.on { border-color: var(--ink); background: #fff3cf; }
.size i { display: block; border-radius: 50%; background: var(--ink); }
.palette { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; }
.swatch {
  height: 26px; border-radius: 7px; border: 2px solid rgba(0,0,0,.18); cursor: pointer; padding: 0;
}
.swatch.on { outline: 3px solid var(--ink); outline-offset: 1px; }

/* side: scores, feed, guess */
.side {
  min-height: 0; display: flex; flex-direction: column; gap: 8px;
  background: var(--paper); border-radius: 12px; padding: 8px;
  box-shadow: 0 3px 0 rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.25);
}
.scores { flex: none; display: flex; flex-direction: column; gap: 4px; max-height: 40%; overflow-y: auto; }
.score-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 9px; background: #f3efe3; font-size: 15px;
}
.score-row .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; font-weight: 800; }
.score-row .nm-wrap { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.score-row .pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.score-row.drawing { background: #fff1c2; }
.score-row.solved { background: #d9f5df; }
.score-row.me { outline: 2px dashed rgba(35, 38, 46, .35); }
.score-row.gone { opacity: .45; }
.score-row .mark { margin-left: 4px; }
.vote-btn {
  flex: none; border: 2px dashed #c4593e; color: #a2391f; background: #fff7f2; border-radius: 10px;
  padding: 6px; font-size: 13px; cursor: pointer;
}
.vote-btn:disabled { opacity: .55; cursor: default; }
.feed {
  flex: 1 1 auto; min-height: 60px; overflow-y: auto; font-size: 14.5px; line-height: 1.35;
  padding: 2px 4px; display: flex; flex-direction: column; gap: 2px;
}
.line { padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.line .who { font-weight: 800; }
.line.solved { background: #d9f5df; color: #1f6b3d; font-weight: 700; }
.line.mine-solved { background: #2f9e5b; color: #fff; font-weight: 800; }
.line.close { background: #fff1c2; color: #7a5a00; }
.line.knowers { background: #e9f3ff; color: #1c4f8c; }
.line.system { color: var(--ink-soft); font-style: italic; }
.line.vote { color: #a2391f; }
.line.turn { color: var(--accent-2); font-weight: 700; }
.guess { flex: none; display: flex; gap: 6px; }
.guess input {
  flex: 1 1 auto; min-width: 0; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 2px solid var(--ink); background: #fff; outline: none; font-family: inherit;
}
.guess input:focus { border-color: var(--accent-2); }
.guess button {
  flex: none; width: 46px; border-radius: 10px; border: 2px solid var(--ink); background: var(--accent);
  color: #fff; font-size: 18px; cursor: pointer;
}

.toast-box {
  position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 20; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 14px;
  animation: pop-in .18s ease-out, fade-out .4s ease-in 2.4s forwards;
}
@keyframes pop-in { from { transform: scale(.8); opacity: 0; } }
@keyframes fade-out { to { opacity: 0; transform: translateY(-6px); } }

.spectator-flag {
  position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); left: 12px; z-index: 9;
  padding: 4px 12px; background: var(--ink); color: #fff; border-radius: 999px; font-size: 12px;
}

/* audio strip in the top bar: tucked behind a small toggle */
.hud-gear { position: relative; }
.hud-gear summary {
  list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: #fff; border: 2px solid var(--ink);
}
.hud-gear summary::-webkit-details-marker { display: none; }
/* site_audio.css pins #hudAudio fixed bottom-centre; inside the gear it sits
   under the button instead, so restate ALL four placement properties. */
#hudAudio {
  position: absolute; top: 44px; right: 0; left: auto; bottom: auto; transform: none;
  z-index: 30; width: max-content; max-width: 92vw;
}
/* web/style.css pins .volume-slider position:fixed top:12px — undo it here
   (CLAUDE.md item 5). */
.volume-slider { position: static !important; top: auto !important; }

/* ── lobby card ─────────────────────────────────────────────────────── */
#lobbyOverlay {
  position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center;
  z-index: 10; overflow-y: auto; padding: 22px 0;
  background:
    radial-gradient(900px 520px at 18% 8%, rgba(255, 210, 63, .16), transparent 60%),
    radial-gradient(800px 520px at 85% 92%, rgba(46, 134, 222, .18), transparent 60%),
    var(--desk);
}
.card {
  width: min(480px, 94vw); padding: 20px 20px 16px 52px; margin: auto 0; position: relative;
  border-radius: 6px 14px 14px 6px; text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.2), 0 20px 60px rgba(0,0,0,.45);
}
.card.notebook {
  background:
    linear-gradient(90deg, transparent 38px, var(--margin) 38px 40px, transparent 40px),
    repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px),
    var(--paper);
}
/* the spiral binding down the left edge */
.card.notebook::before {
  content: ""; position: absolute; left: 10px; top: 18px; bottom: 18px; width: 16px;
  background: radial-gradient(circle at 8px 8px, #3b4252 0 5px, transparent 6px) 0 0 / 16px 28px repeat-y;
}
.dd-title {
  margin: 4px 0 4px; font-size: clamp(38px, 10vw, 56px); font-weight: 800; letter-spacing: .02em;
  color: var(--ink); transform: rotate(-2deg);
}
.dd-title span {
  margin-left: .2em; color: var(--accent);
  text-decoration: underline wavy var(--accent-2); text-decoration-thickness: 3px; text-underline-offset: 6px;
}
.dd-title.small { font-size: clamp(28px, 7vw, 40px); }
.tagline { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; }
.instructions { margin: 12px 0 4px; font-size: 14px; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.need-more { color: #a2391f; }

input#nameInput {
  width: 100%; padding: 11px 14px; border-radius: 10px; font-size: 16px;
  border: 2px solid var(--ink); background: #fff; color: var(--ink); outline: none; margin-bottom: 10px;
  font-family: inherit;
}
button.primary, button.secondary {
  width: 100%; padding: 12px; border-radius: 12px; font-size: 17px; font-weight: 800; cursor: pointer;
  border: 2px solid var(--ink);
}
button.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--ink); }
button.primary:disabled { background: #c9c2b0; box-shadow: 0 4px 0 #8f8a7d; cursor: default; }
button.secondary { margin-top: 10px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
button.primary:active:not(:disabled), button.secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.link-btn { margin-top: 10px; background: none; border: 0; color: var(--accent-2); cursor: pointer; font-size: 15px; font-weight: 700; }
.back-link { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 14px; }
.mini-btn { font-size: 13px; padding: 3px 9px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; cursor: pointer; vertical-align: middle; }

.squad-count { color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.player-list { max-height: 180px; overflow-y: auto; margin-bottom: 10px; }
.player-row {
  display: flex; align-items: center; gap: 8px; text-align: left; padding: 5px 8px; border-radius: 8px;
  background: rgba(243, 239, 227, .9); margin-bottom: 4px; font-size: 15px;
}
.player-row .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.player-row .tag { margin-left: auto; font-size: 12px; color: var(--ink-soft); }

.settings { margin: 8px 0 10px; text-align: left; }
.settings-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.settings-label { width: 76px; font-size: 13px; color: var(--ink-soft); }
.seg { display: inline-flex; border-radius: 10px; overflow: hidden; border: 2px solid var(--ink); }
.seg button { background: #fff; color: var(--ink); border: 0; padding: 6px 11px; font-size: 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid #d9d2c0; }
.seg button.on { background: var(--accent-2); color: #fff; font-weight: 800; }
.seg.locked button { cursor: default; }
.custom { margin-top: 6px; font-size: 14px; }
.custom summary { cursor: pointer; color: var(--ink-soft); }
.custom textarea {
  width: 100%; margin-top: 6px; border: 2px solid var(--ink); border-radius: 8px; padding: 6px 8px;
  font-family: inherit; font-size: 14px; resize: vertical; background: #fff;
}
.custom .check { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.briefing { text-align: left; margin: 12px 0; font-size: 14px; color: var(--ink-soft); }
.briefing summary { cursor: pointer; }
.briefing ul { margin: 6px 0 0 18px; padding: 0; }
.briefing li { margin-bottom: 4px; }
#lobbyChat { margin-top: 12px; text-align: left; }
/* lobby_chat.css is dark-theme; the notebook wants ink on paper */
#lobbyChat .mps-chat { background: #fff; border: 2px solid var(--ink); }
#lobbyChat .mps-chat-messages, #lobbyChat .mps-chat-line { color: var(--ink); }
#lobbyChat .mps-chat-line b { color: var(--accent-2); }
#lobbyChat .mps-chat-system { color: var(--ink-soft); }
#lobbyChat .mps-chat-input { background: #fff; color: var(--ink); border: 2px solid #c9c2b0; font-family: inherit; }
#lobbyChat .mps-chat-send { background: var(--accent); color: #fff; border: 2px solid var(--ink); font-family: inherit; }
#lobbyPane { position: relative; }

.leaderboard { margin-top: 12px; text-align: left; }
.leaderboard, .lb-panel, .lb-card {
  --lb-accent: #ff7a3d;
  --lb-text: #23262e;
  --lb-dim: rgba(35, 38, 46, .6);
  --lb-edge: rgba(35, 38, 46, .15);
  --lb-panel: rgba(243, 239, 227, .92);
}
.lb-card { max-width: min(560px, 94vw) !important; width: min(560px, 94vw) !important; }
.lobby-audio { display: flex; justify-content: center; margin-bottom: 8px; }

/* ── results: podium + gallery ──────────────────────────────────────── */
.card.results-wide { width: min(820px, 96vw); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 12px 0 16px; min-height: 150px; }
.pod { width: 31%; max-width: 170px; text-align: center; }
.pod .pname { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.pod .ppts { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.pod .block {
  border: 2px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0;
  display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--ink);
}
.pod.p1 .block { height: 110px; background: #ffd23f; }
.pod.p2 .block { height: 80px; background: #d9dee6; }
.pod.p3 .block { height: 60px; background: #e8b07a; }
#resultTable { overflow-x: auto; }
#resultTable .fs-table { width: max-content; min-width: 100%; font-size: .9rem; }
.card .fs-table, .card .fs-awards, .card .fs-table-wrap {
  --fs-accent: #e8652a; --fs-text: #23262e; --fs-dim: rgba(35, 38, 46, .6); --fs-edge: rgba(35, 38, 46, .15);
  color: var(--ink);
}
.card .fs-award { background: #fff; }
.gallery-h { margin: 18px 0 8px; font-size: 22px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.gitem {
  margin: 0; background: #fff; padding: 8px 8px 6px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transform: rotate(var(--tilt, 0deg)); text-align: left;
}
.gitem img { width: 100%; aspect-ratio: 4/3; display: block; border: 1px solid #eee; }
.gitem .gword { font-weight: 800; font-size: 16px; margin-top: 4px; }
.gitem .gby { font-size: 13px; color: var(--ink-soft); }
.gitem .gfoot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.gitem a { white-space: nowrap; }
.gitem a { font-size: 13px; color: var(--accent-2); text-decoration: none; font-weight: 700; }
.gallery-empty { color: var(--ink-soft); font-size: 14px; }

/* ── phone ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  #game { padding: calc(4px + env(safe-area-inset-top)) 0 calc(4px + env(safe-area-inset-bottom)); gap: 4px; }
  .topbar { margin: 0 4px; padding: 4px 8px; gap: 6px; border-radius: 10px; }
  .tb-round { font-size: 12px; }
  .tb-round b { font-size: 15px; }
  .tb-word .ch { width: 15px; font-size: 18px; border-bottom-width: 2px; }
  .tb-word { gap: 2px 8px; min-height: 28px; }
  .tb-word .diff { display: none; }
  .tb-timer { width: 38px; height: 38px; font-size: 15px; }
  .tb-timer::before { inset: 4px; }
  .hud-gear summary { width: 32px; height: 32px; }
  .stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 4px; }
  .sheet-col { gap: 4px; }
  .drawer-banner { font-size: 13px; min-height: 0; }
  .sheet { flex: none; container-type: normal; }
  #board { width: 100vw; border-radius: 0; }
  .tape { display: none; }
  .toolbar { width: 100%; border-radius: 0; padding: 4px; gap: 4px; }
  .tools { flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
  .tool, .size { width: 36px; height: 36px; flex: none; font-size: 17px; }
  .tb-sep { flex: none; }
  .palette { grid-template-columns: repeat(10, 1fr); gap: 3px; }
  .swatch { height: 20px; }
  .side { border-radius: 0; padding: 4px 6px; gap: 4px; min-height: 0; }
  .scores { flex-direction: row; overflow-x: auto; max-height: none; gap: 4px; }
  .score-row { flex: none; grid-template-columns: 18px auto auto; font-size: 13px; padding: 3px 7px; max-width: 46vw; }
  .score-row .av { width: 18px; height: 18px; font-size: 10px; }
  .feed { font-size: 13.5px; }
  .guess input { padding: 8px 10px; }
  .card { padding-left: 44px; }
  .card.notebook::before { left: 6px; }
  .pod .block { font-size: 22px; }
}

/* ── onboarding: how to play + drawer coach tips ────────────────────── */
.help-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); background: #fff3cf;
  font-size: 18px; font-weight: 800; cursor: pointer; color: var(--ink); padding: 0; flex: none;
}
.help-btn.corner { position: absolute; top: 0; right: 0; z-index: 3; }
.link-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.howto {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 24, 32, .62); padding: 12px;
}
.howto-card {
  position: relative; width: min(460px, 100%); max-height: calc(var(--vvh) - 24px); overflow-y: auto;
  border-radius: 14px; padding: 18px 18px 14px; text-align: center; border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px), var(--paper);
  box-shadow: 0 4px 0 var(--ink), 0 24px 60px rgba(0,0,0,.5);
}
.howto-card h2 { margin: 0 36px 8px; font-size: 26px; transform: rotate(-1.5deg); }
.howto-x { position: absolute; z-index: 3; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink-soft); }
.hstep { display: none; }
.hstep.on { display: block; animation: pop-in .2s ease-out; }
.hstep h3 { margin: 10px 0 6px; font-size: 21px; color: var(--accent); }
.hstep p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink); }
.hart {
  display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap;
  min-height: 74px; padding: 10px; background: #fff; border: 2px dashed #c9c2b0; border-radius: 12px;
}
.hart .chip { padding: 6px 12px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 800; box-shadow: 0 3px 0 var(--ink); }
.hart .chip.easy { background: #d9f5df; } .hart .chip.medium { background: #ffe3cc; } .hart .chip.hard { background: #ffd6da; }
.hart .tool-ico { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 9px; display: grid; place-items: center; font-size: 19px; background: #fff3cf; }
.hart .sw { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(0,0,0,.2); }
.hart .fake-input { border: 2px solid var(--ink); border-radius: 8px; padding: 6px 10px; min-width: 110px; text-align: left; }
.hart .fake-close { background: #fff1c2; color: #7a5a00; border-radius: 6px; padding: 4px 8px; font-size: 14px; }
.hint-art b { width: 20px; border-bottom: 3px solid var(--ink); font-size: 22px; text-align: center; color: var(--good); }
.hart .pts { font-size: 30px; font-weight: 800; color: var(--good); }
.hart .pts.small { font-size: 20px; color: var(--accent-2); }
.howto-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 8px; }
.howto-dots { display: flex; gap: 6px; }
.howto-dots i { width: 9px; height: 9px; border-radius: 50%; background: #d9d2c0; display: block; }
.howto-dots i.on { background: var(--accent); }
.primary-mini { background: var(--accent) !important; color: #fff; }
.mini-btn:disabled { opacity: .35; cursor: default; }

.coach {
  position: fixed; z-index: 40; width: min(300px, calc(100vw - 20px));
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 15px; line-height: 1.35;
}
.coach::after {
  content: ""; position: absolute; left: var(--arrow-x, 40px); width: 14px; height: 14px; background: var(--ink);
  transform: rotate(45deg);
}
.coach.below::after { top: -7px; }
.coach.above::after { bottom: -7px; }
.coach-nav { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.coach .mini-btn { border-color: #fff; }
.coach .mini-btn:not(.primary-mini) { background: transparent; color: #fff; }
.coach-target { position: relative; z-index: 41; box-shadow: 0 0 0 4px #ffd23f !important; border-radius: 10px; }
