@charset "UTF-8";
@font-face { font-family:"Cafe WenKai"; src:url('assets/fonts/cafe-wenkai.woff2?v=4') format('woff2'); font-weight:400 700; font-style:normal; font-display:swap; }
:root {
  /* Defaults are the Halloween night; main.ts applies the current theme's palette (content/themes.ts). */
  --bg:#203c36; --text:#faf1de; --muted:#c7d2bc; --line:#56715a; --topbar:#16382fee; --panel:#14382ef0; --scrim:#0d251da6;
  --choice:#183a2e; --choice-line:#79916a; --select:#d4e595; --select-ink:#253c31;
  --accent:#f0ad68; --accent-ink:#253c31; --highlight:#f0ad68; --link:#d4e595;
  --button:#3b5943; --button-ink:#faf1de; --button-line:#7d9569; --strong:#d4e595; --strong-ink:#253c31;
  --skill-idle:#3c5140; --skill-off:#294838; --skill-off-ink:#d7dfca; --energy:#d4e595;
  --board:#142b27; --grid:#2b4035; --frame:#b38b52; --frame-outer:#654a2b; --scene-bg:#142d2c;
  --scene-image:url('assets/realistic-v2/cafe-window.webp'); --scene-fallback:none;
  --p1:#f0ad68; --p2:#e2edac; --p3:#e07a3c;
  /* Dialogs, speech bubbles and toasts stay on paper in every theme. */
  --paper:#faf1de; --ink:#253c31;
  color-scheme:dark; color:var(--text); background:var(--bg);
  font-family:"PingFang TC","Microsoft JhengHei",sans-serif; font-synthesis:none;
}
* { box-sizing:border-box; scrollbar-color:#a1af8b var(--bg); }
body { margin:0; min-width:320px; }
button,input,a { -webkit-tap-highlight-color:transparent; }
button,a { touch-action:manipulation; }
button { font:inherit; cursor:pointer; color:inherit; }
button:disabled { cursor:default; }
a { color:inherit; text-underline-offset:5px; }
button,fieldset { border:0; }
button:focus-visible,a:focus-visible,canvas:focus-visible,input:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
::selection { color:var(--accent-ink); background:var(--accent); }
[hidden] { display:none!important; }
.symbols,.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; }
h1,h2,p { margin:0; }
h1,h2 { font-family:"Cafe WenKai",serif; text-wrap:balance; font-weight:500; }
button:hover:not(:disabled) { filter:brightness(1.08); }
.topbar { max-width:1280px; margin:auto; padding:14px 32px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:1px solid var(--line); min-height:72px; background:var(--topbar); }
.shop-link { display:flex; gap:8px; align-items:center; font-size:14px; text-decoration:none; min-height:44px; }
.shop-link svg { width:19px; }
.wordmark { font-family:"Cafe WenKai",serif; font-size:21px; }
.wordmark span { font-size:15px; color:var(--muted); }
.top-actions { display:flex; align-items:center; gap:8px; }
.quiet { background:transparent; display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:8px; border-radius:8px; font-size:14px; }
.book-link>span:last-child { font-variant-numeric:tabular-nums; color:var(--muted); }
.lobby { max-width:1180px; margin:auto; padding:36px 30px 20px; display:grid; grid-template-columns:1fr 1.1fr; column-gap:40px; grid-template-areas:'title scene' 'subtitle scene' 'invite scene' 'companions scene' 'modes scene' 'modehelp scene' 'start scene' 'help scene' 'foot foot'; }
.welcome,.welcome-copy { display:contents; }
.welcome-copy h1 { grid-area:title; }
h1 strong { display:block; font-size:clamp(38px,4.8vw,60px); line-height:1.2; font-weight:500; letter-spacing:.015em; }
.subtitle { grid-area:subtitle; margin-top:15px; font-size:18px; color:var(--highlight); }
.invitation { grid-area:invite; white-space:pre-line; margin-top:14px; font-size:15px; line-height:1.8; color:var(--muted); }
.welcome-actions { grid-area:start; display:flex; gap:10px; margin-top:15px; flex-wrap:wrap; }
.primary,.outline { border-radius:12px; min-height:52px; padding:12px 22px; font-size:18px; font-weight:600; display:inline-flex; justify-content:center; align-items:center; gap:20px; }
.primary { background:var(--accent); color:var(--accent-ink); box-shadow:0 6px 16px #091c1726; }
.outline { border:1px solid var(--line); background:transparent; font-size:16px; }
.mode-choice { grid-area:modes; padding:0; margin:15px 0 0; display:flex; gap:22px; }
.mode-choice label { display:flex; align-items:center; gap:7px; cursor:pointer; min-height:36px; font-size:15px; }
.mode-choice input { accent-color:var(--accent); width:20px; height:20px; margin:0; }
.mode-help { grid-area:modehelp; font-size:13px; color:var(--muted); margin:4px 0 0; line-height:1.6; }
.text-button { grid-area:help; justify-self:start; padding:8px 0; margin-top:4px; font-size:14px; background:none; text-decoration:underline; text-underline-offset:5px; color:var(--link); min-height:44px; }
.cat-scene { grid-area:scene; min-height:540px; position:relative; isolation:isolate; overflow:hidden; border-radius:180px 180px 18px 18px; background:var(--scene-image) center/cover no-repeat,var(--scene-fallback) var(--scene-bg); box-shadow:0 18px 38px #0a201744; border:2px solid var(--frame); }
.hero-actor { position:absolute; width:90%; height:79%; left:5%; bottom:9%; transform-origin:50% 96%; }
.hero-cat { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 10px 12px #0b241b66); transform-origin:50% 95%; animation:breathe 5.6s ease-in-out infinite; }
.speech { position:absolute; left:20px; top:85px; padding:12px 16px; border-radius:16px 16px 3px 16px; background:var(--paper); color:var(--ink); font-family:"Kaiti TC",serif; font-size:17px; z-index:4; box-shadow:0 8px 22px #10271e40; max-width:250px; }
.scene-caption { position:absolute; bottom:15px; left:50%; transform:translateX(-50%); width:max-content; max-width:90%; padding:3px 14px; border-radius:20px; background:#16261c80; text-align:center; font-size:13px; letter-spacing:.1em; color:#fff2ce; text-shadow:0 1px 3px #071811; z-index:3; }
.ambient { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:2; }
.ambient i { position:absolute; top:-5%; width:9px; height:6px; background:var(--p1); border-radius:60% 0; opacity:.85; animation:drift 9s linear infinite; }
.ambient i:nth-child(1) { left:8%; animation-delay:-1s; }
.ambient i:nth-child(2) { left:22%; animation-delay:-6s; animation-duration:11s; background:var(--p2); }
.ambient i:nth-child(3) { left:37%; animation-delay:-3s; background:var(--p3); }
.ambient i:nth-child(4) { left:51%; animation-delay:-8s; animation-duration:12s; }
.ambient i:nth-child(5) { left:64%; animation-delay:-4.5s; background:var(--p2); }
.ambient i:nth-child(6) { left:76%; animation-delay:-2s; animation-duration:10s; background:var(--p3); }
.ambient i:nth-child(7) { left:88%; animation-delay:-7s; }
.ambient i:nth-child(8) { left:95%; animation-delay:-5s; animation-duration:13s; background:var(--p2); }
html[data-particle=leaf] .ambient i { width:11px; height:8px; border-radius:0 70%; }
html[data-particle=snow] .ambient i { width:6px; height:6px; border-radius:50%; animation-duration:13s; }
html[data-particle=glow] .ambient i { top:auto; bottom:12%; width:4px; height:4px; border-radius:50%; box-shadow:0 0 8px 3px var(--p1); animation:firefly 6s ease-in-out infinite; }
html[data-particle=glow] .ambient i:nth-child(even) { bottom:38%; }
@keyframes drift { 0%{transform:translate(0,0) rotate(0)} 50%{transform:translate(18px,280px) rotate(180deg)} 100%{transform:translate(-6px,620px) rotate(360deg)} }
.greeting { animation:greet .65s cubic-bezier(.16,1,.3,1); }
@keyframes breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.012,1.018)} }
@keyframes greet { 0%{transform:translateY(4px) rotate(-1deg)} 45%{transform:translateY(-5px) rotate(1deg)} 100%{transform:none} }
@keyframes firefly { 0%,100%{opacity:0;transform:translate(0,10px)} 50%{opacity:.7;transform:translate(8px,-10px)} }
.companions { grid-area:companions; margin-top:22px; }
.section-heading { margin-bottom:12px; }
.section-heading h2 { font-size:23px; }
.section-heading>span { display:none; }
.cat-picker { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.cat-choice { display:flex; flex-direction:column; align-items:center; text-align:center; padding:5px 4px 10px; border:1px solid var(--choice-line); border-radius:12px; background:var(--choice); min-width:0; overflow:hidden; }
.cat-choice[aria-pressed=true] { background:var(--select); color:var(--select-ink); border-color:var(--select); }
.portrait-frame { display:block; width:100%; height:86px; overflow:hidden; position:relative; }
.portrait-frame img { width:190%; height:auto; max-width:none; position:absolute; left:-45%; top:-8%; }
.cat-choice:first-child .portrait-frame img { width:170%; left:-48%; top:-21%; }
.cat-choice strong { display:block; font-size:17px; margin-top:5px; font-weight:500; }
.cat-choice small { display:none; }
.cat-note { padding:12px 0 0; display:flex; flex-direction:column; gap:5px; }
.cat-note p { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; line-height:1.7; font-size:13px; color:var(--muted); }
.cat-note p:first-child { display:none; }
.cat-note strong { color:var(--text); font-weight:500; }
.cat-note p>span { flex-basis:100%; }
.cat-note svg { width:16px; height:16px; color:var(--highlight); }
.lobby-footnote { grid-area:foot; text-align:center; color:var(--muted); font-size:12px; line-height:1.8; border-top:1px solid var(--line); padding-top:16px; margin-top:26px; }
body.is-playing { background:var(--scene-image) center/cover fixed no-repeat,var(--scene-fallback) fixed var(--scene-bg); }
body.is-playing:before { content:''; position:fixed; inset:0; background:var(--scrim); pointer-events:none; z-index:-1; }
body.is-playing .topbar { padding-top:6px; padding-bottom:6px; min-height:56px; }
.play { --cell:clamp(12px,min(calc((100dvh - 300px)/20),calc((100vw - 142px)/10)),30px); width:calc(var(--cell)*10 + 124px); max-width:calc(100% - 20px); margin:0 auto; padding:6px 4px 12px; background:var(--panel); border-radius:0 0 18px 18px; }
.play-heading { display:flex; align-items:center; justify-content:space-between; min-height:40px; margin-bottom:5px; }
.play-heading h1 { font-size:18px; }
.play-heading button { font-size:14px; }
.play-actions { display:flex; align-items:center; }
.play-actions .quiet { padding:6px; }
.game-layout { display:grid; grid-template-columns:calc(var(--cell)*10) 96px; gap:16px; justify-content:center; }
.board-wrap { position:relative; width:calc(var(--cell)*10); height:calc(var(--cell)*20); box-shadow:0 8px 18px #07181166; border:2px solid var(--frame); outline:4px solid var(--frame-outer); border-radius:6px; overflow:hidden; background:var(--board); }
#board { width:100%; height:100%; display:block; touch-action:none; }
#effects { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.game-side { display:flex; flex-direction:column; align-items:stretch; gap:8px; font-size:13px; min-width:0; height:calc(var(--cell)*20); }
.score>span { display:block; color:var(--muted); }
.score strong { display:block; font-size:clamp(23px,4vw,31px); line-height:1.4; color:var(--highlight); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.score small { display:block; font-size:12px; color:var(--muted); }
.game-stats { display:flex; flex-direction:column; gap:3px; }
.game-stats b { font-variant-numeric:tabular-nums; font-weight:500; }
.preview>span { color:var(--muted); font-size:12px; }
#next { width:76px; height:119px; display:block; margin:3px auto 0; }
.hold { background:#ffffff0a; border:1px solid var(--line); border-radius:8px; padding:6px 5px 2px; font-size:12px; }
.hold:disabled { opacity:.55; }
kbd { font:inherit; font-size:12px; color:var(--muted); padding-left:3px; }
.hold kbd { color:var(--muted); }
#held { width:70px; height:35px; display:block; margin:auto; }
.companion-actor { margin-top:auto; position:relative; min-height:0; flex:1; max-height:165px; }
#play-cat { display:block; width:115%; height:100%; object-fit:contain; object-position:center bottom; margin-left:-7%; transform-origin:50% 95%; animation:breathe 5.6s ease-in-out infinite; }
.companion-reaction { position:absolute; bottom:85%; right:0; width:max-content; max-width:135px; padding:8px 10px; border-radius:10px 10px 2px 10px; background:var(--paper); color:var(--ink); font-size:12px; line-height:1.5; box-shadow:0 5px 12px #07181144; pointer-events:none; }
.companion-reaction:empty { display:none; }
.companion-actor[data-reaction=celebrate],.companion-actor[data-reaction=story] { animation:celebrate .7s ease-out; }
.companion-actor[data-reaction=morph] { animation:head-tilt .6s ease-in-out; }
.companion-actor[data-reaction=paint] { animation:head-tilt .8s ease-in-out; }
.companion-actor[data-reaction=stars] { animation:celebrate .9s ease-out; }
.companion-actor[data-reaction=slow] { animation:head-tilt 1.2s ease-in-out; }
@keyframes celebrate { 0%,100%{transform:none} 35%{transform:translateY(-8px) rotate(-2deg)} 65%{transform:translateY(-3px) rotate(1deg)} }
@keyframes head-tilt { 0%,100%{transform:none} 40%{transform:rotate(-4deg)} 70%{transform:rotate(2deg)} }
.skill-button { grid-area:skill; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; min-height:84px; padding:8px 6px 12px; border-radius:14px; overflow:hidden; border:1px solid var(--button-line); background:var(--skill-idle); color:var(--button-ink); font-size:13px; line-height:1.3; text-align:center; }
.skill-button:disabled { color:var(--skill-off-ink); background:var(--skill-off); }
.skill-button:not(:disabled) { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.skill-button.charged:after { content:''; position:absolute; top:0; bottom:0; width:22px; background:#fff9d940; transform:skewX(-20deg); animation:charged 2.6s ease-in-out infinite; }
@keyframes charged { 0%,45%{left:-35px} 100%{left:110%} }
.skill-button svg { width:18px; height:18px; }
#energy { font-variant-numeric:tabular-nums; font-size:12px; white-space:nowrap; }
.energy-track { position:absolute; bottom:0; left:0; right:0; height:5px; background:#0003; }
.energy-track span { display:block; height:100%; width:0; background:var(--energy); transition:width .22s; }
.pad { --pad:116px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:'dpad skill face'; align-items:center; gap:8px; margin:10px 2px 4px; }
html[data-lefty=on] .pad { grid-template-areas:'face skill dpad'; }
.pad button { touch-action:none; user-select:none; -webkit-user-select:none; position:relative; }
.dpad { grid-area:dpad; position:relative; width:var(--pad); height:var(--pad); touch-action:none; user-select:none; -webkit-user-select:none; }
.dpad:before,.dpad:after { content:''; position:absolute; background:var(--button); border:1px solid var(--button-line); border-radius:12px; box-shadow:0 3px 0 #0002; }
.dpad:before { left:33%; width:34%; top:0; bottom:0; }
.dpad:after { top:33%; height:34%; left:0; right:0; }
.dpad button { position:absolute; z-index:1; width:34%; height:34%; padding:0; border-radius:10px; background:transparent; color:var(--button-ink); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; }
.dpad svg { width:20px; height:20px; }
.dpad small { font-size:10px; line-height:1; }
.dpad [data-pad=up] { left:33%; top:0; }
.dpad [data-pad=down] { left:33%; bottom:0; }
.dpad [data-pad=left] { left:0; top:33%; }
.dpad [data-pad=right] { right:0; top:33%; }
.dpad[data-dir=up] [data-pad=up],.dpad[data-dir=down] [data-pad=down],.dpad[data-dir=left] [data-pad=left],.dpad[data-dir=right] [data-pad=right] { background:var(--strong); color:var(--strong-ink); }
.turn-up { transform:rotate(90deg); }
.face { grid-area:face; display:grid; grid-template-columns:auto auto; grid-template-areas:'hold hold' 'b a'; gap:6px 8px; align-items:end; }
.face button { border:1px solid var(--button-line); background:var(--button); color:var(--button-ink); box-shadow:0 3px 0 #0002; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1.1; }
.face button:active,.dpad button:active { filter:brightness(1.1); }
.face [data-control=hold] { grid-area:hold; min-height:34px; border-radius:17px; font-size:12px; flex-direction:row; gap:6px; }
.face [data-control=hold]:disabled { opacity:.5; }
.face [data-control=reverse] { grid-area:b; width:50px; height:50px; border-radius:50%; font-size:17px; font-weight:700; }
.face [data-control=rotate] { grid-area:a; width:58px; height:58px; border-radius:50%; font-size:19px; font-weight:700; margin-bottom:12px; background:var(--strong); color:var(--strong-ink); border-color:var(--strong); }
.face small { font-size:10px; font-weight:400; }
.pad kbd { position:absolute; right:-4px; top:-6px; padding:0 4px; border-radius:5px; background:var(--paper); color:var(--ink); font-size:10px; line-height:15px; box-shadow:0 1px 3px #0003; z-index:2; }
/* Key labels sit in the empty corners around the cross, never on a neighbouring arm. */
.dpad [data-pad=up] kbd { top:-4px; right:-24px; }
.dpad [data-pad=down] kbd { top:auto; bottom:-4px; right:-24px; }
.dpad [data-pad=left] kbd { top:-14px; left:-2px; right:auto; }
.dpad [data-pad=right] kbd { top:-14px; right:-2px; }
.skill-button kbd { top:4px; right:4px; }
.turn-right { transform:rotate(180deg); }
.turn-down { transform:rotate(-90deg); }
.board-message { min-height:25px; margin:4px 0 0; text-align:center; color:var(--highlight); font-size:14px; line-height:25px; pointer-events:none; }
.session-note { font-size:12px; color:var(--muted); line-height:20px; text-align:center; }
.play[data-lantern=lit] .session-note { color:var(--highlight); }
.keyboard-hint { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px 12px; font-size:12px; color:var(--muted); margin-top:9px; padding-top:9px; border-top:1px solid var(--line); line-height:1.6; }
.keyboard-hint strong { color:var(--text); font-weight:500; }
.keyboard-hint kbd { display:inline-block; min-width:20px; padding:0 5px; margin-right:3px; border-radius:5px; border:1px solid var(--button-line); background:var(--button); color:var(--button-ink); text-align:center; font-size:12px; }
/* Keyboard labels only where a keyboard is likely: hover-capable fine pointers. */
@media (hover:none),(pointer:coarse),(max-width:700px) { .keyboard-hint,.pad kbd { display:none; } }
.storage-notice { position:fixed; pointer-events:none; top:8px; left:15px; right:15px; max-width:600px; margin:auto; padding:14px 18px; border-radius:10px; background:var(--paper); color:var(--ink); font-size:14px; z-index:10; box-shadow:0 8px 24px #0003; }
dialog { color:var(--ink); background:var(--paper); width:min(540px,calc(100% - 28px)); border:0; border-radius:20px; box-shadow:0 24px 80px #0005; padding:0; max-height:85dvh; overflow-y:auto; color-scheme:light; }
dialog::backdrop { background:#0b211cd9; }
.dialog-content { padding:28px; }
dialog h2 { font-size:27px; margin:0 0 18px; }
dialog p { line-height:1.85; font-size:16px; margin-bottom:14px; }
dialog .muted { font-size:13px; color:#58654f; }
.dialog-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:22px; }
.dialog-actions button { flex:1; white-space:nowrap; }
.dialog-actions .outline,.sound-test { color:var(--ink); border-color:#a7b094; }
.dialog-actions .primary { background:#536d36; color:white; font-size:16px; }
dialog ul { padding-left:22px; line-height:1.9; }
dialog kbd { color:inherit; }
.bond-dots { display:flex; justify-content:center; gap:4px; margin-top:6px; }
.bond-dots i { width:7px; height:7px; border-radius:50%; border:1px solid currentColor; opacity:.55; }
.bond-dots i.on { background:var(--accent); border-color:var(--accent); opacity:1; }
.cat-choice[aria-pressed=true] .bond-dots i.on,dialog .bond-dots i.on { background:#c4672a; border-color:#c4672a; }
dialog .bond-dots { display:inline-flex; margin:0 0 0 6px; vertical-align:middle; }
.book-intro { margin:0 0 18px; padding:14px 16px; border-left:3px solid #c4672a; background:#f1e6cc; border-radius:0 12px 12px 0; font-family:"Kaiti TC",serif; font-size:16px; line-height:1.85; }
.book-intro cite { display:block; margin-top:4px; font-style:normal; font-size:13px; color:#58654f; text-align:right; }
.book-tabs { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-bottom:6px; }
.book-tab { min-height:52px; padding:6px 4px; border:1px solid #a7b094; border-radius:10px; background:transparent; color:var(--ink); font-size:15px; display:flex; flex-direction:column; align-items:center; line-height:1.3; }
.book-tab small { font-size:12px; color:#58654f; font-variant-numeric:tabular-nums; }
.book-tab[aria-pressed=true] { background:#536d36; border-color:#536d36; color:white; }
.book-tab[aria-pressed=true] small { color:#e6edd2; }
.book-cat { display:grid; grid-template-columns:64px 1fr; gap:12px; align-items:center; padding:14px 0 6px; }
.book-cat img { width:64px; height:80px; object-fit:contain; }
.book-cat h3 { margin:0 0 2px; font-weight:500; font-size:18px; }
.book-cat p { font-size:13px; margin:0; color:#58654f; line-height:1.6; }
.card-list { list-style:none; padding:0; margin:0; }
.bond-card { padding:13px 0; border-bottom:1px solid #d5d8bc; }
.bond-card h4 { margin:0 0 4px; font-size:16px; font-weight:600; }
dialog .bond-card p { font-size:14px; line-height:1.75; margin:0; }
.bond-card.locked h4 { color:#7a8270; }
.bond-card.locked h4::before { content:"？ "; color:#c4672a; }
dialog .bond-card.locked p { color:#58654f; font-size:13px; }
.recap { margin:14px 0; }
.recap .muted { margin-bottom:0; }
.letter { margin:0 0 20px; padding:18px 18px 12px; background:#fffaf0; border:1px solid #e1d5b7; border-radius:14px; box-shadow:0 6px 18px #6b5a3015; }
.letter h3 { margin:0 0 10px; font-family:"Cafe WenKai",serif; font-weight:500; font-size:20px; }
dialog .letter p { font-family:"Kaiti TC",serif; font-size:16px; line-height:1.9; margin-bottom:8px; }
dialog .letter .signature { text-align:right; }
dialog h3 { font-size:17px; margin:18px 0 6px; font-weight:500; }
.card-toast { position:fixed; z-index:11; top:12px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:12px; padding:12px 18px; border-radius:14px; background:var(--paper); color:var(--ink); box-shadow:0 10px 30px #0006; pointer-events:none; width:max-content; max-width:calc(100% - 32px); animation:card-in .35s ease-out; }
.card-toast svg { color:#c4672a; width:26px; height:26px; }
.card-toast span { display:flex; flex-direction:column; }
.card-toast small { font-size:12px; color:#58654f; }
.card-toast strong { font-size:16px; font-weight:600; }
@keyframes card-in { from { opacity:0; transform:translate(-50%,-12px); } }
html[data-motion=off] .card-toast { animation:none; }
.setting-row { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:70px; border-bottom:1px solid #d5d8bc; padding:12px 0; }
.setting-row span { font-size:16px; }
.setting-row small { display:block; font-size:12px; color:#58654f; margin-top:5px; line-height:1.5; }
.setting-row input { width:24px; height:24px; accent-color:#536d36; flex:none; }
.volume-setting { display:flex; justify-content:space-between; margin-top:20px; }
#setting-volume { width:100%; min-height:44px; accent-color:#536d36; }
.sound-test { width:100%; margin:10px 0; min-height:44px; }
.noscript { padding:40px; text-align:center; }
html[data-motion=off] *,html[data-motion=off] *:before,html[data-motion=off] *:after { animation:none!important; transition:none!important; }
@media(max-width:700px) {
 .topbar { padding:8px 14px; gap:8px; min-height:58px; }
 .wordmark { display:none; }
 .top-actions { gap:0; }
 .quiet { font-size:13px; gap:5px; padding:8px 6px; }
 .shop-link { font-size:13px; }
 .lobby { padding:22px 18px 20px; grid-template-columns:1fr; grid-template-areas:'title' 'subtitle' 'scene' 'companions' 'modes' 'modehelp' 'start' 'help' 'foot'; }
 h1 { text-align:center; }
 h1 strong { font-size:40px; }
 .subtitle { text-align:center; margin-top:9px; font-size:16px; }
 .invitation { display:none; }
 .cat-scene { margin-top:18px; width:100%; min-height:0; height:300px; border-radius:110px 110px 12px 12px; }
 .hero-actor { width:82%; left:9%; height:87%; bottom:7%; }
 .speech { font-size:14px; left:10px; top:55px; padding:9px 12px; max-width:180px; }
 .scene-caption { bottom:9px; font-size:12px; }
 .companions { margin-top:18px; }
 .section-heading { margin-bottom:10px; text-align:center; }
 .section-heading h2 { font-size:22px; }
 .cat-picker { gap:8px; }
 .portrait-frame { height:66px; }
 .cat-choice { padding-bottom:8px; }
 .cat-choice strong { font-size:15px; margin-top:4px; }
 .cat-note p>span { display:block; text-align:center; }
 .cat-note p { justify-content:center; }
 .cat-note { padding:9px 0 0; align-items:center; }
 .mode-choice { justify-content:center; margin-top:10px; }
 .mode-help { text-align:center; font-size:12px; }
 .welcome-actions { margin-top:13px; }
 .welcome-actions button { width:100%; }
 .welcome-actions #resume { min-height:44px; }
 .text-button { justify-self:center; font-size:13px; }
 .lobby-footnote { margin-top:14px; }
 .play { padding-top:3px; }
 .play-heading h1 { font-size:17px; }
 .dialog-actions { flex-direction:column; }
 .dialog-content { padding:23px; }
 body.is-playing .topbar { min-height:52px; padding-top:4px; padding-bottom:4px; }
}
@media(max-height:720px) {
 .play { --cell:clamp(12px,min(calc((100dvh - 268px)/20),calc((100vw - 142px)/10)),25px); }
 .game-side { gap:5px; }
 .score strong { font-size:24px; }
 .game-stats { font-size:12px; }
 #next { height:86px; width:55px; }
 #held { height:28px; width:56px; }
 .hold { padding-top:4px; }
 .companion-actor { max-height:70px; }
 .pad { --pad:104px; margin-top:8px; }
 .skill-button { min-height:76px; }
 .face [data-control=rotate] { width:54px; height:54px; }
 .face [data-control=reverse] { width:46px; height:46px; }
}
@media(max-height:600px) {
 .companion-actor { display:none; } .game-side { gap:3px; } .session-note { display:none; }
 .pad { --pad:94px; margin-top:6px; }
 .skill-button { min-height:62px; }
 .face [data-control=hold] { min-height:30px; }
 .face [data-control=rotate] { width:48px; height:48px; margin-bottom:10px; }
 .face [data-control=reverse] { width:42px; height:42px; }
}
@media(orientation:landscape) and (max-height:600px) and (min-width:560px) {
 body.is-playing .topbar { min-height:48px; padding:2px 18px; }
 .play { --cell:max(8px,calc((100dvh - 118px)/20)); width:max-content; max-width:calc(100% - 20px); display:grid; grid-template-columns:calc(var(--cell)*10) 100px minmax(240px,280px); grid-template-rows:44px 52px 1fr 50px; gap:5px 14px; padding:4px 12px 10px; }
 .play-heading { grid-column:1/-1; grid-row:1; margin:0; }
 .game-layout { display:contents; }
 .board-wrap { grid-column:1; grid-row:2/5; }
 .game-side { grid-column:2; grid-row:2/5; gap:3px; }
 .score strong { font-size:23px; line-height:1.2; }
 .game-stats { flex-direction:row; flex-wrap:wrap; gap:2px 8px; }
 #next { width:48px; height:75px; }
 .hold { margin-top:auto; min-height:44px; }
 #held { width:48px; height:24px; }
 .pad { grid-column:3; grid-row:2/4; margin:0; align-self:center; grid-template-columns:auto auto; grid-template-areas:'skill skill' 'dpad face'; justify-content:space-between; }
 html[data-lefty=on] .pad { grid-template-areas:'skill skill' 'face dpad'; }
 .skill-button { min-height:44px; flex-direction:row; gap:8px; }
 .board-message { grid-column:3; grid-row:4; align-self:center; line-height:20px; margin:0; }
 .keyboard-hint,.session-note { display:none; }
}
@media(prefers-reduced-motion:reduce) {
 html:not([data-motion=on]) *,html:not([data-motion=on]) *:before,html:not([data-motion=on]) *:after { animation:none!important; transition:none!important; }
}
.games-link { text-decoration:none; }
@media (max-width:480px) { .games-link span { display:none; } }
