/* Acorn Trail: shared styles for the hub and every game. Games link this file and add their own styles after it.
   Fonts are the device's own (no downloads). Colors: see --tokens below. */
:root {
  color-scheme: light;
  --ink: #2b2240; --muted: #5e5574; --cream: #fffaf0; --paper: #fff4dc; --line: #f0d9a0;
  --leaf: #4fb83c; --leafD: #2f8f2a; --sun: #ffc93c; --sunD: #e3a018; --blue: #2f7fe0; --berry: #ff5a7a; --grape: #7a5ab8; --orange: #ff8a2a;
  --math: #ff8a2a; --ela: #4fb83c; --science: #2f9fe0; --social: #a45ad8;
  --font: ui-rounded, "Nunito", "Varela Round", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --bar-h: 58px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; color: var(--ink); font: 18px/1.4 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  background: #cfeeff linear-gradient(170deg, #bfe6ff 0%, #dff3ff 45%, #e6f8d0 100%) fixed; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
img, svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-weight: 700; }

/* ---------- top bar (game shell) ---------- */
.sbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; min-height: var(--bar-h); padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); background: #fff7e0; border-bottom: 3px solid var(--sun); }
.sbar .back { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font: 900 15px/1 var(--font); background: #fff; }
.sbar .back svg { width: 26px; height: 26px; }
.sbar h1 { margin: 0; min-width: 0; font: 900 22px/1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--grape); text-shadow: 0 2px 0 #e0d0ff; }
.sbar .sp { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px 0 8px; border-radius: 999px; background: #fff; box-shadow: 0 3px 0 rgba(43,34,64,.18); font: 900 17px/1 var(--font); white-space: nowrap; border: 0; }
.pill .i { font-size: 20px; line-height: 1; }
.pill.grade { background: #efe6ff; color: var(--grape); min-height: 44px; }
.pill.grade.try { background: #ffe8c8; color: #b0500a; }
.ibtn { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: #fff; padding: 0; font-size: 22px; line-height: 1; }
.ibtn svg { width: 28px; height: 28px; }
@media (max-width: 520px) { .sbar { gap: 5px; } .sbar h1 { font-size: 17px; } .sbar .back { padding: 0 10px; } .sbar .back span { display: none; } .pill { padding: 0 9px 0 6px; font-size: 15px; height: 34px; } .ibtn { width: 42px; height: 42px; } }
@media (max-width: 400px) { .sbar h1 { display: none; } .sbar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); } }

/* ---------- buttons ---------- */
.rbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; min-width: 54px; padding: 0 20px; border: 3px solid var(--ink); border-radius: 999px; background: var(--leaf); color: #fff; font: 900 19px/1.1 var(--font); box-shadow: 0 4px 0 var(--ink); text-shadow: 0 1px 0 rgba(0,0,0,.2); touch-action: manipulation; text-decoration: none; user-select: none; -webkit-user-select: none; }
.rbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.rbtn.alt { background: #fff; color: var(--ink); text-shadow: none; }
.rbtn.gold { background: var(--sun); color: var(--ink); text-shadow: none; }
.rbtn.blue { background: var(--blue); }
.rbtn.red { background: #ff6a5a; }
.rbtn.grape { background: var(--grape); }
.rbtn.xl { min-height: 62px; font-size: 23px; padding: 0 30px; }
.rbtn.sm { min-height: 44px; padding: 0 14px; font-size: 16px; border-width: 2px; box-shadow: 0 3px 0 var(--ink); }
.rbtn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: 0 4px 0 var(--ink); }
.rbtn.holding { background: linear-gradient(90deg, #2f8f2a 50%, #8fd25e 50%) right / 200% 100%; animation: hold var(--hold, 3s) linear forwards; }
@keyframes hold { to { background-position: left; } }
.btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: #fff4dc; font: 900 15px/1.2 var(--font); }
.card { background: #fff; border-radius: 22px; padding: 14px; box-shadow: 0 4px 0 rgba(43,34,64,.12); border: 2px solid #f4e6c4; }
.paper { background: rgba(255,250,240,.97); border-radius: 26px; padding: 16px; box-shadow: 0 6px 0 rgba(43,34,64,.15); }

/* ---------- guide bubble ---------- */
.guide { display: flex; align-items: flex-end; gap: 6px; }
.guide .gimg { flex: none; width: 84px; height: 84px; filter: drop-shadow(0 4px 0 rgba(43,34,64,.15)); }
.guide .gimg svg { width: 100%; height: 100%; }
.bubble { position: relative; flex: 1; padding: 12px 16px; border-radius: 22px; background: #fff; border: 3px solid var(--sun); box-shadow: 0 4px 0 var(--sunD); font: 800 18px/1.35 var(--font); }
.bubble b { color: var(--grape); }
.say { flex: none; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid #bcd8ff; background: #eef6ff; padding: 0; font-size: 22px; line-height: 1; vertical-align: middle; }
.say:active { transform: scale(.94); }

/* ---------- overlays & sheets ---------- */
.ov { position: fixed; inset: 0; z-index: 60; display: flex; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(40,20,70,.45); overflow: auto; }
.ovcard { position: relative; margin: auto; flex: none; width: min(560px, 100%); padding: 20px 18px; border-radius: 28px; background: var(--cream); border: 4px solid var(--sun); box-shadow: 0 10px 40px rgba(0,0,0,.3); text-align: center; animation: sup .28s cubic-bezier(.2,1.3,.4,1); }
.ovcard h2 { margin: 2px 0 8px; font: 900 28px/1.1 var(--font); color: var(--grape); }
.ovcard p { font: 800 18px/1.4 var(--font); margin: 6px 0; }
.ovx { position: absolute; right: 10px; top: 10px; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font: 900 22px/1 var(--font); padding: 0; box-shadow: 0 3px 0 var(--ink); }
@keyframes sup { from { transform: translateY(30px) scale(.96); opacity: 0; } }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 2px solid #f4e6c4; font: 800 18px/1.3 var(--font); text-align: left; }
.opt input { width: 30px; height: 30px; accent-color: var(--leaf); flex: none; }
.opt span { display: grid; } .opt small { font: 700 14px/1.25 var(--font); color: var(--muted); }
#toasts { position: fixed; left: 50%; top: calc(var(--bar-h) + 14px); transform: translateX(-50%); z-index: 70; display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(92%, 440px); }
.toast { padding: 10px 18px; border-radius: 999px; background: rgba(43,34,64,.92); color: #fff; font: 800 17px/1.25 var(--font); text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: tin .25s ease-out; }
.toast.good { background: rgba(47,143,42,.96); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- question frame ---------- */
.q { position: relative; display: grid; gap: 12px; width: 100%; max-width: 760px; margin: 0 auto; }
.q-top { display: flex; align-items: flex-start; gap: 10px; }
.q-prompt { flex: 1; margin: 0; font: 900 clamp(21px, 5.4vw, 28px)/1.3 var(--font); }
.q-prompt.long { font-size: clamp(18px, 4.4vw, 22px); font-weight: 800; }
.q-prompt .big { font-size: 1.3em; letter-spacing: .02em; }
.q-pic { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; }
.q-pic svg { max-width: 100%; height: auto; }
.q-passage { margin: 0; padding: 12px 16px; border-radius: 18px; background: #fff; border: 2px solid #f4e6c4; font: 700 19px/1.55 var(--font); max-height: 40vh; overflow: auto; }
.q-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.q-hinttext { margin: 0; padding: 10px 14px; border-radius: 16px; background: #fff8d8; border: 2px dashed var(--sunD); font: 800 17px/1.35 var(--font); color: #7a4a00; }
.q-fb { display: grid; justify-items: center; gap: 8px; padding: 14px; border-radius: 22px; text-align: center; animation: sup .25s cubic-bezier(.2,1.3,.4,1); }
.q-fb.good { background: #e8f9dc; border: 3px solid #9ad87a; }
.q-fb.again { background: #fff4e0; border: 3px solid #f6c07a; }
.q-fb.show { background: #eef4ff; border: 3px solid #a8c8f0; }
.q-fb .yay { font: 900 28px/1.1 var(--font); }
.q-fb.good .yay { color: var(--leafD); } .q-fb.again .yay { color: #c8601a; } .q-fb.show .yay { color: var(--blue); }
.q-fb p { margin: 0; font: 800 18px/1.4 var(--font); max-width: 40ch; }
.q-fb .ans { font: 900 26px/1.2 var(--font); padding: 4px 16px; background: #fff; border-radius: 14px; border: 2px solid #cfe0f6; }
.q.locked .w { pointer-events: none; }

/* choice tiles */
.w-choice { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w-choice.c1 { grid-template-columns: 1fr; } .w-choice.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 700px) { .w-choice.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; display: grid; place-items: center; gap: 4px; min-height: 66px; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 20px; background: #fff; font: 900 clamp(20px, 5vw, 26px)/1.15 var(--font); box-shadow: 0 5px 0 var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tile svg { max-width: 100%; height: auto; max-height: 120px; }
.tile small { font: 800 15px/1.2 var(--font); color: var(--muted); }
.w-choice .tile:nth-child(4n+1) { background: #ffe3ea; } .w-choice .tile:nth-child(4n+2) { background: #e3f1ff; } .w-choice .tile:nth-child(4n+3) { background: #e6f8dc; } .w-choice .tile:nth-child(4n) { background: #fff3c8; }
.w-choice.pics .tile { background: #fff !important; min-height: 110px; }
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.tile.right { background: #c8f4b0 !important; border-color: var(--leafD); box-shadow: 0 5px 0 var(--leafD); }
.tile.right::after { content: "✔"; position: absolute; right: 8px; top: 4px; font-size: 18px; color: var(--leafD); }
.tile.wrong { background: #fff0e4 !important; border-color: #e89a5a; box-shadow: 0 5px 0 #e89a5a; }
.tile.out { opacity: .4; box-shadow: none; transform: translateY(4px); }
.tile:disabled { cursor: default; }
.tile.sel { background: #fff3a8 !important; border-color: var(--sunD); box-shadow: 0 5px 0 var(--sunD), 0 0 0 4px rgba(255,201,60,.5); }
.w-tf { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.w-tf .tile { min-height: 84px; font-size: 26px; }
.w-tf .tile.t { background: #e6f8dc; } .w-tf .tile.f { background: #ffe3ea; }
.w-tf .tile .em { font-size: 34px; line-height: 1; }

/* number pad */
.w-numpad { display: grid; gap: 10px; justify-items: center; }
.np-show { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 180px; min-height: 66px; padding: 4px 20px; border-radius: 18px; background: #fff; border: 3px solid var(--ink); font: 900 38px/1 var(--font); letter-spacing: .04em; box-shadow: inset 0 3px 0 rgba(43,34,64,.08); }
.np-show .cur { display: inline-block; width: 3px; height: 36px; background: var(--blue); animation: blink 1s steps(2) infinite; }
.np-show .u { font-size: 24px; color: var(--muted); }
.np-show.right { border-color: var(--leafD); background: #e8f9dc; } .np-show.wrong { border-color: #e89a5a; background: #fff0e4; }
@keyframes blink { 50% { opacity: 0; } }
.np-keys { display: grid; grid-template-columns: repeat(3, minmax(64px, 84px)); gap: 9px; }
.np-keys.wide { grid-template-columns: repeat(4, minmax(56px, 76px)); }
.key { min-height: 60px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; font: 900 28px/1 var(--font); box-shadow: 0 4px 0 var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; padding: 0; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.key.ok { background: var(--leaf); color: #fff; } .key.del { background: #ffe3ea; font-size: 24px; } .key.sym { background: #efe6ff; }
.key:disabled { opacity: .4; }
@media (max-height: 700px) and (max-width: 520px) { .key { min-height: 50px; font-size: 24px; } .np-show { min-height: 54px; font-size: 32px; } }

/* letter tiles */
.w-letters { display: grid; gap: 14px; justify-items: center; }
.lt-slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lt-slot { width: 46px; height: 58px; border-radius: 12px; border: 3px dashed #e0c890; background: #fff; display: grid; place-items: center; font: 900 30px/1 var(--font); padding: 0; }
.lt-slot.on { border-style: solid; border-color: #7bc85a; background: #f2ffe8; }
.lt-slot.cur { border-color: var(--sunD); background: #fffbe6; }
.lt-slot.ok { background: #d8f6c8; border-color: var(--leafD); } .lt-slot.no { background: #fff0e0; border-color: #f0a050; }
.lt-tiles { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; max-width: 540px; }
.lt-tile { width: 60px; height: 60px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; font: 900 32px/1 var(--font); padding: 0 0 3px; box-shadow: 0 5px 0 var(--ink); touch-action: manipulation; }
.lt-tile:nth-child(5n+1) { background: #ffe3ea; } .lt-tile:nth-child(5n+2) { background: #e3f1ff; } .lt-tile:nth-child(5n+3) { background: #e6f8dc; } .lt-tile:nth-child(5n+4) { background: #fff3c8; } .lt-tile:nth-child(5n) { background: #f1e6ff; }
.lt-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.lt-tile:disabled { opacity: .22; box-shadow: none; transform: translateY(5px); cursor: default; }
@media (max-width: 480px) { .lt-tile { width: 52px; height: 54px; font-size: 28px; } .lt-slot { width: 38px; height: 50px; font-size: 26px; } }

/* order & sort (tap or drag) */
.w-order, .w-sort { display: grid; gap: 14px; }
.os-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 64px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.6); border: 2px dashed #d8c8a8; }
.os-slots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.os-slots.v { flex-direction: column; align-items: stretch; }
.os-slot { display: flex; align-items: center; gap: 8px; min-width: 64px; min-height: 64px; padding: 6px; border-radius: 18px; border: 3px dashed #c8b8e8; background: #fbf8ff; }
.os-slot .n { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #e8dcff; font: 900 16px/1 var(--font); color: var(--grape); }
.os-slot.ok { border-style: solid; border-color: var(--leafD); background: #e8f9dc; } .os-slot.no { border-style: solid; border-color: #e89a5a; background: #fff0e4; }
.os-slot.hot, .os-bin.hot { border-color: var(--sunD); background: #fffbe0; }
.os-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; padding: 6px 16px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; font: 900 20px/1.2 var(--font); box-shadow: 0 4px 0 var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; text-align: center; }
.os-chip svg { max-height: 60px; width: auto; }
.os-chip.sel { background: #fff3a8; border-color: var(--sunD); box-shadow: 0 4px 0 var(--sunD), 0 0 0 4px rgba(255,201,60,.5); }
.os-chip.drag { position: fixed; z-index: 80; pointer-events: none; transform: scale(1.08) rotate(-2deg); box-shadow: 0 14px 24px rgba(0,0,0,.25); }
.os-chip.ghost { opacity: .3; }
.os-slots.v .os-chip { flex: 1; justify-content: flex-start; text-align: left; font-size: 18px; }
.os-bins { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.os-bin { display: grid; align-content: start; gap: 8px; min-height: 130px; padding: 10px; border-radius: 20px; border: 3px solid var(--ink); background: #fff; box-shadow: 0 4px 0 rgba(43,34,64,.2); touch-action: manipulation; text-align: center; }
.os-bin > b { font: 900 19px/1.2 var(--font); display: flex; align-items: center; justify-content: center; gap: 6px; }
.os-bin > b svg { width: 34px; height: 34px; }
.os-bin .items { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.os-bin .os-chip { min-height: 44px; font-size: 16px; padding: 4px 10px; }
.os-bin .os-chip.no { border-color: #e89a5a; background: #fff0e4; }
.os-bin:nth-child(4n+1) { background: #ffeef2; } .os-bin:nth-child(4n+2) { background: #eaf4ff; } .os-bin:nth-child(4n+3) { background: #edfae4; } .os-bin:nth-child(4n) { background: #fff7d8; }

/* tap the word */
.w-tapword { display: flex; flex-wrap: wrap; gap: 8px 6px; justify-content: center; padding: 12px; border-radius: 18px; background: #fff; border: 2px solid #f4e6c4; }
.tw { min-height: 52px; padding: 4px 12px; border: 3px solid transparent; border-radius: 14px; background: #f6f2ea; font: 800 clamp(20px, 5vw, 26px)/1.2 var(--font); touch-action: manipulation; }
.tw:active { transform: scale(.96); }
.tw.sel { background: #fff3a8; border-color: var(--sunD); }
.tw.right { background: #c8f4b0; border-color: var(--leafD); } .tw.wrong { background: #fff0e4; border-color: #e89a5a; }

/* matching pairs */
.w-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.w-match .col { display: grid; gap: 10px; align-content: start; }
.mt { min-height: 60px; padding: 8px 10px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; font: 900 clamp(17px, 4.4vw, 22px)/1.2 var(--font); box-shadow: 0 4px 0 var(--ink); touch-action: manipulation; display: grid; place-items: center; }
.mt svg { max-height: 64px; width: auto; }
.mt.sel { background: #fff3a8; border-color: var(--sunD); box-shadow: 0 4px 0 var(--sunD), 0 0 0 4px rgba(255,201,60,.5); }
.mt.done { opacity: 1; cursor: default; border-color: var(--leafD); box-shadow: 0 4px 0 var(--leafD); }
.mt.p0 { background: #d8f6c8; } .mt.p1 { background: #d6ecff; } .mt.p2 { background: #ffe0ea; } .mt.p3 { background: #fff1b8; } .mt.p4 { background: #eadcff; } .mt.p5 { background: #ffe6cc; }

/* number line */
.w-numline { display: grid; gap: 8px; justify-items: center; }
.nl-svg { width: 100%; max-width: 700px; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.nl-read { font: 900 24px/1 var(--font); min-height: 28px; color: var(--grape); }

/* fraction input */
.w-fraction { display: grid; gap: 10px; justify-items: center; }
.fr-svg { width: min(100%, 520px); height: auto; touch-action: manipulation; }
.fr-svg.circle { width: min(80vw, 260px); }
.fr-svg .part { cursor: pointer; }
.fr-read { font: 900 26px/1 var(--font); color: var(--grape); }
.fr-step { display: flex; align-items: center; gap: 10px; font: 900 18px/1 var(--font); }

/* clock */
.w-clock { display: grid; gap: 10px; justify-items: center; }
.ck-svg { width: min(78vw, 280px); height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.ck-svg .hand { cursor: grab; }
.ck-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.ck-step { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 999px; background: #fff; border: 2px solid #f4e6c4; font: 900 16px/1 var(--font); }
.ck-step .key { min-height: 46px; min-width: 50px; font-size: 22px; }
.ck-dig { font: 900 30px/1 var(--font); padding: 6px 16px; border-radius: 14px; background: #1f2340; color: #8fffb0; letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* coins */
.w-coins { display: grid; gap: 12px; justify-items: center; }
.cn-mat { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; width: 100%; min-height: 90px; padding: 12px; border-radius: 20px; background: #6ab04a; border: 4px solid #3f7f2f; box-shadow: inset 0 4px 0 rgba(0,0,0,.12); }
.cn-mat:empty::before { content: "Tap coins to put them here"; color: #eaffd8; font: 800 16px/1.2 var(--font); }
.cn-mat button { padding: 0; border: 0; background: none; border-radius: 50%; touch-action: manipulation; }
.cn-mat button.bill { border-radius: 6px; }
.cn-tray { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.cn-tray button { display: grid; justify-items: center; gap: 2px; padding: 6px; min-width: 66px; min-height: 66px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--ink); font: 900 14px/1 var(--font); touch-action: manipulation; }
.cn-tray button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.cn-total { font: 900 24px/1 var(--font); color: var(--leafD); min-height: 26px; }

/* ---------- results ---------- */
.res-stars { font-size: 64px; letter-spacing: 8px; color: #e8dcc0; line-height: 1.1; margin: 4px 0; }
.res-stars span { display: inline-block; }
.res-stars .on { color: #ffc93c; animation: starin .5s both cubic-bezier(.2,1.8,.4,1); text-shadow: 0 4px 0 #e3a018; }
.res-stars .on:nth-child(2) { animation-delay: .25s; } .res-stars .on:nth-child(3) { animation-delay: .5s; }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } }
.res-lines { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; font: 800 18px/1.35 var(--font); }
.res-skills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.res-skills .chip { background: #efe6ff; color: #4a2f80; }
.res-new { display: flex; align-items: center; gap: 12px; margin: 10px auto 0; padding: 10px 14px; border-radius: 20px; background: #fff8d8; border: 3px solid var(--sun); text-align: left; max-width: 420px; }
.res-new .pic { flex: none; width: 66px; height: 66px; } .res-new .pic svg { width: 100%; height: 100%; }
.res-new b { display: block; font: 900 19px/1.2 var(--font); color: #b0500a; }
.res-new small { font: 700 15px/1.3 var(--font); color: var(--muted); }

/* ---------- fx ---------- */
.fx-conf { position: absolute; z-index: 5; left: 50%; top: 40%; font-size: 28px; pointer-events: none; animation: fxconf 1.2s ease-out forwards; }
@keyframes fxconf { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 60px)) scale(1.1) rotate(200deg); opacity: 0; } }
.fx-spark { position: fixed; z-index: 90; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 3px; pointer-events: none; transform: rotate(45deg); animation: fxspark .7s ease-out forwards; }
@keyframes fxspark { to { transform: translate(var(--dx), var(--dy)) rotate(225deg) scale(.2); opacity: 0; } }
.fx-star { position: fixed; z-index: 90; font-size: 70px; line-height: 1; pointer-events: none; transform: translate(-50%, -50%); animation: fxstar .9s ease-out forwards; }
@keyframes fxstar { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-40deg); } 40% { transform: translate(-50%, -50%) scale(1.25) rotate(10deg); opacity: 1; } 100% { transform: translate(-50%, -90%) scale(1); opacity: 0; } }
.fx-fly { position: fixed; z-index: 90; font-size: 34px; line-height: 1; pointer-events: none; margin: -17px 0 0 -17px; transition: transform .8s cubic-bezier(.5,-0.3,.6,1), opacity .8s; }
.fx-party { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.fx-party i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fxfall linear forwards; }
@keyframes fxfall { to { transform: translateY(110vh) rotate(var(--r)); } }
.fx-wiggle { animation: fxwig .5s ease-in-out; }
@keyframes fxwig { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.bob { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

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