/* Layout: one centered column. The onsen scene (sky, ridges, tubs on a cedar deck) opens the page,
   then the waiting bench, past soaks, the list of requests, and a soak bar pinned to the bottom. */
:root {
  --bg: #E7F0EC;          /* onsen steam */
  --surface: #FFFFFF;
  --surface-2: #F2F7F4;
  --ink: #3A2A21;         /* capybara cocoa */
  --ink-soft: #76675D;
  --line: #D6E2DD;
  --yuzu: #F7A21E;
  --yuzu-strong: #D9840A;
  --yuzu-ink: #3B2200;
  --yuzu-soft: #FFEBC4;
  --water: #74CEC6;
  --water-front: #5FC0B7;
  --wood: #CF9563;
  --wood-dark: #9A6238;
  --wood-light: #E9BC8E;
  --band: #6E4A33;
  --deck: #DDAF80;
  --deck-line: #C4925F;
  --sky-top: #B9DFEC;
  --sky-bottom: #F5EEF4;
  --ridge-far: #C9D2EC;
  --ridge-near: #ABB9E0;
  --snow: #FFFFFF;
  --orb: #FFE4A3;
  --orb-glow: rgba(255, 214, 120, .45);
  --star-opacity: 0;
  --steam: rgba(255, 255, 255, .9);
  --noren: #2F4B7C;
  --noren-ink: #FFFFFF;
  --happy: #36A673;
  --happy-soft: #DAF2E5;
  --miss: #D9655F;
  --miss-soft: #FBE3E0;
  --cool: #3D84C6;
  --hot: #D4512F;
  --heart: #F2789A;
  --shadow: 0 1px 2px rgba(58, 42, 33, .06), 0 12px 30px -16px rgba(58, 42, 33, .32);
  --font-display: "Mochiy Pop One", "M PLUS Rounded 1c", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "M PLUS Rounded 1c", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --radius: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111923; --surface: #1A2431; --surface-2: #212D3D; --ink: #F4ECE2; --ink-soft: #A9B1BF; --line: #2B384A;
    --yuzu: #FFB13F; --yuzu-strong: #D98B17; --yuzu-ink: #2B1700; --yuzu-soft: #3B2D18;
    --water: #3F9F99; --water-front: #358B86; --wood: #A56F45; --wood-dark: #6B4327; --wood-light: #C38D5E; --band: #3D291B;
    --deck: #6A4931; --deck-line: #563A26;
    --sky-top: #0E1830; --sky-bottom: #2D2A55; --ridge-far: #28325E; --ridge-near: #1B2347; --snow: #C9D3EE;
    --orb: #FFF2CC; --orb-glow: rgba(255, 240, 200, .25); --star-opacity: .95; --steam: rgba(220, 232, 248, .65);
    --noren: #E9D9B8; --noren-ink: #2A2E4A;
    --happy: #5AD39A; --happy-soft: #173A2C; --miss: #F08A84; --miss-soft: #3E2227;
    --cool: #4A93D6; --hot: #E0603C; --heart: #FF8FAD;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 34px -18px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111923; --surface: #1A2431; --surface-2: #212D3D; --ink: #F4ECE2; --ink-soft: #A9B1BF; --line: #2B384A;
  --yuzu: #FFB13F; --yuzu-strong: #D98B17; --yuzu-ink: #2B1700; --yuzu-soft: #3B2D18;
  --water: #3F9F99; --water-front: #358B86; --wood: #A56F45; --wood-dark: #6B4327; --wood-light: #C38D5E; --band: #3D291B;
  --deck: #6A4931; --deck-line: #563A26;
  --sky-top: #0E1830; --sky-bottom: #2D2A55; --ridge-far: #28325E; --ridge-near: #1B2347; --snow: #C9D3EE;
  --orb: #FFF2CC; --orb-glow: rgba(255, 240, 200, .25); --star-opacity: .95; --steam: rgba(220, 232, 248, .65);
  --noren: #E9D9B8; --noren-ink: #2A2E4A;
  --happy: #5AD39A; --happy-soft: #173A2C; --miss: #F08A84; --miss-soft: #3E2227;
  --cool: #4A93D6; --hot: #E0603C; --heart: #FF8FAD;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 34px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--yuzu); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  max-width: 600px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.main { display: flex; flex-direction: column; gap: 14px; }

/* ---------- top bar ---------- */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.topbar-right { display: flex; justify-content: flex-end; gap: 6px; }
.brand { text-align: center; }
.wordmark {
  margin: 0;
  font: 400 clamp(26px, 7vw, 34px)/1.05 var(--font-display);
  letter-spacing: -.01em;
  color: var(--ink);
}
.wordmark span { color: var(--yuzu-strong); }
.meta {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg, .close-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .fill { fill: var(--ink); }

.practice-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--yuzu-soft);
  color: var(--yuzu-ink);
  font-size: 13px; font-weight: 700;
}
:root[data-theme="dark"] .practice-bar { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .practice-bar { color: var(--ink); } }
.practice-actions { display: flex; gap: 12px; }
.link-btn { border: 0; background: none; padding: 0; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- the onsen scene ---------- */
.scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 30px;
  padding: 26px clamp(5px, 2.4vw, 18px) 6px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 78%);
  box-shadow: var(--shadow);
}
.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.stars {
  position: absolute; inset: 0 0 40% 0;
  opacity: var(--star-opacity);
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 46% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 10%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 78% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 16%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 36% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 46%, #fff 50%, transparent 51%);
}
.orb {
  position: absolute; top: 14px; right: 9%;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orb);
  box-shadow: 0 0 0 10px var(--orb-glow), 0 0 40px 18px var(--orb-glow);
}
.ridges { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; }
.ridge-far { fill: var(--ridge-far); }
.ridge-near { fill: var(--ridge-near); }
.snowcap { fill: var(--snow); opacity: .85; }

