/* Shared controls. Layout belongs to the page; surfaces and states belong here.
   primary/secondary aliases keep dynamically created and guest controls consistent. */
@import url('./tokens.css');
:root {
 --ui-control-radius:12px;
 --ui-control-height:48px;--ui-control-small-height:36px;
}
.ui-button,.primary,.secondary {
 display:inline-flex;align-items:center;justify-content:center;gap:8px;
 min-width:44px;min-height:var(--ui-control-height);padding:12px 18px;
 border:1px solid var(--ui-border);border-radius:var(--ui-control-radius);
 background:var(--ui-surface);color:var(--ui-text);box-shadow:var(--ui-control-shadow);
 font-family:var(--font-ui);font-size:14px;font-weight:650;line-height:1.3;
 text-align:center;text-decoration:none;cursor:pointer;touch-action:manipulation;
 transition:background 120ms ease,border-color 120ms ease,transform 90ms ease;
}
.primary,.ui-button[data-variant=primary] {background:var(--ui-action);border-color:var(--ui-action);color:var(--ui-action-ink)}
.ui-button[data-variant=quiet] {background:transparent;border-color:transparent;box-shadow:none}
.ui-button svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
@media(hover:hover) {
 :is(.ui-button,.primary,.secondary):not(:disabled):hover {background:var(--ui-surface-hover)}
 :is(.primary,.ui-button[data-variant=primary]):not(:disabled):hover {background:var(--ui-action-hover);border-color:var(--ui-action-hover)}
}
:is(.ui-button,.primary,.secondary):not(:disabled):active {transform:translateY(1px);background:var(--ui-surface-hover);box-shadow:none}
:is(.primary,.ui-button[data-variant=primary]):not(:disabled):active {background:var(--ui-action-pressed);border-color:var(--ui-action-pressed)}
:is(.ui-button,.primary,.secondary):focus-visible {outline:3px solid var(--ui-focus);outline-offset:3px}
:is(.ui-button,.primary,.secondary):disabled {opacity:1;cursor:default;background:var(--ui-disabled);border-color:var(--ui-disabled);color:var(--ui-disabled-text);box-shadow:none;transform:none}
.ui-button[data-size=small] {position:relative;min-height:var(--ui-control-small-height);padding:7px 12px;border-radius:8px;font-size:13px}
/* A compact visible surface with a 44px pointer target. Leave at least 8px
   between vertically adjacent small buttons so their hit areas do not overlap. */
.ui-button[data-size=small]::after {content:"";position:absolute;inset:-4px 0}
.ui-button[data-layout=stack] {flex-direction:column;gap:5px;min-height:72px;font-size:12px}
.ui-button[data-layout=icon] {width:44px;height:44px;min-height:44px;padding:10px}
.ui-button[data-width=full] {width:100%}
.ui-button[data-layout=icon][data-shape=circle] {border-radius:50%}
.ui-scroll-row {min-width:0;overflow-x:auto;touch-action:pan-x;overscroll-behavior-x:contain;user-select:none}
.ui-scroll-row[data-dragging=true],.ui-scroll-row[data-dragging=true] * {cursor:grabbing}
/* More to the side: a small arrow at the edge of a ui-scroll-row, shown until the row is moved.
   The page places it (its parent is the positioning box) and turns it on with data-on. */