.noren {
  position: absolute; top: 0; left: 18px; z-index: 2;
  width: 30px; height: 40px;
  display: grid; place-items: center;
  border-radius: 0 0 8px 8px;
  background: var(--noren);
  color: var(--noren-ink);
  font: 800 17px/1 var(--font-body);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5);
}
.noren::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px;
  background: var(--noren-ink); opacity: .25;
}
.noren span { transform: translateY(2px); }

.tubs {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
  gap: clamp(2px, 1.3vw, 12px);
  max-width: calc(var(--n, 5) * 104px);
  margin: 0 auto;
}
.deck {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; z-index: 0;
  background: repeating-linear-gradient(180deg, var(--deck) 0 10px, var(--deck-line) 10px 11.5px);
  border-top: 3px solid var(--deck-line);
}

.pool { display: flex; flex-direction: column; align-items: center; min-width: 0; container-type: inline-size; }
.landmark {
  height: 30px; display: grid; place-items: center;
  font-size: clamp(15px, 4vw, 20px); line-height: 1;
}
.landmark span {
  display: grid; place-items: center;
  width: 1.65em; height: 1.65em; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 2px 6px -3px rgba(0, 0, 0, .3);
}
.tub {
  position: relative;
  width: 100%;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  border-radius: 16px;
}
.tub[data-capy] { touch-action: none; cursor: grab; }
.tub-svg { display: block; width: 100%; height: auto; aspect-ratio: 100 / 134; max-width: 100%; overflow: visible; }
.tub-name {
  height: 22px; margin-top: 6px;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(9px, 21cqi, 13px); font-weight: 800; line-height: 22px; letter-spacing: -.01em;
  color: #FFF8EE;
  text-shadow: 0 1px 0 rgba(60, 30, 10, .35);
}
.temp {
  position: absolute; left: 50%; bottom: 5%;
  transform: translateX(-50%);
  padding: 2px clamp(3px, 9cqi, 7px);
  border-radius: 999px;
  background: color-mix(in oklab, var(--cool), var(--hot) var(--heat, 50%));
  color: #FFFFFF;
  font: 800 clamp(9px, 22cqi, 13px)/1.25 var(--font-body);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
  pointer-events: none;
}

/* tub art */
.tub-rim-back { fill: var(--wood-dark); }
.tub-water { fill: var(--water); }
.tub-water-front { fill: var(--water-front); opacity: .82; }
.tub-body { fill: var(--wood); stroke: var(--wood-dark); stroke-width: 2; stroke-linejoin: round; }
.tub-slats path { stroke: var(--wood-dark); stroke-width: 1.3; opacity: .32; }
.tub-band { fill: none; stroke: var(--band); stroke-width: 3.2; stroke-linecap: round; }
.tub-rim-front { fill: none; stroke: var(--wood-light); stroke-width: 4; stroke-linecap: round; }
.ripple { fill: none; stroke: var(--steam); stroke-width: 1.4; opacity: .7; transform-box: fill-box; transform-origin: center; animation: ripple 3s ease-in-out infinite; }
.wisp { fill: none; stroke: var(--steam); stroke-width: 3.4; stroke-linecap: round; opacity: 0; animation: wisp 3.6s ease-in-out infinite; }
.heart { fill: var(--heart); animation: heart 2.2s ease-in-out infinite; }
.heart-2 { animation-delay: .7s; }
.splash { fill: none; stroke: var(--steam); stroke-width: 2.2; transform-box: fill-box; transform-origin: center; animation: splash .7s ease-out forwards; }
.capy-art { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.capy-art.hop { animation: hop .45s cubic-bezier(.3, 1.5, .5, 1); }
.capy-art.dunk { animation: dunk .6s ease; }

.pool.is-selected .capy-art { transform: translateY(-8px); }
.pool.is-selected .tub { background: radial-gradient(closest-side, var(--orb-glow), transparent); }
.tubs.has-selection .tub:not([data-capy]) .tub-water,
.pool.is-hover .tub-water { fill: color-mix(in oklab, var(--water), var(--yuzu) 35%); }
.tubs.has-selection .tub:not([data-capy]) .ripple { stroke: var(--yuzu); stroke-width: 2.4; }
.pool.is-dragging .capy-art { opacity: .25; }

@keyframes wisp {
  0% { opacity: 0; transform: translateY(8px) scaleY(.8); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-18px) scaleY(1.1); }
}
@keyframes ripple { 0%, 100% { transform: scale(.85); opacity: .35; } 50% { transform: scale(1.05); opacity: .8; } }
@keyframes heart { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.15); } }
@keyframes splash { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes hop { 0% { transform: translateY(-18px); } 60% { transform: translateY(3px); } 100% { transform: translateY(0); } }
@keyframes dunk { 0% { transform: translateY(0); } 35% { transform: translateY(12px); } 70% { transform: translateY(-6px); } 100% { transform: translateY(0); } }

/* ---------- waiting bench ---------- */
.waiting, .requests, .history {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.waiting { padding: 12px 12px 14px; transition: box-shadow .15s ease; }
.waiting.is-hover { box-shadow: 0 0 0 3px var(--yuzu), var(--shadow); }
.section-label {
  margin: 0 0 8px;
  font-size: 11.5px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft);
}
.waiting .section-label { text-align: center; }
.waiting-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 86px; align-items: center; }
.waiter {
  width: 70px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px 7px;
  border: 2px solid transparent; border-radius: 18px;
  background: var(--surface-2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), border-color .15s, background .15s;
}
.waiter:hover { transform: translateY(-2px); }
.waiter .capy-svg { width: 52px; height: 52px; }
.waiter .name { font-size: 12.5px; font-weight: 800; }
.waiter.is-selected { border-color: var(--yuzu); background: var(--yuzu-soft); transform: translateY(-4px); }
.waiter.is-dragging { opacity: .3; }
.waiter.hop { animation: pop-in .35s cubic-bezier(.3, 1.6, .5, 1); }
.tray-empty { margin: 0; max-width: 34ch; text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 14px; text-wrap: balance; }