.ui-scroll-hint {position:absolute;display:grid;place-items:center;width:26px;height:26px;border:1px solid var(--ui-border);border-radius:50%;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 2px 8px var(--ui-shadow-soft);pointer-events:none;opacity:0;transition:opacity 200ms ease}
.ui-scroll-hint[data-on=true] {opacity:1}
.ui-scroll-hint svg {width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ui-scroll-hint[data-on=true] svg {animation:ui-scroll-hint-nudge 1.6s ease-in-out infinite}
@keyframes ui-scroll-hint-nudge {0%,100% {transform:translateX(-1px)} 50% {transform:translateX(2px)}}
@media(prefers-reduced-motion:reduce) {.ui-scroll-hint {transition:none}.ui-scroll-hint[data-on=true] svg {animation:none}}
@media(prefers-reduced-motion:reduce) {.ui-button,.primary,.secondary {transition:none}}
@media(forced-colors:active) {
 .ui-button,.primary,.secondary {background:ButtonFace;color:ButtonText;border:1px solid ButtonText;box-shadow:none}
 :is(.ui-button,.primary,.secondary):disabled {color:GrayText;border-color:GrayText}
 :is(.ui-button,.primary,.secondary):focus-visible {outline-color:Highlight}
}

/* Compact line navigation: Collection on the left, the brand in the middle, the
   controls toggle on the right. Each is a quiet 44px hit area around a 21px line icon. */

.ui-header-action {
 display:inline-flex;align-items:center;justify-content:center;flex:none;
 width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:12px;
 background:transparent;color:var(--ui-icon);cursor:pointer;filter:var(--ui-header-icon-shadow);touch-action:manipulation;
}
.ui-header-action img {display:block;object-fit:contain;pointer-events:none;user-select:none}
.ui-header-action svg {display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.ui-header-action:not(:disabled):active {transform:translateY(1px)}
.ui-header-action:focus-visible {outline:2px solid var(--ui-focus);outline-offset:2px}
.ui-header-action:disabled {opacity:.45;cursor:default}
/* Something new waits behind this control (a keycap drawn since Collection was last opened). */
.ui-header-action {position:relative}
.ui-header-dot {position:absolute;top:9px;right:9px;width:8px;height:8px;border-radius:50%;background:var(--ui-action);box-shadow:0 0 0 2px var(--ui-stage-mid);pointer-events:none}
/* The same mark on a dock action (the button is positioned by its page). */
.ui-action-dot {position:absolute;top:7px;right:9px;width:8px;height:8px;border-radius:50%;background:var(--ui-action);box-shadow:0 0 0 2px var(--ui-surface);pointer-events:none}
/* The brand lockup in a row, for the top bar: small, and the symbol only just taller than the logotype. */
.ui-brand-lockup[data-layout=row] {flex-direction:row;justify-content:center;gap:7px;flex:1;min-width:0;color:var(--brand-ink,var(--ui-icon));filter:var(--ui-header-brand-shadow)}
.ui-brand-lockup[data-layout=row] .ui-brand-symbol {width:auto;height:13px}
.ui-brand-lockup[data-layout=row] .ui-brand-logotype {width:auto;max-width:none;height:11px}
.ui-brand-lockup[data-layout=row] svg {width:auto;height:100%}
/* Ticket count: a fixed-width cell, so the progress bar beside it never moves as the
   balance changes on the same device. Four digits fit at full size; longer balances
   shrink to stay inside the cell. */
.ui-ticket-count {--ui-ticket-font:20px;--ui-ticket-scale:1;display:flex;align-items:center;flex:none;gap:5px;width:94px;color:var(--ui-text)}
.ui-ticket-count img {display:block;flex:none;width:28px;height:22px;object-fit:contain}
.ui-ticket-count b {flex:1;min-width:0;font-size:calc(var(--ui-ticket-font) * var(--ui-ticket-scale));font-weight:800;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap}
/* Manrope 800 tabular digits are about 0.61em wide, so the 50px number box holds four
   at 20px; each further digit steps the size down to keep the count inside the cell.
   Pages scale the whole cell with --ui-ticket-scale; the digit steps stay here. */
/* The + beside a zero count: opens the offer of tickets for an ad (src/game/ad-ui.js).
   26px disc with a 44px touch area; quiet when no ad can be watched now. */
.ui-ticket-add {position:relative;display:grid;place-items:center;flex:none;width:26px;height:26px;margin-right:-2px;padding:0;border:0;border-radius:50%;background:var(--ui-action);color:var(--ui-action-ink);cursor:pointer}
.ui-ticket-add::after {content:"";position:absolute;inset:-9px}
.ui-ticket-add svg {display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
.ui-ticket-add[data-ready=false] {background:var(--ui-soft-fill);color:var(--ui-muted)}
.ui-ticket-add:focus-visible {outline:2px solid var(--ui-focus);outline-offset:2px}
.ui-ticket-add[hidden] {display:none}
@media(forced-colors:active) {.ui-ticket-add {border:1px solid ButtonText;background:ButtonFace;color:ButtonText}}
.ui-ticket-count[data-digits="5"] {--ui-ticket-font:16px}
.ui-ticket-count[data-digits="6"] {--ui-ticket-font:13.5px}
.ui-ticket-count[data-digits="7"] {--ui-ticket-font:11.5px}
.ui-ticket-count[data-digits="8"] {--ui-ticket-font:10px}
.ui-ticket-count[data-digits="9"] {--ui-ticket-font:9px}
.ui-ticket-count[data-digits="10"] {--ui-ticket-font:8px}
/* A rainbow turning around the border says a ticket is ready to spend. The button's own
   surface moves to ::after so the gradient shows only in the 2px ring; hover, pressed and
   disabled keep their usual fills. */
.ui-button[data-halo=rainbow] {position:relative;isolation:isolate;overflow:hidden;background:transparent;border-color:transparent}
/* One turn when a ticket arrives, then the ring rests (2026-10-20): a ring that never stops kept a
   phone's WebView compositing every frame, about a core while the player was idle. */
.ui-button[data-halo=rainbow]::before {content:"";position:absolute;inset:-150%;z-index:-2;background:var(--ui-draw-halo);animation:ui-halo-turn 2.6s linear}
.ui-button[data-halo=rainbow]::after {content:"";position:absolute;inset:2px;z-index:-1;border-radius:calc(var(--ui-control-radius) - 2px);background:var(--ui-action);transition:background 120ms ease}
@media(hover:hover) {.ui-button[data-halo=rainbow]:not(:disabled):hover {background:transparent}.ui-button[data-halo=rainbow]:not(:disabled):hover::after {background:var(--ui-action-hover)}}
.ui-button[data-halo=rainbow]:not(:disabled):active {background:transparent}
.ui-button[data-halo=rainbow]:not(:disabled):active::after {background:var(--ui-action-pressed)}
/* A second, identical turn: switching data-halo-turn starts a fresh turn for the next ticket. */
.ui-button[data-halo=rainbow][data-halo-turn=b]::before {animation-name:ui-halo-turn-b}
@keyframes ui-halo-turn {to {transform:rotate(1turn)}}
@keyframes ui-halo-turn-b {to {transform:rotate(1turn)}}
@media(prefers-reduced-motion:reduce) {.ui-button[data-halo=rainbow]::before,.ui-button[data-halo=rainbow][data-halo-turn=b]::before {animation:none}}
@media(forced-colors:active) {
 .ui-header-action {border:1px solid ButtonText;background:Canvas;filter:none;box-shadow:none}
 .ui-header-dot,.ui-action-dot {background:Highlight;box-shadow:none}
 .ui-button[data-halo=rainbow] {background:ButtonFace;border-color:ButtonText}
 .ui-button[data-halo=rainbow]::before,.ui-button[data-halo=rainbow]::after {display:none}
}
/* Shared settings controls. Use with native buttons, labels and details. */
:root {--ui-panel-radius:18px;}
.ui-panel {padding:18px;border:1px solid var(--ui-border);border-radius:var(--ui-panel-radius);background:var(--ui-panel-fill);text-align:left}
.ui-panel h3 {margin:0;font-size:14px;font-weight:750;line-height:1.4}
.ui-row {display:flex;align-items:center;justify-content:space-between;gap:12px}
.ui-row>div {min-width:0}
.ui-row>.ui-button {flex-shrink:0}
.ui-caption {margin:0;color:var(--color-muted);font-size:10px;font-weight:750;letter-spacing:.13em;line-height:1.5}
.ui-description {margin:4px 0 0;color:var(--color-muted);font-size:12px;font-weight:400;line-height:1.6}
.ui-badge {display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:6px;background:var(--ui-soft-fill);color:var(--color-muted);font-size:10px;font-weight:650;line-height:1.4;white-space:nowrap}
.ui-badge[data-tone=selected] {background:var(--ui-selected-fill);color:var(--ui-selected-ink)}
/* Fever (2026-10-08). The brand mark fills from the left in the action colour as play goes
   toward the next stage (--fever-fill 0 to 1), the first fever included. Once in fever, the
   badge reads FEVER and the ticket multiplier (x1 in the muted ink out of fever),
   waves its letters independently of taps, and draws a 1px reserve that charges with continued
   play and drains smoothly on a break (--fever-hold 0 to 1). The top stage writes FEVER in the
   Open button's rainbow. */
.ui-brand-lockup .ui-fever-mark {position:relative;display:flex;flex-direction:row;align-items:center;gap:inherit;height:100%;transform-origin:50% 60%}
.ui-brand-lockup .ui-fever-mark-fill,.ui-brand-lockup .ui-fever-mark-hit {position:absolute;inset:0;display:flex;flex-direction:row;align-items:center;gap:inherit;color:var(--ui-fever);pointer-events:none}
.ui-brand-lockup .ui-fever-mark-fill {clip-path:inset(0 calc(100% - var(--fever-fill,0) * 100%) 0 0)}
.ui-brand-lockup .ui-fever-mark-hit {opacity:0;color:color-mix(in srgb,var(--ui-fever),white 25%)}
/* Each tap has a fast contact and one quiet release. The ink pulse reaches the
   whole silhouette, including the first tap when the time-based gauge is empty. */
.ui-fever-mark[data-fever-motion=tap] {animation:ui-fever-contact 170ms ease-out}
.ui-fever-mark[data-fever-motion=tap] .ui-fever-mark-hit {animation:ui-fever-ink 170ms ease-out}
.ui-fever-mark[data-fever-motion=rise] {animation:ui-fever-charge 360ms ease-out}
.ui-fever-mark[data-fever-motion=rise] .ui-fever-mark-hit {animation:ui-fever-sweep 360ms ease-out}
@keyframes ui-fever-contact {0% {transform:scale(.982,.96)} 38% {transform:scale(1.018,1.025)} 100% {transform:scale(1)}}
@keyframes ui-fever-ink {0% {opacity:.48} 35% {opacity:.22} 100% {opacity:0}}
@keyframes ui-fever-charge {0% {transform:scale(.97)} 35% {transform:scale(1.045)} 100% {transform:scale(1)}}
@keyframes ui-fever-sweep {0% {opacity:0;clip-path:inset(0 100% 0 0)} 18% {opacity:.9;clip-path:inset(0 70% 0 0)} 75% {opacity:.65;clip-path:inset(0 0 0 70%)} 100% {opacity:0;clip-path:inset(0 0 0 100%)}}
/* Stage-rise celebration lives around FEVER, above the edge light but below its text. */
.ui-fever-burst {position:absolute;inset:0;width:100%;height:100%;z-index:31;pointer-events:none}
.ui-fever-badge {display:grid;justify-items:center;gap:5px;pointer-events:none;filter:var(--ui-header-brand-shadow);transition:opacity 240ms ease}
.ui-fever-badge[hidden] {display:none}
.ui-fever-word {display:block;color:var(--ui-fever);font-size:19px;font-weight:850;line-height:1;letter-spacing:.1em;white-space:nowrap;transition:color .3s ease}
/* Out of fever the badge waits in the muted ink. */
.ui-fever-badge[data-stage="0"] {opacity:.45}
.ui-fever-badge[data-stage="0"] .ui-fever-word {color:var(--color-muted)}
.ui-fever-badge[data-stage="0"] .ui-fever-hold i {background:var(--color-muted)}
.ui-fever-word span {letter-spacing:0;font-variant-numeric:tabular-nums}
.ui-fever-word .ui-fever-letters {display:inline-flex;gap:.1em;margin-right:.1em}
.ui-fever-letters i {display:inline-block;font-style:normal;--fever-letter-index:0}
.ui-fever-letters i:nth-child(2) {--fever-letter-index:1}
.ui-fever-letters i:nth-child(3) {--fever-letter-index:2}
.ui-fever-letters i:nth-child(4) {--fever-letter-index:3}
.ui-fever-letters i:nth-child(5) {--fever-letter-index:4}
/* One wave every 2.8 s, started by fever-motion.js (data-hop a/b). A wave looping in CSS kept ticking
   through its rest, so a phone's WebView composed every frame of fever. The wave is the first 21% of
   the 2.8 s loop it replaces, with the same keyframe timings in milliseconds. */
.ui-fever-badge:not([data-stage="0"])[data-hop] .ui-fever-letters i {animation:ui-fever-letter-hop .588s cubic-bezier(.3,.7,.4,1);animation-delay:calc(var(--fever-letter-index) * 80ms)}
.ui-fever-badge:not([data-stage="0"])[data-hop=b] .ui-fever-letters i {animation-name:ui-fever-letter-hop-b}
/* One short left-to-right ripple, then a quiet rest. The multiplier stays still. */
@keyframes ui-fever-letter-hop {0%,23.81%,100% {transform:translateY(0)} 52.38% {transform:translateY(-2.5px)} 80.95% {transform:translateY(.3px)}}
@keyframes ui-fever-letter-hop-b {0%,23.81%,100% {transform:translateY(0)} 52.38% {transform:translateY(-2.5px)} 80.95% {transform:translateY(.3px)}}
.ui-fever-caption {color:var(--color-muted);font-size:8px;font-weight:750;line-height:1;letter-spacing:.14em;white-space:nowrap}
/* Short phones put the explanation beside the rate so neither needs to shrink to
   fit a three-line badge in the narrow gap above the board. */
.ui-fever-badge[data-compact=true] {grid-template-columns:auto auto;align-items:center;gap:4px 8px}
.ui-fever-badge[data-compact=true] .ui-fever-word {font-size:16px}
.ui-fever-badge[data-compact=true] .ui-fever-hold {grid-column:1 / -1}
.ui-fever-badge[data-top="true"] :is(.ui-fever-letters i,.ui-fever-rate) {background:var(--ui-fever-top);-webkit-background-clip:text;background-clip:text;color:transparent}
.ui-fever-badge[data-top="true"] .ui-fever-letters i {background-size:500% 100%;background-position:calc(var(--fever-letter-index) * 25%) 50%}
.ui-fever-hold {position:relative;display:block;width:100%;height:1px;overflow:hidden;background:var(--ui-progress-track)}
.ui-fever-hold i {position:absolute;inset:0;background:var(--ui-fever);transform:scaleX(var(--fever-hold,0));transform-origin:0 50%;transition:transform 100ms linear}
.ui-fever-badge[data-hold-drain=true] .ui-fever-hold i {transition:none}
@media(prefers-reduced-motion:reduce) {.ui-fever-badge,.ui-fever-hold i {transition:none}.ui-fever-burst {display:none}.ui-fever-mark[data-fever-motion],.ui-fever-mark[data-fever-motion] .ui-fever-mark-hit,.ui-fever-badge:not([data-stage="0"])[data-hop] .ui-fever-letters i {animation:none}}
@media(forced-colors:active) {.ui-brand-lockup .ui-fever-mark-fill,.ui-fever-word {color:Highlight}.ui-fever-badge[data-stage="0"] {opacity:1}.ui-fever-badge[data-top="true"] :is(.ui-fever-letters i,.ui-fever-rate) {background:none;color:Highlight}.ui-fever-hold i {background:Highlight}}
.ui-choice {position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:68px;min-width:44px;padding:12px 8px;border:1px solid var(--ui-border);border-radius:var(--ui-control-radius);background:var(--ui-surface);color:var(--ui-text);font:inherit;cursor:pointer;touch-action:manipulation}
.ui-choice strong {font-size:15px;font-weight:750}
.ui-choice span {font-size:11px;color:var(--color-muted)}
.ui-choice[aria-pressed=true] {background:var(--color-action);border-color:var(--color-action);color:var(--ui-selection-ink)}
.ui-choice[aria-pressed=true] span {color:var(--ui-selection-ink)}
/* Compact choice: for dense grids (the nine switches), where a note may wrap to two lines. */
.ui-choice[data-size=compact] {min-height:64px;padding:10px 6px;text-align:center}
.ui-choice[data-size=compact] strong {font-size:14px}
.ui-choice[data-size=compact] span {line-height:1.3}
.ui-choice:disabled {background:var(--ui-disabled);color:var(--ui-disabled-text);cursor:default}
/* Not open yet but still pressable (a locked switch plays once): muted, never selected. */
.ui-choice[data-locked=true] {color:var(--ui-muted)}
.ui-choice[data-locked=true] strong {font-weight:650}
/* Tabs keep navigation separate from the scrolling contents of each panel. */
.ui-tabs {display:flex;gap:4px;padding:4px;border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-soft-fill)}
.ui-tab {flex:1;min-width:0;min-height:44px;border:0;border-radius:10px;padding:10px 16px;background:transparent;color:var(--ui-muted);font:inherit;font-size:13px;font-weight:750;cursor:pointer;touch-action:manipulation}
.ui-tab[aria-selected=true] {background:var(--ui-selection);color:var(--ui-selection-ink)}
.ui-tab:focus-visible {outline:2px solid var(--ui-focus);outline-offset:2px}
@media(hover:hover) {.ui-tab:not([aria-selected=true]):hover {background:var(--ui-surface-hover);color:var(--ui-text)}}
.ui-tab:active {transform:translateY(1px)}
@media(forced-colors:active) {.ui-tab[aria-selected=true] {background:Highlight;color:HighlightText;outline:1px solid Highlight}}
.theme-option.ui-choice {width:100%;flex-direction:row;justify-content:flex-start;gap:12px;padding:12px;text-align:left}
.theme-option.ui-choice:disabled {opacity:1;background:var(--ui-surface);color:var(--ui-muted)}
.theme-option.ui-choice i {width:48px;height:48px;flex:none;border-radius:9px;background:#e8e9e6 url('/public/assets/themes/mood-thumbnails/neutral.jpg') center/cover no-repeat;box-shadow:inset 0 0 0 1px #00000015}
.theme-option.ui-choice[data-mood=sunlit-chalk-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/sunlit-chalk-v1.jpg')}
.theme-option.ui-choice[data-mood=color-atelier-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/color-atelier-v1.jpg')}
.theme-option.ui-choice[data-mood=walnut-desk-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/walnut-desk-v1.jpg')}
.theme-option.ui-choice[data-mood=jelly-lab-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/jelly-lab-v1.jpg')}
.theme-option.ui-choice[data-mood=metal-workbench-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/metal-workbench-v1.jpg')}
.theme-option.ui-choice[data-mood=dessert-cafe-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/dessert-cafe-v1.jpg')}
.theme-option.ui-choice[data-mood=night-study-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/night-study-v1.jpg')}
.theme-option.ui-choice[data-mood=control-room-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/control-room-v1.jpg')}
.theme-option.ui-choice[data-mood=retro-arcade-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/retro-arcade-v1.jpg')}
.theme-option.ui-choice[data-mood=living-corner-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/living-corner-v1.jpg')}
.theme-option.ui-choice[data-mood=pattern-studio-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/pattern-studio-v1.jpg')}
.theme-option.ui-choice[data-mood=prism-gallery-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/prism-gallery-v1.jpg')}
.theme-option.ui-choice[data-mood=photo-greenhouse-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/photo-greenhouse-v1.jpg')}
.theme-option.ui-choice[data-mood=fiesta-courtyard-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/fiesta-courtyard-v1.jpg')}
.theme-option.ui-choice[data-mood=velvet-stage-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/velvet-stage-v1.jpg')}
.theme-option.ui-choice[data-mood=citrus-pavilion-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/citrus-pavilion-v1.jpg')}
.theme-option.ui-choice[data-mood=lavender-spa-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/lavender-spa-v1.jpg')}
.theme-option.ui-choice[data-mood=copper-atrium-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/copper-atrium-v1.jpg')}
.theme-option.ui-choice[data-mood=cherry-chrome-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/cherry-chrome-v1.jpg')}
.theme-option.ui-choice[data-mood=rainy-window-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/rainy-window-v1.jpg')}
.theme-option.ui-choice[data-mood=moonlit-garden-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/moonlit-garden-v1.jpg')}
.theme-option.ui-choice[data-mood=gesso-bole-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/gesso-bole-v1.jpg')}
.theme-option.ui-choice[data-mood=gold-leaf-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/gold-leaf-v1.jpg')}
.theme-option.ui-choice[data-mood=burnished-gold-v1] i {background-image:url('/public/assets/themes/mood-thumbnails/burnished-gold-v1.jpg')}
/* A locked mood keeps its name and its condition, and hides its picture (after the list above: same weight). */
.theme-option.ui-choice:disabled i {position:relative;background:var(--ui-placeholder-face);box-shadow:none}
.theme-option.ui-choice:disabled i::after {content:'';position:absolute;inset:0;background:var(--ui-placeholder-ink);mask:var(--ui-unknown-mark) center/130% no-repeat}
.theme-option.ui-choice strong,.theme-option.ui-choice small {display:block;color:inherit}
.theme-option.ui-choice>span {color:inherit;min-width:0}
.theme-option.ui-choice strong {font-size:13px}
.theme-option.ui-choice small {font-size:11px;margin-top:3px;line-height:1.5}
.ui-select {display:block;width:100%;min-height:48px;margin-top:8px;padding:10px 12px;border:1px solid var(--ui-border);border-radius:var(--ui-control-radius);background:var(--ui-surface);color:var(--ui-text);font:inherit;font-size:16px;cursor:pointer}
.ui-field-label {font-size:12px;font-weight:650;color:var(--ui-text);letter-spacing:normal;line-height:1.5}
/* Text entry: the same surface as ui-select. 16px text so iOS does not zoom on focus. */
.ui-text-field {display:block;box-sizing:border-box;width:100%;min-height:48px;margin-top:8px;padding:10px 12px;border:1px solid var(--ui-border);border-radius:var(--ui-control-radius);background:var(--ui-surface);color:var(--ui-text);font:inherit;font-size:16px;line-height:1.5}
textarea.ui-text-field {min-height:112px;resize:vertical}
.ui-text-field::placeholder {color:var(--color-muted)}
.ui-text-field:focus-visible {outline:3px solid var(--ui-focus);outline-offset:2px}
.ui-range {appearance:none;-webkit-appearance:none;display:block;width:100%;height:44px;min-height:44px;margin:0;background:transparent;accent-color:var(--ui-action);cursor:pointer;--ui-range-rest:var(--ui-border)}
.ui-range::-webkit-slider-runnable-track {height:6px;border:0;border-radius:6px;background:linear-gradient(to right,var(--ui-action) 0 var(--ui-range-fill,80%),var(--ui-range-rest) var(--ui-range-fill,80%) 100%)}
.ui-range::-webkit-slider-thumb {-webkit-appearance:none;appearance:none;width:16px;height:16px;margin-top:-5px;border:0;border-radius:50%;background:var(--ui-action)}
.ui-range::-moz-range-track {height:6px;border:0;border-radius:6px;background:var(--ui-range-rest)}
.ui-range::-moz-range-progress {height:6px;border-radius:6px;background:var(--ui-action)}
.ui-range::-moz-range-thumb {width:16px;height:16px;border:0;border-radius:50%;background:var(--ui-action)}
@media(forced-colors:active) {.ui-range {--ui-action:Highlight;--ui-range-rest:GrayText}.ui-choice[aria-pressed=true] span {color:CanvasText}}
.ui-disclosure {font-size:12px;text-align:left}
.ui-disclosure+.ui-disclosure {border-top:1px solid var(--ui-border)}
.ui-disclosure summary {display:flex;align-items:center;gap:8px;min-height:52px;cursor:pointer;list-style:none;font-size:13px;font-weight:650}
.ui-disclosure summary::-webkit-details-marker {display:none}
.ui-disclosure summary::after {content:'+';margin-left:auto;color:var(--color-muted);font-size:20px;font-weight:400}
.ui-disclosure[open] summary::after {content:'−'}
.ui-disclosure summary .ui-description {margin:0;font-size:10px}
.ui-disclosure>div {padding:0 0 14px;color:var(--color-muted);line-height:1.7}
.ui-disclosure p {margin:0 0 10px}
.ui-disclosure p:last-child {margin-bottom:0}
:is(.ui-choice,.ui-disclosure summary):focus-visible {outline:3px solid var(--ui-focus);outline-offset:3px}
:is(input,select,textarea):focus-visible {outline:0;box-shadow:0 0 0 3px var(--ui-focus-halo)}
dialog[tabindex="-1"]:focus {outline:0}
@media(hover:hover) {.ui-choice:not(:disabled):hover {border-color:var(--ui-focus)}.ui-disclosure summary:hover {color:var(--ui-focus)}}
@media(forced-colors:active) {.ui-panel,.ui-choice,.ui-select,.ui-badge {background:Canvas;color:CanvasText;border:1px solid ButtonText}.ui-choice[aria-pressed=true] {outline:2px solid Highlight}}

/* Non-interactive selected-item marker. Pair with the control's aria-pressed state. */
.ui-current-mark {display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;border:1px solid var(--ui-selected-border);border-radius:50%;background:var(--ui-selected-fill);color:var(--ui-selected-ink);pointer-events:none}
.ui-current-mark svg {display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(forced-colors:active) {.ui-current-mark {background:Canvas;color:Highlight;border-color:Highlight}}
/* Keep text labels visible: rarity is never communicated by color alone. */
[data-rarity=common] {--rarity-ink:var(--rarity-common-ink);--rarity-accent:var(--rarity-common-accent);--rarity-surface:var(--rarity-common-surface);--rarity-line:var(--rarity-common-line)}
[data-rarity=uncommon] {--rarity-ink:var(--rarity-uncommon-ink);--rarity-accent:var(--rarity-uncommon-accent);--rarity-surface:var(--rarity-uncommon-surface);--rarity-line:var(--rarity-uncommon-line)}
[data-rarity=rare] {--rarity-ink:var(--rarity-rare-ink);--rarity-accent:var(--rarity-rare-accent);--rarity-surface:var(--rarity-rare-surface);--rarity-line:var(--rarity-rare-line)}
[data-rarity=epic] {--rarity-ink:var(--rarity-epic-ink);--rarity-accent:var(--rarity-epic-accent);--rarity-surface:var(--rarity-epic-surface);--rarity-line:var(--rarity-epic-line)}
[data-rarity=legendary] {--rarity-ink:var(--rarity-legendary-ink);--rarity-accent:var(--rarity-legendary-accent);--rarity-surface:var(--rarity-legendary-surface);--rarity-line:var(--rarity-legendary-line)}
[data-rarity=mythic] {--rarity-ink:var(--rarity-mythic-ink);--rarity-accent:var(--rarity-mythic-accent);--rarity-surface:var(--rarity-mythic-surface);--rarity-line:var(--rarity-mythic-line)}
.ui-collectible {min-width:0;padding:8px 6px;border:1px solid var(--ui-collectible-border);border-radius:12px;background:var(--ui-collectible-surface);text-align:center}
.ui-collectible .ui-collectible-name {display:block;margin:6px 0 4px;font-size:11px;font-weight:700;line-height:1.35;color:var(--rarity-ink);overflow-wrap:anywhere}
.ui-rarity {display:inline-flex;align-items:center;justify-content:center;max-width:100%;padding:4px 6px;border-radius:6px;background:var(--rarity-surface);color:var(--rarity-ink);font-size:10px;font-weight:700;line-height:1.3;white-space:nowrap}
.ui-collectible .ui-collectible-count {display:block;margin:4px 0 0;font-size:10px;font-weight:400;line-height:1.5;color:var(--ui-collectible-muted)}
@media(forced-colors:active) {.ui-collectible,.ui-rarity {background:Canvas;border:1px solid CanvasText;color:CanvasText}.ui-collectible .ui-collectible-name {color:CanvasText}}

.ui-collectible .art {display:block;width:100%;max-width:100px;height:auto;aspect-ratio:1;margin:auto}
/* The question mark of something not found yet: an undiscovered keycap, a locked mood. */
:root {--ui-unknown-mark:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpath%20d%3D%22M40%2039c0-12%2021-13%2021%200%200%208-11%208-11%2017%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%226%22%20stroke-linecap%3D%22round%22%2F%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2267%22%20r%3D%223.2%22%2F%3E%3C%2Fsvg%3E")}
.ui-collectible.is-missing {position:relative;min-height:150px;display:grid;place-items:center}
.ui-collectible.is-missing > :not(.art) {display:none}
/* An undiscovered keycap keeps its question mark over a faint, grey, softened picture of itself
   (2026-10-20, user decision), so the shelf hints at what is still out there without naming it.
   The plain silhouette stands in until that picture is drawn (data-art=hint). */
.ui-collectible.is-missing .art {filter:grayscale(1) blur(2px);opacity:.45}
.ui-collectible.is-missing[data-art=hint]::before {display:none}
.ui-collectible.is-missing:not([data-art=hint]) .art {visibility:hidden}
.ui-collectible.is-missing::before,.ui-collectible.is-missing::after {content:'';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:calc(100% - 12px);max-width:100px;aspect-ratio:1;pointer-events:none}
.ui-collectible.is-missing::before {background:var(--ui-placeholder-face);mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpath%20d%3D%22M23%207h54c7%200%2010%204%2012%2011l7%2062c1%208-3%2013-11%2013H15C7%2093%203%2088%204%2080l7-62c2-7%205-11%2012-11Z%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
/* The mark sits small on the keycap's top face (2026-10-21, user decision), over the silhouette
   and over the picture alike. */
.ui-collectible.is-missing::after {background:var(--ui-placeholder-ink);mask:var(--ui-unknown-mark) 50% 27%/44% no-repeat}
@media(forced-colors:active) {.ui-collectible.is-missing {border-color:CanvasText}}

/* Next goal chip (2026-10-21, user decision): the closest unlock in one line, opening where it
   lives. A 36px surface with a 44px target. */
.ui-goal-chip {position:relative;display:flex;align-items:center;gap:9px;width:max-content;max-width:100%;min-height:36px;margin:0 auto;padding:5px 14px 5px 5px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-surface);box-shadow:var(--ui-control-shadow);color:var(--ui-text);font-family:var(--font-ui);font-size:12px;font-weight:400;line-height:1.3;cursor:pointer;touch-action:manipulation}
.ui-goal-chip[hidden] {display:none}
.ui-goal-chip::after {content:"";position:absolute;inset:-4px 0}
.ui-goal-chip:not(:disabled):active {transform:translateY(1px)}
.ui-goal-chip:focus-visible {outline:3px solid var(--ui-focus);outline-offset:3px}
.ui-goal-icon {display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:999px;background:var(--ui-soft-fill);color:var(--color-muted)}
.ui-goal-icon svg {width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ui-goal-chip[data-kind=mood] .ui-goal-icon {background:var(--ui-placeholder-face)}
.ui-goal-chip[data-kind=mood] .ui-goal-icon::after {content:"";width:100%;height:100%;background:var(--ui-placeholder-ink);mask:var(--ui-unknown-mark) center/100% no-repeat}
.ui-goal-text {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ui-goal-text b {font-weight:700}
.ui-goal-sub {color:var(--color-muted)}
.ui-goal-sub::before {content:"· "}
@media(forced-colors:active) {.ui-goal-chip {border-color:ButtonText}}

.ui-button.ui-filter {position:relative;min-height:36px;padding:6px 12px;border-radius:999px;font-size:11px;white-space:nowrap;flex:none}
.ui-button.ui-filter::after {content:"";position:absolute;inset:-4px 0}
.ui-button.ui-filter[aria-pressed=true] {background:var(--color-action);border-color:var(--color-action);color:var(--ui-selection-ink)}
@media(hover:hover) {.ui-button.ui-filter[aria-pressed=true]:hover {background:var(--color-action-bottom)}}
@media(forced-colors:active) {.ui-button.ui-filter[aria-pressed=true] {background:Highlight;color:HighlightText;border-color:Highlight}}

/* Compact filters preserve the full 44px touch target. */
.ui-select[data-size=compact] {min-width:0;min-height:44px;height:44px;margin:0;padding:8px;font-size:12px;text-overflow:ellipsis}
.ui-button[data-size=compact] {min-height:44px;padding:8px 10px;font-size:12px;gap:5px}
.ui-button[data-size=compact] svg {width:18px;height:18px}
.ui-empty-state {margin:0;padding:18px 12px;border:1px solid var(--ui-border);border-radius:var(--ui-control-radius);background:var(--ui-soft-fill);color:var(--color-muted);font-size:12px;text-align:center;line-height:1.6}
.ui-confirm {width:calc(100% - 32px);max-width:380px;max-height:calc(100dvh - 32px);overflow-y:auto;margin:auto;padding:24px;border:1px solid var(--ui-border);border-radius:var(--radius-sheet);background:var(--ui-surface);color:var(--ui-text);box-shadow:0 18px 60px var(--ui-shadow-strong)}
.ui-confirm::backdrop {background:var(--ui-backdrop);backdrop-filter:blur(4px)}
.ui-confirm h2 {margin:0 0 10px;font-size:21px;line-height:1.3;letter-spacing:-.5px}
.ui-confirm p {margin:0;color:var(--color-muted);font-size:13px;line-height:1.65}
.ui-confirm-actions {display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:24px}
.ui-confirm-actions:not(:has(> :not([hidden]) ~ :not([hidden]))) {grid-template-columns:1fr}
/* The first-visit tour (src/game/tour.js): a modal with no surface of its own. The lit area is
   a hole in the dimming, made by one very wide shadow around it; the card sits under or above
   it. Both move from step to step. */
.ui-tour {position:fixed;inset:0;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:0;border:0;background:transparent;overflow:hidden;color:var(--ui-text)}
.ui-tour::backdrop {background:transparent}
.ui-tour:has(.tour-spot[hidden]) {background:var(--ui-backdrop)}
.ui-tour .tour-spot {position:absolute;border-radius:18px;box-shadow:0 0 0 2px var(--ui-surface),0 0 0 200vmax var(--ui-backdrop);transition:left 280ms cubic-bezier(.22,1,.36,1),top 280ms cubic-bezier(.22,1,.36,1),width 280ms cubic-bezier(.22,1,.36,1),height 280ms cubic-bezier(.22,1,.36,1);pointer-events:none}
.ui-tour .tour-spot[hidden] {display:none}
.ui-tour .tour-card {position:absolute;left:16px;right:16px;max-width:360px;margin:0 auto;padding:16px 16px 12px;border:1px solid var(--ui-border);border-radius:20px;background:var(--ui-surface);box-shadow:0 18px 60px var(--ui-shadow-strong);transition:top 280ms cubic-bezier(.22,1,.36,1)}
.ui-tour .tour-card[data-place=center] {top:50%;transform:translateY(-50%)}
.ui-tour .tour-count {margin:0 0 2px;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ui-muted)}
.ui-tour h2 {margin:0 0 6px;font-size:18px;line-height:1.3}
.ui-tour p {margin:0;font-size:13px;line-height:1.6;color:var(--ui-muted)}
.ui-tour dl {display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 12px;margin:0;font-size:13px;line-height:1.5}
.ui-tour dl[hidden] {display:none}
.ui-tour dt {font-weight:700}
.ui-tour dd {margin:0;color:var(--ui-muted)}
.ui-tour .tour-actions {display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
@media(prefers-reduced-motion:reduce) {.ui-tour .tour-spot,.ui-tour .tour-card {transition:none}}
@media(forced-colors:active) {.ui-tour .tour-spot {box-shadow:none;outline:3px solid Highlight}.ui-tour .tour-card {background:Canvas;color:CanvasText;border-color:CanvasText}.ui-tour {background:Canvas}}
/* The offer of tickets for an ad: the confirm dialog with a play mark on its action. */
.ad-offer .ui-confirm-actions .ui-button {padding-inline:10px;white-space:nowrap}
.ad-offer .ad-watch-icon {display:inline-grid;margin-right:5px;vertical-align:-4px}
.ad-offer .ad-watch-icon svg {display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media(forced-colors:active) {.ui-confirm,.ui-empty-state {background:Canvas;color:CanvasText;border-color:CanvasText}}

/* Title artwork and loading sequence. */
.ui-title-swipe-stack {position:relative;overflow:hidden}
.ui-title-swipe-stack.is-swiping>.ui-title-screen,.ui-title-swipe-stack.is-swiping>.ui-title-swipe-next {position:absolute;inset:0;width:100%;height:100%;margin:0;pointer-events:none}
.ui-title-swipe-stack.is-swiping>.ui-title-swipe-next {transform:translateY(100%)}
.ui-title-screen {position:relative;height:100%;overflow:hidden;isolation:isolate;background:var(--ui-art-surface);color:var(--ui-on-art)}
.ui-title-background {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;pointer-events:none;user-select:none}
.ui-brand-lockup {display:flex;flex-direction:column;align-items:center;gap:24px;color:var(--ui-on-art)}
.ui-brand-lockup span {display:block;flex:none}
.ui-brand-symbol {width:106px}
.ui-brand-logotype {width:260px;max-width:76vw}
.ui-brand-lockup svg {display:block;width:100%;height:auto;fill:currentColor;stroke:none}
.ui-brand-lockup svg :is(path,polygon,rect,circle,ellipse) {fill:currentColor;stroke:none}
.ui-title-screen>.ui-brand-lockup {position:absolute;top:31%;left:50%;transform:translate(-50%,-50%);width:100%;padding:0 24px}
/* Splash (2026-10-13): before the title, the lockup in the brand's orange on white. The keycap
   lands (CAP) and is pressed twice (TOK, TOK) in 1.2s; then the photo comes in under the lockup,
   which turns white where it stands, and the progress bar appears. The resting styles are the
   title itself, so a screen without data-splash="play" (or with reduced motion) is the title. */
.ui-title-screen .ui-brand-lockup svg {overflow:visible}
.ui-title-screen .ui-brand-symbol {position:relative}
.ui-splash-base,.ui-splash-cap,.ui-title-screen .ui-brand-logotype svg>* {transform-box:fill-box;transform-origin:50% 100%}
.ui-splash-ring {position:absolute;left:50%;top:50%;width:100%;aspect-ratio:1;margin:-50% 0 0 -50%;border:1.6px solid currentColor;border-radius:50%;opacity:0;pointer-events:none}
.ui-title-screen[data-splash=play] {animation:ui-splash-ground 520ms 1550ms cubic-bezier(.4,0,.2,1) both}
.ui-title-screen[data-splash=play] .ui-title-background {animation:ui-splash-in 520ms 1550ms cubic-bezier(.4,0,.2,1) both}
.ui-title-screen[data-splash=play] .ui-title-loading {animation:ui-splash-in 260ms 1850ms cubic-bezier(.4,0,.2,1) both}
.ui-title-screen[data-splash=play]>.ui-brand-lockup {animation:ui-splash-ink 420ms 1550ms cubic-bezier(.4,0,.2,1) both,ui-splash-beat 1200ms linear both}
.ui-title-screen[data-splash=play] .ui-splash-base {animation:ui-splash-base 1200ms linear both}
.ui-title-screen[data-splash=play] .ui-splash-cap {animation:ui-splash-cap 1200ms linear both}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>* {animation:ui-splash-letter 150ms cubic-bezier(.175,.885,.32,1.4) both}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(1) {animation-delay:280ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(2) {animation-delay:302ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(3) {animation-delay:324ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(4) {animation-delay:580ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(5) {animation-delay:602ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(6) {animation-delay:624ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(7) {animation-delay:880ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(8) {animation-delay:902ms}
.ui-title-screen[data-splash=play] .ui-brand-logotype svg>:nth-child(9) {animation-delay:924ms}
.ui-title-screen[data-splash=play] .ui-splash-ring {animation:ui-splash-ring 380ms 280ms cubic-bezier(.16,1,.3,1) forwards}
.ui-title-screen[data-splash=play] .ui-splash-ring:nth-child(2) {animation-delay:580ms}
.ui-title-screen[data-splash=play] .ui-splash-ring:nth-child(3) {animation-name:ui-splash-ring-last;animation-delay:880ms}
@keyframes ui-splash-ground {from {background-color:var(--ui-splash-ground)}to {background-color:var(--ui-art-surface)}}
@keyframes ui-splash-in {from {opacity:0}to {opacity:1}}
@keyframes ui-splash-ink {from {color:var(--ui-splash-ink)}to {color:var(--ui-on-art)}}
@keyframes ui-splash-beat {0%,23.33% {translate:0 0;animation-timing-function:cubic-bezier(.16,1,.3,1)}26.67% {translate:0 3px;animation-timing-function:cubic-bezier(.16,1,.3,1)}38.33%,48.33% {translate:0 0;animation-timing-function:cubic-bezier(.16,1,.3,1)}51.67% {translate:0 2.5px;animation-timing-function:cubic-bezier(.16,1,.3,1)}61.67%,73.33% {translate:0 0;animation-timing-function:cubic-bezier(.16,1,.3,1)}76.67% {translate:0 3.5px;animation-timing-function:cubic-bezier(.16,1,.3,1)}90%,100% {translate:0 0}}
@keyframes ui-splash-base {0% {opacity:0;transform:translateY(14px) scale(1,1);animation-timing-function:cubic-bezier(.16,1,.3,1)}15% {opacity:1;transform:translateY(0) scale(1,1)}23.33% {transform:translateY(0) scale(1,1);animation-timing-function:cubic-bezier(.16,1,.3,1)}26.67% {transform:translateY(0) scale(1.04,.9);animation-timing-function:cubic-bezier(.16,1,.3,1)}36.67%,45% {transform:translateY(0) scale(1,1);animation-timing-function:cubic-bezier(.16,1,.3,1)}48.33% {transform:translateY(0) scale(1.03,.92);animation-timing-function:cubic-bezier(.16,1,.3,1)}56.67%,70% {transform:translateY(0) scale(1,1);animation-timing-function:cubic-bezier(.16,1,.3,1)}73.33% {transform:translateY(0) scale(1.04,.9);animation-timing-function:cubic-bezier(.16,1,.3,1)}83.33% {transform:translateY(0) scale(.99,1.02);animation-timing-function:cubic-bezier(.4,0,.2,1)}93.33%,100% {opacity:1;transform:translateY(0) scale(1,1)}}
@keyframes ui-splash-cap {0%,5% {opacity:0;transform:translateY(-90px) scale(1,1);animation-timing-function:cubic-bezier(.55,0,1,.75)}10% {opacity:1}23.33% {transform:translateY(0) scale(1,1);animation-timing-function:cubic-bezier(.16,1,.3,1)}26.67% {transform:translateY(4px) scale(1.07,.86);animation-timing-function:cubic-bezier(.16,1,.3,1)}35% {transform:translateY(-12px) scale(.98,1.03);animation-timing-function:cubic-bezier(.55,0,1,.75)}43.33%,45% {transform:translateY(0) scale(1,1);animation-timing-function:cubic-bezier(.55,0,1,.75)}48.33% {transform:translateY(11px) scale(1.03,.95);animation-timing-function:cubic-bezier(.16,1,.3,1)}56.67% {transform:translateY(-5px) scale(1,1);animation-timing-function:cubic-bezier(.4,0,.2,1)}63.33%,70% {transform:translateY(0) scale(1,1);animation-timing-function:cubic-bezier(.55,0,1,.75)}73.33% {transform:translateY(12px) scale(1.04,.94);animation-timing-function:cubic-bezier(.16,1,.3,1)}83.33% {transform:translateY(-6px) scale(1,1);animation-timing-function:cubic-bezier(.4,0,.2,1)}93.33% {transform:translateY(1px) scale(1,1);animation-timing-function:cubic-bezier(.4,0,.2,1)}100% {opacity:1;transform:translateY(0) scale(1,1)}}
@keyframes ui-splash-letter {from {opacity:0;transform:translateY(4px) scale(.7)}to {opacity:1;transform:translateY(0) scale(1)}}
@keyframes ui-splash-ring {from {opacity:.4;transform:scale(.5)}to {opacity:0;transform:scale(1.6)}}
@keyframes ui-splash-ring-last {from {opacity:.6;transform:scale(.5)}to {opacity:0;transform:scale(2.1)}}
.ui-title-loading {position:absolute;top:68%;left:50%;width:min(250px,calc(100% - 64px));transform:translate(-50%,-50%);display:grid;gap:14px}
.ui-title-progress {height:7px;border:1px solid color-mix(in srgb,var(--ui-on-art) 60%,transparent);border-radius:99px;background:color-mix(in srgb,var(--ui-on-art) 19%,transparent);box-shadow:0 1px 12px var(--ui-art-shadow);overflow:hidden}
.ui-title-progress-fill {display:block;width:100%;height:100%;border-radius:inherit;background:var(--ui-on-art);transform:scaleX(0);transform-origin:left;transition:transform 420ms cubic-bezier(.2,.7,.2,1)}
/* The one link on the title: the about page, in a new tab so the game is not left. */
.ui-title-status {min-height:21px;margin:0;font-family:var(--font-ui);font-size:12px;font-weight:650;letter-spacing:.045em;line-height:1.5;text-align:center;color:var(--ui-on-art);text-shadow:0 1px 8px var(--ui-art-shadow)}
.ui-title-screen[data-state=ready] .ui-title-progress-fill {box-shadow:0 0 16px var(--ui-on-art)}
@media(max-height:500px) {.ui-title-screen .ui-brand-lockup {gap:14px}.ui-title-screen .ui-brand-symbol {width:76px}.ui-title-screen .ui-brand-logotype {width:220px}}
@media(prefers-reduced-motion:reduce) {.ui-title-screen[data-splash=play],.ui-title-screen[data-splash=play] * {animation:none!important}.ui-title-progress-fill {transition:none}}
@media(forced-colors:active) {.ui-title-screen {background:Canvas;color:CanvasText}.ui-title-background {display:none}.ui-title-screen .ui-brand-lockup,.ui-title-status {color:CanvasText}.ui-title-progress {border-color:CanvasText;background:Canvas}.ui-title-progress-fill {background:Highlight}}

/* Interactive art preview: same physical renderer and gesture as the play board. */
.ui-mount-preview {display:block;position:relative;width:160px;height:170px;margin:12px auto;padding:0;border:0;border-radius:16px;background:transparent;box-shadow:none;cursor:pointer;touch-action:manipulation}
.ui-mount-preview canvas {display:block;width:100%;height:100%;pointer-events:none}
.ui-mount-preview:focus-visible {outline:3px solid var(--ui-focus);outline-offset:3px}
.ui-light-preview {width:100%;height:auto;max-width:336px;border-radius:16px;overflow:hidden;touch-action:none}
.ui-light-preview canvas {width:100%;height:auto}

/* Reward history: rarity belongs to the border; selection uses a separate white ring. */
.ui-reward-history {min-width:0;color:var(--gacha-ink);--reward-surface:var(--gacha-reward);--reward-focus:var(--gacha-reward-ring)}
.ui-reward-nav {display:flex;align-items:center;justify-content:center;gap:12px;min-height:44px}
.ui-reward-nav span {min-width:145px;font-size:11px;text-align:center;color:var(--gacha-muted);font-variant-numeric:tabular-nums}
.ui-reward-nav button {display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;font-size:27px;box-shadow:none}
.ui-reward-nav button:disabled {opacity:.25;cursor:default}
.ui-reward-pages {display:flex;width:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:none;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x pan-y;cursor:grab}
.ui-reward-pages::-webkit-scrollbar {display:none}
.ui-reward-pages[data-dragging=true] {scroll-snap-type:none;cursor:grabbing}
.ui-reward-page {flex:0 0 100%;min-width:0;padding:4px 6px 6px}
.ui-reward-grid {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;max-width:300px;margin:auto}
.ui-reward-card {position:relative;display:block;aspect-ratio:1;min-width:44px;min-height:44px;width:100%;padding:3px;border:2px solid var(--rarity-accent);border-radius:9px;background:var(--reward-surface);box-shadow:none;touch-action:pan-x pan-y}
.ui-reward-card[aria-pressed=true] {outline:2px solid var(--reward-focus);outline-offset:2px}
.ui-reward-card .art {display:block;width:100%;height:auto;aspect-ratio:1;margin:0;background:none;border-radius:4px;pointer-events:none}
.ui-reward-card:focus-visible,.ui-reward-nav button:focus-visible,.ui-reward-pages:focus-visible {outline:3px solid var(--ui-focus);outline-offset:2px}
@media(hover:hover){.ui-reward-card:hover {background:var(--gacha-surface-hover)}.ui-reward-nav button:not(:disabled):hover {background:var(--gacha-quiet-hover)}}
@media(forced-colors:active){.ui-reward-history {color:CanvasText;--reward-surface:Canvas;--reward-focus:Highlight}.ui-reward-card {border-color:ButtonText}.ui-reward-nav span {color:CanvasText}}

/* Shared curve editor: gacha and keycap mounting use the same handles and states. */
.bezier-editor{border:1px solid var(--editor-border);border-radius:14px;padding:18px;margin:24px 0;background:var(--editor-surface)}
.bezier-editor h2{font-size:17px;margin:0 0 8px}.bezier-editor>label{font-size:12px;color:var(--editor-text)}
.bezier-editor select{margin-bottom:12px}.curve-mode{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px}
.curve-mode label{display:flex;align-items:center;gap:5px}.curve-mode input{accent-color:var(--editor-accent)}
#curve-mode{color:var(--editor-accent);font-size:10px}
#curve-graph{display:block;width:100%;height:auto;background:var(--editor-paper);border:1px solid var(--editor-border);border-radius:9px;margin:14px 0;touch-action:none;user-select:none}
#curve-graph text{fill:var(--editor-muted);font-size:11px}.curve-grid path{fill:none;stroke:var(--editor-grid);stroke-width:1}
.curve-diagonal{stroke:var(--editor-border);stroke-dasharray:3 5;fill:none}.curve-arm{stroke:var(--editor-line);stroke-width:1.5}
.curve-path{fill:none;stroke:var(--editor-accent);stroke-width:3;stroke-linecap:round}
.curve-origin,.curve-end{fill:var(--editor-point)}.curve-playhead{fill:var(--ui-highlight);stroke:var(--editor-accent);stroke-width:2;pointer-events:none}
.handle-dot{fill:var(--editor-accent);stroke:var(--editor-field);stroke-width:2}.handle-1 .handle-dot{fill:var(--editor-second)}
.curve-handle{cursor:grab;outline:none}.curve-handle:active{cursor:grabbing}.curve-handle:focus .handle-dot{stroke:var(--ui-highlight);stroke-width:3}
.is-legacy .curve-arm{stroke-dasharray:4 4;opacity:.5}.is-legacy .handle-dot{opacity:.55}
.curve-numbers{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.curve-numbers label{font-size:11px;color:var(--editor-muted);display:flex;flex-direction:column;gap:5px}
.curve-numbers input,#curve-css{width:100%;min-width:0;color:var(--editor-accent);background:var(--editor-field);border:1px solid var(--editor-border);border-radius:6px;padding:7px;font-size:12px}
.curve-css-label{display:block;margin:12px 0 6px}#curve-css{font-family:monospace}
.curve-presets{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:12px 0}
.curve-presets button{font-size:11px}.bezier-editor>.row button{flex:1;font-size:11px}
#curve-note{min-height:54px;margin-bottom:0}
.control input:disabled{opacity:.4}.curve-numbers input:focus-visible,#curve-css:focus-visible{outline:0;box-shadow:0 0 0 3px var(--ui-focus-halo)}

/* Editable numeric values and motion tracks accompany the shared range controls. */
.ui-number{min-width:0;min-height:44px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:var(--ui-text);padding:8px;font:inherit;font-size:13px;font-variant-numeric:tabular-nums}
.ui-number:focus-visible{outline:0;box-shadow:0 0 0 3px var(--ui-focus-halo)}
.motion-tracks{display:grid;gap:5px;padding:4px 0;position:relative}
.motion-track{height:19px;position:relative;background:var(--ui-soft-fill);border-radius:5px;overflow:hidden}
.motion-track>span{position:absolute;top:0;bottom:0;min-width:2px;border-radius:5px;background:var(--ui-track-press)}
.motion-track[data-track=lift]>span{background:var(--ui-track-lift)}.motion-track[data-track=fade]>span{background:var(--ui-track-fade)}
.motion-track>small{position:relative;padding-left:7px;font-size:10px;line-height:19px;color:var(--ui-text)}
.motion-cue{position:absolute;top:0;bottom:0;border-left:2px dashed var(--ui-action);pointer-events:none}

.motion-track[data-selected=true]{outline:1px solid var(--ui-action);outline-offset:1px}
@media(forced-colors:active){:is(input,select,textarea):focus-visible,.ui-number:focus-visible,.curve-numbers input:focus-visible,#curve-css:focus-visible{outline:2px solid Highlight;outline-offset:2px;box-shadow:none}}

/* Native controls and text selection share the active theme, including dark UI. */
[data-color-scheme=light] {color-scheme:light}
[data-color-scheme=dark] {color-scheme:dark}
:is(input,select,textarea) {caret-color:var(--ui-text);accent-color:var(--ui-action)}
::placeholder {color:var(--ui-muted);opacity:1}
::selection {background:var(--ui-selection);color:var(--ui-selection-ink)}

/* Reward signals (2026-09-30). Two ways a draw says it gave more than a keycap.

   Sound mark: a keycap that makes its own sound wears this disc on its corner wherever
   the keycap is shown large. Quiet by default (surface disc, muted glyph); data-tone=new
   paints it in the action colour for a sound the player did not have, and data-burst
   plays the arrival once: the disc pops in, two rings ripple out and the bars swing like
   a level meter for about a second. --size sets the disc (30–44px); the page positions
   it. The surface it sits on can remap --mark-* (the gacha stage does). */
.ui-sound-mark {--size:36px;position:relative;display:grid;place-items:center;flex:none;width:var(--size);height:var(--size);border-radius:50%;background:var(--mark-surface,var(--ui-surface));color:var(--mark-ink,var(--ui-muted));box-shadow:0 0 0 2px var(--mark-ring,var(--ui-border)),0 4px 12px var(--mark-shadow,var(--ui-shadow))}
.ui-sound-mark svg {display:block;width:calc(var(--size) * .56);height:calc(var(--size) * .56);fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.ui-sound-mark[data-tone=new] {background:var(--mark-accent,var(--ui-action));color:var(--mark-accent-ink,var(--ui-action-ink));box-shadow:0 0 0 2px var(--mark-accent-ring,var(--ui-highlight)),0 6px 18px var(--mark-shadow,var(--ui-shadow-strong))}
.ui-sound-mark::before,.ui-sound-mark::after {content:"";position:absolute;inset:-2px;border-radius:50%;border:2px solid var(--mark-accent,var(--ui-action));opacity:0;pointer-events:none}
.ui-sound-mark[data-burst] {animation:ui-sound-mark-pop 640ms cubic-bezier(.22,1.4,.36,1) both}
.ui-sound-mark[data-burst]::before {animation:ui-sound-mark-ring 880ms 140ms cubic-bezier(.2,.7,.3,1) both}
.ui-sound-mark[data-burst]::after {animation:ui-sound-mark-ring 880ms 360ms cubic-bezier(.2,.7,.3,1) both}
.ui-sound-mark[data-burst] svg path {transform-box:fill-box;transform-origin:center;animation:ui-sound-mark-bar 300ms 300ms ease-in-out 4 alternate both}
.ui-sound-mark[data-burst] svg path:nth-child(2n) {animation-delay:380ms}
.ui-sound-mark[data-burst] svg path:nth-child(3n) {animation-delay:450ms}
@keyframes ui-sound-mark-pop {0% {transform:scale(.2) rotate(-30deg);opacity:0} 55% {transform:scale(1.24) rotate(6deg);opacity:1} 100% {transform:scale(1) rotate(0);opacity:1}}
@keyframes ui-sound-mark-ring {0% {transform:scale(1);opacity:.95} 100% {transform:scale(2.7);opacity:0}}
@keyframes ui-sound-mark-bar {from {transform:scaleY(.4)} to {transform:scaleY(1.3)}}

/* Toast: one line of good news that needs no answer (a mood unlocked). The page places
   the host; the toast slides in from above, stays about four seconds and can be tapped
   away. One at a time; the next waits for it. The surface it sits on can remap
   --ui-toast-* (the gacha stage does). */
.ui-toast-host {display:grid;justify-items:center;pointer-events:none}
.ui-toast {pointer-events:auto;display:flex;align-items:center;gap:12px;max-width:100%;min-height:54px;margin:0;padding:10px 18px 10px 11px;border:1px solid var(--ui-toast-border,var(--ui-border));border-radius:19px;background:var(--ui-toast-surface,var(--ui-sheet));color:var(--ui-toast-ink,var(--ui-text));box-shadow:0 14px 36px var(--ui-toast-shadow,var(--ui-shadow-strong));font:inherit;text-align:left;cursor:pointer;animation:ui-toast-in 420ms cubic-bezier(.22,1,.36,1) both}
.ui-toast[data-leaving] {animation:ui-toast-out 220ms cubic-bezier(.4,0,1,1) both}
.ui-toast-icon {display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--ui-toast-accent,var(--ui-action));color:var(--ui-toast-accent-ink,var(--ui-action-ink))}
.ui-toast-icon svg {display:block;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ui-toast-text {min-width:0}
.ui-toast strong {display:block;font-size:14px;font-weight:750;line-height:1.3}
.ui-toast small {display:block;font-size:12px;line-height:1.4;color:var(--ui-toast-muted,var(--ui-muted))}
/* One small action at the end of a toast; the text shrinks first, the button never wraps. */
.ui-toast .ui-toast-action {flex:none;margin-left:auto;white-space:nowrap}
@keyframes ui-toast-in {from {opacity:0;transform:translateY(-14px) scale(.96)} to {opacity:1;transform:none}}
@keyframes ui-toast-out {to {opacity:0;transform:translateY(-8px)}}
/* The same toast rising from below, for a host placed near the bottom. */
@keyframes ui-toast-in-up {from {opacity:0;transform:translateY(14px) scale(.96)} to {opacity:1;transform:none}}
@keyframes ui-toast-out-down {to {opacity:0;transform:translateY(8px)}}
@media(prefers-reduced-motion:reduce) {
 .ui-toast,.ui-toast[data-leaving] {animation-duration:1ms}
 .ui-sound-mark[data-burst],.ui-sound-mark[data-burst]::before,.ui-sound-mark[data-burst]::after,.ui-sound-mark[data-burst] svg path {animation:none}
}
@media(forced-colors:active) {
 .ui-toast {background:Canvas;color:CanvasText;border:1px solid CanvasText;box-shadow:none}
 .ui-toast-icon,.ui-sound-mark[data-tone=new] {background:Highlight;color:HighlightText;box-shadow:none}
 .ui-sound-mark {background:Canvas;color:CanvasText;box-shadow:0 0 0 1px CanvasText}
 .ui-sound-mark::before,.ui-sound-mark::after {border-color:Highlight}
}
/* Mood drawer: a locked mood whose keycaps are a Typing group can aim draws there (focus). */
.theme-entry {position:relative}
.theme-entry[data-aim] .theme-option.ui-choice {padding-right:112px}
.theme-entry .theme-aim {position:absolute;right:12px;top:0;bottom:0;height:max-content;margin-block:auto}
.theme-entry .theme-aim:disabled {opacity:1;background:var(--ui-soft-fill);color:var(--ui-muted);border-color:transparent}

/* Coach bubble (2026-11-10, user decision): on a first session, the next thing to do, pointed at
   the thing itself (src/game/coach.js). It rises in, bobs three times and rests; its ring
   pulses three times and fades. Nothing loops: a phone's WebView recomposites every frame of an
   endless animation. The caller places both (absolute, inside a positioned screen). */
.ui-coach {position:absolute;z-index:5;pointer-events:none;padding:9px 15px;border-radius:999px;background:var(--ui-action);color:var(--ui-action-ink);font-size:14px;font-weight:750;line-height:1.2;white-space:nowrap;box-shadow:0 10px 24px var(--ui-shadow-strong);animation:ui-coach-in 420ms cubic-bezier(.22,1,.36,1) both,ui-coach-bob 1.4s 600ms ease-in-out 3}
.ui-coach::after {content:"";position:absolute;top:100%;left:var(--ui-coach-arrow,50%);margin-left:-7px;border:7px solid transparent;border-top-color:var(--ui-action);border-bottom-width:0}
.ui-coach-ring {position:absolute;z-index:4;pointer-events:none;border:2.5px solid var(--ui-action);border-radius:16px;animation:ui-coach-ring 1.4s 300ms ease-out 3 both}
@keyframes ui-coach-in {from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:none}}
@keyframes ui-coach-bob {0%,100%{transform:none}50%{transform:translateY(-4px)}}
@keyframes ui-coach-ring {0%{opacity:0;transform:scale(.97)}30%{opacity:1}100%{opacity:0;transform:scale(1.06)}}
@media(prefers-reduced-motion:reduce) {.ui-coach,.ui-coach-ring {animation:none}}
@media(forced-colors:active) {.ui-coach {background:Highlight;color:HighlightText;border:1px solid HighlightText}.ui-coach::after {border-top-color:Highlight}.ui-coach-ring {border-color:Highlight}}