/* ---------- past soaks ---------- */
.history { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.soak-row { display: flex; align-items: center; gap: 10px; }
.soak-label { width: 52px; flex: none; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.soak-cells { display: flex; gap: 5px; flex: 1; min-width: 0; }
.soak-cell {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px; overflow: hidden;
  border: 2px solid var(--miss);
  background: var(--miss-soft);
}
.soak-cell.ok { border-color: var(--happy); background: var(--happy-soft); }
.soak-cell .capy-svg { width: 100%; height: 100%; display: block; }
.soak-score { flex: none; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- requests ---------- */
.requests { padding: 16px 14px 8px; }
.requests-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; padding-inline: 4px; }
.requests-head h2 { margin: 0; font: 400 18px/1.2 var(--font-display); text-wrap: balance; }
.hint { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.clue-list { list-style: none; margin: 0; padding: 0; }
.clue-list li + li { border-top: 1.5px dashed var(--line); }
.clue {
  width: 100%;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 4px;
  border: 0; background: none; text-align: left;
  cursor: pointer;
  line-height: 1.95;
  border-radius: 12px;
}
.clue:hover { background: var(--surface-2); }
.clue-num {
  flex: none; width: 24px; height: 24px; margin-top: 4px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--yuzu-soft); color: var(--yuzu-ink);
  font-size: 12px; font-weight: 800; line-height: 1;
}
:root[data-theme="dark"] .clue-num { color: var(--yuzu); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .clue-num { color: var(--yuzu); } }
.clue-text { min-width: 0; font-size: 15px; }
.clue.is-done { opacity: .42; }
.clue.is-done .clue-text { text-decoration: line-through; text-decoration-thickness: 2px; }
.clue.is-done .clue-num { background: var(--happy-soft); color: var(--happy); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  vertical-align: middle;
  padding: 0 9px 0 3px;
  margin-block: 1px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font-weight: 800; line-height: 26px;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.chip-capy .capy-svg { width: 22px; height: 22px; border-radius: 50%; background: var(--sky-top); }
.chip-capy.is-lit { border-color: var(--yuzu); background: var(--yuzu-soft); }
.chip-feat { padding-left: 7px; }
.chip-temp {
  padding: 0 8px;
  border: 0;
  background: color-mix(in oklab, var(--cool), var(--hot) var(--heat, 50%));
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

/* ---------- soak bar ---------- */
.soakbar {
  position: sticky; bottom: 0; z-index: 6;
  padding-block: 10px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
}
.soakbar-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.tries { display: flex; gap: 3px; }
.yuzu-icon { width: 22px; height: 22px; transition: transform .3s, opacity .3s; }
.yuzu-fruit { fill: #FFC93C; stroke: #E39B19; stroke-width: 1.6; }
.yuzu-shine { fill: #FFE58A; }
.yuzu-leaf { fill: #7CB342; }
.yuzu-icon.is-spent { opacity: .28; transform: scale(.82); filter: grayscale(1); }
.timer { margin-right: auto; font-size: 14px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.soak-btn, .ghost-btn {
  border: 0; cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .12s ease, box-shadow .12s ease, opacity .15s;
}
.soak-btn {
  padding: 11px 24px;
  background: var(--yuzu);
  color: var(--yuzu-ink);
  font-size: 16px;
  box-shadow: 0 3px 0 var(--yuzu-strong);
}
.soak-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--yuzu-strong); }
.soak-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--yuzu-strong); }
.soak-btn[aria-disabled="true"] { opacity: .55; }
.soak-btn.shake { animation: shake .4s ease; }
.ghost-btn { padding: 10px 14px; background: var(--surface-2); color: var(--ink); font-size: 14px; }
.ghost-btn:hover { background: var(--line); }
.wide { width: 100%; }

.foot { padding: 4px 0 18px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }

/* ---------- dialogs ---------- */
.sheet {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
.sheet[open] { animation: sheet-in .32s cubic-bezier(.3, 1.4, .5, 1); }
.sheet::backdrop { background: rgba(16, 22, 32, .45); backdrop-filter: blur(3px); }
.sheet-inner { position: relative; padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.close-btn {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}
.sheet-title { margin: 0; font: 400 24px/1.2 var(--font-display); text-align: center; text-wrap: balance; }
.sheet-title.small { font-size: 18px; margin-top: 4px; }
.lede { margin: 0; color: var(--ink-soft); text-align: center; text-wrap: pretty; }
.help-hero { display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 84px; }
.help-hero .capy-svg { width: 72px; height: 72px; }
.help-hero .capy-svg:nth-child(2) { width: 84px; height: 84px; }
.help-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.help-list li { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; }
.help-week { margin: 0; text-align: center; font-size: 14px; color: var(--ink-soft); }

.result { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.result-faces { display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.result-faces .capy-svg { width: 46px; height: 46px; }
.result h2 { margin: 4px 0 0; font: 400 26px/1.15 var(--font-display); }
.result p { margin: 0; color: var(--ink-soft); max-width: 32ch; text-wrap: balance; }
.result-grid { margin-top: 4px; font-size: 18px; line-height: 1.25; letter-spacing: 2px; }

.stat-row { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { margin: 0; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.stat dd { margin: 0; font: 400 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat dt { font-size: 11px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }

.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dist-row > span:first-child { width: 14px; text-align: right; color: var(--ink-soft); }
.dist-bar {
  min-width: 26px; padding: 2px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  text-align: right;
  transition: width .5s ease;
}
.dist-row.is-today .dist-bar { background: var(--yuzu); color: var(--yuzu-ink); }

.stats-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1.5px dashed var(--line); margin-top: 4px; }
.next { display: flex; flex-direction: column; }
.next .section-label { margin: 0; }
.countdown { font: 400 22px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.share-fallback {
  width: 100%; resize: none;
  padding: 10px; border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font: 600 14px/1.4 var(--font-body);
}

/* ---------- toast, drag ghost, celebration ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 60;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, -12px);
  transition: opacity .2s ease, transform .25s ease;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.ghost {
  position: fixed; left: 0; top: 0; z-index: 70;
  width: 76px; height: 76px;
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(40, 20, 10, .3));
}
.ghost .capy-svg { width: 100%; height: 100%; }
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

.fx { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.float {
  position: absolute; width: 18px; height: 18px;
  animation: float-up 1.8s ease-out forwards;
}
.float svg { width: 100%; height: 100%; display: block; }
.float .h { fill: var(--heart); }

@keyframes float-up {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), -140px) scale(1.15) rotate(var(--rot, 0deg)); }
}
@keyframes pop-in { from { transform: scale(.7); } to { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 420px) {
  .soak-btn { padding: 11px 18px; }
  .ghost-btn { padding: 10px 11px; }
  .soakbar-inner { gap: 6px; padding-left: 10px; }
  .yuzu-icon { width: 19px; height: 19px; }
  .waiter { width: 64px; }
  .waiter .capy-svg { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .wisp { opacity: .5; }
}
