/* The page's styles (index.html). Loaded with ?v=<its hash>, stamped by build.mjs. */
@font-face { font-family: "UmadleDisplay"; src: url("./fonts/display.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
:root { --bg: #fff; --text: #333; --soft: #555; --label: #5f5a66; --pill: rgba(255,255,255,.88); --card: rgba(255,255,255,.94);
        --surface-hud: var(--pill); --blur-hud: 6px; --surface-panel: var(--card); --blur-panel: 12px;
        --border-accent: rgba(224,85,154,.22); --border-accent-hover: rgba(224,85,154,.44);
        --shade: rgba(0,0,0,.08); --shade-hover: rgba(0,0,0,.16); --border: rgba(0,0,0,.08); --track: #ddd; --disabled: #aaa; --disabled-icon: #ccc; --cal-empty: #706a78;
        --accent: #e0559a; --accent-soft: #f25ca0; --accent-deep: #b02266;
        --accent-grad: linear-gradient(90deg, var(--accent-soft), #d63d86);
        --accent-pill: linear-gradient(90deg, #cc357d, var(--accent-deep));
        --strong: #b8336f; --overlay: rgba(255,255,255,.82); color-scheme: light;
        --sc1: linear-gradient(90deg, #646b78, #4d5461);
        --sc2: linear-gradient(90deg, #8c5377, #743e61);
        --sc3: linear-gradient(90deg, #b84277, #9e3162);
        --sc4: linear-gradient(90deg, #c92d79, #a41d60);
        --sc5: linear-gradient(90deg, #9e6200, #a36800, #8a5400, #a36800, #9e6200);
        --sc6: linear-gradient(90deg, #c82342, #b35700, #8c6d00, #167a3b, #156ca3, #693cc9, #c82342);
        --display: "UmadleDisplay", system-ui, sans-serif;
        --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
        /* The stage's backdrop (see stageBackdrop): the share card's pink wash.
           --chrome-bg is the solid colour Safari 26/27 extends behind its chrome (including
           iPhone Duo's outer side rail and bottom bar); index.html keeps it in step with the stage. */
        --wash-top: #fff6f9; --wash-bottom: #ffe3ef; --chrome-bg: #ffedf4; }
:root[data-theme="dark"] { --bg: #1c1a21; --text: #e6e2ea; --soft: #cfc9d6; --label: #bdb6c6; --pill: rgba(44,40,51,.88);
        --card: rgba(48,44,56,.95); --surface-hud: var(--pill); --surface-panel: var(--card);
        --border-accent: rgba(255,255,255,.12); --border-accent-hover: rgba(224,85,154,.44);
        --shade: rgba(0,0,0,.3); --shade-hover: rgba(0,0,0,.5); --border: rgba(255,255,255,.12); --track: #4a4553; --disabled: #6e6878; --cal-empty: #9b94a6;
        --disabled-icon: #57515f; --strong: #ff8cc0; --overlay: rgba(28,26,33,.82); color-scheme: dark;
        --sc1: linear-gradient(90deg, #9ba1ad, #7a8291);
        --sc2: linear-gradient(90deg, #c99ab8, #a9789a);
        --sc3: linear-gradient(90deg, #ffa0c6, #f283b4);
        --sc4: linear-gradient(90deg, #ff7eb3, #e0559a);
        --sc5: linear-gradient(90deg, #e39b12, #f2bf3a, #d4870f, #f2bf3a, #e39b12);
        --sc6: linear-gradient(90deg, #ff4d6d, #ff9a2e, #e6b800, #2fbf5f, #2fa4e6, #9d6bff, #ff4d6d);
        --wash-top: #1c1a21; --wash-bottom: #2c1e2c; --chrome-bg: #241d27; }
html, body { margin: 0; height: 100%; overflow: hidden; background-color: var(--chrome-bg); color: var(--text); font-family: system-ui, sans-serif; }
body { background-image: linear-gradient(var(--wash-top), var(--wash-bottom)); } /* under the stage as it fades in; keeps background-color solid for Safari */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The 3D stage fills the page; the camera keeps a margin around the uma and jukebox. Sized to
   the visible page (100%), not 100vh: on iPhones 100vh is the height with the toolbars hidden,
   so the picture was stretched taller. resize() draws at whatever size this comes out. */
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.about { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Welcome brand header shown before today's roll; floats up and fades smoothly as rolling starts. */
#brand { display: none; position: fixed; top: calc(18px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 1;
         flex-direction: column; align-items: center; gap: 3px; text-align: center; pointer-events: none; user-select: none;
         max-width: calc(100vw - 32px); transition: opacity .32s ease, transform .38s cubic-bezier(.4,0,.2,1); }
body:is(.unrolled, .rolling) #brand { display: flex; }
body.rolling #brand { opacity: 0; transform: translate(-50%, -26px) scale(.93); }
#brand strong { font: 700 32px/1.05 var(--display); letter-spacing: .01em; color: var(--strong);
                background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
                filter: drop-shadow(0 2px 8px rgba(224,85,154,.18)); }
#brand span { font-size: 13px; font-weight: 500; color: var(--soft); }
@media (max-width: 560px) {
  #brand { top: calc(58px + var(--safe-top)); }
  #brand strong { font-size: 28px; }
}

/* The song row above the controls: cohesive frosted glass pills matching #score and #picker. */
#bar { position: fixed; left: 16px; right: calc(16px + var(--picker-side, 0px)); bottom: calc(58px + var(--picker-room, 0px) + var(--safe-bottom)); display: grid; align-items: center; gap: 8px; z-index: 1;
       grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); pointer-events: none;
       transition: bottom .36s cubic-bezier(.22,1.22,.36,1), right .3s cubic-bezier(.3,1.2,.5,1) }
#bar > * { pointer-events: auto; }
#song { grid-column: 2; position: relative; display: flex; min-width: 0; } /* #who centres on the song alone */
#bar-end { grid-column: 3; justify-self: start; display: flex; align-items: center; gap: 8px; }
/* Its parts share the room fairly once it's capped: each grid column grows evenly up to its own
   width, so a short song shows whole beside a long duet's names (never "♪ …"), and the reverse. */
#info { box-sizing: border-box; display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, max-content); align-items: center; gap: 6px; height: 36px; max-width: 100%; min-width: 0; padding: 0 15px;
        border: 1px solid var(--border-accent); border-radius: 999px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel));
        box-shadow: 0 4px 16px var(--shade); font: 500 13px/1.45 system-ui, sans-serif; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        transition: border-color .2s, box-shadow .2s, transform .14s; }
#info.swap { animation: info-swap .32s cubic-bezier(.22,1.3,.36,1); }
@keyframes info-swap { 0% { opacity: .45; transform: scale(.94); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
#info:empty { display: none; }
#info:not(:has(.info-song))::before { content: "♪ "; color: var(--accent); }
#info .info-uma { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 700 13px/1.45 var(--display); color: var(--strong); }
#info .info-sep { opacity: .4; }
#info .info-song { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.45; }
#info .info-song::before { content: "♪ "; color: var(--accent); }
#info.loading .info-song::before { content: ""; }
/* While the song downloads (songLoading), a small spinner at the start of the pill. */
#info.loading::before { content: ""; flex: none; display: inline-block; box-sizing: border-box; width: 11px; height: 11px; margin: 0 2px 0 0;
                        border-radius: 50%; border: 2px solid rgba(224,85,154,.25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
/* Clicking the song shows who's dancing above it; a small chevron at its end hints at that,
   and turns over while she's shown. */
#bar:has(#who:not(:empty)) #info { position: relative; padding-right: 30px; cursor: pointer; }
#bar:has(#who:not(:empty)) #info:hover { border-color: var(--border-accent-hover); box-shadow: 0 5px 20px var(--shade-hover); }
#bar:has(#who:not(:empty)) #info:active { transform: scale(.985); }
#bar:has(#who:not(:empty)) #info::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px;
       margin-top: 1.5px; border: solid var(--strong); border-width: 0 1.8px 1.8px 0; opacity: .75;
       transform: translateY(-50%) rotate(-135deg); transition: transform .2s, opacity .2s; }
#bar:has(#who:not(:empty)) #info:is(:hover, :focus-visible)::after, #bar.who:has(#who:not(:empty)) #info::after { opacity: 1; }
#bar.who:has(#who:not(:empty)) #info::after { transform: translateY(-90%) rotate(45deg); }
#who { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 4px);
       padding: 10px 16px; border: 1px solid var(--border-accent); border-radius: 14px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel));
       box-shadow: 0 6px 22px var(--shade); font-size: 13px; color: var(--soft); text-align: center; white-space: nowrap;
       opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
#who b { display: block; color: var(--strong); font-weight: 600; }
#who b:not(:first-child) { margin-top: 6px; } /* a duet's second uma */
#who b + b { margin-top: 2px; } /* three or more: just their names */
#bar.who #who:not(:empty) { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
/* Under the umas, the song's page on Last.fm (left out for a song Last.fm doesn't know). */
#song-link { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; padding-top: 7px;
             border-top: 1px solid var(--track); font-size: 12px; font-weight: 600; color: var(--strong); text-decoration: none; }
#song-link:hover, #full-song-link:hover { text-decoration: underline; }
#full-song-link { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--strong); text-decoration: none; }
#full-song-link[hidden] { display: none; }
#song-link[hidden] + #full-song-link { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--track); }
#song-link[hidden] { display: none; }
#song-link svg { width: 12px; height: 12px; stroke: currentColor; }
/* Mute button: height-matched to #info and #controls; hovering slides out the volume slider. */
#vol { flex: none; position: relative; width: 36px; height: 36px; }
#vol .pill { position: absolute; left: 0; top: 0; display: flex; align-items: center; height: 36px; box-sizing: border-box;
             border: 1px solid var(--border-accent); border-radius: 999px;
             background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 4px 16px var(--shade);
             transition: border-color .2s, box-shadow .2s; }
#vol:hover .pill { border-color: var(--border-accent-hover); box-shadow: 0 5px 20px var(--shade-hover); }
#vol button { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0;
              border-radius: 50%; background: none; cursor: pointer; }
#vol svg { width: 17px; height: 17px; stroke: var(--accent); }
#vol .off { display: none; }
#vol.muted .on { display: none; }
#vol.muted .off { display: inline; }
#vol input { width: 0; margin: 0; opacity: 0; accent-color: #e0559a; cursor: pointer; transition: width .2s, margin .2s, opacity .2s; }
#vol:hover input, #vol:focus-within input { width: 80px; margin: 0 12px 0 2px; opacity: 1; }
/* Touch screens (index.html placeSlider): the speaker opens this instead, the slider and Mute in a
   pill above it. Raised over the Share row while it's open. */
#vol-pop { position: absolute; right: -6px; bottom: calc(100% + 10px); display: flex; align-items: center; gap: 10px; box-sizing: border-box;
           padding: 6px 16px 6px 6px; border: 1px solid var(--border-accent); border-radius: 999px; white-space: nowrap;
           background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 6px 22px var(--shade-hover); animation: fade-in .15s ease both; }
#vol-pop[hidden] { display: none; }
#bar:has(#vol-pop:not([hidden])) { z-index: 3; }
#vol #vol-pop button { width: auto; height: 36px; gap: 6px; padding: 0 13px 0 10px; border-radius: 999px; background: var(--pill);
                       box-shadow: inset 0 0 0 1px var(--track); font: 600 13px/1 system-ui, sans-serif; color: var(--text); }
#vol #vol-pop button[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--strong); }
#vol #vol-pop input { width: 128px; height: 32px; margin: 0; opacity: 1; }

/* Shown while an uma is still downloading, where she'll stand. */
#loading, .uma-loading { position: fixed; left: 58%; top: 55%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
           border: 3px solid rgba(224,85,154,.2); border-top-color: #e0559a; animation: spin .8s linear infinite;
           opacity: 0; transition: opacity .2s; pointer-events: none; }
:is(#loading, .uma-loading).show { opacity: 1; }
.uma-loading { z-index: 1; } /* a duet's others, each where she'll stand */
/* Under it on the first load: how much of what the page waits for has arrived (see loadProgress).
   Only once the load is taking a moment, and gone as the stage appears. */
#load-progress { position: fixed; left: 58%; top: 55%; width: 120px; height: 5px; margin: 28px 0 0 -60px; overflow: hidden;
                 border-radius: 999px; background: rgba(224,85,154,.18); pointer-events: none;
                 animation: fade-in .3s ease .4s both; }
#load-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff7eb3, #e0559a);
                   transition: width .25s ease-out; }
body.ready #load-progress { display: none; }
/* Something the page needed wouldn't load (index.html's failNotice): what, and Retry. */
#load-error, #load-stuck { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 50; box-sizing: border-box;
              width: min(340px, calc(100% - 32px)); padding: 18px 20px; border-radius: 16px; background: var(--card);
              box-shadow: 0 4px 22px var(--shade-hover); text-align: center; font-size: 15px; color: var(--text); }
#load-error[hidden], #load-stuck[hidden], #load-slow[hidden] { display: none; }
#load-error p, #load-stuck p { margin: 0 0 14px; line-height: 1.4; }
#load-error button, #load-stuck button { padding: 9px 22px; border: 0; border-radius: 999px; font: 600 14px system-ui, sans-serif; color: #fff; cursor: pointer;
                     background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 11px rgba(224,85,154,.42); }
body.load-failed :is(#loading, #load-progress), body.load-stuck :is(#loading, #load-progress, #load-slow) { display: none; }
/* The first-load watchdog (index.html): a quiet line under the bar when the load is slow. */
#load-slow { position: fixed; left: 58%; top: 55%; width: 260px; max-width: calc(100% - 32px); margin: 44px 0 0 -130px; text-align: center;
             font-size: 13px; line-height: 1.4; color: var(--text); opacity: .7; pointer-events: none; }
body.ready #load-slow { display: none; }
@keyframes spin { to { transform: rotate(1turn); } }

/* The row along the bottom, under the song row: in free mode reroll, save and Customise (which
   opens the picker under it); on the daily page just Customise, as the roll saves its video from
   the Share button instead. */
#controls { position: fixed; left: calc(50% + var(--ctrl-shift, 0px)); bottom: calc(14px + var(--picker-room, 0px) + var(--safe-bottom)); transform: translateX(-50%); width: max-content;
            display: flex; gap: 8px; transition: bottom .36s cubic-bezier(.22,1.22,.36,1), left .32s cubic-bezier(.22,1.22,.36,1); }
body.daily #save { display: none; }
#controls button { display: flex; align-items: center; gap: 7px; height: 36px; box-sizing: border-box; padding: 0 15px 0 13px;
      border: 1px solid var(--border-accent); border-radius: 999px; cursor: pointer;
      font: 700 12.5px/1 var(--display); letter-spacing: .03em; color: var(--text);
      background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 4px 16px var(--shade);
      transition: color .2s, border-color .2s, box-shadow .2s, transform .14s; }
#controls button:hover:not(:disabled) { color: var(--strong); border-color: var(--border-accent-hover); box-shadow: 0 5px 20px var(--shade-hover); transform: translateY(-1px); }
#controls button:active:not(:disabled) { transform: scale(.97); }
#controls { max-width: calc(100vw - 24px); }
#controls button { flex: none; }
#controls :is(#reroll, #picker-toggle) { flex: 0 1 auto; min-width: 0; } /* the last resort: their words shorten */
#controls button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; } /* room for the p's */
/* Phones: Random and Customise keep their words; Share, Photo and Save go to just their icons
   (their titles still name them), Share saying "Copied" and Save its progress while they do. */
@media (max-width: 500px) {
  #controls { gap: 5px; }
  #controls :is(#reroll, #picker-toggle) { gap: 5px; padding: 0 11px 0 9px; }
  #controls :is(#share-free, #save) { justify-content: center; width: 34px; padding: 0; }
  #controls :is(#share-free:not(.said), #save:not(.busy)) span { display: none; }
  #controls :is(#share-free.said, #save.busy) { width: auto; padding: 0 12px 0 10px; }
  /* Free mode's row reaches the corners, so the changelog's "i" moves up beside the song row's top
     edge (and the changelog with it) rather than sit on Random. */
  body:not(.daily, .shared) :is(#about-toggle, #x-link, #suggest-toggle) { bottom: calc(104px + var(--picker-room, 0px) + var(--who-room, 0px) + var(--safe-bottom)); }
  body:not(.daily, .shared) #changelog { bottom: calc(140px + var(--picker-room, 0px) + var(--who-room, 0px) + var(--safe-bottom));
                                         max-height: calc(100dvh - 200px - var(--picker-room, 0px) - var(--who-room, 0px) - var(--safe-top) - var(--safe-bottom)); }
}
#picker-toggle { padding: 0 16px 0 13px; gap: 7px; }
#picker-toggle svg { width: 15px; height: 15px; stroke: var(--accent); }
#picker-toggle[aria-expanded="true"] { color: var(--strong); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(224,85,154,.22); }
/* The daily page's countdown and account button sit top right, beside the theme button, across
   from the Free mode button. Narrow screens get just the icon for free mode, and on phones a
   shorter countdown. */
#top-right { position: fixed; top: calc(14px + var(--safe-top)); right: 58px; display: flex; gap: 8px; }
#top-left { position: fixed; top: calc(14px + var(--safe-top)); left: 16px; display: flex; align-items: center; gap: 8px; }
#top-left #mode { position: static; top: auto; left: auto; right: auto; }
@media (max-width: 560px) {
  body.daily #mode { width: 34px; padding: 0; justify-content: center; }
  body.daily #mode span { display: none; }
}
@media (max-width: 420px) { /* tighter, so the account button fits too */
  #countdown span { font-size: 0; }
  #countdown span::after { content: "Next roll "; font-size: 13px; }
  #top-right, #top-left { gap: 6px; }
  #top-right #countdown { padding: 8px 12px; }
}
@media (max-width: 374px) {
  #countdown span { display: none; }
}
#reroll { padding: 0 14px 0 12px; gap: 7px; }
#reroll svg { width: 16px; height: 16px; stroke: var(--accent); transition: transform .4s; }
#reroll:hover svg { transform: rotate(90deg); }
#share-free { padding: 0 14px 0 12px; gap: 7px; }
#share-free svg { width: 15px; height: 15px; stroke: var(--accent); transition: transform .3s; }
#share-free:hover svg { transform: rotate(-20deg); }
#save { padding: 0 14px 0 12px; gap: 7px; font-variant-numeric: tabular-nums; }
#save svg { width: 15px; height: 15px; stroke: var(--accent); }
#save:disabled { cursor: default; color: var(--disabled); }
#save:disabled svg { stroke: var(--disabled-icon); }
#save.busy { color: var(--strong); cursor: pointer; }

/* Dark mode switch (top right), Photo mode, Camera flip & Festive buttons (top left beside mode). */
:is(#theme, #festive, #photo-toggle, #camera-flip) { position: fixed; top: calc(14px + var(--safe-top)); right: 16px; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
         box-sizing: border-box; padding: 0; border: 1px solid var(--border); border-radius: 50%; cursor: pointer; background: var(--surface-hud); backdrop-filter: blur(var(--blur-hud));
         box-shadow: 0 1px 6px var(--shade); transition: box-shadow .2s, transform .12s, opacity .2s; }
#top-left :is(#festive, #photo-toggle, #camera-flip) { position: static; top: auto; left: auto; right: auto; }
#festive[hidden], #camera-flip[hidden] { display: none; }
:is(body.daily:not(.rolled), body.just-rolled, body.shared, body.golden) #photo-toggle { display: none; }
#photo-toggle:disabled, #camera-flip:disabled { cursor: default; opacity: .45; }
:is(#theme, #festive, #photo-toggle, #camera-flip):hover:not(:disabled) { box-shadow: 0 2px 10px var(--shade-hover); }
:is(#theme, #festive, #photo-toggle, #camera-flip):active:not(:disabled) { transform: scale(.94); }
:is(#theme, #festive, #photo-toggle, #camera-flip) svg { width: 17px; height: 17px; stroke: var(--accent); transition: transform .4s, opacity .2s; }
#photo-toggle:hover:not(:disabled) svg { transform: scale(1.1); }
#camera-flip:hover:not(:disabled) svg { transform: rotate(180deg); }
#theme:hover svg { transform: rotate(-20deg); }
#festive:hover svg { transform: rotate(30deg); }
#festive[aria-pressed="false"] svg { stroke: var(--soft); }
#festive[aria-pressed="true"] .slash { display: none; }
#festive .festive-label { display: none; }
@media (min-width: 600px) {
  #festive { width: auto; padding-inline: 10px; gap: 6px; border-radius: 999px;
             color: var(--label); font: 600 12px/1 system-ui, sans-serif; white-space: nowrap; }
  #festive .festive-label { display: inline; }
}
:root[data-theme="dark"] #theme .moon, :root:not([data-theme="dark"]) #theme .sun { display: none; }

/* A faint "i" in the bottom left corner opens the changelog above it, as tall as its entries. */
#about-toggle, #x-link { position: fixed; left: 12px; bottom: calc(10px + var(--safe-bottom)); display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
                padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; opacity: .55; transition: opacity .2s, background .2s; text-decoration: none; }
#x-link { left: 44px; }
:is(#about-toggle, #x-link):is(:hover, :focus-visible, [aria-expanded="true"]) { opacity: 1; background: var(--pill); }
#about-toggle svg { width: 17px; height: 17px; stroke: var(--label); }
/* "New update!": a small tag above the button until What's new has been opened once since the last entry. */
#about-toggle.has-update { opacity: 1; }
#about-toggle .update-badge { position: absolute; left: 0; bottom: calc(100% + 7px); padding: 4px 8px; border-radius: 8px; white-space: nowrap;
  font: 700 11px/1.2 inherit; font-family: inherit; color: var(--strong); background: var(--pill); box-shadow: 0 2px 10px rgb(0 0 0 / .18);
  pointer-events: auto; animation: update-badge-in .35s ease-out both; }
#about-toggle .update-badge::after { content: ""; position: absolute; left: 10px; top: 100%; border: 5px solid transparent; border-top-color: var(--pill); }
@keyframes update-badge-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { #about-toggle .update-badge { animation: none; } }
#x-link svg { width: 14px; height: 14px; fill: var(--label); }
#suggest-toggle { position: fixed; left: 78px; bottom: calc(10px + var(--safe-bottom)); display: inline-flex; align-items: center; gap: 5px; height: 28px;
                  padding: 0 11px 0 9px; border: 1px solid var(--border-accent); border-radius: 999px; background: var(--pill); backdrop-filter: blur(8px);
                  font: 700 12px/1 var(--display); letter-spacing: .03em; color: var(--strong); cursor: pointer; opacity: .9; transition: opacity .2s, background .2s, border-color .2s, transform .15s; }
#suggest-toggle:is(:hover, :focus-visible) { opacity: 1; background: var(--surface-panel); border-color: var(--accent); }
#suggest-toggle:active { transform: scale(.97); }
#suggest-toggle svg { width: 13px; height: 13px; stroke: var(--accent); flex: none; }
#suggest-toggle span { line-height: 1.3; white-space: nowrap; } /* room for the g's, as in #controls */
#changelog { position: fixed; left: 12px; bottom: calc(46px + var(--safe-bottom)); z-index: 3; box-sizing: border-box; width: min(330px, calc(100vw - 24px));
             max-height: calc(100dvh - 80px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto;
             padding: 14px 16px; border: 1px solid var(--border-accent); border-radius: 16px; background: var(--surface-panel);
             backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 4px 18px var(--shade-hover); font-size: 13px; line-height: 1.45; color: var(--soft);
             transform-origin: bottom left; animation: pop-up .26s cubic-bezier(.22,1.28,.36,1) both; }
@keyframes pop-up { from { opacity: 0; transform: translateY(10px) scale(.94); } }
#changelog[hidden] { display: none; }
#changelog .changelog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#changelog .changelog-head h2 { margin: 0; }
#changelog .changelog-how { margin: 0 0 6px; }
#changelog .changelog-note { margin: 0 0 10px; padding-bottom: 9px; border-bottom: 1px solid var(--track); font-size: 11.5px; line-height: 1.35; color: var(--label); }
.songs-page, .songs-page body { height: auto; min-height: 100%; overflow: visible; }
.songs-page body { min-height: 100vh; line-height: 1.5; }
.songs-page main { box-sizing: border-box; max-width: 680px; margin: auto; padding: 32px 16px 64px; overflow-wrap: anywhere; }
.songs-page a, #changelog a[data-changelog-link] { color: var(--strong); }
.songs-page h1, .songs-page h2 { font-family: var(--display); line-height: 1.2; }
.songs-page .song-search { padding: 16px; border: 1px solid var(--border-accent); border-radius: 16px; background: var(--surface-panel); }
.songs-page label { display: block; margin-bottom: 8px; font-weight: 600; }
.songs-page input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--track);
                    border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.songs-page p { margin: 10px 0 0; color: var(--soft); }
.songs-page p:empty { display: none; }
.songs-page ul { padding-left: 22px; }
.songs-page li + li { margin-top: 4px; }
.songs-page .dance-list { padding-left: 0; list-style: none; }
.songs-page .dance-list li { display: flex; align-items: center; gap: 10px; }
.songs-page .dance-list img { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-panel); }

#changelog .changelog-how :is(button, a) { padding: 0; border: 0; background: none; cursor: pointer; font: 600 12.5px/1.2 system-ui, sans-serif; color: var(--strong); }
#changelog .changelog-how button:hover { text-decoration: underline; }
#changelog .close { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px -6px -4px 0; padding: 0; border: 0;
                    border-radius: 50%; background: none; cursor: pointer; }
#changelog .close:hover { background: var(--shade); }
#changelog .close svg { width: 16px; height: 16px; stroke: var(--label); }
#changelog h2 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#changelog h3 { margin: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--strong); }
#changelog .changelog-head + h3 { margin-top: 0; }
#changelog ul { margin: 0; padding-left: 18px; }
#changelog li + li { margin-top: 3px; }
#changelog .privacy { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--track); font-size: 12px; }

/* The picker (Customise): a sleek bottom dock right where the Customise button lives, rising
   smoothly while the buttons above glide up (--picker-room) and the stage frames itself cleanly
   above it (framePage). Daily gets a compact 468px card; free mode gets a consistent 620px dock
   so switching between Uma & song and Stage never shifts its width. */
#picker { position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); z-index: 2; width: min(656px, calc(100vw - 32px));
          opacity: 0; transform: translate(-50%, calc(100% + 22px + var(--safe-bottom))) scale(.97);
          transition: transform .36s cubic-bezier(.22,1.22,.36,1), opacity .22s ease; }
body.daily #picker { width: min(496px, calc(100vw - 32px)); }
#picker.open { opacity: 1; transform: translate(-50%, 0) scale(1); }
#picker .panel { display: flex; flex-direction: column; gap: 14px; padding: 6px 18px 16px; box-sizing: border-box;
                 border: 1px solid var(--border-accent); border-radius: 18px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 6px 24px var(--shade); }
#picker:not(.open) { pointer-events: none; }
#picker:not(.open) .panel { visibility: hidden; transition: visibility 0s .36s; }
/* Never taller than leaves the stage room above it: it scrolls instead. On phones it stops at
   half the screen, with Close under it, always there. */
#picker .panel { max-height: min(calc(100dvh - 130px), 56dvh); overflow-y: auto; overscroll-behavior: contain; }
#picker-close { display: none; }
@media (max-width: 700px) {
  #picker, body.daily #picker { width: calc(100vw - 32px); }
  #picker .panel { max-height: 50dvh; }
  #picker-close { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 40px; margin-top: 8px;
                  border: 1px solid var(--border-accent); border-radius: 999px; cursor: pointer; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel));
                  box-shadow: 0 2px 14px var(--shade); font: 600 14px/1 system-ui, sans-serif; color: var(--label); }
  #picker-close svg { width: 16px; height: 16px; stroke: var(--accent); }
  #picker:not(.open) #picker-close { visibility: hidden; transition: visibility 0s .36s; }
}
/* The tabs along the top (with gliding pink underline) and a close button on desktop.
   In daily mode there's only Stage, so it reads as a clean title without a lonely tab underline. */
#picker .picker-head { position: sticky; top: -6px; z-index: 1; display: flex; align-items: center; gap: 8px; margin: -6px -18px 0; padding: 6px 10px 0 18px;
                       background: inherit; border-bottom: 1px solid var(--track); }
#picker .tabs { position: relative; display: flex; gap: 4px; flex: 1; }
#picker [role="tab"] { position: relative; height: 40px; padding: 0 12px; border: 0; background: none; cursor: pointer;
                       font: 600 14px/1 system-ui, sans-serif; color: var(--label); transition: color .2s; }
#picker [role="tab"]:hover { color: var(--text); }
#picker [role="tab"][aria-selected="true"] { color: var(--strong); }
#picker .tabs:not(.has-glide) [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
                                                    border-radius: 2px; background: var(--accent); }
#picker [role="tab"]:only-child, body.daily #picker [role="tab"] { cursor: default; padding-left: 0; font: 700 14px/1 var(--display); letter-spacing: .01em; }
body.daily #picker .tabs .glide, body.daily #picker [role="tab"]::after { display: none; }
#picker-x { display: flex; }
@media (max-width: 700px) { #picker-x { display: none; } }
#picker .picker-head .close { align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0;
                              border-radius: 50%; background: none; cursor: pointer; transition: background .18s, transform .14s; }
#picker .picker-head .close:hover { background: var(--shade); }
#picker .picker-head .close:active { transform: scale(.9); }
#picker .picker-head .close svg { width: 18px; height: 18px; stroke: var(--label); }
#picker .group { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 100%; animation: pane-in .22s ease both; }
#picker .group[hidden] { display: none; }
#save-sheet .fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
#picker .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px 16px; }
#picker .wide { width: auto; min-width: 0; }
/* The backdrop row: full-width selector, with "Light umas to match" neatly beside it on 3D stages. */
#picker .backdrop-block { min-width: 0; }
#picker .backdrop-block[hidden] { display: none; }
#picker .backdrop-row { display: flex; align-items: center; gap: 10px; }
#picker .backdrop-row .cycle { flex: 1; min-width: 0; }
#picker .backdrop-row :is(.switch, .action) { flex: none; height: 34px; }
#picker .backdrop-row :is(.switch, .action)[hidden] { display: none; }
/* Free mode Stage colours: Jukebox light & Notes in a balanced, clearly separated 2-column well. */
#picker .swatch-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; padding: 10px 14px;
                      border: 1px solid var(--border); border-radius: 14px; background: rgba(0,0,0,.024); }
:root[data-theme="dark"] #picker .swatch-row { background: rgba(255,255,255,.035); }
#picker .swatch-row .swatch-field { position: relative; }
#picker .swatch-row .swatch-field + .swatch-field::before { content: ""; position: absolute; left: -12px; top: 4px; bottom: 4px; width: 1px; background: var(--track); }
/* Bottom toggles: anchored cleanly under a hairline divider. */
#picker .toggles { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--track); }
body.daily #picker #group-stage .toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body:not(.daily) #picker #group-stage .toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#picker .move-hint { display: none; font: 500 11.5px/1.35 system-ui, sans-serif; color: var(--soft); }
body.moving #picker .move-hint { display: block; }
/* Duet controls in a soft tinted card under the toggles. */
#picker .duet-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px;
                     border: 1px solid var(--border); border-radius: 14px; background: rgba(0,0,0,.024); }
:root[data-theme="dark"] #picker .duet-card { background: rgba(255,255,255,.035); }
#picker .duet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#picker .duet-card h3 { margin: 0; font: 700 11px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--strong); }
#picker .switch.compact { height: 28px; padding: 0 5px 0 10px; font-size: 11.5px; border-radius: 999px; }
#picker .switch.compact .track { width: 30px; height: 18px; }
#picker .switch.compact .knob { width: 14px; height: 14px; }
#picker .switch.compact[aria-checked="true"] .knob { transform: translateX(12px); }
/* Uma, Outfit and Dance: her face or the outfit beside the name, opening the gallery above,
   between arrows that step to the previous or next one in the gallery's order. */
:is(#picker, #uma-menu) .cycle { display: flex; align-items: center; gap: 2px; }
:is(#picker, #uma-menu) .cycle .choice { flex: 1; min-width: 0; }
:is(#picker, #uma-menu) .step { flex: none; position: relative; width: 26px; height: 34px; padding: 0; border: 0; border-radius: 8px;
                background: none; cursor: pointer; }
:is(#picker, #uma-menu) .step:hover { background: var(--pill); }
:is(#picker, #uma-menu) .step::before { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border: solid var(--label);
      border-width: 0 1.8px 1.8px 0; transform: translate(-70%, -50%) rotate(-45deg); }
:is(#picker, #uma-menu) .step.prev::before { transform: translate(-30%, -50%) rotate(135deg); }
/* After the arrows, a random one (the Uma & song tab and per-uma stage menu). */
:is(#picker, #uma-menu) .rand { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 34px; padding: 0; border: 0;
                border-radius: 8px; background: none; cursor: pointer; }
:is(#picker, #uma-menu) .rand:hover { background: var(--pill); }
:is(#picker, #uma-menu) .rand svg { width: 15px; height: 15px; stroke: var(--label); transition: transform .4s; }
:is(#picker, #uma-menu) .rand:hover svg { stroke: #e0559a; transform: rotate(90deg); }
:is(#picker, #uma-menu) .rand:disabled { cursor: progress; opacity: .4; }
:is(#picker, #uma-menu) .step:hover::before { border-color: #e0559a; }
:is(#picker, #uma-menu) .field .choice { display: flex; align-items: center; justify-content: flex-start; gap: 8px; height: 34px; padding: 0 26px 0 4px; position: relative;
      border: 1px solid var(--track); border-radius: 10px; background: var(--bg); box-shadow: none; color: var(--text);
      font: 13px system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-align: left; cursor: pointer; }
:is(#picker, #uma-menu) .field .choice:hover { box-shadow: 0 1px 6px var(--shade); }
:is(#picker, #uma-menu) .field .choice[aria-expanded="true"] { border-color: #e0559a; }
:is(#picker, #uma-menu) .choice img { flex: none; width: 26px; height: 26px; border-radius: 7px; object-fit: cover; object-position: top; background: var(--pill); }
:is(#picker, #uma-menu) .choice span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#picker, #uma-menu) .choice::after { content: ""; position: absolute; right: 11px; top: 50%; width: 5px; height: 5px; border: solid var(--label);
      border-width: 0 1.6px 1.6px 0; transform: translateY(-70%) rotate(45deg); }
/* Per-uma floating customiser (uma-menu.js): appears next to the clicked uma in free mode,
   and becomes a compact bottom sheet on narrow screens. */
#stage.uma-hover { cursor: pointer; }
#uma-menu { position: fixed; left: 16px; top: 16px; z-index: 10; box-sizing: border-box;
            width: min(308px, calc(100vw - 32px)); padding: 12px 14px 14px;
            display: flex; flex-direction: column; gap: 10px;
            border: 1px solid var(--border-accent); border-radius: 18px;
            background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel));
            box-shadow: 0 8px 28px var(--shade-hover); color: var(--text);
            animation: uma-menu-in .2s cubic-bezier(.22,1.24,.36,1) both; }
#uma-menu:focus { outline: none; }
#uma-menu[hidden] { display: none; }
@keyframes uma-menu-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }
#uma-menu .uma-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
                           padding-bottom: 8px; border-bottom: 1px solid var(--track); }
#uma-menu .uma-menu-title { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; }
#uma-menu #uma-menu-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                           font: 700 15px/1.2 var(--display); color: var(--strong); }
#uma-menu .uma-menu-slot { flex: none; padding: 2px 7px; border-radius: 999px;
                           background: rgba(224,85,154,.12); color: var(--strong);
                           font: 700 10.5px/1.3 system-ui, sans-serif; letter-spacing: .02em; }
#uma-menu .uma-menu-slot[hidden] { display: none; }
#uma-menu .close { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
                   margin: -2px -4px -2px 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
                   transition: background .18s, transform .14s; }
#uma-menu .close:hover { background: var(--shade); }
#uma-menu .close:active { transform: scale(.9); }
#uma-menu .close svg { width: 16px; height: 16px; stroke: var(--label); }
#uma-menu .fields { display: flex; flex-direction: column; gap: 9px; }
#uma-menu .unison-note { margin-top: 2px; font: 500 11px/1.3 system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--soft); }
#uma-menu .unison-note[hidden] { display: none; }
#uma-menu .uma-transform { display: grid; grid-template-columns: max-content minmax(0, 1fr) 4ch; align-items: center;
                           gap: 6px 8px; padding-top: 8px; border-top: 1px solid var(--track);
                           color: var(--label); font: 600 12px/1.2 system-ui, sans-serif; }
#uma-menu .uma-transform input { width: 100%; margin: 0; accent-color: var(--accent); }
#uma-menu .uma-transform output { text-align: right; font-variant-numeric: tabular-nums; }
#uma-menu #uma-transform-reset { grid-column: 1 / -1; justify-self: start; padding: 5px 8px; border: 0;
                                 border-radius: 8px; background: var(--pill); color: var(--text); cursor: pointer; font: inherit; }
#uma-menu #uma-transform-reset:disabled { opacity: .55; cursor: default; }
@media (max-width: 700px) {
  #uma-menu { left: 16px !important; right: 16px; top: auto !important; bottom: calc(102px + var(--picker-room, 0px) + var(--safe-bottom)); /* above #bar and #controls */
              width: auto; max-height: min(55dvh, calc(100dvh - 170px - var(--picker-room, 0px) - var(--safe-top) - var(--safe-bottom))); overflow-y: auto; padding: 12px 14px 14px;
              animation: gallery-sheet .24s cubic-bezier(.22,1.2,.36,1) both; }
  #uma-menu .close { width: 34px; height: 34px; background: var(--pill); }
}
/* The gallery: the umas' faces (with a search box) or her outfits head to toe, in a scrolling
   grid above the picker (or above the controls when opened from an uma on stage); the one on
   stage is outlined. On phones and the side panel it's a sheet over the panel instead, with its
   name and a close button along the top, so there's room to browse while she stays in view. */
#gallery { position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); box-sizing: border-box;
           width: min(760px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; padding: 12px;
           border: 1px solid var(--border-accent); border-radius: 18px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 6px 26px var(--shade-hover);
           transform-origin: bottom center; animation: gallery-pop .26s cubic-bezier(.22,1.24,.36,1) both; }
body > #gallery.from-stage { position: fixed; bottom: calc(64px + var(--safe-bottom)); z-index: 12; } /* opened from the uma menu: above the controls */
@keyframes gallery-pop { from { opacity: 0; transform: translate(-50%, 10px) scale(.95); } }
#gallery .empty { margin: 6px 0 10px; padding: 18px 12px; text-align: center; font-size: 13px; color: var(--soft); }
#gallery .empty .clear-search { margin-left: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: 600 13px system-ui, sans-serif; color: var(--strong); }
#gallery .empty .clear-search:hover { text-decoration: underline; }
#gallery .gallery-head { display: flex; align-items: center; gap: 8px; }
#gallery .song-filter:not([hidden]) { display: flex; gap: 6px; }
#gallery .song-filter button { padding: 6px 13px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pill); color: var(--text); font: 600 12px system-ui, sans-serif; }
#gallery .song-filter button[aria-pressed="true"] { color: #fff; background: var(--accent-pill); }
#gallery .gallery-head .close { display: flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 0;
                                border: 0; border-radius: 50%; background: none; cursor: pointer; transition: background .18s, transform .14s; }
#gallery .gallery-head .close:hover { background: var(--shade); }
#gallery .gallery-head .close:active { transform: scale(.9); }
#gallery .gallery-head .close svg { width: 17px; height: 17px; stroke: var(--label); }
#gallery .gallery-head .title { display: none; }
#gallery .gallery-head .title:not([hidden]) { display: block; flex: 1; min-width: 0; padding-left: 4px; font: 600 14px/1 system-ui, sans-serif; color: var(--text); }
#gallery input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--track); border-radius: 10px; background: var(--bg); color: var(--text);
                 font: 13px system-ui, sans-serif; }
#gallery input:focus-visible { outline: 2px solid #e0559a; outline-offset: 1px; }
#gallery .grid { position: relative; display: grid; gap: 6px; overflow-y: auto; padding: 2px;
                 max-height: min(52vh, 440px, calc(100dvh - var(--picker-room, 0px) - 100px)); } /* room above the picker */
#gallery[data-kind="chara"] .grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
#gallery[data-kind="outfit"] .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
#gallery[data-kind="dance"] .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
#gallery[data-kind="song"] .grid { --song-tile-min: 104px; display: block; scrollbar-gutter: stable; }
#gallery .song-space { position: relative; }
#gallery .song-row { position: absolute; inset-inline: 0; display: grid; gap: 6px; }
#gallery .grid h3.song-row { display: flex; align-items: center; margin: 0 4px; }
#gallery .grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 0;
      border-radius: 12px; background: none; cursor: pointer; color: var(--soft); font: 11px/1.25 system-ui, sans-serif;
      transition: background .16s, box-shadow .16s, transform .16s cubic-bezier(.22,1.3,.36,1); }
#gallery .grid button:hover { background: var(--pill); box-shadow: 0 2px 8px var(--shade); transform: translateY(-2px); }
#gallery .grid button:active { transform: scale(.95); }
#gallery .grid button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--strong); }
#gallery .grid .tile-in { animation: tile-in .24s cubic-bezier(.22,1.2,.36,1) var(--stagger, 0ms) both; }
@keyframes tile-in { from { opacity: 0; transform: translateY(8px) scale(.94); } }
#gallery .grid img { width: 100%; aspect-ratio: 1; border-radius: 10px; background: var(--pill); object-fit: cover; }
#gallery[data-kind="outfit"] .grid img { aspect-ratio: 3 / 4; }
#gallery[data-kind="backdrop"] .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#gallery[data-kind="backdrop"] .grid img { aspect-ratio: 16 / 9; }
#gallery .grid button { position: relative; }
#gallery .grid .tag { position: absolute; top: 10px; right: 8px; padding: 2px 6px; border-radius: 999px; background: rgb(0 0 0 / .6);
                      color: #fff; font: 600 10px/1.3 system-ui, sans-serif; pointer-events: none; }
/* A dance added in the last week (index.html NEW_DANCES): a small pink tag */
#gallery .grid .tag.new { top: 6px; right: 6px; padding: 1px 5px; background: var(--accent); font-size: 9px; letter-spacing: .03em; text-transform: uppercase; }
#gallery .grid h3 { grid-column: 1 / -1; margin: 8px 4px 0; font: 600 12px/1 system-ui, sans-serif; color: var(--label); }
/* The backdrop gallery's note on download sizes, and each location's favourite star (on the thumbnail's other corner). */
#gallery .grid .note { grid-column: 1 / -1; margin: 0 4px; color: var(--label); font: 11px/1.3 system-ui, sans-serif; }
#gallery .grid .tile-wrap { position: relative; display: flex; min-width: 0; }
#gallery .grid .tile-wrap > button:first-child { flex: 1; min-width: 0; }
#gallery .grid .fav { position: absolute; top: 9px; left: 7px; width: 30px; height: 30px; padding: 0; justify-content: center;
                      border-radius: 999px; background: rgb(0 0 0 / .45); }
#gallery .grid .fav:hover { background: rgb(0 0 0 / .7); box-shadow: none; }
#gallery .grid .fav:focus-visible { outline: 2px solid #e0559a; outline-offset: 1px; }
#gallery .grid .fav svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
#gallery .grid .fav.on svg { fill: #f6c445; stroke: #f6c445; }
#gallery .grid h3:first-child { margin-top: 2px; }
#gallery .grid span { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                      text-align: center; }
@media (max-width: 700px) {
  #gallery { left: 0; right: 0; top: auto; bottom: 0; z-index: 2; width: auto; height: max(62dvh, calc(100% + 100px));
             transform: none; transform-origin: bottom center; box-shadow: 0 2px 18px var(--shade-hover); animation: gallery-sheet .26s cubic-bezier(.22,1.2,.36,1) both; }
  @keyframes gallery-sheet { from { opacity: 0; transform: translateY(18px); } }
  body > #gallery.from-stage { left: 16px; right: 16px; bottom: calc(14px + var(--safe-bottom)); height: min(70dvh, calc(100dvh - 76px)); }
  #gallery .grid { flex: 1; min-height: 0; max-height: none; align-content: start; }
  #gallery .gallery-head .close { width: 38px; height: 38px; background: var(--pill); }
  #gallery .gallery-head .close svg { width: 18px; height: 18px; }
  #gallery input { height: 38px; box-sizing: border-box; font-size: 16px; } /* 16px: iPhones zoom the page in on anything smaller */
  #gallery[data-kind="dance"] .grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  #gallery[data-kind="song"] .grid { --song-tile-min: 88px; }
}
/* Above the panel on desktop: never taller than the room over it (the panel sits 60px up, under the song row). */
@media (min-width: 701px) {
  body:not(.picker-side) #picker #gallery { max-height: calc(var(--picker-top, 100dvh) - 28px - var(--safe-top)); }
  body:not(.picker-side) #picker #gallery .grid { min-height: 0; }
}
#gallery[hidden], #gallery [hidden], #gallery .grid [hidden] { display: none; } /* after the rest: it beats their display */
/* Wide, tall screens (body.picker-side, set by pickerRoom): Customise docks along the right, full
   height under the top buttons, sliding in from the side; the stage, the song row and the buttons
   keep to what's left (--picker-side). Its galleries open over it as a sheet. */
body.picker-side #picker, body.picker-side.daily #picker { left: auto; right: 16px; top: calc(64px + var(--safe-top)); bottom: calc(14px + var(--safe-bottom));
      width: clamp(360px, 30vw, 420px); transform: translateX(calc(100% + 24px)) scale(.98); transform-origin: center right; }
body.picker-side #picker.open { transform: none; }
body.picker-side #picker .panel { height: 100%; max-height: none; overflow-x: hidden; }
/* Free mode on a desktop (desk-dock): a floating window centred vertically beside the stage.
   Galleries open as a taller sheet over it. */
body.desk-dock.picker-side:not(.daily) #picker {
      --float-top: calc(64px + var(--safe-top)); --float-room: calc(100dvh - 122px - var(--safe-top) - var(--safe-bottom));
      top: calc(var(--float-top) + var(--float-room) / 2); bottom: auto; right: var(--picker-right, 16px);
      width: clamp(440px, 34vw, 560px); transform: translate(18px, -50%) scale(.98); transform-origin: center left;
      transition: transform .36s cubic-bezier(.22,1.22,.36,1), opacity .22s ease, right .36s cubic-bezier(.22,1.22,.36,1); }
body.desk-dock.picker-side:not(.daily) #picker.open { transform: translate(0, -50%); }
body.desk-dock.picker-side:not(.daily) #picker .panel { height: auto; max-height: var(--float-room); }
body.desk-dock.picker-side:not(.daily) #picker #gallery { --gallery-h: min(var(--float-room), 820px);
      inset: auto 0; top: 50%; height: var(--gallery-h); margin-top: calc(var(--gallery-h) / -2); }
@media (min-width: 1440px) { /* 490px+ wide: two to a row */
  body.desk-dock.picker-side:not(.daily) #picker .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.desk-dock.picker-side:not(.daily) #picker #group-stage .toggles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* The daily page's is just Stage: as tall as that, not an empty column; its backdrop gallery still
   gets the full height, down over the stage below it. */
body.picker-side.daily #picker { bottom: auto; }
body.picker-side.daily #picker .panel { height: auto; max-height: calc(100dvh - 78px - var(--safe-top) - var(--safe-bottom)); }
body.picker-side.daily #picker #gallery { bottom: auto; height: calc(100dvh - 78px - var(--safe-top) - var(--safe-bottom)); }
body.picker-side #picker .fields { grid-template-columns: minmax(0, 1fr); }
body.picker-side #picker #group-stage .toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* long (Japanese) labels shorten, not widen it */
body.picker-side.picker-open :is(#account-hint, #recap-hint) { display: none; } /* they'd sit on its head; back when it closes */
body.picker-side #picker #gallery { inset: 0; z-index: 2; width: auto; transform: none; transform-origin: center right; animation-name: gallery-side; }
@keyframes gallery-side { from { opacity: 0; transform: translateX(14px); } }
body.picker-side #picker #gallery .grid { flex: 1; min-height: 0; max-height: none; align-content: start; }
body.picker-side #picker #gallery[data-kind="dance"] .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
body.picker-side #picker #gallery[data-kind="song"] .grid { --song-tile-min: 96px; }
body.picker-side #picker #gallery[data-kind="backdrop"] .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
body.picker-side #controls { left: calc(50% - var(--picker-side, 0px) / 2 + var(--ctrl-shift, 0px)); }
body.picker-side #score { left: min(calc(50% - var(--picker-side, 0px) / 2 + 175px), calc(100vw - var(--picker-side, 0px) - 288px)); }
body.picker-side #score-pill { left: calc(50% - var(--picker-side, 0px) / 2 + var(--pill-shift, 0px)); }
/* More below: the bottom of the panel's scroll fades out, gone once it's at the end (pickerFade). */
#picker .panel::after { content: ""; position: sticky; bottom: -16px; z-index: 1; flex: none; height: 30px; margin-top: -44px; /* its gap and height: it takes no room */
      background: linear-gradient(to bottom, transparent, var(--surface-panel)); pointer-events: none; transition: opacity .2s; }
#picker .panel.at-end::after { opacity: 0; }
@media (max-width: 500px) { #picker .panel::after { bottom: -12px; } } /* its bottom padding there */
:is(#picker, #uma-menu, #save-sheet) .field { display: flex; flex-direction: column; gap: 6px; font: 600 11px/1 system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: var(--label); }
#picker .swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-height: 28px; }
#picker .swatches button { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
                           box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); transition: transform .18s cubic-bezier(.3,1.5,.5,1), box-shadow .18s; }
#picker .swatches button:hover { transform: scale(1.16); }
#picker .swatches button:active { transform: scale(.9); }
#picker .swatches button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; animation: swatch-pop .32s cubic-bezier(.3,1.6,.5,1); }
@keyframes swatch-pop { 0% { transform: scale(.86); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
#picker .swatches .unlit { background: repeating-linear-gradient(135deg, var(--track) 0 4px, var(--bg) 4px 8px); }
#picker .swatches .rainbow { background: conic-gradient(from 0deg, #ff4d6d, #ffa53b, #ffe14d, #4dd77a, #4dc3ff, #9d6bff, #ff4d6d); }
#picker .swatches .swatch-custom { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
                                   background: var(--pill); box-shadow: inset 0 0 0 1px var(--border); transition: transform .18s cubic-bezier(.3,1.5,.5,1), box-shadow .18s; }
#picker .swatches .swatch-custom:hover { transform: scale(1.16); }
#picker .swatches .swatch-custom:active { transform: scale(.9); }
#picker .swatches .swatch-custom[data-active="true"] { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); animation: swatch-pop .32s cubic-bezier(.3,1.6,.5,1); }
#picker .swatches .swatch-custom:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#picker .swatches .swatch-custom svg { width: 13px; height: 13px; stroke: var(--label); pointer-events: none; }
#picker .swatches .swatch-custom[data-active="true"] svg { stroke: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
#picker .swatches .swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
/* Actions (Hide buttons, Reset places) and switches (Duet, Move umas, the backdrop's light, Stage
   effects, Low quality, Free camera): flat crisp pills inside the dock (no nested drop shadows)
   with a subtle rose tint when enabled. */
:is(#picker :is(.action, .switch), #photo .switch) { display: flex; align-items: center; gap: 7px; min-width: 0; height: 34px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--track); border-radius: 10px;
      cursor: pointer; background: var(--bg); box-shadow: none; font: 500 12.5px/1.35 system-ui, sans-serif; letter-spacing: 0; text-transform: none;
      white-space: nowrap; color: var(--soft); transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .14s cubic-bezier(.22,1.3,.36,1); }
:is(#picker :is(.action, .switch), #photo .switch):hover { border-color: rgba(224,85,154,.45); box-shadow: 0 1px 6px var(--shade); color: var(--text); }
:is(#picker :is(.action, .switch), #photo .switch):active { transform: scale(.97); }
#picker :is(.action, .switch)[hidden] { display: none; }
#picker #pick-daily-mix:disabled { opacity: .5; cursor: default; box-shadow: none; }
#picker .action { justify-content: center; }
#picker .action span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#picker .action svg { width: 14px; height: 14px; stroke: var(--accent); transition: transform .4s; flex: none; }
#pick-unplace:hover svg { transform: rotate(-90deg); }
#formations { position: fixed; inset: var(--formation-top, 8px) auto auto var(--formation-left, 8px);
  box-sizing: border-box; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 16px);
  margin: 0; padding: 10px; border: 1px solid var(--border-accent); border-radius: 18px;
  background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 8px 28px var(--shade-hover); }
#formations .formation-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#formations button { min-height: 36px; padding: 5px 8px; border: 1px solid var(--track); border-radius: 10px;
  color: var(--text); background: var(--pill); font: 500 12.5px/1.25 system-ui, sans-serif; cursor: pointer; }
#formations button:hover { border-color: var(--accent); color: var(--strong); }
#formations button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 700px) {
  #formations { inset: auto 16px calc(12px + var(--safe-bottom)); width: auto; max-width: none;
    max-height: calc(100dvh - 24px - var(--safe-bottom)); }
  #formations button { min-height: 44px; }
}
:is(#picker, #photo, #uma-menu) .switch { justify-content: space-between; gap: 8px; padding-right: 6px; }
:is(#picker, #photo, #uma-menu) .switch .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
:is(#picker, #photo, #uma-menu) .switch .track { flex: none; position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--track); transition: background .25s; }
:is(#picker, #photo, #uma-menu) .switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff;
                        box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .28s cubic-bezier(.3,1.55,.55,1), width .16s ease; }
:is(#picker, #photo, #uma-menu) .switch:active .knob { width: 20px; }
:is(#picker, #photo, #uma-menu) .switch[aria-checked="true"] { color: var(--strong); border-color: rgba(224,85,154,.36); background: rgba(224,85,154,.055); }
:root[data-theme="dark"] :is(#picker, #photo, #uma-menu) .switch[aria-checked="true"] { background: rgba(224,85,154,.12); }
:is(#picker, #photo, #uma-menu) .switch[aria-checked="true"] .track { background: var(--accent-grad); }
:is(#picker, #photo, #uma-menu) .switch[aria-checked="true"] .knob { transform: translateX(14px); }
:is(#picker, #photo, #uma-menu) .switch[aria-checked="true"]:active .knob { transform: translateX(10px); }
/* Customise's "?" (explain mode): a round head button like the score's "?", and each switch's and
   action's title written out under its label, the toggles one or two to a row so the words fit. */
#pick-camera, #pick-camera-move, #pick-camera-reset, #picker-explain { display: flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0;
                  border-radius: 50%; background: none; cursor: pointer; color: var(--label); transition: background .2s, color .2s, transform .14s; }
#pick-camera svg, #pick-camera-move svg, #pick-camera-reset svg, #picker-explain svg { width: 18px; height: 18px; stroke: currentColor; }
#pick-camera:hover, #pick-camera-move:hover, #pick-camera-reset:hover, #picker-explain:hover { background: var(--shade); color: var(--strong); }
#pick-camera:active, #pick-camera-move:active, #pick-camera-reset:active, #picker-explain:active { transform: scale(.88); }
#pick-camera[aria-checked="true"], #pick-camera-move[aria-checked="true"], #picker-explain[aria-pressed="true"] { color: #e0559a; background: rgba(224,85,154,.1); }
:root[data-theme="dark"] :is(#pick-camera[aria-checked="true"], #pick-camera-move[aria-checked="true"], #picker-explain[aria-pressed="true"]) { background: rgba(224,85,154,.18); }
body:not(.free-camera) #pick-camera-reset { display: none; }
@media (hover: none) and (pointer: coarse) { #pick-camera-move { display: none; } } /* keyboard only */
#picker .toggle-help { display: none; }
#picker.explain .group :is(.switch, .action) { flex-wrap: wrap; align-content: center; row-gap: 3px; height: auto; min-height: 34px; padding-top: 7px; padding-bottom: 8px; text-align: left; }
#picker.explain .group .toggle-help { display: block; flex: 1 0 100%; order: 9; padding-right: 6px; font: 500 11.5px/1.35 system-ui, sans-serif;
                                     color: var(--soft); white-space: normal; overflow-wrap: anywhere; }
#picker.explain .group .action > span { flex: 1; min-width: 0; }
#picker.explain .backdrop-row { flex-wrap: wrap; }
#picker.explain .backdrop-row .switch { flex: 1 1 100%; }
#picker.explain .duet-head { flex-wrap: wrap; }
#picker.explain .duet-head .switch { flex: 1 1 100%; }
#picker.explain #group-umas .toggles,
body.daily #picker.explain #group-stage .toggles,
body:not(.daily) #picker.explain #group-stage .toggles { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; }
@media (min-width: 541px) {
  #picker.explain #group-umas .toggles,
  body.daily #picker.explain #group-stage .toggles,
  body:not(.daily) #picker.explain #group-stage .toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.picker-side #picker.explain #group-umas .toggles,
body.picker-side #picker.explain #group-stage .toggles { grid-template-columns: minmax(0, 1fr); } /* the side dock is too narrow for two */
@media (max-width: 500px) { #picker-explain { width: 36px; height: 36px; } }
body:not(.duet) #picker .duet-only { display: none; }
#picker .count { display: flex; align-items: center; gap: 8px; height: 32px; }
#picker .count input { flex: 1; min-width: 0; accent-color: #e0559a; cursor: pointer; }
#picker .count output { min-width: 1.5em; font: 700 14px/1 system-ui, sans-serif; color: var(--strong); }
/* The uma count beside its slider: looks like the plain number until hovered or focused, then can be typed in. */
#picker .count #count-value { flex: none; width: 3.2em; padding: 4px 4px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  font: 700 14px/1 system-ui, sans-serif; color: var(--strong); text-align: center; cursor: text; -moz-appearance: textfield; appearance: textfield; }
#picker .count #count-value::-webkit-inner-spin-button, #picker .count #count-value::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#picker .count #count-value:is(:hover, :focus) { border-color: rgba(224,85,154,.45); background: #fff; outline: none; }
#picker .count #count-value:focus-visible { box-shadow: 0 0 0 2px rgba(224,85,154,.35); }
#picker #spin-speed { grid-column: 1 / -1; color: var(--label); font: 600 12px/1.2 system-ui, sans-serif; }
#picker #spin-speed output { min-width: 5ch; text-align: right; font-variant-numeric: tabular-nums; }
#picker #count-warn { margin-top: -2px; font: 500 11px/1.3 system-ui, sans-serif; color: #a35500; }
:root[data-theme="dark"] #picker #count-warn { color: #f2a65a; }
#picker #count-warn::before { content: "⚠ "; }
#picker #count-warn[hidden] { display: none; }
/* Move umas: drag one to move her (the page doesn't scroll or zoom under your finger meanwhile). */
body.moving canvas#stage, body.free-camera canvas#stage { cursor: grab; touch-action: none; }
body.moving.dragging, body.moving.dragging canvas#stage { cursor: grabbing; }
body.free-camera #stage { cursor: grab; }
body.free-camera #stage:active { cursor: grabbing; }

/* The Save sheet, opened by Save (free mode) or the daily roll's MP4 button: what's drawn on the
   video, MP4 or GIF, that format's settings, roughly how big the file will be, and Save. Frame rate,
   bitrate, codec, a GIF's colours and anti-aliasing wait behind Advanced. A bottom sheet on phones. */
#save-sheet { box-sizing: border-box; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0 20px 20px; border: 0;
              border-radius: 20px; background: var(--bg); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.3);
              font: 14px/1.4 system-ui, sans-serif; overflow-y: auto; scrollbar-gutter: stable; }
/* scrollbar-gutter: the scrollbar's room is always kept, so the fields wrap the same with or without it.
   Without it a window just short enough flickered: the scrollbar narrowed the sheet, Advanced wrapped
   to its own row, the sheet's height changed, the scrollbar went, and round again. */
#save-sheet[open] { display: flex; flex-direction: column; gap: 16px; animation: score-in .3s cubic-bezier(.3,1.4,.5,1) both; }
#save-sheet::backdrop { background: rgba(20,16,24,.35); }
#save-sheet .head { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px 0 0; padding-top: 14px; }
#save-sheet .framing:not([hidden]) { display: block; width: auto; height: auto; max-width: 100%; max-height: min(20dvh, 160px); align-self: center;
  border-radius: 10px; box-shadow: 0 0 0 1px var(--border); }
#save-sheet .save-retry:not([hidden]) { align-self: center; color: var(--strong); font: 600 13px system-ui, sans-serif; }
#save-sheet h2 { margin: 0; font: 700 16px/1 system-ui, sans-serif; color: var(--text); }
#save-sheet .close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0;
                     border-radius: 50%; background: none; cursor: pointer; }
#save-sheet .close:hover { background: var(--shade); }
#save-sheet .close svg { width: 18px; height: 18px; stroke: var(--label); }
#save-sheet .go { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 0; border-radius: 999px; cursor: pointer;
                  background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 11px rgba(224,85,154,.42);
                  font: 700 15px/1 var(--display); color: #fff; transition: box-shadow .2s, transform .12s; }
#save-sheet .go:hover { box-shadow: 0 3px 16px rgba(224,85,154,.58); }
#save-sheet .go:active { transform: scale(.98); }
#save-sheet .go svg { width: 18px; height: 18px; stroke: #fff; }
#save-sheet .downloads:not(.gif) .gif, #save-sheet .downloads.gif .mp4, #save-sheet .downloads:not(.advanced) .adv, #save-sheet .field[hidden], #save-sheet .seg[hidden], #save-sheet .yt-explain[hidden] { display: none; }
#save-sheet .yt-sound { flex-basis: 100%; }
#save-sheet .yt-explain { margin: 6px 0 0; padding: 8px 11px; border-radius: 10px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--border);
                          font: 500 12px/1.45 system-ui, sans-serif; color: var(--label); text-transform: none; letter-spacing: 0; }
#save-sheet .seg { display: flex; height: 32px; border-radius: 999px; overflow: hidden; background: var(--pill); box-shadow: 0 1px 6px var(--shade), inset 0 0 0 1px var(--border); }
#save-sheet .seg button { padding: 0 15px; border: 0; background: none; cursor: pointer; font: 600 13px/1 system-ui, sans-serif;
                          color: var(--label); transition: color .2s; }
#save-sheet .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#save-sheet .seg button[aria-pressed="true"] { color: #fff; background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); }
#save-sheet .chips button + button { border-left: 1px solid var(--track); }
#save-sheet .chips button[aria-pressed="true"] + button[aria-pressed="true"] { border-left-color: rgba(255,255,255,.45); }
#save-sheet .chips button { padding: 0 11px; }
body:not(.daily) #save-sheet .daily-only { display: none; } /* free mode's videos have no score or date */
body:not(.daily) #dl-overlay [data-part="uma"] { border-left: 0; }
#save-sheet select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--track); border-radius: 10px; cursor: pointer;
                 appearance: none; -webkit-appearance: none; color: var(--text); font: 13px system-ui, sans-serif;
                 background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e0559a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 6px; }
#save-sheet select:hover { box-shadow: 0 1px 6px var(--shade); }
#save-sheet .range input { box-sizing: border-box; width: 96px; height: 32px; padding: 0 10px; border: 1px solid var(--track); border-radius: 10px;
                           color: var(--text); background: var(--bg); font: 13px system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
#save-sheet .range input[aria-invalid="true"] { border-color: #d33; }
#save-sheet #dl-size { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 32px; font: 700 14px/1.3 system-ui, sans-serif; color: var(--strong); text-transform: none; letter-spacing: 0; }
#save-sheet #dl-size small { margin-left: 0; font-weight: 500; font-size: 12px; color: var(--label); text-transform: none; letter-spacing: 0; }
#save-sheet #dl-size.bad { color: #d33; font-size: 12px; font-weight: 600; }
#save-sheet .more { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px; border: 0; background: none; cursor: pointer;
                    font: 600 13px/1 system-ui, sans-serif; color: var(--strong); }
#save-sheet .more:hover span { text-decoration: underline; }
#save-sheet .more svg { width: 13px; height: 13px; stroke: currentColor; transition: transform .2s; }
#save-sheet .more[aria-expanded="true"] svg { transform: rotate(180deg); }
#save-sheet .seg { align-self: flex-start; }
/* Hide buttons: nothing but the stage (and a roll's celebration). */
body.clean > :not(#stage, #fx, #clean-tip, #photo, #yt-card) { display: none !important; } /* YouTube's player stays in view */

/* Photo mode (photo.js): over the bare stage, a camera flash, a tip, and a bar of buttons. */
#photo { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#photo[hidden] { display: none; }
#photo .photo-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#photo .photo-tip { position: absolute; top: calc(18px + var(--safe-top)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px);
      padding: 8px 14px; border-radius: 999px; background: var(--overlay); box-shadow: 0 3px 14px var(--shade); color: var(--text);
      font: 600 13px/1.3 system-ui, sans-serif; text-align: center; opacity: 0; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#photo .photo-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); pointer-events: auto;
      display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 999px; background: var(--overlay);
      box-shadow: 0 4px 22px var(--shade-hover); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#photo .photo-bar > button:not(.shutter):not(.switch) { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 12px; border: 0;
      border-radius: 999px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); cursor: pointer;
      font: 700 13px/1 system-ui, sans-serif; transition: transform .12s, box-shadow .12s; }
#photo .photo-bar > button:not(.shutter):not(.switch):hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--strong); }
#photo .photo-bar > button:active { transform: scale(.95); }
#photo .photo-bar svg { width: 18px; height: 18px; stroke: currentColor; }
#photo [data-photo="freeze"] .play, #photo [data-photo="freeze"][aria-pressed="true"] .pause { display: none; }
#photo [data-photo="freeze"][aria-pressed="true"] .play { display: inline; fill: currentColor; }
#photo [data-photo="freeze"][aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--strong); }
#photo .photo-bar .switch { height: 40px; padding: 0 8px 0 13px; border-radius: 999px; font-weight: 700; font-size: 13px; }
#photo .shutter { position: relative; width: 58px; height: 58px; margin: 0 4px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
      background: var(--accent-grad); box-shadow: 0 3px 14px rgba(214,61,134,.5); transition: transform .12s; }
#photo .shutter i { position: absolute; inset: 5px; border: 3px solid rgba(255,255,255,.95); border-radius: 50%; }
#photo .shutter:hover { transform: scale(1.06); }
#photo .shutter:active { transform: scale(.92); }
#photo .shutter:disabled { opacity: .6; cursor: progress; }
#photo .shutter:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
body.photo #stage { cursor: grab; }
body.photo #stage:active { cursor: grabbing; }
@media (max-width: 480px) {
  #photo .photo-bar { gap: 5px; padding: 6px; }
  #photo .photo-bar > button:not(.shutter):not(.switch) { padding: 0 11px; }
  #photo .photo-bar > button:not(.shutter) span:not(.track):not(.knob):not(.label) { display: none; }
}
body.clean { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#clean-tip { position: fixed; left: 50%; bottom: 24px; z-index: 5; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 9px 16px;
             border-radius: 999px; background: var(--card); backdrop-filter: blur(6px); box-shadow: 0 2px 12px var(--shade-hover);
             font-size: 13px; color: var(--soft); text-align: center; pointer-events: none; opacity: 0; }
/* The daily page's panel: just Stage (the backdrop, its switches and the view). */
body.daily #picker .free-only { display: none; }
body:not(.daily) #picker .daily-only { display: none; }
/* Desktop gallery tile sizing and narrow-screen dock adaptation. */
@media (min-width: 701px) {
  #gallery[data-kind="chara"] .grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  #gallery[data-kind="dance"] .grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  #gallery[data-kind="song"] .grid { --song-tile-min: 92px; }
  #gallery[data-kind="outfit"] .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  #gallery[data-kind="backdrop"] .grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
}
@media (max-width: 660px) {
  body:not(.daily) #picker #group-stage .toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  #picker .backdrop-row { flex-direction: column; align-items: stretch; gap: 8px; }
  #picker .swatch-row { grid-template-columns: 1fr; gap: 12px; }
  #picker .swatch-row .swatch-field + .swatch-field::before { display: none; }
}
@media (max-width: 500px) { /* phones: everything a finger's size, two to a row */
  #picker { width: calc(100vw - 32px); }
  #picker .panel { padding: 6px 14px 12px; }
  #picker .picker-head { margin: -6px -14px 0; padding: 6px 14px 0; }
  #picker .fields { grid-template-columns: 1fr; gap: 10px; }
  #save-sheet .fields, #picker .toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px 12px; }
  #save-sheet :is(.overlay, .format, .size, .yt-sound, .gif-bg) { grid-column: 1 / -1; }
  :is(#picker, #uma-menu) :is(.step, .rand) { width: 36px; height: 40px; }
  :is(#picker, #uma-menu) .field .choice { height: 40px; }
  :is(#picker, #uma-menu) .choice img { width: 30px; height: 30px; }
  #picker .swatches { gap: 10px; }
  #picker .swatches :is(button, .swatch-custom) { width: 32px; height: 32px; }
  #picker :is(.action, .switch), #save-sheet :is(.seg, .more), #save-sheet select { height: 40px; }
  #picker .backdrop-row .switch { height: 40px; }
  #save-sheet .seg { align-self: stretch; }
  #save-sheet .seg button { flex: 1; padding: 0 6px; } /* full-width rows: the buttons share them, no empty end */
  #save-sheet select { width: 100%; font-size: 16px; } /* 16px: iPhones zoom the page in on anything smaller */
  #save-sheet .more { justify-self: start; }
  #save-sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* The Free editor keeps its dock size while tabs and option groups scroll inside it. */
body.free-editor #picker .panel {
  height: min(445px, 54dvh); overflow-x: hidden; scrollbar-gutter: stable;
  scroll-padding-block: 56px 20px;
}
body.free-editor.picker-side #picker .panel { height: 100%; }
body.free-editor.desk-dock.picker-side #picker .panel { height: min(445px, var(--float-room)); }
body.free-editor #picker-close { display: none; }
body.free-editor #picker-x { display: flex; flex: none; }
body.free-editor #picker .picker-head { background: var(--bg); }
body.free-editor #picker .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
body.free-editor #picker [role="tab"] { min-width: 0; padding-inline: 3px; font-size: 13px; white-space: nowrap; }
body.free-editor #picker .group { flex: none; }
body.free-editor #picker :is(button, select):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

#picker .uma-target { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 5px 9px;
  padding: 7px 9px; border: 1px solid var(--border-accent); border-radius: 12px; background: var(--pill); }
#picker .uma-target-controls { display: flex; align-items: center; gap: 2px; min-width: 0; }
#picker #pick-uma-slot { flex: 1; min-width: 0; width: 100%; height: 36px; padding: 0 5px 0 8px; border: 1px solid var(--track);
  border-radius: 9px; background: var(--bg); color: var(--strong); font: 650 13px system-ui, sans-serif; cursor: pointer; text-overflow: ellipsis; }
#picker #pick-uma-slot:disabled { appearance: none; opacity: 1; cursor: default; }
#picker #pick-uma-slot option { color: var(--text); background: var(--bg); }
#picker #uma-edit-hint { grid-column: 1 / -1; min-height: 1.35em; margin: 0 2px; align-content: center;
  color: var(--soft); font: 500 11.5px/1.35 system-ui, sans-serif; }
body.moving #picker #uma-edit-hint { color: var(--strong); font-weight: 650; }
#picker :is(.uma-target-controls button, .uma-fields button, #pick-unplace):disabled { opacity: .52; cursor: default; box-shadow: none; }
#picker #group-umas .uma-fields { grid-template-columns: minmax(0, 1fr); gap: 6px; }
#picker .uma-fields .field { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 6px; }
#picker #pick-dance-shared { display: block; text-transform: none; letter-spacing: 0; font-weight: 550; }
#picker #pick-dance-shared[hidden] { display: none; }
#picker .uma-lineup { padding: 10px 12px; gap: 8px; }
#picker .uma-lineup .toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 6px; padding: 0; border: 0; }
#picker .uma-lineup #pick-move { grid-column: 1 / -1; }
#picker .uma-placement .toggles :is(.switch, .action) { padding-left: 8px; }
@media (min-width: 1100px) {
  body.desk-dock.picker-side #picker:not(.explain) .uma-placement .toggles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.desk-dock.picker-side #picker:not(.explain) .uma-placement #pick-move { grid-column: auto; }
}
#picker #duet-controls { border-top: 1px solid var(--track); padding-top: 7px; }
#picker #duet-controls .count { padding-inline: 2px; }

body.free-editor #picker .stage-settings { align-items: stretch; padding: 0; border: 0; }
body.free-editor #picker .stage-settings .switch { gap: 5px; padding-left: 8px; }
#picker .stage-settings > h3 { grid-column: 1 / -1; margin: 4px 0 1px; padding-top: 10px; border-top: 1px solid var(--track);
  color: var(--strong); font: 700 11px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
#picker .camera-tools { grid-column: 1 / -1; display: flex; gap: 6px; }
#picker .camera-tools button { flex: 1 1 0; gap: 5px; width: auto; min-width: 0; height: auto; min-height: 38px;
  padding: 4px 6px; border: 1px solid var(--track); border-radius: 10px; background: var(--bg); color: var(--text);
  font: 500 12px/1.2 system-ui, sans-serif; overflow-wrap: anywhere; }
#picker .camera-tools button svg { flex: none; width: 14px; height: 14px; }
#picker .camera-mode-state {
  display: block; width: 3.2em; margin: 3px auto 0; padding: 2px 0; border-radius: 999px;
  background: var(--track); color: var(--text); font: 700 10px/1.2 system-ui, sans-serif;
}
#picker .camera-tools [aria-checked="true"] {
  border-color: var(--accent); background: var(--pill); color: var(--strong);
}
#picker .camera-tools [aria-checked="true"] .camera-mode-state { background: var(--accent-deep); color: #fff; }
#picker .camera-tools [aria-checked="true"] .camera-mode-state span:first-child,
#picker .camera-tools [aria-checked="false"] .camera-mode-state span:last-child { display: none; }
body.free-editor #picker #pick-camera-reset { display: flex; }
#picker .camera-tools button:disabled { opacity: .52; cursor: default; }
@media (max-width: 700px) {
  body.free-editor.picker-open :is(#fx-debug, #beat-debug, #hits-toggle) { display: none; }
}
@media (max-width: 500px) {
  #picker #pick-uma-slot { height: 40px; font-size: 16px; }
  #picker #uma-edit-hint { min-height: 2.7em; }
  #picker .uma-fields :is(.step, .rand) { width: 30px; }
  #picker .uma-fields .field { grid-template-columns: 52px minmax(0, 1fr); gap: 3px; }
  #picker .uma-fields .field .choice { gap: 4px; padding-right: 15px; }
  #picker .uma-fields .choice::after { right: 7px; }
  #picker .uma-fields .choice img { width: 23px; height: 29px; }
}
@media (max-width: 370px) {
  #picker .uma-target { grid-template-columns: minmax(0, 1fr); }
  #picker .uma-fields .field { grid-template-columns: minmax(0, 1fr); }
}

/* Daily mode (the default): one roll a day, then a countdown to the next at 00:00 UTC. The
   free mode link swaps between it and endless rerolls with the picker. */
#mode { position: fixed; top: calc(14px + var(--safe-top)); left: 16px; display: flex; align-items: center; gap: 7px; height: 34px; box-sizing: border-box; padding: 0 14px 0 12px;
        border: 1px solid var(--border); border-radius: 999px; background: var(--surface-hud); backdrop-filter: blur(var(--blur-hud)); box-shadow: 0 1px 6px var(--shade);
        font: 600 12px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label);
        text-decoration: none; transition: box-shadow .2s, transform .12s; }
#mode:hover { box-shadow: 0 2px 10px var(--shade-hover); }
#mode:active { transform: scale(.97); }
#mode svg { width: 15px; height: 15px; stroke: var(--accent); }
body.daily #reroll, body.daily #share-free, body.daily:not(.rolled) #controls { display: none; }
#roll { position: fixed; z-index: 1; display: none; flex-direction: column; align-items: center; gap: 12px;
        transform: translate(-50%, -50%); }
body.unrolled #roll { display: flex; animation: roll-in .6s .35s cubic-bezier(.3,1.5,.5,1) both; } /* after the jukebox lands */
@keyframes roll-in { from { opacity: 0; transform: translate(-50%, -30%) scale(.7); } }

/* On load only the spinner shows; the stage, then the buttons, fade in once it's ready. */
/* (Share fades in the same way whenever it appears.) */
body:not(.ready) :is(#stage, #brand, #mode, #theme, #festive, #top-left, #top-right, #controls, #bar, #picker, #shared, #share-actions, #share, #score, #score-pill) { opacity: 0; }
body.ready #stage { animation: fade-in .6s ease backwards; }
body.ready :is(#brand, #mode, #theme, #festive, #top-left, #top-right, #controls, #bar, #picker, #shared, #share-actions, #share, #score, #score-pill) { animation: fade-in .6s .2s ease backwards; }
@keyframes fade-in { from { opacity: 0; } }
#roll #roll-button { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 30px 0 24px; border: 0; border-radius: 999px;
                     cursor: pointer; background: var(--accent-pill); box-shadow: 0 4px 16px rgba(214,61,134,.45);
                     font: 700 20px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #fff;
                     text-shadow: 0 1px 2px rgba(120,18,66,.24); transition: transform .15s, box-shadow .2s; }
#roll #roll-button:hover { transform: scale(1.05); box-shadow: 0 5px 22px rgba(214,61,134,.6); }
#roll #roll-button:active { transform: scale(.97); }
#roll #roll-button:focus-visible { outline: 3px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 3px var(--accent), 0 4px 20px rgba(214,61,134,.6); }
#roll #roll-button svg { width: 22px; height: 22px; stroke: #fff; transition: transform .4s; }
#roll #roll-button:hover svg { transform: rotate(90deg); }
/* Pre-roll "How it works" pill: shown ONLY before rolling; hides once the reel starts or after rolling. */
#how-toggle { display: none; align-items: center; gap: 7px; height: 32px; padding: 0 14px 0 11px; border: 1px solid var(--border);
              border-radius: 999px; cursor: pointer; background: var(--surface-hud); backdrop-filter: blur(var(--blur-hud));
              box-shadow: 0 2px 10px var(--shade); font: 600 12px/1 system-ui, sans-serif; letter-spacing: .04em;
              color: var(--label); transition: color .2s, box-shadow .2s, transform .14s; }
body.unrolled #how-toggle { display: flex; }
body.rolling #how-toggle { display: none; }
#how-toggle:hover { color: var(--strong); box-shadow: 0 3px 14px var(--shade-hover); transform: translateY(-1px); }
#how-toggle:active { transform: scale(.97); }
#how-toggle svg { width: 15px; height: 15px; stroke: var(--accent); }
#how-panel { box-sizing: border-box; width: min(500px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0;
             border-radius: 20px; background: var(--bg); color: var(--text);
             box-shadow: 0 10px 40px rgba(0,0,0,.3), inset 0 0 0 1px var(--border); font: 14px/1.5 system-ui, sans-serif; overflow: hidden; }
#how-panel[open] { display: flex; flex-direction: column; animation: score-in .32s cubic-bezier(.3,1.4,.5,1) both; }
#how-panel::backdrop { background: rgba(20,16,24,.42); backdrop-filter: blur(3px); animation: fade-in .25s ease both; }
#how-panel .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--track); }
#how-panel h2 { margin: 0; font: 700 16px/1.2 var(--display); color: var(--strong); }
#how-panel .close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
#how-panel .close:hover { background: var(--shade); }
#how-panel .close svg { width: 18px; height: 18px; stroke: var(--label); }
#how-panel .body { overflow-y: auto; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
#how-panel section h3 { margin: 0 0 6px; font: 700 12px/1.2 system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--strong); }
#how-panel p { margin: 0; font-size: 13.5px; color: var(--soft); }
#how-panel b { color: var(--text); }
#how-panel .how-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--soft); }
#how-panel .how-list li + li { margin-top: 5px; }
#how-panel .how-note { margin-top: 8px; padding: 9px 12px; border-radius: 10px; background: rgba(224,85,154,.08); font-size: 12.5px; color: var(--text); }
#how-panel .how-keys kbd { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track);
                           font: 700 11.5px/1.2 ui-monospace, Consolas, monospace; color: var(--text); }
/* The "More than 10 umas?" warning (index.html askCrowd): a small box like How it works, Cancel or Continue. */
#crowd-panel { box-sizing: border-box; width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0;
               border-radius: 20px; background: var(--bg); color: var(--text);
               box-shadow: 0 10px 40px rgba(0,0,0,.3), inset 0 0 0 1px var(--border); font: 14px/1.5 system-ui, sans-serif; overflow: hidden; }
#crowd-panel[open] { display: flex; flex-direction: column; animation: score-in .32s cubic-bezier(.3,1.4,.5,1) both; }
#crowd-panel::backdrop { background: rgba(20,16,24,.42); backdrop-filter: blur(3px); animation: fade-in .25s ease both; }
#crowd-panel .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--track); }
#crowd-panel h2 { margin: 0; font: 700 16px/1.2 var(--display); color: var(--strong); }
#crowd-panel .close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
#crowd-panel .close:hover { background: var(--shade); }
#crowd-panel .close svg { width: 18px; height: 18px; stroke: var(--label); }
#crowd-panel .body { overflow-y: auto; padding: 16px 20px 4px; display: flex; flex-direction: column; gap: 10px; }
#crowd-panel p { margin: 0; font-size: 13.5px; color: var(--soft); }
#crowd-panel .crowd-note { padding: 9px 12px; border-radius: 10px; background: rgba(224,85,154,.08); font-size: 12.5px; color: var(--text); }
#crowd-panel .actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 16px 20px 20px; }
#crowd-panel .actions button { height: 38px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; font: 700 14px/1 system-ui, sans-serif;
                               transition: box-shadow .2s, transform .14s; }
#crowd-panel .actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#crowd-panel .actions button:active { transform: scale(.98); }
#crowd-panel .cancel { background: var(--pill); color: var(--text); box-shadow: inset 0 0 0 1px var(--track); }
#crowd-panel .cancel:hover { box-shadow: inset 0 0 0 1px var(--track), 0 2px 10px var(--shade); }
#crowd-panel .go { background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 12px rgba(224,85,154,.42); }
#crowd-panel .go:hover { box-shadow: 0 3px 16px rgba(224,85,154,.58); }
@media (max-width: 500px) {
  #crowd-panel .actions { flex-direction: column-reverse; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  #crowd-panel .actions button { width: 100%; height: 44px; }
}
/* Suggestions box (suggest.js): Songs and Features tabs, like How it works; a bottom sheet on phones.
   Nothing in it is public: links and ideas go to the dev only. */
#suggest-panel { --warn: #a35500; --ok: #1d7a43; box-sizing: border-box; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0;
                 border-radius: 20px; background: var(--bg); color: var(--text);
                 box-shadow: 0 10px 40px rgba(0,0,0,.3), inset 0 0 0 1px var(--border); font: 14px/1.5 system-ui, sans-serif; overflow: hidden; }
:root[data-theme="dark"] #suggest-panel { --warn: #f2a65a; --ok: #6fd79a; }
#suggest-panel[open] { display: flex; flex-direction: column; animation: score-in .32s cubic-bezier(.3,1.4,.5,1) both; }
#suggest-panel::backdrop { background: rgba(20,16,24,.42); backdrop-filter: blur(3px); animation: fade-in .25s ease both; }
#suggest-panel .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 20px; }
#suggest-panel h2 { margin: 0; font: 700 16px/1.2 var(--display); color: var(--strong); }
#suggest-panel .close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
#suggest-panel .close:hover { background: var(--shade); }
#suggest-panel .close svg { width: 18px; height: 18px; stroke: var(--label); }
#suggest-panel .suggest-tabs { position: sticky; top: 0; z-index: 1; display: flex; gap: 4px; margin: 0 20px; padding: 3px; border-radius: 999px;
                               background: var(--shade); flex: none; }
#suggest-panel [role="tab"] { flex: 1; height: 34px; border: 0; border-radius: 999px; background: none; cursor: pointer;
                              font: 700 13.5px/1 system-ui, sans-serif; color: var(--label); transition: background .15s, color .15s, box-shadow .15s; }
#suggest-panel [role="tab"]:hover { color: var(--text); }
#suggest-panel [role="tab"][aria-selected="true"] { background: var(--bg); color: var(--strong); box-shadow: 0 1px 4px var(--shade-hover); }
#suggest-panel :is([role="tab"], button, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#suggest-panel .body { overflow-y: auto; padding: 14px 20px 20px; }
#suggest-panel [role="tabpanel"][hidden] { display: none; }
#suggest-panel form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
#suggest-panel p { margin: 0; }
#suggest-panel .suggest-lead { font-size: 13.5px; color: var(--soft); }
/* Song requests closed (suggest.js SONG_REQUESTS_OPEN): a banner over the features form */
#suggest-panel .suggest-tabs[hidden] { display: none; }
#suggest-panel .suggest-closed { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
#suggest-panel .suggest-closed a { color: var(--strong); font-weight: 600; white-space: nowrap; }
#suggest-panel .suggest-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
#suggest-panel .suggest-field { margin-top: 6px; padding: 0; font: 700 12px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#suggest-panel .suggest-field small { font-weight: 500; letter-spacing: 0; text-transform: none; }
#suggest-panel .suggest-field-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
#suggest-panel :is(input[type="url"], input[type="text"], textarea) { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 12px;
    background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); color: var(--text); font: 15px/1.4 system-ui, sans-serif; }
#suggest-panel textarea { min-height: 96px; resize: vertical; }
#suggest-panel :is(input, textarea)::placeholder { color: var(--disabled); }
#suggest-panel :is(input, textarea):focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
#suggest-panel input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--warn); }
#suggest-panel .suggest-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
#suggest-panel .suggest-hint { min-height: 0; font-size: 12.5px; color: var(--warn); }
#suggest-panel .suggest-hint:empty { display: none; }
#suggest-panel .suggest-preview { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 8px 12px; border-radius: 10px;
                                  background: rgba(224,85,154,.08); font-size: 13px; color: var(--text); }
#suggest-panel .suggest-preview[hidden] { display: none; }
#suggest-panel .suggest-preview b { flex: none; font-weight: 700; color: var(--strong); }
#suggest-panel .suggest-preview[data-provider="youtube"] b { color: #d4202a; }
#suggest-panel .suggest-preview[data-provider="spotify"] b { color: #138a45; }
:root[data-theme="dark"] #suggest-panel .suggest-preview[data-provider="youtube"] b { color: #ff6b6b; }
:root[data-theme="dark"] #suggest-panel .suggest-preview[data-provider="spotify"] b { color: #4fd987; }
#suggest-panel .suggest-preview i { font-style: normal; color: var(--label); }
#suggest-panel .suggest-preview span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#suggest-panel .suggest-preview .loading { color: var(--label); }
#suggest-panel .suggest-owned { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px;
                                background: rgba(224,85,154,.12); box-shadow: inset 0 0 0 1px var(--border-accent); }
#suggest-panel .suggest-owned[hidden] { display: none; }
#suggest-panel .suggest-owned .owned-anyway { align-self: flex-start; margin-top: 3px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--soft); text-decoration: underline; cursor: pointer; }
#suggest-panel .suggest-owned .owned-anyway[hidden] { display: none; }
#suggest-panel .suggest-owned div { display: flex; flex-direction: column; min-width: 0; }
#suggest-panel .suggest-owned b { color: var(--strong); font-size: 13.5px; }
#suggest-panel .suggest-owned .owned-song { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--soft); }
#suggest-panel :is(#suggest-play, .suggest-send) { flex: none; height: 38px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
    font: 700 14px/1 system-ui, sans-serif; background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22);
    box-shadow: 0 2px 12px rgba(224,85,154,.42); transition: box-shadow .2s, transform .14s, opacity .2s; }
#suggest-panel :is(#suggest-play, .suggest-send):hover:not(:disabled) { box-shadow: 0 3px 16px rgba(224,85,154,.58); }
#suggest-panel :is(#suggest-play, .suggest-send):active:not(:disabled) { transform: scale(.98); }
#suggest-panel .suggest-send:disabled { opacity: .45; cursor: default; box-shadow: none; }
#suggest-panel .suggest-send.busy { opacity: .7; cursor: progress; }
#suggest-panel #suggest-play[hidden] { display: none; }
#suggest-panel .suggest-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }
#suggest-panel .suggest-status { flex: 1; min-width: 0; font-size: 13px; color: var(--soft); }
#suggest-panel .suggest-status[data-tone="ok"] { color: var(--ok); font-weight: 600; }
#suggest-panel .suggest-status[data-tone="info"] { color: var(--strong); font-weight: 600; }
#suggest-panel .suggest-status[data-tone="warn"] { color: var(--warn); }
#suggest-panel .suggest-quota { flex: none; padding: 4px 10px; border-radius: 999px; background: rgba(224,85,154,.1); font: 700 12px/1.3 system-ui, sans-serif;
                                color: var(--strong); white-space: nowrap; }
#suggest-panel .suggest-quota[data-tone="warn"] { background: rgba(214,130,30,.14); color: var(--warn); white-space: normal; text-align: right; }
#suggest-panel .suggest-quota[hidden] { display: none; }
#suggest-panel .suggest-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
#suggest-panel .suggest-cats legend { width: 100%; margin-bottom: 6px; }
#suggest-panel .suggest-cats label { position: relative; }
#suggest-panel .suggest-cats input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
#suggest-panel .suggest-cats span { display: flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--pill);
    box-shadow: inset 0 0 0 1px var(--track); font: 600 13px/1 system-ui, sans-serif; color: var(--text); transition: background .15s, box-shadow .15s, color .15s; }
#suggest-panel .suggest-cats label:hover span { box-shadow: inset 0 0 0 1px var(--border-accent-hover); }
#suggest-panel .suggest-cats input:checked + span { background: var(--accent-pill); color: #fff; box-shadow: 0 2px 10px rgba(224,85,154,.35); }
#suggest-panel .suggest-cats input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#suggest-panel .suggest-count { font: 600 11.5px/1.2 system-ui, sans-serif; color: var(--label); font-variant-numeric: tabular-nums; }
#suggest-panel .suggest-count[data-tone="warn"] { color: var(--warn); }
#suggest-panel .suggest-board { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
#suggest-panel .suggest-board h3 { margin: 0 0 8px; }
#suggest-panel .suggest-board-list { list-style: none; margin: 0; padding: 2px 4px 2px 0; display: flex; flex-direction: column; gap: 6px;
                                     max-height: min(300px, 42dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
#suggest-panel .suggest-board-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
#suggest-panel .suggest-board-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); transition: box-shadow .15s; }
#suggest-panel .sb-rank { width: 26px; flex: none; text-align: center; font: 700 12px/1 system-ui, sans-serif; color: var(--label); font-variant-numeric: tabular-nums; }
#suggest-panel .sb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#suggest-panel .sb-title { font: 600 13.5px/1.25 system-ui, sans-serif; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#suggest-panel .sb-title:hover { color: var(--strong); text-decoration: underline; }
#suggest-panel .sb-meta { font-size: 11.5px; line-height: 1.2; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#suggest-panel .sb-meta-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
#suggest-panel .sb-meta-row .sb-meta { min-width: 0; }
#suggest-panel .sb-tag { flex: none; padding: 1px 7px; border-radius: 999px; font: 700 10.5px/1.35 system-ui, sans-serif;
                         letter-spacing: .02em; color: var(--accent-deep); background: rgba(224,85,154,.13); }
:root[data-theme="dark"] #suggest-panel .sb-tag { color: #ffb3d6; background: rgba(224,85,154,.22); }
#suggest-panel .sb-vote { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 64px; height: 32px; padding: 0 10px;
                          box-sizing: border-box; border: 0; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--track); color: var(--text);
                          font: 700 12.5px/1 system-ui, sans-serif; cursor: pointer; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent;
                          transition: background .15s, color .15s, box-shadow .15s, transform .12s; }
#suggest-panel .sb-vote .sb-mark { min-width: 1.3em; text-align: center; font-size: 11.5px; color: var(--accent); }
#suggest-panel .sb-vote[aria-pressed="true"] .sb-mark { color: inherit; }
@media (hover: hover) {
  #suggest-panel .suggest-board-row:hover { box-shadow: inset 0 0 0 1px var(--border-accent); }
  #suggest-panel .sb-vote:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--strong); }
  #suggest-panel .sb-vote[aria-pressed="true"]:hover { box-shadow: 0 3px 12px rgba(224,85,154,.45); color: #fff; }
}
#suggest-panel .sb-vote:active { transform: scale(.95); }
#suggest-panel .sb-vote[aria-pressed="true"] { background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 8px rgba(224,85,154,.3); }
#suggest-panel .suggest-board-row:nth-child(-n+3) .sb-rank { color: var(--accent); }
#suggest-panel .suggest-last-update { margin: -4px 0 10px; font-size: 12.5px; color: var(--soft); }
#suggest-panel .suggest-last-update a { color: var(--strong); }
#suggest-panel .suggest-added { margin-top: 10px; font-size: 12px; line-height: 1.45; color: var(--soft); overflow-wrap: anywhere; }
#suggest-panel .suggest-added b { color: var(--ok); font-weight: 700; }
#suggest-panel .suggest-features-board { display: flex; flex-direction: column; gap: 14px; }
#suggest-panel .suggest-features-board[hidden], #suggest-panel .suggest-features-section[hidden] { display: none; }
#suggest-panel #suggest-features-added h3::before { content: "✓"; margin-right: 5px; color: var(--ok); }
#suggest-panel #suggest-features-planned h3::before { content: "•"; margin-right: 5px; color: var(--accent); }
#suggest-panel .suggest-features-list { list-style: none; margin: 0; padding: 2px 4px 2px 0; display: flex; flex-direction: column; gap: 6px;
                                        max-height: min(380px, 48dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
#suggest-panel .suggest-features-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
#suggest-panel .suggest-feat-row { flex: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 11px; border-radius: 12px;
                                   background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#suggest-panel .sf-text { font: 650 13.5px/1.3 system-ui, sans-serif; color: var(--text); overflow-wrap: anywhere; }
#suggest-panel .sf-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11.5px; line-height: 1.2; color: var(--label); }
#suggest-panel .sf-cat { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
                         background: rgba(224,85,154,.1); color: var(--strong); font: 600 10.5px/1.2 system-ui, sans-serif; }
:root[data-theme="dark"] #suggest-panel .sf-cat { background: rgba(224,85,154,.16); }
#suggest-panel .sf-time { font-size: 11.5px; color: var(--label); }
#suggest-panel .suggest-features-planned .suggest-features-list { max-height: min(340px, 44dvh); }
#suggest-panel .suggest-features-planned .suggest-feat-row { position: relative; padding-left: 14px; }
#suggest-panel .suggest-features-planned .suggest-feat-row::before { content: ""; position: absolute; inset: 8px auto 8px 0; width: 3px;
                                                                     border-radius: 0 3px 3px 0; background: var(--accent); opacity: .7; }
#suggest-panel .sf-note { margin: 1px 0 2px; padding: 5px 9px; border-radius: 8px; background: rgba(224,85,154,.07);
                          font: 400 12px/1.45 system-ui, sans-serif; color: var(--soft); white-space: pre-line; overflow-wrap: anywhere; }
:root[data-theme="dark"] #suggest-panel .sf-note { background: rgba(255,255,255,.05); }
#suggest-panel .suggest-features-planned .sf-cat { background: rgba(0,0,0,.06); color: var(--label); }
:root[data-theme="dark"] #suggest-panel .suggest-features-planned .sf-cat { background: rgba(255,255,255,.08); }
@media (max-width: 500px) {
  #suggest-panel { width: 100vw; max-width: 100vw; max-height: 88dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  #suggest-panel[open] { animation: suggest-up .3s cubic-bezier(.2,.9,.3,1) both; }
  #suggest-panel .body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  #suggest-panel [role="tab"], #suggest-panel .suggest-cats span { height: 44px; }
  #suggest-panel .close { width: 44px; height: 44px; margin: -6px -6px -6px 0; }
  #suggest-panel :is(#suggest-play, .suggest-send) { height: 44px; }
  #suggest-panel .sb-vote { min-width: 72px; height: 40px; padding: 0 12px; }
  #suggest-panel .suggest-actions { flex-direction: column-reverse; align-items: stretch; }
  #suggest-panel .suggest-send { width: 100%; }
  #suggest-panel .suggest-row { flex-direction: column; gap: 6px; }
  #suggest-panel .suggest-quota[data-tone="warn"] { text-align: left; }
}
@keyframes suggest-up { from { transform: translateY(40px); opacity: 0; } }
/* Its ways in: beside How scoring works, under the who's-dancing card, at the end of How it works. */
#changelog .changelog-how { display: flex; flex-wrap: wrap; gap: 6px 16px; }
#who #who-suggest { display: block; margin: 6px auto 0; padding: 4px 6px; border: 0; background: none; cursor: pointer;
                    font: 500 11.5px/1.2 system-ui, sans-serif; color: var(--label); }
#who #who-suggest:hover { color: var(--strong); text-decoration: underline; }
#who #song-link[hidden] + #full-song-link[hidden] + #who-suggest { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--track); width: 100%; }
#how-panel .how-suggest { padding-top: 12px; border-top: 1px solid var(--track); font-size: 13px; color: var(--soft); }
#how-panel .how-suggest button { padding: 0; border: 0; background: none; cursor: pointer; font: 700 13px/1.4 system-ui, sans-serif; color: var(--strong); }
#how-panel .how-suggest button:hover { text-decoration: underline; }
/* Rolling: a slot reel of uma names, slowing down until it lands on today's. */
body.rolling #roll { display: flex; }
body.rolling #roll button, body.rolling :is(#who, #loading) { visibility: hidden; }
body.rolling #info { display: none; }
#reel { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(312px, calc(100vw - 32px)); height: 66px;
        overflow: hidden; border-radius: 18px; background: var(--card); backdrop-filter: blur(10px);
        box-shadow: 0 4px 20px var(--shade), inset 0 0 0 2px rgba(224,85,154,.4);
        -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
body.rolling #reel { display: block; }
#reel.entering { animation: reel-enter .28s cubic-bezier(.22,1.35,.36,1) both; }
@keyframes reel-enter { from { opacity: 0; transform: translate(-50%, -50%) scale(.72, .88); border-radius: 999px; } }
#reel.tick-kick { animation: reel-kick .16s cubic-bezier(.22,1.4,.36,1); }
@keyframes reel-kick { 35% { transform: translate(-50%, -50%) scale(1.045); box-shadow: 0 5px 24px rgba(224,85,154,.38), inset 0 0 0 2px rgba(224,85,154,.65); } }
#reel.exiting { animation: reel-exit .19s cubic-bezier(.4,0,.2,1) forwards !important; }
@keyframes reel-exit { to { opacity: 0; transform: translate(-50%, -50%) scale(1.22); filter: brightness(1.3); } }
/* A signature roll's tune (signature.js): every button and bar fades away until it's over. */
body.signature :is(#brand, #bar, #controls, #picker, #gallery, #uma-menu, #picker-toggle, #share, #top-left, #top-right, #theme, #festive, #mode, #about-toggle, #x-link, #suggest-toggle,
                   #changelog, #account-hint, #recap-hint, #score, #score-pill) {
  opacity: 0 !important; pointer-events: none !important; transition: opacity .35s !important;
}
body.signature-out :is(#brand, #bar, #controls, #picker, #picker-toggle, #share, #top-left, #top-right, #theme, #festive, #mode, #about-toggle, #x-link, #suggest-toggle,
                       #score-pill) { animation: signature-back .45s ease-out; }
@keyframes signature-back { from { opacity: 0; } }
#reel .slot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; white-space: nowrap; }
#reel .slot img { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: cover; object-position: top;
                  background: var(--pill); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
#reel .slot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 700 20px/1.1 var(--display); color: var(--text); }
#reel .slot.in { animation: reel-in var(--tick) cubic-bezier(.3,.6,.4,1) both; } /* same curve, so they stay touching */
#reel .slot.out { animation: reel-out var(--tick) cubic-bezier(.3,.6,.4,1) both; }
#reel .slot.in-rev { animation: reel-in-rev var(--tick) cubic-bezier(.3,.6,.4,1) both; }
#reel .slot.out-rev { animation: reel-out-rev var(--tick) cubic-bezier(.3,.6,.4,1) both; }
@keyframes reel-in { from { transform: translateY(-100%); } }
@keyframes reel-out { to { transform: translateY(100%); } }
@keyframes reel-in-rev { from { transform: translateY(100%); } }
@keyframes reel-out-rev { to { transform: translateY(-100%); } }
#reel.turbo { box-shadow: 0 0 0 3px var(--accent), 0 0 32px rgba(242,92,160,.72); animation: reel-turbo .08s linear infinite; }
#reel.turbo .slot { filter: blur(1.2px); }
@keyframes reel-turbo { 25% { transform: translate(calc(-50% - 2px), calc(-50% + 1.5px)) scale(1.035); }
                        75% { transform: translate(calc(-50% + 2px), calc(-50% - 1.5px)) scale(1.035); } }
#reel.glitching { box-shadow: -3px 0 0 rgba(0,230,255,.78), 3px 0 0 rgba(255,40,120,.82), 0 6px 24px var(--shade);
                  animation: reel-glitch .07s steps(2) infinite; }
#reel.glitching .slot span { text-shadow: -2px 0 #00e6ff, 2px 0 #ff2878; }
@keyframes reel-glitch { 0% { transform: translate(calc(-50% - 4px), calc(-50% + 2px)) skewX(-4deg); }
                         50% { transform: translate(calc(-50% + 4px), calc(-50% - 2px)) skewX(5deg); } }
#reel.bsod { -webkit-mask-image: none; background: #0058cc; box-shadow: 0 0 0 2px #7cb8ff, 0 6px 28px rgba(0,88,204,.55); }
#reel .bsod-msg { gap: 10px; font-family: ui-monospace, Consolas, monospace; color: #fff; }
#reel .bsod-msg b { font-size: 24px; line-height: 1; }
#reel .bsod-msg span { font: 600 13px/1.2 ui-monospace, Consolas, monospace; color: #e6f2ff; }
#reel.vhs { filter: contrast(1.12) saturate(.75); box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 6px 24px rgba(0,0,0,.35); }
#reel .vhs-tag { position: absolute; top: 5px; right: 10px; z-index: 3; font: 700 10px/1 ui-monospace, Consolas, monospace;
                 letter-spacing: .08em; color: #ff4d6d; background: rgba(0,0,0,.65); padding: 3px 6px; border-radius: 5px; font-style: normal; }
#reel .reel-buf { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 9px;
                  background: var(--card); backdrop-filter: blur(4px); font: 600 13px/1 system-ui, sans-serif; color: var(--soft); }
#reel .reel-buf i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(224,85,154,.25); border-top-color: var(--accent); animation: spin .75s linear infinite; }
#reel.slot3 { -webkit-mask-image: none; }
#reel .slot3-row { gap: 14px; padding: 0 16px; }
#reel .slot3-col { flex: none; width: 46px; height: 46px; border-radius: 11px; overflow: hidden; border: 2px solid var(--track); background: var(--pill);
                   transition: border-color .16s, transform .2s cubic-bezier(.22,1.5,.36,1), box-shadow .2s; }
#reel .slot3-col img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
#reel .slot3-col.locked { border-color: var(--accent); transform: scale(1.08); box-shadow: 0 2px 10px rgba(224,85,154,.45); }
#reel .reel-claw { position: absolute; left: 50%; top: 0; z-index: 4; width: 42px; height: 32px; color: var(--strong); pointer-events: none;
                   filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
#reel .reel-claw svg { width: 100%; height: 100%; }
#reel .reel-stamp { position: absolute; left: 50%; top: 50%; z-index: 4; padding: 4px 12px; border: 3px solid currentColor; border-radius: 8px;
                    font: 800 17px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; pointer-events: none;
                    background: rgba(255,255,255,.88); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
#reel .reel-stamp.bad { color: #d92638; }
#reel .reel-stamp.ok { color: #16a34a; }
#reel.matrix { -webkit-mask-image: none; background: #07190d; box-shadow: 0 0 0 2px #22c55e, 0 6px 26px rgba(34,197,94,.42); }
#reel.matrix .slot span { font-family: ui-monospace, Consolas, monospace; font-size: 16px; color: #4ade80; text-shadow: 0 0 8px rgba(74,222,128,.75); }
#reel.radar { -webkit-mask-image: none; background: #081c22; box-shadow: 0 0 0 2px #22d3ee, 0 6px 26px rgba(34,211,238,.4); }
#reel.radar .slot span { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .08em; color: #67e8f9; }
#reel .radar-sweep { position: absolute; inset: 0; z-index: 3; pointer-events: none;
                     background: linear-gradient(90deg, transparent 20%, rgba(34,211,238,.38) 50%, transparent 80%);
                     animation: radar-scan .64s linear infinite; }
@keyframes radar-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
#reel .radar-reticle { position: absolute; left: 50%; top: 50%; z-index: 4; width: 46px; height: 46px; margin: -23px; border-radius: 50%;
                       border: 2px dashed rgba(103,232,249,.75); pointer-events: none; transition: transform .18s, border-color .18s; }
#reel .radar-reticle.locked { border-style: solid; border-color: #4ade80; transform: scale(.86); box-shadow: 0 0 12px rgba(74,222,128,.7); }
#reel.dark-reel { -webkit-mask-image: none; background: #0d0b12; box-shadow: 0 0 0 2px rgba(255,255,255,.16), 0 6px 26px rgba(0,0,0,.55); }
#reel.dark-reel .slot { opacity: .95; }
#reel.dark-reel .slot span { color: #fff; }
#reel .reel-spot { position: absolute; top: 50%; left: 50%; z-index: 4; width: 124px; height: 124px; transform: translate(-50%, -50%); border-radius: 50%;
                   pointer-events: none; box-shadow: 0 0 0 400px rgba(8,6,14,.92); background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%); }
#reel .reel-dice { position: absolute; left: 50%; top: 50%; z-index: 4; font-size: 34px; line-height: 1; pointer-events: none;
                   filter: drop-shadow(0 3px 6px rgba(0,0,0,.28)); }
#reel .reel-captcha { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px;
                      background: var(--card); backdrop-filter: blur(4px); font: 600 13.5px/1 system-ui, sans-serif; color: var(--text); }
#reel .reel-captcha .box { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--accent); border-radius: 6px;
                           background: var(--bg); font: 800 14px/1 system-ui, sans-serif; color: #fff; transition: background .16s, transform .2s cubic-bezier(.22,1.5,.36,1); }
#reel .reel-captcha .box.checked { background: var(--accent); transform: scale(1.12); }
#reel .reel-curtain { position: absolute; top: 0; bottom: 0; width: 52%; z-index: 4; pointer-events: none;
                      background: repeating-linear-gradient(90deg, #9e1b32 0 12px, #b8213c 12px 24px); box-shadow: inset 0 -4px 10px rgba(0,0,0,.3); }
#reel .reel-curtain.left { left: 0; border-right: 2px solid #f6c445; }
#reel .reel-curtain.right { right: 0; border-left: 2px solid #f6c445; }
/* Fakeouts 41-60 */
#reel.unmasked { -webkit-mask-image: none; }
#reel.board { -webkit-mask-image: none; background: #18161d; box-shadow: 0 0 0 2px #3a3644, 0 6px 26px rgba(0,0,0,.45); }
#reel.board .slot { background: #22202a; }
#reel.board .slot span { color: #f4f1e8; font-family: ui-monospace, Consolas, monospace; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
#reel.board::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; z-index: 5; background: #0b0a0e; }
#reel .flap-top { clip-path: inset(0 0 50% 0); transform-origin: 50% 50%; }
#reel .flap-bot { clip-path: inset(50% 0 0 0); transform-origin: 50% 50%; }
#reel .flap-move { z-index: 2; }
#reel.conveyor { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
#reel.conveyor::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 3; pointer-events: none;
                         background: repeating-linear-gradient(90deg, var(--track) 0 10px, var(--border) 10px 20px); animation: belt-run .3s linear infinite; }
#reel.conveyor.belt-stop::before { animation-play-state: paused; }
@keyframes belt-run { to { background-position: -20px 0; } }
#reel .reel-ice { position: absolute; inset: 0; z-index: 4; pointer-events: none; backdrop-filter: blur(1.5px);
                  background: linear-gradient(135deg, rgba(200,236,255,.78), rgba(150,210,250,.55) 45%, rgba(225,245,255,.82));
                  box-shadow: inset 0 0 18px rgba(255,255,255,.9), inset 0 0 0 2px rgba(160,215,255,.9); }
#reel .reel-ice svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round;
                      filter: drop-shadow(0 0 2px rgba(60,140,220,.8)); transition: opacity .08s; }
#reel .reel-ice.cracked svg { opacity: 1; }
#reel .reel-ice.shard { backdrop-filter: none; }
#reel .slot .reel-balloon { position: absolute; bottom: 62%; z-index: 4; font-size: 30px; line-height: 1; pointer-events: none; transform-origin: 50% 100%; }
#reel .reel-peek { position: absolute; top: 50%; z-index: 4; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; object-position: top;
                   pointer-events: none; box-shadow: 0 2px 10px var(--shade); }
#reel .reel-peek.right { right: -6px; }
#reel .reel-peek.left { left: -6px; }
#reel .slot.jig { z-index: 2; background: var(--card); }
#reel .reel-count { position: absolute; right: 18px; top: 50%; z-index: 4; font: 700 30px/1 var(--display); color: var(--accent); pointer-events: none;
                    text-shadow: 0 2px 8px rgba(224,85,154,.35); }
#reel .slot .reel-flame { position: absolute; top: 74%; z-index: -1; font-size: 24px; line-height: 1; transform: translateX(-50%) rotate(180deg); pointer-events: none;
                          animation: flame-flicker .08s linear infinite alternate; }
@keyframes flame-flicker { to { transform: translateX(-50%) rotate(180deg) scale(1.15, .9); } }
#reel .reel-hat { position: absolute; top: 50%; z-index: 4; font-size: 46px; line-height: 1; pointer-events: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
#reel .reel-sparkle { position: absolute; z-index: 5; font-size: 15px; line-height: 1; pointer-events: none; }
#reel.shell .shell-cup { position: absolute; left: calc(50% - 22px); top: 12px; width: 44px; height: 44px; }
#reel.shell .shell-cup img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; object-position: top; display: block; }
#reel.shell .shell-cup i { position: absolute; left: -4px; right: -4px; top: -6px; bottom: -2px; border-radius: 12px 12px 8px 8px;
                           background: linear-gradient(180deg, var(--accent-soft), var(--accent-deep)); box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 3px 8px var(--shade); }
#reel.tv { -webkit-mask-image: none; background: #101014; box-shadow: 0 0 0 3px #2b2b33, 0 6px 26px rgba(0,0,0,.5); }
#reel.tv .slot span { color: #f2f2f2; }
#reel.tv::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
                  background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px); }
#reel .reel-osd { position: absolute; top: 6px; right: 10px; z-index: 5; font: 700 12px/1 ui-monospace, Consolas, monospace; color: #6dff8a;
                  text-shadow: 0 0 6px rgba(109,255,138,.7); pointer-events: none; }
#reel .reel-static { position: absolute; inset: 0; z-index: 4; opacity: 0; pointer-events: none;
                     background: repeating-radial-gradient(circle at 17% 32%, #fff 0 1px, #333 1px 2px, #999 2px 3px, #111 3px 4px);
                     background-size: 7px 5px; animation: static-jitter .06s steps(2) infinite; }
#reel .reel-static.on { opacity: 1; }
@keyframes static-jitter { 50% { background-position: 3px 2px; } }
#reel .reel-z { position: absolute; top: 6px; z-index: 4; font: 700 15px/1 var(--display); color: var(--accent); pointer-events: none; }
#reel .reel-alarm { position: absolute; right: 12px; top: 50%; z-index: 4; font-size: 26px; line-height: 1; pointer-events: none; }
#reel.storm { -webkit-mask-image: none; background: #1b1d2a; box-shadow: 0 0 0 2px #3c4160, 0 6px 26px rgba(10,12,30,.6); transition: background .3s; }
#reel.storm .slot span { color: #e4e7f5; }
#reel .reel-bolt { position: absolute; top: 0; bottom: 0; z-index: 5; width: 30px; transform: translateX(-50%); pointer-events: none;
                   filter: drop-shadow(0 0 6px #fff59a) drop-shadow(0 0 12px #ffe14d); }
#reel .reel-bolt svg { width: 100%; height: 100%; fill: #fffbe0; }
#reel .reel-flash { position: absolute; inset: 0; z-index: 6; background: #fff; pointer-events: none; opacity: 0; }
#reel .slot.charred img { filter: brightness(.25) sepia(1) saturate(.4); }
#reel .slot.charred span { color: #555; }
#reel .slot canvas.reel-pixel { width: 40px; height: 40px; flex: none; border-radius: 10px; image-rendering: pixelated; }
#reel .reel-hic { position: absolute; right: 14px; top: 6px; z-index: 4; font: 700 13px/1 var(--display); color: var(--accent); pointer-events: none; }
#reel .reel-jbox { position: absolute; bottom: 0; z-index: 4; width: 50px; height: 42px; border-radius: 5px 5px 0 0; pointer-events: none;
                   background: repeating-linear-gradient(45deg, #f25ca0 0 8px, #ffd34d 8px 16px); box-shadow: inset 0 0 0 2px rgba(0,0,0,.18), 0 2px 8px var(--shade); }
#reel .reel-jbox::after { content: ""; position: absolute; right: -9px; top: 14px; width: 9px; height: 4px; border-radius: 2px; background: #6b6f78; }
#reel .slot.xray-ghost { z-index: 2; background: #0b1622; }
#reel .slot.xray-ghost img { filter: grayscale(1) invert(1) brightness(1.1) sepia(1) hue-rotate(160deg) saturate(3); }
#reel .slot.xray-ghost span { color: #7fe3ff; text-shadow: 0 0 8px rgba(127,227,255,.6); }
#reel .reel-scan { position: absolute; top: 0; bottom: 0; z-index: 4; width: 3px; margin-left: -1px; background: #7fe3ff; pointer-events: none;
                   box-shadow: 0 0 10px 3px rgba(127,227,255,.7); }
#reel .reel-poll { position: absolute; inset: 0; z-index: 4; display: grid; align-content: center; gap: 5px; padding: 0 14px; background: var(--card); }
#reel .poll-row { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) 34px; align-items: center; gap: 7px; height: 22px; }
#reel .poll-row img { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; object-position: top; position: relative; z-index: 1; }
#reel .poll-row b { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px/1 var(--display); color: var(--text); }
#reel .poll-row i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 6px; background: var(--track);
                    transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .12s, background .2s; }
#reel .poll-row em { position: relative; z-index: 1; font: 700 12px/1 var(--display); font-style: normal; text-align: right; color: var(--soft); }
#reel .poll-row.won i { background: linear-gradient(90deg, var(--accent-soft), var(--accent-deep)); opacity: .45; }
#reel .poll-row.won em { color: var(--accent); }
#reel .poll-row.lost { opacity: .55; }
/* The 12 Christmas fakeouts (xmas.js). */
#reel .xm-gifts { position: absolute; inset: 0; z-index: 4; display: flex; justify-content: center; align-items: flex-end; gap: 40px; padding-bottom: 3px; background: var(--card); }
#reel .xm-gift { position: relative; width: 50px; height: 58px; }
#reel .xm-gift img { position: absolute; left: 7px; bottom: 2px; width: 36px; height: 36px; border-radius: 9px; object-fit: cover; object-position: top; }
#reel .xm-gift .box { position: absolute; left: 0; right: 0; bottom: 0; height: 29px; border-radius: 4px; box-shadow: 0 2px 6px var(--shade);
                      background: linear-gradient(90deg, transparent 42%, #ffd34d 42% 58%, transparent 58%), var(--gift, #d8344a); }
#reel .xm-gift .lid { position: absolute; left: -3px; right: -3px; bottom: 27px; height: 10px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.2);
                      background: linear-gradient(90deg, transparent 42%, #ffd34d 42% 58%, transparent 58%), var(--gift, #d8344a); filter: brightness(1.08); }
#reel .xm-gift .lid::before, #reel .xm-gift .lid::after { content: ""; position: absolute; bottom: 8px; width: 9px; height: 7px; border: 3px solid #ffd34d; border-radius: 50% 50% 40% 40%; }
#reel .xm-gift .lid::before { left: calc(50% - 13px); transform: rotate(-24deg); }
#reel .xm-gift .lid::after { right: calc(50% - 13px); transform: rotate(24deg); }
#reel .xm-gift.g1 { --gift: #1f9d55; }
#reel .xm-stocking { position: absolute; top: 2px; z-index: 4; width: 36px; height: 58px; pointer-events: none; transform-origin: 50% 0; }
#reel .xm-stocking > i { position: absolute; inset: 0; border-radius: 4px 4px 22px 4px; clip-path: polygon(8% 0, 72% 0, 72% 62%, 100% 74%, 100% 100%, 8% 100%);
                         background: linear-gradient(#f4f4f4 0 10px, #d8344a 10px); box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
#reel .xm-pulled { position: absolute; left: 40%; top: 0; z-index: -1; width: 30px; height: 30px; border-radius: 8px; object-fit: cover; object-position: top; }
#reel .xm-pulled.coal { filter: grayscale(1) brightness(.22) contrast(1.4); border-radius: 46% 38% 50% 42%; }
#reel .xm-coal-tag { position: absolute; top: 6px; z-index: 5; font: 700 13px/1 var(--display); color: #555; pointer-events: none; }
#reel .xm-cracker { position: absolute; left: 50%; top: 50%; z-index: 4; width: 0; height: 0; pointer-events: none; }
#reel .xm-cracker .half { position: absolute; top: -12px; width: 74px; height: 24px;
                          background: linear-gradient(90deg, transparent 0 8px, #ffd34d 8px 12px, transparent 12px 62px, #ffd34d 62px 66px, transparent 66px), #d8344a; }
#reel .xm-cracker .half.l { right: 0; clip-path: polygon(0 10%, 16% 40%, 16% 0, 100% 0, 100% 100%, 16% 100%, 16% 60%, 0 90%); border-radius: 0 3px 3px 0; }
#reel .xm-cracker .half.r { left: 0; clip-path: polygon(100% 10%, 84% 40%, 84% 0, 0 0, 0 100%, 84% 100%, 84% 60%, 100% 90%); border-radius: 3px 0 0 3px; }
#reel .slot .xm-crown { position: absolute; top: 1px; z-index: 3; width: 34px; height: 13px; pointer-events: none; background: #ffd34d;
                         clip-path: polygon(0 100%, 0 20%, 17% 60%, 33% 0, 50% 60%, 67% 0, 83% 60%, 100% 20%, 100% 100%); }
#reel .xm-snowball { position: absolute; z-index: 5; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; pointer-events: none;
                     background: radial-gradient(circle at 35% 30%, #fff, #dfe9f5); box-shadow: 0 2px 5px rgba(0,0,0,.25); }
#reel .slot .xm-splat { position: absolute; top: 50%; z-index: 3; width: 34px; height: 28px; pointer-events: none; background: #fff; opacity: .95;
                        border-radius: 46% 54% 40% 60% / 55% 40% 60% 45%; box-shadow: 8px -6px 0 -4px #fff, -10px 7px 0 -5px #fff; }
#reel .xm-tree { position: absolute; bottom: 0; z-index: 4; width: 52px; height: 62px; transform-origin: 50% 100%; pointer-events: none; }
#reel .xm-tree .cone { position: absolute; left: 0; right: 0; top: 8px; bottom: 7px; clip-path: polygon(50% 0, 100% 100%, 0 100%);
                       background: linear-gradient(160deg, #2fbf6b, #157a40); }
#reel .xm-tree .trunk { position: absolute; left: 21px; bottom: 0; width: 10px; height: 8px; background: #8a5a35; }
#reel .xm-bauble-face { position: absolute; width: 13px; height: 13px; border-radius: 50%; object-fit: cover; object-position: top; box-shadow: 0 0 0 1.5px #ffd34d; }
#reel .xm-bauble-face.b0 { left: 19px; top: 24px; }
#reel .xm-bauble-face.b1 { left: 9px; top: 39px; }
#reel .xm-bauble-face.b2 { left: 30px; top: 37px; }
#reel .xm-topper { position: absolute; left: 50%; top: -3px; width: 22px; height: 22px; background: #ffd34d; padding: 3px;
                   clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
#reel .xm-topper img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
#reel .xm-topper.lit { filter: drop-shadow(0 0 5px #ffe14d) brightness(1.08); }
#reel .slot.xm-ginger img { filter: sepia(1) saturate(2.6) hue-rotate(-14deg) brightness(.72) contrast(1.15); outline: 2px dashed #fff; outline-offset: -4px; }
#reel .slot.xm-ginger span { color: #8a5a35; }
#reel .slot .xm-bite { position: absolute; z-index: 3; width: 16px; height: 16px; border-radius: 50%; background: var(--card); pointer-events: none; }
#reel .slot .xm-crumb { position: absolute; z-index: 3; width: 4px; height: 4px; border-radius: 1px; background: #a66a3a; pointer-events: none; }
#reel .xm-bell { position: absolute; top: 50%; z-index: 4; margin-top: -14px; font-size: 22px; line-height: 1; pointer-events: none; transform-origin: 50% 0; }
#reel .xm-bell.l { left: 10px; }
#reel .xm-bell.r { right: 10px; }
#reel .xm-globe { position: absolute; top: 4px; z-index: 4; width: 56px; height: 56px; pointer-events: none; transform-origin: 50% 100%; }
#reel .xm-globe .glass { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
                         background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.7) 0 6%, rgba(200,225,255,.22) 8%, rgba(160,200,255,.12) 70%);
                         box-shadow: inset 0 -6px 12px rgba(120,160,220,.3), 0 2px 8px var(--shade); }
#reel .xm-gflake { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px rgba(120,160,220,.8); }
#reel .xm-ornament { position: absolute; top: 0; z-index: 4; width: 44px; height: 62px; pointer-events: none; transform-origin: 50% 0; }
#reel .xm-ornament img { position: absolute; left: 2px; bottom: 6px; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top;
                         box-shadow: 0 0 0 2px #e0559a, inset 0 0 8px rgba(255,255,255,.6), 0 3px 8px var(--shade); }
#reel .xm-ornament .cap { position: absolute; left: 16px; top: 10px; width: 12px; height: 7px; border-radius: 2px; background: linear-gradient(#ffe08a, #d4a02a); }
#reel .xm-ornament .thread { position: absolute; left: 21px; top: 0; width: 2px; height: 11px; background: #c9a227; }
#reel .xm-shard { position: absolute; top: 46px; z-index: 5; width: 7px; height: 9px; pointer-events: none; background: #e0559a; clip-path: polygon(50% 0, 100% 100%, 0 80%); }
#reel .xm-fall { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#reel .xm-fall i { position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px rgba(120,160,220,.9); }
#reel .xm-drift { position: absolute; left: -10px; right: -10px; bottom: 0; height: 0; z-index: 4; pointer-events: none;
                  background: radial-gradient(14px 9px at 12% 0, #fff 98%, transparent) 0 0 / 64px 10px repeat-x, linear-gradient(transparent 6px, #fff 6px, #e8f0fa);
                  box-shadow: 0 -2px 8px rgba(120,160,220,.35); }
#reel .xm-advent { position: absolute; inset: 0; z-index: 4; display: flex; justify-content: center; align-items: center; gap: 6px; background: #7a1f2b; }
#reel .xm-door { position: relative; width: 40px; height: 48px; border-radius: 5px; background: #2a1016; }
#reel .xm-door img { position: absolute; inset: 3px; width: 34px; height: 42px; border-radius: 4px; object-fit: cover; object-position: top; }
#reel .xm-door .leaf { position: absolute; inset: 0; border-radius: 5px; transform-origin: 0 50%; display: grid; place-items: center; backface-visibility: hidden;
                       background: #1f7a45; box-shadow: inset 0 0 0 2px rgba(255,211,77,.7); }
#reel .xm-door.d1 .leaf { background: #c22e44; }
#reel .xm-door .leaf b { font: 700 17px/1 var(--display); color: #ffd34d; }
#reel .xm-door.wrong img { filter: grayscale(1) brightness(.6); }
#reel .xm-door.right { box-shadow: 0 0 0 2px #ffd34d, 0 0 12px rgba(255,211,77,.7); }
#reel.xm-night { -webkit-mask-image: none; background: linear-gradient(#0e1a3a, #1d2f5c); box-shadow: 0 0 0 2px #3a4f86, 0 6px 26px rgba(10,20,50,.55); }
#reel.xm-night .slot span { color: #f1f4ff; }
#reel.xm-night::before { content: ""; position: absolute; inset: 0; pointer-events: none;
                         background: radial-gradient(1px 1px at 12% 22%, #fff 99%, transparent), radial-gradient(1px 1px at 33% 12%, #fff 99%, transparent),
                                     radial-gradient(1.5px 1.5px at 58% 30%, #fff 99%, transparent), radial-gradient(1px 1px at 81% 16%, #fff 99%, transparent),
                                     radial-gradient(1px 1px at 92% 40%, #fff 99%, transparent), radial-gradient(9px 9px at 88% 26%, #fff6d6 98%, transparent); }
#reel .xm-chimney { position: absolute; bottom: 0; z-index: 4; width: 38px; height: 26px; pointer-events: none; border-radius: 2px;
                    background: linear-gradient(#f6f8ff 0 5px, transparent 5px), repeating-linear-gradient(0deg, #a33a2c 0 6px, #e8d9c8 6px 7px); }
#reel .xm-sleigh { position: absolute; left: 0; top: 2px; z-index: 5; font-size: 18px; line-height: 1; white-space: nowrap; pointer-events: none; }
#reel .xm-drop { position: absolute; top: 4px; z-index: 3; width: 26px; height: 26px; border-radius: 7px; object-fit: cover; object-position: top; }
#reel .xm-puff { position: absolute; bottom: 20px; z-index: 5; width: 26px; height: 16px; border-radius: 50%; pointer-events: none;
                 background: radial-gradient(circle at 30% 60%, #9aa1ad 0 30%, transparent 32%), radial-gradient(circle at 65% 45%, #b8bec8 0 34%, transparent 36%); }
#reel.landed { -webkit-mask-image: none; box-shadow: 0 0 0 3px var(--accent), 0 6px 28px rgba(214,61,134,.58); animation: land .48s cubic-bezier(.25,1.8,.45,1); }
#reel.landed::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                      background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.68) 48%, transparent 72%);
                      animation: reel-sheen .62s ease-out both; }
@keyframes reel-sheen { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
#reel.landed .slot span { color: var(--strong); }
/* Rare gacha tease on the reel for Top 1%+ (gold) or Mythic/Signature (rainbow) rolls. */
#reel.tease-gold { box-shadow: 0 0 0 3px #f2bf3a, 0 6px 34px rgba(240,169,43,.72); }
#reel.tease-gold.landed .slot span { color: #b87400; }
:root[data-theme="dark"] #reel.tease-gold.landed .slot span { color: #ffd966; }
#reel.tease-gold.landed::after { background: linear-gradient(115deg, transparent 15%, rgba(255,233,150,.85) 48%, transparent 75%); }
#reel.tease-rainbow { box-shadow: 0 0 0 3px #ff4d6d, 0 0 0 6px rgba(157,107,255,.35), 0 8px 36px rgba(255,100,180,.72); }
#reel.tease-rainbow.landed .slot span { background: linear-gradient(90deg, #ff4d6d, #ff9a2e, #e6b800, #2fbf5f, #2fa4e6, #9d6bff, #ff4d6d);
                                        background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
                                        animation: sc-slide 1.5s linear infinite; }
@keyframes land { 0% { transform: translate(-50%, -50%) scale(.84); } 55% { transform: translate(-50%, -50%) scale(1.06); } }
/* The reveal: radial light bloom, double concentric rings, colored sparks, and 4-point star sparkles bursting out where she appears. */
#burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 2; }
#burst i { position: absolute; left: 0; top: 0; opacity: 0; }
#burst .bloom { width: 220px; height: 220px; margin: -110px; border-radius: 50%;
                background: radial-gradient(circle, rgba(255,232,246,.92), rgba(255,126,179,.34) 46%, transparent 72%); }
#burst.gold .bloom { background: radial-gradient(circle, rgba(255,248,210,.95), rgba(246,196,69,.42) 48%, transparent 72%); }
#burst.rainbow .bloom { background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,120,200,.38) 38%, rgba(77,195,255,.28) 58%, transparent 76%); }
#burst .ring { width: 44px; height: 44px; margin: -22px; border-radius: 50%; border: 4px solid #ff7eb3; }
#burst.gold .ring { border-color: #f6c445; }
#burst.rainbow .ring { border-color: #ff6eb4; }
#burst .ring2 { border-width: 2.5px; border-color: #ffd166; }
#burst.rainbow .ring2 { border-color: #4dc3ff; }
#burst .spark { width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--c); }
#burst .star { width: 16px; height: 16px; margin: -8px; background: var(--c);
               clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%); }
#burst.go .bloom { animation: bloom-flash .56s cubic-bezier(.16,.84,.3,1); }
#burst.mini .bloom { display: none; }
@keyframes bloom-flash { 0% { opacity: .95; transform: scale(.35); } 100% { opacity: 0; transform: scale(2.4); } }
#burst.go .ring { animation: ring .72s cubic-bezier(.18,.82,.28,1); }
#burst.go .ring2 { animation: ring2 .82s .07s cubic-bezier(.18,.82,.28,1); }
#burst.go .spark { animation: spark .82s cubic-bezier(.15,.72,.28,1); }
#burst.go .star { animation: star-pop .88s cubic-bezier(.15,.72,.28,1); }
#burst.mini .ring { animation-duration: .46s; }
#burst.mini .ring2 { display: none; }
#burst.mini .spark, #burst.mini .star { animation-duration: .52s; }
@keyframes ring { 0% { opacity: 1; transform: scale(.25); } 100% { opacity: 0; transform: scale(9.5); border-width: 1px; } }
@keyframes ring2 { 0% { opacity: .95; transform: scale(.2); } 100% { opacity: 0; transform: scale(7.2); border-width: 1px; } }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(8px) scale(var(--s, 1)); }
                   100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(.2); } }
@keyframes star-pop { 0% { opacity: 1; transform: rotate(var(--a)) translateX(10px) scale(calc(var(--s, 1) * 1.25)) rotate(0deg); }
                      100% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--d) * 1.08)) scale(.25) rotate(140deg); } }
#burst.mini.go .ring { animation-name: ring-mini; }
#burst.mini.go .spark { animation-name: spark-mini; }
#burst.mini.go .star { animation-name: star-mini; }
@keyframes ring-mini { 0% { opacity: .9; transform: scale(.25); } 100% { opacity: 0; transform: scale(5.4); border-width: 1px; } }
@keyframes spark-mini { 0% { opacity: .95; transform: rotate(var(--a)) translateX(6px) scale(.85); }
                        100% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--d) * .56)) scale(.15); } }
@keyframes star-mini { 0% { opacity: .95; transform: rotate(var(--a)) translateX(8px) scale(1) rotate(0deg); }
                       100% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--d) * .62)) scale(.2) rotate(110deg); } }
/* Staggered HUD entrance right after a daily roll reveals the uma. */
body.reveal-cascade #countdown { animation: hud-drop .42s .06s cubic-bezier(.22,1.25,.36,1) both; }
body.reveal-cascade #bar { animation: hud-rise .44s .12s cubic-bezier(.22,1.25,.36,1) both; }
body.reveal-cascade #controls { animation: hud-rise-x .46s .2s cubic-bezier(.22,1.25,.36,1) both; }
body.reveal-cascade #share { animation: hud-rise-x .48s .04s cubic-bezier(.22,1.28,.36,1) both; }
@keyframes hud-drop { from { opacity: 0; transform: translateY(-14px) scale(.94); } }
@keyframes hud-rise { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes hud-rise-x { from { opacity: 0; transform: translate(-50%, 18px) scale(.92); } }
#countdown { display: none; height: 34px; box-sizing: border-box; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px;
             background: var(--surface-hud); backdrop-filter: blur(var(--blur-hud)); box-shadow: 0 1px 6px var(--shade); font: 400 13px/1.25 system-ui, sans-serif;
             color: var(--soft); white-space: nowrap; cursor: pointer; transition: box-shadow .2s; }
#countdown:hover { box-shadow: 0 2px 10px var(--shade-hover); }
body.rolled #countdown { display: block; }
#countdown b { color: var(--strong); font-variant-numeric: tabular-nums; }

/* The primary daily action pill above the song bar: Share | MP4 (+ optional reroll token),
   sized and styled to harmonize cleanly with the frosted bottom HUD. */
#share { position: fixed; top: auto; left: calc(50% - var(--picker-side, 0px) / 2); right: auto; transform: translateX(-50%);
         z-index: 1; display: flex; align-items: center; overflow: hidden; border: 0; border-radius: 999px; white-space: nowrap;
         bottom: calc(102px + var(--who-room, 0px) + var(--picker-room, 0px) + var(--safe-bottom)); height: 38px;
         background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22);
         font: 700 13.5px/1 var(--display); letter-spacing: .04em;
         box-shadow: 0 4px 16px rgba(214,61,134,.36), inset 0 1px 0 rgba(255,255,255,.26);
         transition: scale .15s, box-shadow .2s, bottom .36s cubic-bezier(.22,1.22,.36,1), left .32s cubic-bezier(.22,1.22,.36,1); }
#share:hover { box-shadow: 0 5px 20px rgba(214,61,134,.5); }
#share svg { width: 16px; height: 16px; stroke: #fff; transition: transform .4s; }
#share button { display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 16px; border: 0; background: none; cursor: pointer;
                font: inherit; letter-spacing: inherit; color: inherit; text-shadow: inherit; transition: background .2s, transform .12s; }
#share button:hover:not(:disabled) { background: rgba(0,0,0,.08); } /* darker, not lighter: white text keeps 4.5:1 */
#share button:active:not(:disabled) { background: rgba(0,0,0,.14); transform: scale(.97); }
#share button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
#share #share-link { padding-left: 18px; }
#share-link:hover svg { transform: rotate(-20deg); }
#share #share-mp4 { padding-right: 18px; border-left: 1px solid rgba(255,255,255,.3); font-variant-numeric: tabular-nums; }
#share-mp4:hover:not(:disabled) svg { transform: translateY(2px); }
/* A reroll token's button (streak rewards): the tokens left; the first press asks, the second rerolls. */
#share #share-reroll { gap: 6px; padding: 0 16px 0 13px; border-left: 1px solid rgba(255,255,255,.3); font-variant-numeric: tabular-nums; }
#share #share-reroll[hidden] { display: none; }
#share #share-reroll.armed { background: rgba(0,0,0,.2); } /* darker, not lighter: white text keeps 4.5:1 */
#share-reroll:hover svg { transform: rotate(90deg); }
#share-reroll svg { transition: transform .4s; }
#share-mp4.busy { cursor: pointer; }
/* Never wider than the screen; the buttons after Share each have a hairline before them. */
#share { max-width: calc(100vw - 24px); }
#share button[hidden] { display: none; }
#share button + button { border-left: 1px solid rgba(255,255,255,.3); }
/* Share copies at once, then finishes the link's video behind it (index.html prepareEmbed): its
   background fills as that goes (--prep-pct), and its label keeps one width meanwhile. */
#share #share-link { position: relative; font-variant-numeric: tabular-nums; }
#share-link span { min-width: 3.4em; text-align: center; }
#share-link.busy::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--prep-pct, 0%); pointer-events: none;
                           background: rgba(255,255,255,.22); transition: width .3s ease-out; }
/* The phone share sheet (icon only) and Copy score, beside Share. */
#share #share-native { padding: 0 13px; }
#share #share-score { gap: 6px; padding: 0 15px 0 13px; }
#share-score svg { width: 15px; height: 15px; }
#share-score.copied svg { transform: scale(1.1); }
/* While a video's filming, the reroll token and Photo wait (index.html setFilming). */
#share button:disabled { cursor: default; }
#share.filming #share-reroll:disabled { opacity: .5; }
/* Phones: the secondary ones go to just their icons (their titles still name them); MP4 shows its
   progress while it saves. */
@media (max-width: 560px) {
  #share button { padding: 0 12px; }
  #share #share-link { padding: 0 14px 0 15px; }
  #share :is(#share-score, #share-mp4:not(.busy)) span { display: none; }
  #share #share-mp4 { padding-right: 13px; }
  #share #share-reroll { padding: 0 13px 0 11px; }
  /* Asking "Use a token?", the reroll gets the row to itself beside Share (for its four seconds),
     as the question doesn't fit beside the icons on a phone, least of all in Japanese. */
  #share:has(#share-reroll.armed) :is(#share-native, #share-score, #share-mp4) { display: none; }
}
@media (max-width: 400px) {
  #share :is(#share-native, #share-score, #share-mp4:not(.busy)) { padding: 0 10px; }
}
/* Only for a daily roll (not free mode or a shared one) once its song is in, a beat after its reveal (just-rolled). */
:is(body:not(.daily), body:not(.rolled), body.just-rolled) #share, #share:not(.loaded) { display: none; }

/* A shared daily roll or shared Free mode stage (?s=...): modern glassmorphic banner with mode
   badge up top, theme toggle kept available, and a two-button pill action row above the song bar. */
body.shared :is(#controls, #picker, #mode, #countdown) { display: none; }
body.shared-free :is(#score, #score-pill) { display: none !important; }
body.shared #bar { bottom: calc(14px + var(--safe-bottom)); } /* nothing under it here */
/* Before the daily roll there's no controls row (Customise, with its Low quality switch, waits
   for the roll), so the song row sits lower. */
body.daily:not(.rolled) #bar { bottom: calc(36px + var(--safe-bottom)); }
#shared { display: none; position: fixed; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 2; box-sizing: border-box;
          width: max-content; max-width: calc(100vw - 112px); flex-direction: column; align-items: center; gap: 4px; padding: 10px 22px 12px;
          border: 1px solid var(--border-accent); border-radius: 18px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); text-align: center;
          box-shadow: 0 6px 24px var(--shade); }
body.shared #shared { display: flex; }
body.shared-free #shared { border-color: rgba(138,92,246,.36); }
#shared .shared-badge { display: inline-flex; align-items: center; padding: 3px 10px; margin-bottom: 2px; border-radius: 999px;
                        background: var(--accent-pill); color: #fff; font: 700 10px/1 system-ui, sans-serif;
                        font-style: normal; letter-spacing: .09em; text-transform: uppercase;
                        text-shadow: 0 1px 2px rgba(120,18,66,.22); }
body.shared-free #shared .shared-badge { background: linear-gradient(90deg, #7444e6, #c42e78); }
#shared b { font: 700 19px/1.15 var(--display); letter-spacing: .01em; color: var(--text); }
#shared span { font-size: 12.5px; color: var(--soft); }
/* Until sound's allowed: a clear pill saying so (any tap on the page unmutes, this one too). */
#shared .tap-sound { display: none; align-items: center; gap: 6px; height: 30px; margin-top: 6px; padding: 0 14px 0 11px; border: 0; border-radius: 999px;
                     background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 10px rgba(214,61,134,.38);
                     font: 700 12.5px/1 system-ui, sans-serif; cursor: pointer; transition: transform .14s, box-shadow .2s; }
#shared .tap-sound:hover { box-shadow: 0 4px 16px rgba(214,61,134,.5); }
#shared .tap-sound:active { transform: scale(.96); }
#shared .tap-sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#shared .tap-sound svg { flex: none; width: 16px; height: 16px; stroke: #fff; }
#shared .tap-sound span { font: inherit; color: inherit; line-height: 1; }
body.shared-free #shared .tap-sound { background: linear-gradient(90deg, #7444e6, #c42e78); box-shadow: 0 2px 10px rgba(138,92,246,.38); }
#shared.tap .tap-sound { display: inline-flex; }
#shared.broken b { font-size: 16px; }
@keyframes pulse { 50% { opacity: .45; } }
#share-actions { display: none; position: fixed; left: 50%; bottom: calc(62px + var(--who-room, 0px) + var(--safe-bottom)); transform: translateX(-50%);
                 z-index: 2; width: max-content; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; max-width: calc(100vw - 24px);
                 transition: bottom .36s cubic-bezier(.22,1.22,.36,1); }
body.shared #share-actions { display: flex; }
#share-actions a { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px 0 16px; border-radius: 999px;
                   text-decoration: none; white-space: nowrap; font: 700 13.5px/1 var(--display); letter-spacing: .04em; text-transform: uppercase;
                   transition: transform .15s, box-shadow .2s, background .2s; }
#share-actions a svg { width: 17px; height: 17px; transition: transform .35s; }
#share-actions a.primary { background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22);
                           box-shadow: 0 3px 14px rgba(214,61,134,.45); }
body.shared-free #share-actions a.primary { background: linear-gradient(90deg, #7444e6, #c42e78); box-shadow: 0 3px 16px rgba(138,92,246,.42); }
#share-actions a.primary svg { stroke: #fff; }
#share-actions a.primary:hover { transform: scale(1.04); box-shadow: 0 5px 20px rgba(214,61,134,.58); }
#share-actions a.secondary { background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); color: var(--text);
                             border: 1px solid var(--border-accent); box-shadow: 0 2px 12px var(--shade); }
#share-actions a.secondary svg { stroke: var(--accent); }
#share-actions a.secondary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--shade-hover); color: var(--strong); }
#share-actions a:active { transform: scale(.97); }
@media (max-width: 560px) {
  #shared { top: calc(14px + var(--safe-top)); max-width: calc(100vw - 112px); gap: 2px; padding: 7px 14px 8px; border-radius: 15px; }
  #shared .shared-badge { padding: 2px 8px; margin-bottom: 1px; font-size: 9.5px; }
  #shared b { font-size: 15.5px; }
  #shared span { font-size: 11.5px; line-height: 1.25; }
  #shared .tap-sound { height: 28px; margin-top: 4px; font-size: 11.5px; }
  #share-actions { gap: 6px; }
  #share-actions a { height: 36px; gap: 6px; padding: 0 13px 0 11px; font-size: 12px; }
  #share-actions a svg { width: 15px; height: 15px; }
}

/* Golden Freddy: nothing but him and the dark. */
html:has(body.golden), body.golden { background: #000; }
body.golden :is(#brand, #bar, #controls, #lq, #picker, #theme, #festive, #loading, #start, #mode, #roll, #how-panel, #suggest-panel, #countdown, #shared, #share-actions, #share, #about-toggle, #x-link, #suggest-toggle, #changelog) { display: none !important; }

/* Phones have no hover, so the pill is just the speaker; it opens the slider in #vol-pop. */
@media (hover: none) {
  #vol .pill input { display: none; }
}
#start { position: fixed; inset: 0; z-index: 10; width: 100%; height: 100%; padding: 0; border: 0; font: inherit; color: inherit;
         background: var(--overlay); backdrop-filter: blur(4px);
         display: none; align-items: center; justify-content: center; cursor: pointer; }
#start:focus-visible { outline: none; }
#start:focus-visible .start-pill { outline: 3px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 3px var(--accent), 0 4px 20px rgba(214,61,134,.6); }
#start .start-pill { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px 0 22px; border-radius: 999px;
                     background: var(--accent-pill); color: #fff; text-shadow: 0 1px 2px rgba(120,18,66,.22);
                     box-shadow: 0 4px 18px rgba(214,61,134,.45); font: 700 17px/1 var(--display); letter-spacing: .02em;
                     transition: transform .15s, box-shadow .2s; }
#start:hover .start-pill { transform: scale(1.04); box-shadow: 0 6px 24px rgba(214,61,134,.58); }
#start:active .start-pill { transform: scale(.97); }
#start .start-pill svg { width: 20px; height: 20px; stroke: #fff; }

/* The daily roll's score (Stage-Side Centerpiece): floats vertically balanced beside the dancing
   uma while the 3D camera gently shifts her left so they form a centered duo; collapsing tucks
   into a Score pill paired neatly beside Customise at the bottom center. */
#score { display: none; position: fixed; left: min(calc(50% + 175px), calc(100vw - 288px)); top: max(220px, calc(50% - 10px - var(--picker-room, 0px) * 0.48));
         z-index: 2; box-sizing: border-box; width: 268px;
         padding: 12px 14px 14px; border: 1px solid var(--border-accent); border-radius: 18px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel));
         box-shadow: 0 6px 24px var(--shade); transform: translateY(-50%) scale(1); transform-origin: center left;
         transition: top .36s cubic-bezier(.22,1.22,.36,1), left .32s cubic-bezier(.22,1.22,.36,1),
                     transform .32s cubic-bezier(.22,1.22,.36,1), opacity .22s ease, border-color .35s, box-shadow .35s, visibility 0s; }
/* Subtle rarity-matched edge & ambient glow on the score card. */
#score[data-level="1"] { border-color: rgba(138,146,162,.32); }
#score[data-level="2"] { border-color: rgba(186,138,170,.32); }
#score[data-level="3"] { border-color: rgba(242,131,180,.34); }
#score[data-level="4"] { border-color: rgba(224,85,154,.38); box-shadow: 0 6px 26px rgba(224,85,154,.16); }
#score[data-level="5"] { border-color: rgba(235,176,34,.52); box-shadow: 0 6px 28px rgba(235,176,34,.22); }
#score[data-level="6"] { border-color: rgba(224,85,154,.48); box-shadow: 0 6px 30px rgba(224,85,154,.24), 0 0 0 1px rgba(157,107,255,.18); }
:is(body.daily.rolled.scored, body.shared.scored) #score { display: block; }
:is(body.daily.rolled.scored, body.shared.scored) #score-pill { display: flex; }
#score.score-enter { animation: score-in-side .48s cubic-bezier(.22,1.28,.36,1) backwards; }
@keyframes score-in-side { from { opacity: 0; transform: translate(18px, -50%) scale(.94); } }
@keyframes score-in { from { opacity: 0; transform: translateY(20px) scale(.94); } }
#score .score-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--track); }
#score h2 { margin: 0; font: 700 12.5px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--strong); }
#score .score-actions { display: flex; align-items: center; gap: 2px; margin: -4px -5px -4px 0; }
#score .score-actions button { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0;
                               border-radius: 50%; background: none; cursor: pointer; color: var(--label); transition: background .2s, color .2s, transform .14s; }
#score .score-actions button:hover { background: var(--shade); color: var(--strong); }
#score .score-actions button:active { transform: scale(.88); }
#score #score-copy.copied { color: #22a06b; }
/* Copy says so, not just its icon: a small labelled pill. */
#score #score-copy { width: auto; gap: 4px; padding: 0 8px 0 6px; border-radius: 999px; font: 600 11.5px/1 system-ui, sans-serif; }
#score .score-actions svg, #score-pill svg { width: 15px; height: 15px; stroke: currentColor; transition: transform .25s ease; }
#score .score-body { display: flex; flex-direction: column; }
/* Collapsed pill: paired right beside Customise at bottom center, matching its height and glass card. */
#score-pill { display: none; position: fixed; left: calc(50% + var(--pill-shift, 0px)); bottom: calc(14px + var(--picker-room, 0px) + var(--safe-bottom)); z-index: 1; /* under Customise and its galleries */ align-items: center; gap: 8px; height: 36px;
              box-sizing: border-box; padding: 0 12px 0 16px; border: 1px solid var(--border-accent); border-radius: 999px; cursor: pointer;
              background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 4px 16px var(--shade); font: 700 12.5px/1 var(--display);
              letter-spacing: .03em; color: var(--label); transform-origin: bottom center;
              opacity: 0; transform: translate(-50%, 8px) scale(.9); visibility: hidden; pointer-events: none;
              transition: bottom .36s cubic-bezier(.22,1.22,.36,1), left .32s cubic-bezier(.22,1.22,.36,1), transform .28s cubic-bezier(.22,1.28,.36,1),
                          opacity .2s ease, box-shadow .2s, border-color .2s, visibility 0s .22s; }
#score-pill:hover { border-color: rgba(224,85,154,.55); box-shadow: 0 3px 16px var(--shade-hover); }
#score-pill:active { transform: translate(-50%, 0) scale(.96); }
#score-pill b { font: 700 17px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--strong); }
/* Collapse / expand cross-morph between #score and #score-pill. */
/* Customise as a bottom sheet leaves no room for the card beside her, so it folds too, for as long as it's open. */
body.score-collapsed #score, body.picker-open:not(.picker-side) #score { opacity: 0; transform: translateY(calc(-50% + 14px)) scale(.92); visibility: hidden; pointer-events: none;
                              transition: top .36s cubic-bezier(.22,1.22,.36,1), left .32s ease, transform .24s cubic-bezier(.4,0,.2,1), opacity .18s ease, visibility 0s .24s; }
body.score-collapsed #score-pill, body.picker-open:not(.picker-side) #score-pill { opacity: 1; transform: translate(-50%, 0) scale(1); visibility: visible; pointer-events: auto;
                                   transition: bottom .36s cubic-bezier(.22,1.22,.36,1), left .32s cubic-bezier(.22,1.22,.36,1), transform .32s cubic-bezier(.22,1.28,.36,1) .06s,
                                               opacity .22s ease .06s, box-shadow .2s, border-color .2s, visibility 0s; }
/* Shared rolls have no Customise button at bottom center, so their collapsed pill rests neatly bottom-right. */
body.shared:not(.score-top) #score-pill { left: auto; right: 16px; bottom: calc(14px + var(--safe-bottom)); transform: translateY(8px) scale(.9); transform-origin: bottom right; }
body.shared:not(.score-top).score-collapsed #score-pill { transform: translateY(0) scale(1); }
body.shared:not(.score-top) #score-pill:active { transform: scale(.96); }
/* A score's number in its rarity's colours (dark-mode --sc1..--sc6 match score-colours.js's
   canvas SCORE_INKS pastel stops; light-mode :root uses darker stops for contrast), as the
   history calendar colours its days: grey, dusky mauve, light pink, pink, gold, rainbow. */
.sc1 { --sc: var(--sc1); }
.sc2 { --sc: var(--sc2); }
.sc3 { --sc: var(--sc3); }
.sc4 { --sc: var(--sc4); }
.sc5 { --sc: var(--sc5); }
.sc6 { --sc: var(--sc6); }
.sc { background: var(--sc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.sc:is(.sc5, .sc6) { background-size: 200% 100%; animation: sc-slide 2.4s linear infinite; }
@keyframes sc-slide { to { background-position: -200% 0; } }
html.reduce-motion .sc:is(.sc5, .sc6) { animation: none; }
#account-panel .pts b.sc { display: inline-block; } /* the colours across the number, not the column */
/* Breakdown rows with colour-coded strength bars. */
#score ol { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
#score li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name pts" "why pts" "bar bar";
            gap: 1px 8px; align-items: center; padding: 5px 8px 6px; border-radius: 10px;
            background: rgba(0,0,0,.024); border: 1px solid transparent; opacity: 0; transform: translateX(16px);
            transition: opacity .3s, transform .4s cubic-bezier(.3,1.4,.5,1), background .2s, border-color .2s; }
:root[data-theme="dark"] #score li { background: rgba(255,255,255,.038); }
#score li.in { opacity: 1; transform: none; }
#score .name { grid-area: name; font: 700 10px/1.25 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#score .why { grid-area: why; min-width: 0; font-size: 11.5px; line-height: 1.3; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The outfit bonus (showScore): a small pill after her name, wrapping under it where it won't fit
   beside, so it's never cut off. On phones' two columns it takes the row's full width. */
#score .why:has(.bonus) { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; overflow: visible; }
#score .why .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#score .why .bonus { flex: none; padding: 1px 6px; border-radius: 999px; background: rgba(224,85,154,.13); color: var(--strong);
                     font: 600 10px/1.35 system-ui, sans-serif; font-style: normal; }
body.score-top #score li:has(.bonus) { grid-template-areas: "name pts" "why why" "bar bar"; }
#score .pts { grid-area: pts; font: 700 15px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }
#score .pts small { font-size: 10.5px; font-weight: 500; color: var(--label); }
#score .bar { grid-area: bar; height: 5px; margin-top: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
#score .bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff7eb3, #e0559a);
                transition: width .7s cubic-bezier(.3,.8,.4,1); }
/* Per-category bar strength tints so you see at a glance what carried or tanked the roll. */
#score li[data-tier="low"] .bar i { background: linear-gradient(90deg, #a7aebc, #8c93a3); }
#score li[data-tier="low"] .pts b { color: var(--soft); }
#score li[data-tier="mid"] .bar i { background: linear-gradient(90deg, #f3a4c6, #e579ac); }
#score li[data-tier="high"] .bar i { background: linear-gradient(90deg, #ff7eb3, #e0559a); }
#score li[data-tier="max"] .bar i { background: linear-gradient(90deg, #f0a422, #f7cb4d, #ffe285, #f0a422); background-size: 200% 100%; animation: sc-slide 2.8s linear infinite; }
#score li[data-tier="max"] .pts b { color: #945e00; }
:root[data-theme="dark"] #score li[data-tier="max"] .pts b { color: #f6c445; }
#score li[data-tier="max"] { border-color: rgba(240,164,34,.22); }
#score li.max-hit { animation: max-hit .46s cubic-bezier(.22,1.4,.36,1); }
@keyframes max-hit { 35% { transform: scale(1.035); box-shadow: 0 0 14px rgba(246,196,69,.42); } }
#score li.added .pts { color: var(--label); transition: color .3s; }
#score .drop { position: absolute; pointer-events: none; white-space: nowrap; color: var(--strong); }
#score .total .drop b { font: 800 17px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; background: none;
                        -webkit-text-fill-color: currentColor; color: var(--strong); }
#score .drop span { font: 600 10px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#lucky-duet { margin: 0 0 8px; color: var(--strong); font-size: 12px; font-weight: 600; }
#score .foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--track); opacity: 0; transition: opacity .3s; }
#score .foot.in { opacity: 1; }
#score .foot[hidden] { display: none; }
#score .total { position: relative; display: flex; align-items: baseline; justify-content: space-between; }
#score .total > span { transition: opacity .3s; }
body:not(.score-top) #score .total.adding > span { opacity: 0; } /* the drops fall where it stands */
#score .total > span { font: 600 11px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#score .total b { display: inline-block; font: 700 40px/1 var(--display); font-variant-numeric: tabular-nums;
                  background: var(--sc, var(--accent-grad)); -webkit-background-clip: text; background-clip: text;
                  -webkit-text-fill-color: transparent; transform-origin: right bottom; text-align: right; }
#score .total small { font-size: 12.5px; font-weight: 500; color: var(--label); }
#score .total.bump b { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(1.08); } }
#score .total.done b { animation: total-pop .55s cubic-bezier(.3,1.8,.5,1); }
#score .total b.sc:is(.sc5, .sc6) { background-size: 200% 100%; }
#score .total.done b.sc:is(.sc5, .sc6) { animation: total-pop .55s cubic-bezier(.3,1.8,.5,1), sc-slide 2.4s linear infinite; }
html.reduce-motion #score .total.done b.sc:is(.sc5, .sc6), html.reduce-motion #score li[data-tier="max"] .bar i { animation: none; }
@keyframes total-pop { 0% { transform: scale(1.4); } }
#score .rank { display: flex; justify-content: center; margin-top: 9px; padding: 8px 12px; border-radius: 999px; color: #fff;
               background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 11px rgba(214,61,134,.42);
               font: 700 14.5px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; visibility: hidden; }
#score .rank.bottom { background: var(--track); text-shadow: none; box-shadow: none; color: var(--soft); }
#score .rank.in { visibility: visible; animation: rank-in .55s cubic-bezier(.3,1.8,.5,1) both; }
#score .rank.elite.in { animation: rank-in .55s cubic-bezier(.3,1.8,.5,1) both, glow 1.6s .55s ease-in-out infinite; }
@keyframes rank-in { from { transform: scale(0); } }
/* Top 15% and bottom 20% rolls (fx.js's tiers) keep a look on the rank, which plays the show again. */
#score .rank[class*="fx-"] { cursor: pointer; align-items: center; gap: 6px; }
#score .rank[class*="fx-"]::after { content: "↻"; font: 700 11px/1 system-ui, sans-serif; opacity: .75; transition: opacity .15s, transform .25s; }
#score .rank[class*="fx-"]:hover::after { opacity: 1; transform: rotate(90deg); }
#score .rank:is(.fx-legendary), #score-pill.fx-legendary .rank { --fx-grad: linear-gradient(90deg, #f6c445, #f0a92b, #f6c445); }
#score .rank.fx-legendary { background: var(--fx-grad); background-size: 200% 100%; color: #5a3b00; animation: rank-in .55s cubic-bezier(.3,1.8,.5,1) both, fx-shine 2s linear infinite; }
#score .rank:is(.fx-mythic, .fx-godlike) { background: linear-gradient(90deg, #ff4d6d, #ffa53b, #ffe14d, #4dd77a, #4dc3ff, #9d6bff, #ff4d6d);
      background-size: 200% 100%; text-shadow: 0 1px 3px rgba(0,0,0,.35); animation: rank-in .55s cubic-bezier(.3,1.8,.5,1) both, fx-shine 1.4s linear infinite; }
#score .rank.fx-cursed::before { content: "🌧\FE0F\00a0"; }
#score .rank:is(.fx-dreadful, .fx-disaster)::before { content: "⛈\FE0F\00a0"; }
#score .rank:is(.fx-catastrophe, .fx-doomed)::before { content: "💀\00a0"; }
#score .rank.fx-doomed { background: #3a1d22; color: #e8c9cc; }
#score-pill.fx-legendary .rank { color: #945e00; }
:root[data-theme="dark"] #score-pill.fx-legendary .rank { color: #f6c445; }
#score-pill:is(.fx-mythic, .fx-godlike) .rank { background: linear-gradient(90deg, #ff4d6d, #ffa53b, #4dc3ff, #9d6bff); -webkit-background-clip: text;
      background-clip: text; color: transparent; }
@keyframes fx-shine { to { background-position: -200% 0; } }
@keyframes glow { 50% { box-shadow: 0 0 22px rgba(255,126,179,.85); } }
/* Phones (score-top, set on resize): along the top under the countdown, in two columns. */
body.score-top #score { top: calc(60px + var(--safe-top)); bottom: auto; left: 16px; right: 16px; width: auto; padding: 11px 13px; transform: translateY(0) scale(1); transform-origin: top right; }
body.score-top #score-pill { top: calc(60px + var(--safe-top)); bottom: auto; left: auto; right: 16px; transform: translateY(-6px) scale(.9); transform-origin: top right; }
body.score-top #score-pill:active { transform: scale(.96); }
body.shared.score-top :is(#score, #score-pill) { top: var(--shared-room, calc(104px + var(--safe-top))); bottom: auto; } /* under the Shared roll banner */
body.score-top #score.score-enter { animation-name: score-in-top; }
@keyframes score-in-top { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
body.score-top.score-collapsed #score,
body.score-top.picker-open #score { opacity: 0; transform: translateY(-12px) scale(.94); visibility: hidden; pointer-events: none;
                                    transition: transform .24s cubic-bezier(.4,0,.2,1), opacity .18s ease, visibility 0s .24s; }
body.score-top.score-collapsed #score-pill,
body.score-top.picker-open #score-pill { opacity: 1; transform: translateY(0) scale(1); visibility: visible; pointer-events: auto;
                                         transition: transform .32s cubic-bezier(.22,1.28,.36,1) .06s, opacity .22s ease .06s, box-shadow .2s, border-color .2s, visibility 0s; }
body.score-top #score .score-head { margin-bottom: 8px; padding-bottom: 6px; }
body.score-top #score h2 { font-size: 11.5px; }
body.score-top :is(#score .hide, #score-pill) svg { transform: rotate(180deg); } /* it folds up, and opens down */
body.score-top #score ol { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
body.score-top #score li { padding: 4px 7px 5px; }
body.score-top #score .pts { font-size: 14px; }
body.score-top #score .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 8px; }
body.score-top #score .total { gap: 8px; }
body.score-top #score .total b { font-size: 30px; }
body.score-top #score .rank { margin-top: 0; padding: 7px 12px; font-size: 13px; }
body.golden :is(#score, #score-pill) { display: none !important; }
body.score-top.picker-open #share { display: none; }

/* Unfolded iPhone Duo & compact landscape tablets (body.duo-dock) + Desktop & tall tablets (body.desk-dock):
   Song credit + volume move into a top-center "Now Playing" pill between the top corners, freeing
   the bottom to stay compact (Share cleanly above stationary Customise, or one row in Free mode).
   Score card sits on the right and collapses under the top-right countdown. */
body:is(.duo-dock, .desk-dock) :is(#about-toggle, #x-link, #suggest-toggle) { bottom: calc(18px + var(--safe-bottom)); }
body:is(.duo-dock, .desk-dock) #changelog { bottom: calc(56px + var(--safe-bottom)); max-height: calc(100dvh - 120px - var(--safe-top) - var(--safe-bottom)); }
body:is(.duo-dock, .desk-dock) #toasts {
  bottom: calc(62px + var(--picker-room, 0px) + var(--safe-bottom));
}
body:is(.duo-dock, .desk-dock).daily.rolled #toasts {
  bottom: calc(106px + var(--picker-room, 0px) + var(--safe-bottom));
}
/* Top-center "Now Playing" pill (song credit + volume): height-matched (34px) to the top HUD row,
   centred cleanly in the open gap between top-left and top-right; details & volume drop downward. */
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #bar {
  top: calc(14px + var(--safe-top)); bottom: auto;
  left: var(--now-x, 50%); right: auto; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; z-index: 3;
  max-width: var(--now-max, calc(100vw - 440px));
}
body:is(.duo-dock, .desk-dock).reveal-cascade #bar { animation-name: hud-drop-x; }
@keyframes hud-drop-x { from { opacity: 0; transform: translate(-50%, -14px) scale(.94); } }
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #bar #song { min-width: 0; flex: 0 1 auto; }
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #bar #bar-end { flex: none; }
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #info { height: 34px; box-shadow: 0 1px 6px var(--shade); }
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #bar:has(#who:not(:empty)) #info::after {
  margin-top: -1.5px; transform: translateY(-50%) rotate(45deg);
}
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #bar.who:has(#who:not(:empty)) #info::after {
  margin-top: 1.5px; transform: translateY(-50%) rotate(-135deg);
}
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #who {
  top: calc(100% + 10px); bottom: auto; left: 50%;
  transform: translate(-50%, -4px);
}
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #bar.who #who:not(:empty) {
  transform: translate(-50%, 0);
}
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol { width: 34px; height: 34px; }
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol .pill {
  width: 34px; height: 34px; box-shadow: 0 1px 6px var(--shade);
}
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol button { width: 32px; height: 32px; }
body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol-pop {
  top: calc(100% + 10px); bottom: auto; left: 50%; right: auto; transform: translateX(-50%);
}
/* Hover pointers: vertical volume slider glides cleanly DOWNWARD below the top speaker button. */
@media (hover: hover) {
  body:is(.desk-dock, .duo-dock):not(.unrolled, .rolling, .shared) #vol .pill {
    top: 0; bottom: auto; left: 0;
    flex-direction: column;
    transition: height .2s, border-color .2s, box-shadow .2s;
  }
  body:is(.desk-dock, .duo-dock):not(.unrolled, .rolling, .shared) #vol:hover .pill,
  body:is(.desk-dock, .duo-dock):not(.unrolled, .rolling, .shared) #vol:focus-within .pill {
    height: 124px; z-index: 4;
  }
  body:is(.desk-dock, .duo-dock):not(.unrolled, .rolling, .shared) #vol input {
    width: 24px; height: 0; margin: 0; opacity: 0;
    writing-mode: vertical-lr; direction: rtl;
    transition: height .2s, margin .2s, opacity .2s;
  }
  body:is(.desk-dock, .duo-dock):not(.unrolled, .rolling, .shared) #vol:hover input,
  body:is(.desk-dock, .duo-dock):not(.unrolled, .rolling, .shared) #vol:focus-within input {
    width: 24px; height: 78px; margin: 2px 0 10px; opacity: 1;
  }
}
/* Narrower Duo/tablet widths: tighten countdown padding so the top-center Now Playing pill
   keeps generous breathing room between the two top corners (text shortening happens in tick()
   so Japanese translations and the clicked local-time toggle still work). */
@media (max-width: 900px) and (min-width: 701px) {
  body:is(.duo-dock, .desk-dock) #top-right #countdown { padding: 8px 12px; }
}
/* Stationary bottom action stack:
   - Desktop (desk-dock): Share centered directly above Customise (2 neat rows), Customise menu opens UPWARD.
   - Unfolded Duo / compact landscape (duo-dock): Share + Customise side-by-side on ONE single row at the
     bottom (~58px total) so shorter screens never overlap the character's feet. */
body.desk-dock #controls {
  left: 50%; right: auto; bottom: calc(14px + var(--safe-bottom));
  transform: translateX(-50%);
}
body.desk-dock.picker-side #controls {
  left: calc(50% - var(--picker-side, 0px) / 2);
  transition: left .36s cubic-bezier(.22,1.22,.36,1), bottom .36s cubic-bezier(.22,1.22,.36,1);
}
body.desk-dock #share {
  left: 50%; right: auto; bottom: calc(58px + var(--safe-bottom));
  transform: translateX(-50%);
}
body.desk-dock.picker-side #share {
  left: calc(50% - var(--picker-side, 0px) / 2);
  transition: box-shadow .2s, left .36s cubic-bezier(.22,1.22,.36,1);
}
body.duo-dock #share {
  left: var(--duo-share-x, 50%); right: auto;
  bottom: calc(14px + var(--safe-bottom));
  transform: none;
}
body.duo-dock #controls,
body.duo-dock.picker-side #controls {
  left: var(--duo-ctrl-x, 50%); right: auto;
  bottom: calc(14px + var(--safe-bottom));
  transform: none;
}
body.duo-dock.reveal-cascade :is(#controls, #share) { animation-name: hud-rise; }
body.duo-dock.daily.rolled #toasts {
  bottom: calc(66px + var(--picker-room, 0px) + var(--safe-bottom));
}
@media (pointer: coarse) {
  body.duo-dock #controls button { height: 40px; }
  body.duo-dock #share { height: 40px; }
}
body:is(.duo-dock, .desk-dock) #score,
body:is(.duo-dock, .desk-dock).picker-side #score {
  left: var(--score-left, min(calc(50% + 175px), calc(100vw - 284px))); right: auto; top: calc(50% + 2px);
  width: 268px;
  padding: 10px 13px 12px;
  transform: translateY(-50%) scale(1); transform-origin: center left;
}
body.duo-dock #score,
body.duo-dock.picker-side #score {
  width: clamp(236px, 27vw, 268px);
  left: var(--score-left, min(calc(50% + 165px), calc(100vw - clamp(236px, 27vw, 268px) - 16px)));
}
body:is(.duo-dock, .desk-dock) #score .score-head { margin-bottom: 8px; padding-bottom: 6px; }
body:is(.duo-dock, .desk-dock) #score ol { gap: 5px; }
body:is(.duo-dock, .desk-dock) #score li { padding: 4px 8px 5px; }
body:is(.duo-dock, .desk-dock) #score .foot { margin-top: 8px; padding-top: 8px; }
body:is(.duo-dock, .desk-dock) #score .total b { font-size: 36px; }
body:is(.duo-dock, .desk-dock) #score .rank { margin-top: 7px; padding: 7px 12px; }
body:is(.duo-dock, .desk-dock).score-collapsed #score,
body:is(.duo-dock, .desk-dock).picker-open #score {
  opacity: 0; transform: translateY(calc(-50% + 14px)) scale(.92); visibility: hidden; pointer-events: none;
  transition: top .36s cubic-bezier(.22,1.22,.36,1), left .32s ease, transform .24s cubic-bezier(.4,0,.2,1), opacity .18s ease, visibility 0s .24s;
}
body:is(.duo-dock, .desk-dock) #score-pill,
body:is(.duo-dock, .desk-dock).picker-side #score-pill,
body:is(.duo-dock, .desk-dock).shared:not(.score-top) #score-pill {
  top: calc(56px + var(--safe-top)); bottom: auto; left: auto; right: 16px;
  transform: translateY(-6px) scale(.9); transform-origin: top right;
}
body:is(.duo-dock, .desk-dock).score-collapsed #score-pill,
body:is(.duo-dock, .desk-dock).picker-open #score-pill,
body:is(.duo-dock, .desk-dock).shared:not(.score-top).score-collapsed #score-pill {
  opacity: 1; transform: translateY(0) scale(1); visibility: visible; pointer-events: auto;
  transition: transform .32s cubic-bezier(.22,1.28,.36,1) .06s, opacity .22s ease .06s, box-shadow .2s, border-color .2s, visibility 0s;
}
body:is(.duo-dock, .desk-dock) #score-pill:active,
body:is(.duo-dock, .desk-dock).shared:not(.score-top) #score-pill:active { transform: scale(.96); }
body:is(.duo-dock, .desk-dock) #score-pill svg { transform: rotate(180deg); }
body:is(.duo-dock, .desk-dock).daily.rolled.scored.score-collapsed :is(#account-hint, #recap-hint) { top: calc(100px + var(--safe-top)); }

/* Desktop & tall wide screens (body.desk-dock, when not right-docked): Customise / Stage menu opens UPWARD directly
   above the stationary bottom buttons (above Share in Daily, above Controls in narrow Free). */
body.desk-dock:not(.picker-side) #picker {
  bottom: calc(60px + var(--safe-bottom));
  transform: translate(-50%, 16px) scale(.97);
  transform-origin: bottom center;
  pointer-events: none;
}
body.desk-dock:not(.picker-side).daily.rolled #picker { bottom: calc(106px + var(--safe-bottom)); }
body.desk-dock:not(.picker-side) #picker.open,
body.desk-dock:not(.picker-side).daily.rolled #picker.open {
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}
body.desk-dock:not(.picker-side) #picker .panel { max-height: min(calc(100dvh - 180px), 52dvh); }

/* Short landscape screens under duo-dock where Customise opens from the bottom (no picker-side):
   open upward directly above the stationary single-row bottom dock so it never covers Share/Customise. */
body.duo-dock:not(.picker-side) #picker {
  bottom: calc(60px + var(--safe-bottom));
  transform: translate(-50%, 16px) scale(.97);
  transform-origin: bottom center;
  pointer-events: none;
}
body.duo-dock:not(.picker-side) #picker.open {
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}
body.duo-dock:not(.picker-side) #picker .panel { max-height: min(calc(100dvh - 122px - var(--safe-top) - var(--safe-bottom)), 58dvh); }

/* Unfolded iPhone Duo & compact landscape tablets (body.duo-dock): Customise docks on the right
   below the Score pill so short screens keep vertical headroom and bottom buttons stay still. */
body.duo-dock.picker-side #picker,
body.duo-dock.picker-side.daily #picker {
  width: clamp(296px, 34vw, 370px);
  top: calc(58px + var(--safe-top)); bottom: calc(64px + var(--safe-bottom));
}
body.duo-dock.picker-side.daily #picker { bottom: auto; }
body.duo-dock.picker-side.daily #picker .panel { max-height: calc(100dvh - 124px - var(--safe-top) - var(--safe-bottom)); }
body.duo-dock.picker-side.daily.rolled.scored #picker { top: calc(100px + var(--safe-top)); }
body.duo-dock.picker-side.daily.rolled.scored #picker .panel { max-height: calc(100dvh - 166px - var(--safe-top) - var(--safe-bottom)); }
body.duo-dock.picker-side.daily.rolled.scored #gallery { height: calc(100dvh - 166px - var(--safe-top) - var(--safe-bottom)); }
body.duo-dock.picker-side #picker-x { display: flex; }
body.duo-dock.picker-side #picker-close { display: none; }
/* Very short landscape screens (e.g. phones on their side): keep the side score card compact so it
   fits between the top bar and bottom dock without clipping. */
@media (max-height: 520px) {
  body.duo-dock #score { padding: 9px 11px 10px; width: 236px; max-height: calc(100dvh - 116px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; }
  body.duo-dock #score .score-head { margin-bottom: 6px; padding-bottom: 5px; }
  body.duo-dock #score ol { gap: 4px; }
  body.duo-dock #score li { padding: 3px 6px 4px; }
  body.duo-dock #score .why { font-size: 10.5px; }
  body.duo-dock #score .pts { font-size: 13px; }
  body.duo-dock #score .foot { margin-top: 6px; padding-top: 6px; }
  body.duo-dock #score .total b { font-size: 28px; }
  body.duo-dock #score .rank { margin-top: 6px; padding: 6px 10px; font-size: 12.5px; }
}
/* Half-folded book posture (Safari 27.1+ Viewport Segments): keep panels cleanly in the right
   segment so nothing straddles the hinge. */
@media (horizontal-viewport-segments: 2) {
  body.duo-dock #score,
  body.duo-dock.picker-side #score {
    left: calc(env(viewport-segment-left 1 0) + 16px); right: 16px; width: auto;
    max-width: calc(env(viewport-segment-width 1 0) - 32px);
  }
  body.duo-dock.picker-side #picker,
  body.duo-dock.picker-side.daily #picker {
    left: calc(env(viewport-segment-left 1 0) + 16px); right: 16px; width: auto;
    max-width: calc(env(viewport-segment-width 1 0) - 32px);
  }
}

/* The account (see docs/local-account-spec.md): a person button in the top-right row opens this
   browser's history of daily rolls, its stats, backups and Discord sync. A modal on desktop, a
   full-screen sheet on phones. Not on a shared roll's page. */
#account { display: flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; box-sizing: border-box; padding: 0; border: 1px solid var(--border);
           border-radius: 50%; cursor: pointer; background: var(--surface-hud); backdrop-filter: blur(var(--blur-hud)); box-shadow: 0 1px 6px var(--shade);
           transition: box-shadow .2s, transform .12s; }
#account:hover { box-shadow: 0 2px 10px var(--shade-hover); }
#account:active { transform: scale(.94); }
#account svg { width: 17px; height: 17px; stroke: var(--accent); }
#account.busy { cursor: progress; }
body.shared #account, body.golden #account, body.golden #account-hint { display: none !important; }
#account-hint { position: fixed; top: calc(58px + var(--safe-top)); right: 16px; z-index: 4; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 9px 14px;
                border-radius: 12px; background: var(--card); backdrop-filter: blur(8px); font-size: 13px; color: var(--soft);
                box-shadow: 0 3px 16px var(--shade), inset 0 0 0 2px rgba(224,85,154,.35); animation: score-in-top .4s cubic-bezier(.3,1.4,.5,1) both; }
#account-hint[hidden] { display: none; }
/* Tips pinned to a button (index.html's pinTip): left/top/bottom and --arrow are set as it moves. */
.tip { position: fixed; z-index: 31; max-width: min(260px, calc(100vw - 16px)); box-sizing: border-box; padding: 9px 14px; border: 0;
       border-radius: 12px; background: var(--card); backdrop-filter: blur(8px); font: inherit; font-size: 13px; color: var(--soft); text-align: left;
       cursor: pointer; box-shadow: 0 3px 16px var(--shade), inset 0 0 0 2px rgba(224,85,154,.55); animation: fade-in .6s ease both; }
.tip[hidden], body:is(.shared, .golden) #discord-tip { display: none; }
.tip b { color: var(--strong); }
.tip::after { content: ""; position: absolute; left: calc(var(--arrow, 50%) - 6px); width: 12px; height: 12px; background: inherit;
              box-shadow: inset 2px 2px 0 rgba(224,85,154,.55); }
.tip.up::after { bottom: -6px; transform: rotate(225deg); }
.tip.down::after { top: -6px; transform: rotate(45deg); }
#account-hint b { color: var(--strong); }
body.score-top.daily.rolled.scored.score-collapsed :is(#account-hint, #recap-hint) { top: calc(100px + var(--safe-top)); }
/* Both at once (the first roll on 31 Dec): the recap's under the account hint, not on it. */
:where(body:has(#account-hint:not([hidden]))) #recap-hint { margin-top: 48px; } /* :where: the stack's margin-top: 0 below wins */
/* Phones with the score card along the top: they drop into the pop-ups' stack above the bottom bar (#toasts). */
body.score-top.daily.rolled.scored:not(.score-collapsed) :is(#account-hint, #recap-hint) {
  position: relative; top: auto; right: auto; bottom: auto; margin-top: 0; transform: none;
  animation-name: fade-in;
}

/* Hung from the top rather than centred, so its tabs stay where they are whichever one's open. */
#account-panel { box-sizing: border-box; width: min(580px, calc(100vw - 32px)); max-height: min(88vh, 860px); margin-top: 6vh; padding: 0; border: 0;
                 border-radius: 20px; background: var(--bg); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.3), inset 0 0 0 2px rgba(224,85,154,.25);
                 font: 14px/1.4 system-ui, sans-serif; overflow: hidden; }
#account-panel[open] { display: flex; flex-direction: column; animation: score-in .35s cubic-bezier(.3,1.4,.5,1) both; }
#account-panel::backdrop { background: rgba(20,16,24,.45); backdrop-filter: blur(3px); animation: fade-in .3s ease both; }
/* Closing: it drops away and the backdrop fades, then the dialog really closes (closeAccount). */
#account-panel[open].closing { animation: panel-out .22s cubic-bezier(.5,0,.75,0) both; }
#account-panel.closing::backdrop { animation: fade-out .22s ease both; }
@keyframes panel-out { to { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes fade-out { to { opacity: 0; } }
#account-panel .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 22px; }
#account-panel h2 { margin: 0; font: 800 14px/1 system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--strong); }
#account-panel .close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0;
                        border-radius: 50%; background: none; cursor: pointer; }
#account-panel .close:hover { background: var(--shade); }
#account-panel .close svg { width: 18px; height: 18px; stroke: var(--label); }
#account-panel .body { overflow-y: auto; padding: 0 22px 24px; overscroll-behavior: contain; }
#account-panel section + section { margin-top: 22px; }
#account-panel h3 { margin: 0 0 10px; font: 600 11px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
#account-panel p { margin: 0; color: var(--soft); font-size: 13px; }
#account-panel .note { margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: var(--pill); font-size: 13px; color: var(--soft);
                       box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .note.pink { box-shadow: inset 0 0 0 2px rgba(224,85,154,.45); color: var(--text); }
#account-panel .note b { color: var(--strong); }
#account-panel [hidden] { display: none !important; }

/* Stat tiles: the current streak big across the top, the rest in threes under it. */
#account-panel .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#account-panel .tile { min-width: 0; padding: 12px 12px 11px; border-radius: 14px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .tile b { display: block; font: 700 23px/1.05 var(--display); font-variant-numeric: tabular-nums; color: var(--text);
                         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#account-panel .tile span { display: block; margin-top: 5px; font: 600 10.5px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
                            color: var(--label); }
#account-panel .tile small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#account-panel .tile b span.sc { display: inline-block; margin: 0; font: inherit; letter-spacing: 0; text-transform: none; } /* a score's colours (Average, Best roll) */
#account-panel .tile.streak { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 14px 18px; color: #fff;
                              background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 3px 14px rgba(214,61,134,.4); }
#account-panel .tile.streak b { font-size: 46px; color: #fff; }
#account-panel .tile.streak span { margin: 0; font-size: 12px; color: #fff; }
#account-panel .tile.streak small { color: rgba(255,255,255,.9); white-space: normal; }

/* Streak rewards: an "i" on the streak tile opens how they work; reroll tokens and the cushion
   get a tile each under it; a note says when the cushion has been used (or is covering yesterday). */
#account-panel .tile.streak { position: relative; }
#account-panel .streak-info { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
      background: rgba(255,255,255,.25); color: #fff; cursor: pointer; font: italic 700 14px/24px Georgia, serif; text-align: center; }
#account-panel .streak-info:hover, #account-panel .streak-info[aria-expanded="true"] { background: rgba(255,255,255,.4); }
#account-panel .streak-info:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
#account-panel .tiles .rewards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#account-panel .tile.reward b small { display: inline; margin: 0; font-size: .6em; color: var(--label); }
#account-panel .tile.reward.on { box-shadow: inset 0 0 0 2px rgba(224,85,154,.45); }
#account-panel .tile.reward.on b { color: var(--strong); }
#account-panel .streak-help { margin: 10px 0 0; }
#account-panel .streak-help ul { margin: 6px 0 0; padding-left: 18px; }
#account-panel .streak-help li + li { margin-top: 4px; }
#account-panel .cushion-note { margin-bottom: 10px; }

/* Your name: shown on rolls you share (the shared page's banner, and umadle.me's link embeds). */
#account-panel .name-row { display: flex; gap: 8px; }
#account-panel .name-row input { flex: 1; min-width: 0; height: 38px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--track);
      border-radius: 999px; background: var(--bg); color: var(--text); font: 15px system-ui, sans-serif; }
#account-panel .name-row input:focus-visible { outline: 2px solid #e0559a; outline-offset: 1px; border-color: transparent; }
#account-panel .name-row .btn { height: 38px; padding: 0 18px; }
#account-panel .name-msg { margin-top: 8px; }
#account-panel .name-msg:empty { display: none; }
#account-panel .name-msg b { color: var(--strong); }

/* Sync: a Sign in with Discord link (off to Discord and back, see sync.js), or who's signed in.
   A disabled button with "Coming soon" until ~/accounts/discord.json is on the server; on a copy
   of the site without sync.php it says so. */
#account-panel .signed-in { display: flex; align-items: center; gap: 10px; min-width: 0; }
#account-panel .signed-in svg { flex: none; width: 22px; height: 22px; color: #5865f2; }
#account-panel .signed-in div { min-width: 0; }
#account-panel .signed-in b { display: block; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .signed-in small { display: block; font-size: 12px; color: var(--soft); }
#account-panel .sync .buttons { margin-top: 12px; }
#account-panel .sync .msg:empty { display: none; }
#account-panel .sync-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
#account-panel .discord { display: flex; align-items: center; gap: 10px; height: 40px; box-sizing: border-box; padding: 0 18px 0 14px; border: 0;
                          border-radius: 999px; background: #5865f2; color: #fff; font: 600 14px/1 system-ui, sans-serif; text-decoration: none;
                          cursor: pointer; box-shadow: 0 2px 10px rgba(88,101,242,.35); transition: background .2s, box-shadow .2s; }
#account-panel a.discord:hover { background: #4752c4; box-shadow: 0 3px 14px rgba(88,101,242,.5); }
#account-panel a.discord:focus-visible { outline: 2px solid #5865f2; outline-offset: 2px; }
#account-panel .discord svg { width: 20px; height: 20px; }
#account-panel button.discord:disabled { background: var(--bg); color: var(--disabled); box-shadow: inset 0 0 0 1px var(--track); cursor: not-allowed; }
#account-panel button.discord:disabled svg { opacity: .55; }
#account-panel .soon { padding: 5px 10px; border-radius: 999px; background: var(--accent-pill); color: #fff;
                       font: 700 10.5px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
#account-panel .sync p { margin-top: 8px; }
#account-panel .sync p a, #changelog .privacy a { color: var(--strong); }

/* History: newest first, each row a link to that roll's share page. */
#account-panel ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
#account-panel ol a, #account-panel ol .row { display: grid; grid-template-columns: 44px 42px minmax(0, 1fr) auto; align-items: center; gap: 12px;
      padding: 9px 12px; border-radius: 12px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); color: inherit; text-decoration: none; }
#account-panel ol a:hover { box-shadow: inset 0 0 0 2px #e0559a; }
#account-panel ol a:focus-visible { outline: 2px solid #e0559a; outline-offset: 1px; }
#account-panel .date { font: 700 12px/1.15 system-ui, sans-serif; color: var(--label); text-align: center; text-transform: uppercase; letter-spacing: .04em; }
#account-panel .date b { display: block; font-size: 19px; color: var(--text); letter-spacing: 0; }
/* The outfit she was rolled in, head to toe (the picker's thumbnail). */
#account-panel .face { width: 42px; height: 56px; border-radius: 9px; overflow: hidden; background: var(--shade); }
#account-panel .face img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
#account-panel .face.none { display: flex; align-items: center; justify-content: center; font: 700 18px/1 system-ui, sans-serif; color: var(--label); }
#account-panel .what { min-width: 0; }
#account-panel .what > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .what b { font-weight: 600; color: var(--text); }
#account-panel .what span { font-size: 12.5px; color: var(--soft); }
#account-panel .what i { font-style: normal; font-size: 12px; color: var(--label); }
#account-panel .pts { text-align: right; white-space: nowrap; }
#account-panel .pts b { display: block; font: 700 21px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--strong); }
#account-panel .pts small { display: block; margin-top: 3px; font-size: 11px; color: var(--label); }
#account-panel .pts .was { color: var(--soft); }
#account-panel .empty { padding: 18px; border-radius: 12px; background: var(--pill); text-align: center; box-shadow: inset 0 0 0 1px var(--track); }

/* Backup and the danger zone. */
#account-panel .buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#account-panel .btn { display: flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px;
      cursor: pointer; background: var(--pill); box-shadow: 0 1px 6px var(--shade), inset 0 0 0 1px var(--track); color: var(--label);
      font: 600 12px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; transition: box-shadow .2s, transform .12s; }
#account-panel .btn:hover:not(:disabled) { box-shadow: 0 2px 10px var(--shade-hover), inset 0 0 0 1px var(--track); }
#account-panel .btn:active:not(:disabled) { transform: scale(.97); }
#account-panel .btn:disabled { color: var(--disabled); cursor: default; }
#account-panel .btn svg { width: 15px; height: 15px; stroke: var(--accent); }
#account-panel .btn.pink { color: #fff; background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 11px rgba(214,61,134,.42); }
#account-panel .btn.red { color: #fff; background: #d64545; box-shadow: 0 2px 10px rgba(214,69,69,.35); }
#account-panel .btn.danger { color: #d64545; }
#account-panel .btn.danger svg { stroke: #d64545; }
#account-panel .box { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel textarea { box-sizing: border-box; width: 100%; min-height: 76px; padding: 9px 11px; border: 1px solid var(--track); border-radius: 10px;
      background: var(--bg); color: var(--text); font: 12px/1.4 ui-monospace, monospace; resize: vertical; word-break: break-all; }
#account-panel textarea:focus-visible { outline: 2px solid #e0559a; outline-offset: 1px; }
#account-panel .msg { margin-top: 8px; font-size: 13px; color: var(--soft); }
#account-panel .msg.bad { color: #d64545; }
#account-panel .msg.good b { color: var(--strong); }
#account-panel .danger-zone { padding-top: 18px; border-top: 1px solid var(--track); }
#account-panel .install[hidden], #install-app[hidden] { display: none; }
#account-panel .install .btn svg { stroke: #fff; }

/* History as a month calendar (or the list): each rolled day coloured by how rare its score is,
   from grey (bottom 5%) through pinks to gold (top 5%) and rainbow (top 1%). Picking a day shows
   its roll under the month, with a link to watch it in full. */
#account-panel .history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#account-panel .history-head h3 { margin: 0; }
#account-panel .view-toggle { display: flex; height: 28px; border-radius: 999px; overflow: hidden; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .view-toggle button { padding: 0 12px; border: 0; background: none; cursor: pointer; color: var(--label);
      font: 600 11px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
#account-panel .view-toggle button[aria-pressed="true"] { color: #fff; background: var(--accent-pill); }
#account-panel .view-toggle button:focus-visible { outline: 2px solid #e0559a; outline-offset: -2px; }
#account-panel .calendar { padding: 12px; border-radius: 16px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
#account-panel .cal-step { display: flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0;
      border-radius: 50%; background: none; cursor: pointer; }
#account-panel .cal-step:hover:not(:disabled) { background: var(--shade); }
#account-panel .cal-step:disabled { cursor: default; opacity: .3; }
#account-panel .cal-step svg { width: 18px; height: 18px; stroke: #e0559a; }
#account-panel .cal-title { min-width: 0; text-align: center; }
#account-panel .cal-title b { display: block; font: 700 17px/1.2 var(--display); color: var(--text); }
#account-panel .cal-title small { display: block; margin-top: 2px; font-size: 12px; color: var(--soft); }
#account-panel .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
#account-panel .cal-grid .wd { padding-bottom: 4px; text-align: center; font: 600 10.5px/1 system-ui, sans-serif; letter-spacing: .06em;
      text-transform: uppercase; color: var(--label); }
#account-panel .cal-day { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 5 / 4; min-width: 0; padding: 0;
      border: 0; border-radius: 10px; background: none; font: 600 13px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--cal-empty); }
#account-panel .cal-day.today { box-shadow: inset 0 0 0 2px var(--track); }
#account-panel button.cal-day { cursor: pointer; color: var(--text); transition: transform .15s; }
#account-panel button.cal-day:hover { transform: scale(1.08); }
#account-panel button.cal-day:focus-visible { outline: 2px solid #e0559a; outline-offset: 2px; }
#account-panel button.cal-day[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 2px; z-index: 1; }
/* The six colours, shared by the days and the key under them. */
#account-panel :is(.cal-day, .cal-key li, .tag).r1 { --c: #b9b3c0; }
#account-panel :is(.cal-day, .cal-key li, .tag).r2 { --c: rgba(255,126,179,.28); }
#account-panel :is(.cal-day, .cal-key li, .tag).r3 { --c: rgba(255,126,179,.6); }
#account-panel :is(.cal-day, .cal-key li, .tag).r4 { --c: linear-gradient(135deg, #cc357d, #ad1e65); }
#account-panel :is(.cal-day, .cal-key li, .tag).r5 { --c: linear-gradient(135deg, #f6c445, #ffe9a3 45%, #f0a92b); }
#account-panel :is(.cal-day, .cal-key li, .tag).r6 { --c: linear-gradient(135deg, #c82342, #b35700, #8c6d00, #167a3b, #156ca3, #693cc9); }
:root[data-theme="dark"] #account-panel :is(.cal-day, .cal-key li, .tag).r3 { --c: rgba(255,126,179,.45); } /* light text on it: 4.9:1 */
#account-panel .cal-day:is(.r1, .r2, .r3, .r4, .r5, .r6) { background: var(--c); }
#account-panel .cal-day.r1 { color: #4b4553; }
#account-panel .cal-day:is(.r4, .r6) { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
#account-panel .cal-day.r5 { color: #4a3100; box-shadow: 0 2px 10px rgba(240,169,43,.45); }
#account-panel .cal-day.r6 { box-shadow: 0 2px 12px rgba(157,107,255,.45); background-size: 200% 200%; animation: cal-shine 3s ease-in-out infinite alternate; }
@keyframes cal-shine { to { background-position: 100% 100%; } }
html.reduce-motion #account-panel .cal-day.r6 { animation: none; }
#account-panel .cal-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin: 12px 0 0; padding: 0; list-style: none;
      font-size: 11px; color: var(--soft); }
#account-panel .cal-key li { display: flex; align-items: center; gap: 5px; }
#account-panel .cal-key li::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px var(--border); }
/* The picked day's roll: its outfit, the score, the song and dance, and Watch in full. */
#account-panel .cal-detail { margin-top: 12px; }
#account-panel .cal-detail .hint { padding: 10px; text-align: center; font-size: 12.5px; color: var(--label); }
#account-panel .cal-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px; border-radius: 14px;
      background: var(--bg); box-shadow: inset 0 0 0 1px var(--track); animation: score-in .3s cubic-bezier(.3,1.4,.5,1) both; }
#account-panel .cal-card .face { width: 96px; height: 128px; border-radius: 12px; }
#account-panel .cal-card .info { display: flex; flex-direction: column; min-width: 0; }
#account-panel .cal-card .when { font: 600 10.5px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#account-panel .cal-card .who { margin-top: 4px; font: 700 16px/1.2 system-ui, sans-serif; color: var(--text); }
#account-panel .cal-card .outfit { font-size: 12.5px; color: var(--soft); }
#account-panel .cal-card :is(.who, .outfit, .song, .dance) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .cal-card .score { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
#account-panel .cal-card .score b { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--strong); }
#account-panel .cal-card .score .of { font-size: 12px; color: var(--label); }
#account-panel .cal-card .score .tag { align-self: center; padding: 4px 8px; border-radius: 999px; background: var(--c, var(--track)); color: #fff;
      font: 700 11px/1 system-ui, sans-serif; }
#account-panel .cal-card .score .tag:is(.r1, .r2, .r3) { color: var(--text); }
#account-panel .cal-card .score .tag.r5 { color: #4a3100; }
#account-panel .cal-card .score .tag.r1 { color: #4b4553; }
#account-panel .cal-card .score .was { font-size: 11.5px; color: var(--soft); }
#account-panel .cal-card .song { margin-top: 8px; font-size: 13px; color: var(--text); }
#account-panel .cal-card .dance { font-size: 12px; color: var(--label); }
#account-panel .cal-card .buttons { margin-top: 10px; }
#account-panel .cal-card a.btn { text-decoration: none; }
#account-panel .cal-card .btn.pink svg { stroke: #fff; fill: #fff; width: 13px; height: 13px; }

#account-panel .cal-recap { margin-top: 6px; }

/* The monthly recap: on the 1st, a pill under the top-right buttons opens last month's; the
   calendar opens any past month's. Its dialog is the image itself (recap.js draws it) and ways to
   share it. */
#recap-hint { position: fixed; top: calc(58px + var(--safe-top)); right: 16px; z-index: 4; display: flex; align-items: center; max-width: calc(100vw - 32px);
              border-radius: 999px; background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 3px 16px rgba(214,61,134,.45);
              animation: score-in-top .4s cubic-bezier(.3,1.4,.5,1) both; }
#recap-hint[hidden], body:is(.shared, .golden) #recap-hint { display: none; }
#recap-hint button { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: #fff; cursor: pointer; }
#recap-hint .open { min-width: 0; padding: 9px 4px 9px 14px; font: 700 13px/1.2 system-ui, sans-serif; text-align: left; }
#recap-hint .open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#recap-hint .dismiss { padding: 9px 12px 9px 6px; }
#recap-hint svg { flex: none; width: 16px; height: 16px; stroke: #fff; }
#recap-hint .dismiss svg { width: 14px; height: 14px; opacity: .85; }
#recap-hint button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; border-radius: 999px; }
#recap-panel { box-sizing: border-box; width: min(480px, calc(100vw - 32px)); max-height: 94dvh; padding: 0; border: 0; border-radius: 20px;
               background: var(--bg); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.3), inset 0 0 0 2px rgba(224,85,154,.25);
               font: 14px/1.4 system-ui, sans-serif; overflow: hidden; }
#recap-panel[open] { display: flex; flex-direction: column; animation: score-in .35s cubic-bezier(.3,1.4,.5,1) both; }
#recap-panel::backdrop { background: rgba(20,16,24,.5); backdrop-filter: blur(3px); animation: fade-in .3s ease both; }
#recap-panel .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 20px; }
#recap-panel h2 { margin: 0; font: 800 14px/1.2 system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--strong); }
#recap-panel .close { display: flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0;
                      border-radius: 50%; background: none; cursor: pointer; }
#recap-panel .close:hover { background: var(--shade); }
#recap-panel .close svg { width: 18px; height: 18px; stroke: var(--label); }
#recap-panel .body { display: flex; flex-direction: column; align-items: center; min-height: 0; overflow-y: auto; padding: 0 20px 20px; }
#recap-panel img { display: block; width: 100%; max-height: calc(94dvh - 160px); object-fit: contain; border-radius: 14px; }
#recap-panel .buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
#recap-panel .btn { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
      background: var(--pill); box-shadow: 0 1px 6px var(--shade), inset 0 0 0 1px var(--track); color: var(--label);
      font: 600 12px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
#recap-panel .btn[hidden] { display: none; }
#recap-panel .btn svg { width: 15px; height: 15px; stroke: #e0559a; }
#recap-panel .btn.pink { color: #fff; background: var(--accent-pill); text-shadow: 0 1px 2px rgba(120,18,66,.22); box-shadow: 0 2px 11px rgba(224,85,154,.42); }
#recap-panel .btn.pink svg { stroke: #fff; }
#recap-panel .msg { margin: 8px 0 0; font-size: 13px; color: var(--soft); }
#recap-panel .msg:empty { display: none; }
@media (max-width: 560px) {
  #recap-panel { width: calc(100vw - 16px); }
  #recap-panel .body { padding: 0 12px 14px; }
}

/* Collection: every uma (with her outfits), song, dance, badge and special (signatures & fakeouts). */
#account-panel .coll-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
#account-panel .coll-kinds button { flex: 1 1 150px; display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 12px 14px 11px; border: 0;
      border-radius: 14px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); cursor: pointer; text-align: left; color: var(--text);
      transition: box-shadow .2s; }
#account-panel .coll-kinds button:hover { box-shadow: inset 0 0 0 1px #e0559a; }
#account-panel .coll-kinds button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #e0559a, 0 3px 12px rgba(224,85,154,.2); }
#account-panel .coll-kinds button:focus-visible { outline: 2px solid #e0559a; outline-offset: 2px; }
#account-panel .coll-kinds span { font: 600 10.5px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#account-panel .coll-kinds b { margin-top: 5px; font: 700 23px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
#account-panel .coll-kinds b small { font-size: .6em; font-weight: 700; color: var(--label); }
#account-panel .coll-kinds i { display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--track); overflow: hidden; }
#account-panel .coll-kinds i s { display: block; width: var(--p, 0%); height: 100%; border-radius: 3px; background: var(--accent-grad); }
#account-panel .coll-kinds .sub { margin-top: 5px; font-size: 11.5px; line-height: 1.3; color: var(--soft); }
#account-panel .coll-bar { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
#account-panel .coll-note { font-size: 12px; }
#account-panel .coll-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
#account-panel .coll-search { flex: 1 1 180px; min-width: 0; height: 32px; box-sizing: border-box; padding: 0 13px; border: 1px solid var(--track);
      border-radius: 999px; background: var(--bg); color: var(--text); font: 13px system-ui, sans-serif; }
#account-panel .coll-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
#account-panel .coll-list { display: flex; flex-direction: column; gap: 6px; }
#account-panel .coll-list .empty p { margin: 0; }
#account-panel .locked { filter: grayscale(1); opacity: .4; }
#account-panel .coll-list .count { flex: none; padding: 4px 8px; border-radius: 999px; background: rgba(224,85,154,.12); color: var(--strong);
      font: 700 11.5px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* An uma: her face, name and outfits rolled, then every outfit of hers. */
#account-panel .coll-chara { padding: 10px 12px 12px; border-radius: 12px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .coll-chara .top { display: flex; align-items: center; gap: 12px; }
#account-panel .coll-chara .top img { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--shade); }
#account-panel .coll-chara .top div { flex: 1; min-width: 0; }
#account-panel .coll-chara .top b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
#account-panel .coll-chara.none .top b { color: var(--soft); }
#account-panel .coll-chara .top small { display: block; font-size: 12px; color: var(--soft); }
#account-panel .coll-chara .outfits { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
#account-panel .coll-chara .outfit-slot { padding: 0; border: 0; background: none; border-radius: 7px; cursor: pointer; transition: transform .15s; }
#account-panel .coll-chara .outfit-slot:hover { transform: scale(1.12); }
#account-panel .coll-chara .outfit-slot[aria-expanded="true"] img { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(224,85,154,.25); }
#account-panel .coll-chara .outfits img { display: block; width: 33px; height: 44px; border-radius: 7px; object-fit: cover; object-position: top;
      background: var(--shade); }
#account-panel .coll-chara .outfits img:not(.locked) { box-shadow: 0 0 0 2px #ff7eb3; }
@media (min-width: 561px) { /* her outfits beside her name, with any opened drawer neatly spanning full width underneath */
  #account-panel .coll-chara { padding: 8px 12px; }
  #account-panel .coll-chara .chara-main { display: flex; align-items: center; gap: 14px; }
  #account-panel .coll-chara .top { flex: 0 0 196px; min-width: 0; }
  #account-panel .coll-chara .outfits { flex: 1; min-width: 0; margin-top: 0; }
}
/* Interactive Collection drawer: roll dates + Free mode jump + song preview. */
#account-panel .coll-drawer { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg);
      box-shadow: inset 0 0 0 1px var(--track); animation: pane-in .18s ease both; }
#account-panel .coll-drawer .drawer-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
#account-panel .coll-drawer .drawer-head b { font-size: 13px; color: var(--text); min-width: 0; }
#account-panel .coll-drawer .drawer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#account-panel .coll-drawer .btn { height: 30px; padding: 0 12px; font-size: 11px; text-decoration: none; }
#account-panel .coll-drawer .preview-btn.playing { background: rgba(224,85,154,.14); color: var(--strong); box-shadow: inset 0 0 0 1px var(--accent); }
#account-panel .coll-drawer .drawer-days { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--track); }
#account-panel .coll-drawer .drawer-days small { font: 600 10.5px/1 system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--label); margin-right: 3px; }
#account-panel .coll-drawer .day-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--pill);
      box-shadow: inset 0 0 0 1px var(--track); color: var(--strong); font: 600 11px/1.2 system-ui, sans-serif; text-decoration: none; transition: box-shadow .16s; }
#account-panel .coll-drawer .day-chip:hover { box-shadow: inset 0 0 0 1px var(--accent); }
#account-panel .coll-song-wrap { display: flex; flex-direction: column; }
#account-panel .coll-song.unlocked { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; transition: box-shadow .16s; }
#account-panel .coll-song.unlocked:hover, #account-panel .coll-song.unlocked[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
#account-panel .coll-dance.unlocked { width: 100%; border: 0; font: inherit; text-align: center; cursor: pointer; transition: box-shadow .16s, transform .14s; }
#account-panel .coll-dance.unlocked:hover { box-shadow: inset 0 0 0 1.5px var(--accent); transform: translateY(-2px); }
#account-panel .coll-dance.unlocked[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
#account-panel .coll-dances .coll-drawer { grid-column: 1 / -1; margin-top: 0; }
/* Collection > Specials: Signature rolls & Reel fakeouts. */
#account-panel .coll-special-sec { margin-top: 4px; }
#account-panel .coll-special-sec + .coll-special-sec { margin-top: 16px; }
#account-panel .coll-special-sec h4 { margin: 0 0 8px; font: 700 11.5px/1.2 system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--label); }
#account-panel .coll-specials { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 7px; }
#account-panel .coll-spec { display: flex; align-items: center; gap: 10px; padding: 8px 11px 8px 8px; border-radius: 12px; color: inherit; text-decoration: none;
      background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); transition: box-shadow .16s; }
#account-panel a.coll-spec:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
#account-panel .coll-spec img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--shade); }
#account-panel .coll-spec > div { flex: 1; min-width: 0; }
#account-panel .coll-spec b { display: block; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .coll-spec small { display: block; font-size: 11.5px; color: var(--soft); }
#account-panel .coll-spec.locked { filter: none; opacity: 1; }
#account-panel .coll-spec.locked img { filter: grayscale(1); opacity: .4; }
#account-panel .coll-spec.locked b { color: var(--soft); }
#account-panel .coll-fakeouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 6px; }
#account-panel .coll-fk { display: flex; flex-direction: column; gap: 2px; padding: 8px 11px; border-radius: 11px;
      background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); min-width: 0; }
#account-panel .coll-fk b { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .coll-fk small { font-size: 10.5px; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .coll-fk.locked { filter: none; opacity: .58; }
#account-panel .coll-fk.locked b { color: var(--label); letter-spacing: .16em; }
/* A badge (badges.js): a rosette in its group's colour, what earns it, and the day it was earned
   or how close you are. Not earned yet: grey, with a progress bar where it takes more than one. */
#account-panel .coll-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
#account-panel .coll-badge { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; padding: 9px 12px 9px 9px;
      border-radius: 12px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .coll-badge svg { width: 40px; height: 40px; }
:is(#account-panel .coll-badge, #badge-toast) svg .disc { fill: var(--c); }
:is(#account-panel .coll-badge, #badge-toast) svg .ribbon { fill: var(--c); opacity: .7; }
:is(#account-panel .coll-badge, #badge-toast) svg .ring { fill: none; stroke: #fff; stroke-width: 1.6; opacity: .75; }
:is(#account-panel .coll-badge, #badge-toast) svg .star { fill: #fff; }
#account-panel .coll-badge.locked { filter: none; opacity: 1; }
#account-panel .coll-badge.locked svg { filter: grayscale(1); opacity: .35; }
#account-panel .coll-badge div { min-width: 0; }
#account-panel .coll-badge :is(b, span, small) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .coll-badge b { font-weight: 600; color: var(--text); }
#account-panel .coll-badge.locked b { color: var(--soft); }
#account-panel .coll-badge span { font-size: 12px; color: var(--soft); }
#account-panel .coll-badge small { margin-top: 2px; font-size: 11px; color: var(--label); font-variant-numeric: tabular-nums; }
#account-panel .coll-badge i { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--track); overflow: hidden; }
#account-panel .coll-badge i s { display: block; width: var(--p, 0%); height: 100%; background: var(--c); }
/* Badge rarity (panel.js's rarityText): how many players have it, in the badge's colour. */
#account-panel .coll-badge em.rarity { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                                       font-size: 10.5px; font-style: normal; font-weight: 600; color: color-mix(in srgb, var(--c) 78%, var(--text)); }
#account-panel .coll-badge.locked em.rarity { color: var(--label); font-weight: 500; }
/* The pop-ups' one slot (index.html #toasts): what a roll brings up (a badge, what it collected, the
   account and recap hints, Christmas's present, the share video's progress) fires within a second
   or two, so they stack upwards from just above the bottom bar rather than landing on each other.
   It has no transform, so what's pinned elsewhere on desktop (the hints top right, the collection
   cards down the left) still is. Hidden ones take no room. */
#toasts { position: fixed; left: 16px; right: calc(16px + var(--picker-side, 0px)); z-index: 30;
          bottom: calc(106px + var(--who-room, 0px) + var(--picker-room, 0px) + var(--safe-bottom));
          display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
          transition: bottom .3s cubic-bezier(.3,1.2,.5,1), right .3s cubic-bezier(.3,1.2,.5,1); }
body.daily.rolled #toasts { bottom: calc(156px + var(--who-room, 0px) + var(--picker-room, 0px) + var(--safe-bottom)); }
#toasts > :not(#collected) { pointer-events: auto; }
:where(#toasts > *) { max-width: 100%; } /* in the stack; the hints keep their own when they're pinned top right */
/* The share video's progress (index.html shareStatusSay): just words and a filling bar, and taps go
   through it to the stage. */
#toasts > #share-status { pointer-events: none; }
#share-status { position: relative; display: flex; align-items: center; box-sizing: border-box; height: 32px; padding: 0 15px; overflow: hidden;
                border-radius: 999px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); color: var(--text);
                box-shadow: inset 0 0 0 1.5px var(--border-accent-hover), 0 4px 16px var(--shade);
                font: 600 12.5px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; animation: fade-in .25s ease both; }
#share-status[hidden] { display: none; }
#share-status .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; } /* not 1: it'd clip the g's */
#share-status .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--prep-pct, 0%); border-radius: 0 3px 3px 0;
                     background: var(--accent-grad); transition: width .3s ease-out; }
#share-status:not(.going) .bar { display: none; }
/* A badge just earned: a pill above the bottom bar for a few seconds, which opens the badges. */
#badge-toast { position: relative; z-index: 1;
      display: flex; align-items: center; gap: 10px; max-width: 100%; box-sizing: border-box;
      padding: 8px 16px 8px 8px; border: 0; border-radius: 999px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); color: var(--text); cursor: pointer;
      box-shadow: inset 0 0 0 2px var(--accent), 0 6px 24px rgba(224,85,154,.3); font: 600 13px/1.25 system-ui, sans-serif; text-align: left;
      visibility: visible; transition: opacity .3s, transform .3s, visibility 0s; }
/* Hidden, it fades where it was, out of the stack's flow (and out of tab order). */
#badge-toast[hidden] { display: flex; position: absolute; bottom: 0; opacity: 0; transform: translateY(16px); pointer-events: none; visibility: hidden; transition: opacity .3s, transform .3s, visibility 0s .3s; }
#badge-toast svg { flex: none; width: 30px; height: 30px; }
#badge-toast span { min-width: 0; }
#badge-toast :is(b, small) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#badge-toast small { font-weight: 500; font-size: 11.5px; color: var(--soft); }
html.reduce-motion #badge-toast { transition: none; }
/* A song: its cover, title and artist, or ??? until it's rolled. */
#account-panel .coll-song { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 12px 7px 7px;
      border-radius: 12px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .coll-song .cover { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px;
      overflow: hidden; background: var(--shade); font: 800 17px/1 system-ui, sans-serif; color: var(--label); }
#account-panel .coll-song .cover img { width: 100%; height: 100%; object-fit: cover; }
#account-panel .coll-song div:not(.cover) { min-width: 0; }
#account-panel .coll-song :is(b, span) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .coll-song b { font-weight: 600; color: var(--text); }
#account-panel .coll-song span { font-size: 12px; color: var(--soft); }
#account-panel .coll-song.locked { filter: none; opacity: 1; }
#account-panel .coll-song.locked b { letter-spacing: .25em; color: var(--label); }
#account-panel .coll-song.locked .cover { opacity: .6; }
/* Dances: a grid of their pictures. */
#account-panel .coll-dances { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#account-panel .coll-dance { position: relative; min-width: 0; padding: 6px 6px 8px; border-radius: 12px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .coll-dance img { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--shade); }
#account-panel .coll-dance b { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
      font: 600 12px/1.2 system-ui, sans-serif; color: var(--text); }
#account-panel .coll-dance.none b { color: var(--label); }
#account-panel .coll-dance .count { position: absolute; top: 10px; right: 10px; background: var(--accent-deep); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }

/* Four tabs in the panel's head: You, Friends, Collection, and Settings. */
#account-panel .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#account-panel .tabs { position: relative; display: flex; gap: 4px; min-width: 0; margin-left: -10px; }
#account-panel [role="tab"] { position: relative; padding: 9px 10px 11px; border: 0; border-radius: 10px; background: none; cursor: pointer;
      font: 800 13.5px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--label); white-space: nowrap; transition: color .2s; }
#account-panel [role="tab"]:hover { color: var(--strong); }
#account-panel [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#account-panel [role="tab"][aria-selected="true"] { color: var(--strong); }
#account-panel .tabs:not(.has-glide) [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 3px;
      border-radius: 2px; background: var(--accent-grad); }
#account-panel .pane { animation: pane-in .22s ease both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } }
#account-panel [role="tab"] .count { display: inline-block; min-width: 8px; margin-left: 5px; padding: 3px 5px; border-radius: 999px; vertical-align: 1px;
      background: var(--accent-pill); color: #fff; font-size: 10.5px; letter-spacing: 0; text-align: center; }

/* Today's rarest roll: one big row, a link to watch it. */
#account-panel .board-card .row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px;
      padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--pill); color: inherit; text-decoration: none;
      box-shadow: inset 0 0 0 2px rgba(224,85,154,.45); transition: box-shadow .2s; }
#account-panel .board-card a.row:hover { box-shadow: inset 0 0 0 2px #e0559a, 0 3px 14px rgba(224,85,154,.25); }
#account-panel .board-card a.row:focus-visible { outline: 2px solid #e0559a; outline-offset: 1px; }
#account-panel .board-card .face { width: 56px; height: 74px; border-radius: 11px; }
#account-panel .board-card .what b { font-size: 15px; }
#account-panel .board-card .what .by { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--strong); }
#account-panel .board-card .pts b { font-size: 28px; }
#account-panel .board-card .pts small { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 999px; color: #fff;
      background: var(--accent-pill); font: 700 11px/1 system-ui, sans-serif; }
#account-panel .board-card .row.cursed { box-shadow: inset 0 0 0 2px rgba(138,146,162,.5); }
#account-panel .board-card a.row.cursed:hover { box-shadow: inset 0 0 0 2px #7a8291, 0 3px 14px rgba(100,108,124,.22); }
#account-panel .board-card .row.cursed .pts small { background: linear-gradient(90deg, #7d8597, #5b6374); }
#account-panel .board-foot { margin-top: 8px; font-size: 12px; color: var(--label); }
/* Recent days' board archive & friend period leaderboard. */
#account-panel .board-history details { border-radius: 14px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); overflow: hidden; }
#account-panel .board-history summary { padding: 10px 14px; cursor: pointer; font: 700 12px/1.2 system-ui, sans-serif; letter-spacing: .06em;
      text-transform: uppercase; color: var(--strong); list-style: none; display: flex; align-items: center; justify-content: space-between; }
#account-panel .board-history summary::-webkit-details-marker { display: none; }
#account-panel .board-history summary::after { content: "▾"; font-size: 14px; color: var(--label); transition: transform .2s; }
#account-panel .board-history details[open] summary::after { transform: rotate(180deg); }
#account-panel .board-archive { margin: 0; padding: 0 12px 12px; list-style: none; display: flex; flex-direction: column; gap: 8px; }
#account-panel .archive-day { padding: 9px 11px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .archive-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
#account-panel .archive-head b { font-size: 12.5px; color: var(--text); }
#account-panel .archive-head small { font-size: 11px; color: var(--label); }
#account-panel .archive-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px; }
#account-panel .archive-pick { display: grid; grid-template-columns: auto 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px;
      border-radius: 10px; background: var(--pill); color: var(--text); text-decoration: none; font-size: 12px;
      box-shadow: inset 0 0 0 1px var(--track); transition: box-shadow .16s; }
#account-panel a.archive-pick:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
#account-panel .archive-pick .tag { padding: 2px 6px; border-radius: 999px; font: 700 9.5px/1.2 system-ui, sans-serif;
      text-transform: uppercase; letter-spacing: .04em; background: rgba(224,85,154,.14); color: var(--strong); white-space: nowrap; }
#account-panel .archive-pick.cursed .tag { background: rgba(122,130,145,.18); color: var(--soft); }
#account-panel .archive-pick .face { width: 28px; height: 36px; border-radius: 6px; }
#account-panel .archive-pick .info { min-width: 0; }
#account-panel .archive-pick .info :is(b, small) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .archive-pick .info b { font-size: 12.5px; color: var(--text); }
#account-panel .archive-pick .info small { font-size: 11px; color: var(--soft); }
#account-panel .archive-pick .pts { font: 700 16px/1 var(--display); font-variant-numeric: tabular-nums; }
#account-panel .friend-period { margin: 8px 0 10px; width: fit-content; }
#account-panel .friend-list .rank-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
#account-panel .friend-list .rank-num { text-align: center; }
#account-panel .friend-list .rank-num b { font: 800 16px/1 var(--display); color: var(--strong); }
#account-panel .friend-list .rank-num span { font-size: 10.5px; color: var(--soft); white-space: nowrap; }
/* All-time breakdown (score distribution, highlights, yearly recap cards) & Daily reminder. */
#account-panel .alltime .dist { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--pill);
      box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .alltime .dist-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 74px; align-items: center; gap: 10px; font-size: 12px; }
#account-panel .alltime .dist-row .lbl { color: var(--soft); font-weight: 600; white-space: nowrap; }
#account-panel .alltime .dist-row i { display: block; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
#account-panel .alltime .dist-row i s { display: block; height: 100%; border-radius: 999px; min-width: 0; }
#account-panel .alltime .dist-row .r1 { background: #b9b3c0; }
#account-panel .alltime .dist-row .r2 { background: rgba(255,126,179,.45); }
#account-panel .alltime .dist-row .r3 { background: rgba(255,126,179,.78); }
#account-panel .alltime .dist-row .r4 { background: linear-gradient(90deg, #ff7eb3, #e0559a); }
#account-panel .alltime .dist-row .r5 { background: linear-gradient(90deg, #f6c445, #f0a92b); }
#account-panel .alltime .dist-row .r6 { background: linear-gradient(90deg, #ff4d6d, #ffa53b, #4dd77a, #4dc3ff, #9d6bff); }
#account-panel .alltime .dist-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-size: 12px; white-space: nowrap; }
#account-panel .alltime .highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
@media (max-width: 560px) { #account-panel .alltime .highlights { grid-template-columns: 1fr; } }
#account-panel .alltime .hl-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--pill);
      box-shadow: inset 0 0 0 1px var(--track); color: inherit; text-decoration: none; min-width: 0; transition: box-shadow .16s; }
#account-panel .alltime a.hl-tile:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
#account-panel .alltime .hl-tile span { font: 600 10.5px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#account-panel .alltime .hl-tile b { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .alltime .hl-tile small { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .alltime .year-recaps { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
#account-panel .alltime .year-recaps[hidden] { display: none; }
#account-panel .alltime .recap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#account-panel .alltime .prev-months-btn { height: 32px; padding: 0 12px; font-size: 11.5px; gap: 5px; }
#account-panel .alltime .prev-months-btn svg { width: 13px; height: 13px; transition: transform .2s; }
#account-panel .alltime .prev-months-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
#account-panel .alltime .prev-months { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 12px;
      background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); animation: pane-in .18s ease both; }
#account-panel .alltime .prev-months[hidden] { display: none; }
#account-panel .alltime .month-chip { padding: 5px 11px; border: 0; border-radius: 999px; cursor: pointer;
      background: var(--bg); box-shadow: inset 0 0 0 1px var(--track); color: var(--strong);
      font: 600 11.5px/1.2 system-ui, sans-serif; transition: box-shadow .16s, background .16s; }
#account-panel .alltime .month-chip:hover { box-shadow: inset 0 0 0 1.5px var(--accent); background: rgba(224,85,154,.08); }
/* Today's rarest roll podium: neat 1st / 2nd / 3rd cards with graduated pedestals. */
#account-panel .podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; }
#account-panel .podium.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 390px; margin: 0 auto; }
#account-panel .podium-slot { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit;
      transition: transform .18s cubic-bezier(.22,1.25,.36,1); }
#account-panel a.podium-slot:hover { transform: translateY(-3px); }
#account-panel .podium-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
      padding: 10px 8px 9px; border-radius: 14px 14px 4px 4px; background: var(--pill); box-shadow: inset 0 0 0 1.5px var(--track); }
#account-panel .podium-slot.p1 .podium-card { padding: 12px 9px 10px; box-shadow: inset 0 0 0 2px rgba(240,169,43,.65), 0 4px 16px rgba(240,169,43,.16); }
#account-panel .podium-slot.p2 .podium-card { box-shadow: inset 0 0 0 1.5px rgba(154,163,178,.55); }
#account-panel .podium-slot.p3 .podium-card { box-shadow: inset 0 0 0 1.5px rgba(205,127,50,.48); }
#account-panel .podium-card .medal { padding: 2px 8px; border-radius: 999px; font: 800 10px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; }
#account-panel .podium-slot.p1 .medal { background: linear-gradient(135deg, #f6c445, #f0a92b); color: #5c3d00; }
#account-panel .podium-slot.p2 .medal { background: linear-gradient(135deg, #d7dce4, #aeb6c4); color: #363c48; }
#account-panel .podium-slot.p3 .medal { background: linear-gradient(135deg, #e0a572, #b9723c); color: #fff; }
#account-panel .podium-card .face { width: 48px; height: 64px; border-radius: 10px; margin-top: 2px; }
#account-panel .podium-slot.p1 .podium-card .face { width: 58px; height: 76px; border-radius: 11px; }
#account-panel .podium-card .pts { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; }
#account-panel .podium-slot.p1 .podium-card .pts { font-size: 26px; }
#account-panel .podium-card .tag { padding: 2px 7px; border-radius: 999px; background: var(--accent-pill); color: #fff;
      font: 700 9.5px/1.2 system-ui, sans-serif; }
#account-panel .podium-card .uma { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      font: 700 12.5px/1.2 system-ui, sans-serif; color: var(--text); margin-top: 2px; }
#account-panel .podium-card .by { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      font: 600 11px/1.2 system-ui, sans-serif; color: var(--strong); }
#account-panel .podium-slot .pedestal { display: flex; align-items: center; justify-content: center; border-radius: 0 0 10px 10px;
      font: 800 12px/1 var(--display); color: rgba(255,255,255,.92); text-shadow: 0 1px 2px rgba(0,0,0,.2); }
#account-panel .podium-slot.p1 .pedestal { height: 28px; background: linear-gradient(180deg, #f6c445, #e69d20); color: #5c3d00; text-shadow: none; }
#account-panel .podium-slot.p2 .pedestal { height: 20px; background: linear-gradient(180deg, #c6ccd6, #9ea7b8); color: #2f3542; text-shadow: none; }
#account-panel .podium-slot.p3 .pedestal { height: 14px; background: linear-gradient(180deg, #d79660, #b36b35); }
#account-panel.show-top100 { width: min(760px, calc(100vw - 32px)); max-height: min(88dvh, 920px); }
#account-panel .top100-podium .count-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
#account-panel .top100-podium .count-1 .p1, #account-panel .top100-podium .count-2 .p1 { grid-area: 1 / 2; }
#account-panel .top100-podium .count-2 .p2 { grid-area: 1 / 1; }
#account-panel .top100-podium .podium-card { min-height: 170px; justify-content: center; }
#account-panel .top100-podium .p1 .podium-card { min-height: 190px; }
#account-panel .top100-podium .face, #account-panel .top100-podium .podium-slot.p1 .face { aspect-ratio: 1; height: auto; }
#account-panel .top100-outfit { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); font-size: 11px; }
#account-panel .top100-list { margin-top: 14px; }
#account-panel .top100-list .row { grid-template-columns: 34px 36px minmax(0, 1fr) auto; gap: 8px; padding: 7px 10px; }
#account-panel .top100-list .face { width: 36px; height: 36px; }
#account-panel .top100-list .pts b { font-size: 17px; }
@media (max-width: 560px) {
  #account-panel.show-top100 { width: 100vw; max-height: 100dvh; }
  #account-panel .tabs { flex-wrap: wrap; }
  #account-panel .tabs [role="tab"] { padding-inline: 5px; font-size: 11px; }
  #account-panel .tabs > .glide { display: none; }
  #account-panel .tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; inset: auto 5px 2px; height: 3px; border-radius: 2px; background: var(--accent-grad); }
  #account-panel .close { flex: 0 0 32px; }
}
@media (max-width: 460px) {
  #account-panel .podium { gap: 5px; }
  #account-panel .podium-card { padding: 8px 5px 7px; }
  #account-panel .podium-card .face { width: 40px; height: 54px; }
  #account-panel .podium-slot.p1 .podium-card .face { width: 48px; height: 64px; }
  #account-panel .podium-card .pts { font-size: 19px; }
  #account-panel .podium-slot.p1 .podium-card .pts { font-size: 22px; }
}
#account-panel .reminder-row { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
#account-panel .reminder-lead { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
#account-panel #reminder-hours, #account-panel #lang-pick { height: 32px; padding: 0 26px 0 10px; border: 1px solid var(--track); border-radius: 10px; background: var(--bg);
      color: var(--text); font: 13px system-ui, sans-serif; cursor: pointer; }
#account-panel #lang-pick { min-width: 160px; }
/* Settings > Motion & flashes switch and Friends/Daily board toggle. */
#account-panel .switch { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; box-sizing: border-box;
      padding: 6px 8px 6px 14px; border: 1px solid var(--track); border-radius: 12px; background: var(--bg); color: var(--text);
      font: 600 13px/1.3 system-ui, sans-serif; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
#account-panel .switch:hover { border-color: var(--border-accent-hover); }
#account-panel .switch .track { flex: none; position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--track); transition: background .25s; }
#account-panel .switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff;
      box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .25s cubic-bezier(.3,1.55,.55,1); }
#account-panel .switch[aria-checked="true"] { color: var(--strong); border-color: rgba(224,85,154,.4); background: rgba(224,85,154,.06); }
:root[data-theme="dark"] #account-panel .switch[aria-checked="true"] { background: rgba(224,85,154,.14); }
#account-panel .switch[aria-checked="true"] .track { background: var(--accent-pill); }
#account-panel .switch[aria-checked="true"] .knob { transform: translateX(16px); }
#account-panel .motion-note { margin-top: 8px; font-size: 12px; color: var(--soft); }
#pane-friends > section:not([hidden]) ~ section:not([hidden]), #pane-top100 > .board:not([hidden]) { margin-top: 22px; }
#pane-top100 .top100-list .by { color: var(--strong); }
/* Your own roll in the Top 100 */
#pane-top100 .top100-list .row.mine { background: color-mix(in srgb, var(--accent) 9%, transparent); border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
#pane-top100 .top100-list .row.mine .by { color: var(--accent-deep); font-weight: 700; }
#account-panel .reminder-msg { margin-top: 8px; font-size: 12px; color: var(--soft); }

/* Friends: you and them, today's rollers first by score, then by streak. The left column is the
   streak (where history rows have the date). Edit shows a remove button on each. */
#account-panel .friends-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#account-panel .link { padding: 0; border: 0; background: none; cursor: pointer; color: var(--strong); font: 600 12px/1 system-ui, sans-serif; }
#account-panel .link:hover { text-decoration: underline; }
#account-panel .friend-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Reactions under a friend's roll today: a chip per emoji, yours lit; under yours, who reacted. */
#account-panel .reacts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 5px; margin: -2px 0 4px 52px; }
#account-panel .react { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 0; border-radius: 999px;
      background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); color: var(--soft); font: 600 11.5px/1 system-ui, sans-serif; }
#account-panel button.react { cursor: pointer; transition: transform .12s, box-shadow .12s; }
#account-panel button.react i { font-style: normal; font-size: 14px; filter: grayscale(.85); opacity: .55; transition: filter .12s, opacity .12s; }
#account-panel button.react:hover:not(:disabled) { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--accent); }
#account-panel button.react:hover i, #account-panel .react.some i, #account-panel .react.on i { filter: none; opacity: 1; }
#account-panel button.react:active:not(:disabled) { transform: scale(.92); }
#account-panel .react.on { box-shadow: inset 0 0 0 2px var(--accent); color: var(--strong); }
#account-panel .react i { font-style: normal; font-size: 14px; }
#account-panel .react b { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-panel .reacts.got .react { cursor: default; }
#account-panel .friend-list li > .row { flex: 1; min-width: 0; }
#account-panel .friend-list li.me > .row { box-shadow: inset 0 0 0 2px rgba(224,85,154,.45); }
#account-panel .friend-list a.row:hover { box-shadow: inset 0 0 0 2px #e0559a; }
#account-panel .streak b { font-size: 19px; }
#account-panel .streak svg { display: block; width: 14px; height: 14px; margin: 3px auto 0; fill: #ff7eb3; }
#account-panel .streak.cold svg { fill: var(--track); }
#account-panel .friend-list .what span.none { font-style: italic; }
#account-panel .remove { display: none; flex: none; align-items: center; justify-content: center; height: 34px; min-width: 34px; padding: 0 10px;
      border: 0; border-radius: 999px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); cursor: pointer; color: #d64545;
      font: 600 12px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
#account-panel .remove svg { width: 15px; height: 15px; stroke: #d64545; }
#account-panel .remove.sure { color: #fff; background: #d64545; box-shadow: none; }
#account-panel .friends.editing .remove { display: flex; }
#account-panel .friend-add { margin-top: 14px; }
#account-panel .add-msg:empty { display: none; }
#account-panel .my-code { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px;
      padding: 12px 14px; border-radius: 14px; background: var(--pill); box-shadow: inset 0 0 0 1px var(--track); }
#account-panel .my-code small { display: block; font: 600 10.5px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
#account-panel .my-code b { display: block; margin-top: 4px; font: 800 20px/1 ui-monospace, monospace; letter-spacing: .08em; color: var(--strong); }
#account-panel .my-code .buttons { margin: 0; }
#account-panel .code-note { margin-top: 8px; font-size: 12px; }
#account-panel .friends-out .discord { display: inline-flex; margin-top: 12px; }
#account-panel .friends-msg:empty { display: none; }

@media (max-width: 560px) { /* a full-screen sheet on phones */
  #account-panel { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; box-shadow: none; }
  #account-panel[open] { animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  #account-panel[open].closing { animation-name: sheet-out; }
  @keyframes sheet-out { to { transform: translateY(60px); opacity: 0; } }
  #account-panel .head { padding: calc(14px + var(--safe-top)) 10px 10px 16px; }
  #account-panel .body { padding: 0 16px calc(24px + var(--safe-bottom)); }
  #account-panel .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #account-panel .tile.streak b { font-size: 38px; }
  #account-panel ol a, #account-panel ol .row { grid-template-columns: 34px 38px minmax(0, 1fr) auto; gap: 9px; padding: 8px 10px; }
  #account-panel .face { width: 38px; height: 50px; }
  #account-panel [role="tab"] { padding-left: 7px; padding-right: 7px; font-size: 11.5px; letter-spacing: .04em; }
  #account-panel [role="tab"][aria-selected="true"]::after { left: 7px; right: 7px; }
  #account-panel .tabs { gap: 1px; margin-left: -7px; }
  #account-panel .coll-search { height: 38px; font-size: 16px; } /* 16px prevents iOS zoom */
  #account-panel .coll-kinds button { padding: 10px 10px 9px; }
  #account-panel .coll-kinds b { font-size: 19px; }
  #account-panel .coll-chara .outfits img { width: 30px; height: 40px; }
  #account-panel .coll-dances { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #account-panel .board-card .row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 11px; padding: 10px 12px 10px 10px; }
  #account-panel .board-card .face { width: 46px; height: 62px; }
  #account-panel .board-card .pts b { font-size: 24px; }
  #account-panel .calendar { padding: 10px 8px; }
  #account-panel .cal-grid { gap: 3px; }
  #account-panel .cal-day { aspect-ratio: 1; }
  #account-panel .cal-card { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; padding: 10px; }
  #account-panel .cal-card .face { width: 78px; height: 104px; }
}

/* A 3D backdrop loading: a pill along the top with its name, a bar, and megabytes so far of its size. */
#stage-loading { position: fixed; top: calc(14px + var(--safe-top)); left: 50%; z-index: 5; display: flex; align-items: center; gap: 10px;
      box-sizing: border-box; width: min(360px, calc(100vw - 32px)); height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
      background: var(--surface-hud); backdrop-filter: blur(var(--blur-hud)); box-shadow: 0 1px 6px var(--shade);
      font: 600 12px/1 system-ui, sans-serif; color: var(--label); transform: translateX(-50%); transition: opacity .35s; }
#stage-loading[hidden] { display: flex; opacity: 0; pointer-events: none; }
#stage-loading b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#stage-loading .bar { flex: 1 0 60px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
#stage-loading .bar i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--accent-grad);
      transition: width .2s; }
#stage-loading .mb { flex: none; font-variant-numeric: tabular-nums; color: var(--strong); }
#stage-loading.failed .bar { display: none; }
#stage-loading.failed b { color: #d64545; }
@media (max-width: 560px) { #stage-loading { top: calc(56px + var(--safe-top)); } } /* under the top row's buttons */
html.reduce-motion #stage-loading, html.reduce-motion #stage-loading .bar i { transition: none; }

/* On a 3D or camera backdrop in light mode the see-through whites go grey over the scenery: solid white
   instead, with a firmer shadow and hairline border so they still stand off it. */
:root:not([data-theme="dark"]) :is(body.located, body.camera-bg) { --pill: #fff; --card: #fff; --surface-hud: #fff; --surface-panel: #fff; --overlay: rgba(255,255,255,.96);
      --border: rgba(0,0,0,.14); --shade: rgba(0,0,0,.28); --shade-hover: rgba(0,0,0,.4); }

/* Groups side by side line up both ways: their headings along the top, their last row of controls along
   the bottom (Backdrop's label makes Stage taller than View). */
#picker .panel { align-items: stretch; }
#picker .fields { flex: 1 0 auto; align-content: flex-end; }

/* Added to collection: a card down the left side on desktop (or above the bottom bar on phones) for
   each uma, outfit or song a daily roll collected for the first time (panel.js announceCollected). */
#collected { position: fixed; left: 16px; top: 50%; z-index: 30; display: flex; flex-direction: column; gap: 8px;
      transform: translateY(-50%); pointer-events: none; }
#collected .collected-card { display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(300px, calc(100vw - 32px));
      padding: 7px 16px 7px 7px; border: 0; border-radius: 16px; background: var(--card); backdrop-filter: blur(8px); color: var(--text);
      box-shadow: inset 0 0 0 2px var(--accent), 0 6px 24px rgba(224,85,154,.3); font: 600 13px/1.25 system-ui, sans-serif; text-align: left;
      cursor: pointer; pointer-events: auto; opacity: 0; transform: translateX(-24px); transition: opacity .35s, transform .35s cubic-bezier(.3,1.3,.5,1); }
#collected .collected-card.in { opacity: 1; transform: none; }
#collected .collected-card.out { opacity: 0; transform: translateX(-12px); transition: opacity .5s, transform .5s; pointer-events: none; }
#collected .pic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; overflow: hidden;
      background: var(--track); font-size: 18px; color: var(--strong); }
#collected .pic img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
#collected .txt { min-width: 0; }
#collected :is(small, b, i) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#collected small { font: 700 10px/1.2 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--strong); }
#collected i { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--soft); }
#collected:empty { display: none; } /* no gap in the pop-ups' stack (#toasts) */
@media (max-width: 700px) { /* in the pop-ups' stack (#toasts), with the badge and hints */
  #collected { position: relative; left: auto; top: auto; bottom: auto; transform: none; align-items: center; }
  #collected .collected-card { transform: translateY(16px); }
  #collected .collected-card.out { transform: translateY(8px); }
}

/* Gliding active highlights for tabs and segmented pills (ui-fx.js attachSlider). */
.has-glide { position: relative; }
.has-glide > :not(.glide) { position: relative; z-index: 1; }
.has-glide > .glide { position: absolute; pointer-events: none; z-index: 0;
                      transition: transform .3s cubic-bezier(.34,1.28,.48,1), width .3s cubic-bezier(.34,1.28,.48,1), opacity .18s; }
.glide-underline > .glide { left: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent-grad); }
#account-panel .glide-underline > .glide { bottom: 2px; }
.glide-pill > .glide { top: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--accent-pill); box-shadow: 0 2px 8px rgba(214,61,134,.32); }
.glide-pill button[aria-pressed="true"] { background: transparent !important; text-shadow: 0 1px 2px rgba(120,18,66,.22); }
.glide-pill button { transition: color .22s ease; }

/* Tactile click ripples spawned at pointer coordinates (ui-fx.js). */
.ui-ripple { position: fixed; left: 0; top: 0; width: var(--r-size, 36px); height: var(--r-size, 36px); margin: calc(var(--r-size, 36px) / -2);
             border-radius: 50%; pointer-events: none; z-index: 9999;
             border: 2px solid var(--r-color, var(--accent)); background: radial-gradient(circle, rgba(242,92,160,.22), transparent 68%);
             animation: ui-ripple .42s cubic-bezier(.16,.84,.3,1) forwards; }
.ui-ripple.burst { border-width: 2.5px; animation-duration: .48s; }
@keyframes ui-ripple {
  0%   { opacity: .88; transform: scale(.22); }
  100% { opacity: 0; transform: scale(1.55); border-width: 1px; }
}

/* Touch screens: slightly larger hit areas on smaller icons so they're comfortable to tap. */
@media (pointer: coarse) {
  #vol { width: 38px; height: 38px; }
  #vol .pill { height: 38px; }
  #vol button { width: 36px; height: 36px; }
  /* Top-center Now Playing pill on Duo & tablets stays height-matched (34px) to the top row; ::after keeps its tap target large. */
  body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol { width: 34px; height: 34px; }
  body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol .pill { width: 34px; height: 34px; }
  body:is(.duo-dock, .desk-dock):not(.unrolled, .rolling, .shared) #vol button { width: 32px; height: 32px; }
  #about-toggle, #x-link { width: 38px; height: 38px; left: 8px; bottom: calc(6px + var(--safe-bottom)); }
  #x-link { left: 50px; }
  #suggest-toggle { height: 36px; left: 94px; bottom: calc(7px + var(--safe-bottom)); padding: 0 13px 0 10px; font-size: 13px; }
  #score .score-actions button { width: 34px; height: 34px; }
  #score-pill { height: 36px; }
  #account-panel .streak-info { width: 32px; height: 32px; line-height: 32px; }
  :is(#picker, #uma-menu) .step { width: 36px; height: 40px; }
  /* Small things keep their look but take a 44px tap: an invisible area around each (::after). */
  #top-left :is(#mode, #festive, #photo-toggle, #camera-flip), #top-right > *, #account-panel .close, #account-panel button.react, #account-panel .coll-chara .outfit-slot { position: relative; top: auto; left: auto; right: auto; }
  :is(#mode, #theme, #festive, #photo-toggle, #camera-flip, #account, #countdown, #account-panel .close)::after { content: ""; position: absolute; inset: -5px; }
  #account-panel .close::after { inset: -6px; }
  #account-panel button.react::after { content: ""; position: absolute; inset: -9px -3px; }
  #account-panel .reacts { gap: 10px 6px; }
  #account-panel .coll-chara .outfits { gap: 6px 11px; }
  #account-panel .coll-chara .outfit-slot::after { content: ""; position: absolute; inset: 0 -6px; }
  /* The rest, each reaching just halfway into the gap beside it, so no two tap areas overlap. */
  #controls button, #vol #mute, #score .score-actions button, :is(#picker, #uma-menu) :is(.step, .rand), #picker .swatches button { position: relative; }
  /* (#about-toggle and #score-pill are fixed, which places their ::after already) */
  :is(#controls button, #vol #mute, #about-toggle, #x-link, #suggest-toggle, #score .score-actions button, #score-pill, #account-panel .streak-info,
      :is(#picker, #uma-menu) :is(.step, .rand), #picker .swatches button)::after { content: ""; position: absolute; }
  #controls button::after { inset: -4px -2px; } /* 36px tall, 5px apart on phones */
  #vol #mute::after { inset: -4px; }
  :is(#about-toggle, #x-link)::after { inset: -3px; }
  #suggest-toggle::after { inset: -4px -2px; }
  #score .score-actions { gap: 8px; }
  #score .score-actions button { width: 36px; height: 36px; }
  #score .score-actions button::after { inset: -4px; }
  #score-pill::after { inset: -4px 0; }
  #account-panel .streak-info::after { inset: -6px; }
  :is(#picker, #uma-menu) :is(.step, .rand) { width: 44px; }
  :is(#picker, #uma-menu) .step::after { inset: -2px 0; } /* 40px tall */
  :is(#picker, #uma-menu) .rand::after { inset: -5px 0; } /* 34px */
  #picker .swatches { gap: 12px; }
  #picker .swatches :is(button, .swatch-custom) { width: 32px; height: 32px; }
  #picker .swatches button::after { inset: -6px; }
  /* Share's row is clipped round (overflow: hidden), so it's just taller, and its icons 44px wide. */
  #share { height: 44px; }
}
@media (pointer: coarse) and (max-width: 560px) {
  #share :is(#share-native, #share-score, #share-mp4:not(.busy)) { justify-content: center; min-width: 44px; padding: 0; }
}
@media (pointer: coarse) and (max-width: 500px) {
  /* Free mode's icon-only buttons: 40px plus half of each 4px gap either side makes 44px
     (Random and Customise pad a little less to pay for it, so their words still fit in Japanese). */
  #controls { gap: 4px; }
  #controls :is(#share-free:not(.said), #save:not(.busy)) { width: 40px; }
  #controls :is(#reroll, #picker-toggle) { gap: 4px; padding: 0 7px 0 6px; }
}

/* Respect reduced motion (OS default or Settings > Motion & flashes) across animations & flashes. */
html.reduce-motion #collected .collected-card { transition: opacity .3s; transform: none; }
html.reduce-motion #score .rank:is(.fx-legendary, .fx-mythic, .fx-godlike, .elite.in),
html.reduce-motion #shared .tap-sound,
html.reduce-motion #reel.landed::after, html.reduce-motion #reel.tease-rainbow.landed .slot span,
html.reduce-motion #reel.turbo, html.reduce-motion #reel.glitching,
html.reduce-motion #reel .slot.in, html.reduce-motion #reel .slot.out,
html.reduce-motion #reel .slot.in-rev, html.reduce-motion #reel .slot.out-rev,
html.reduce-motion #reel .radar-sweep, html.reduce-motion #reel.conveyor::before,
html.reduce-motion #reel .reel-static, html.reduce-motion #reel .slot .reel-flame,
html.reduce-motion #score li.max-hit,
html.reduce-motion #burst.go .bloom, html.reduce-motion #burst.go .ring, html.reduce-motion #burst.go .ring2,
html.reduce-motion #burst.go .spark, html.reduce-motion #burst.go .star,
html.reduce-motion #gallery .grid .tile-in, html.reduce-motion #info.swap, html.reduce-motion #score .score-body.swap,
html.reduce-motion #picker .swatches button[aria-pressed="true"],
html.reduce-motion #picker .swatches .swatch-custom[data-active="true"],
html.reduce-motion .xm-present.open .gift .body::after { animation: none !important; }
html.reduce-motion #reel .reel-flash { display: none !important; animation: none !important; }
html.reduce-motion #score .rank[class*="fx-"]:hover::after { transform: none; }
html.reduce-motion #roll, html.reduce-motion body.unrolled #roll, html.reduce-motion #score, html.reduce-motion #score-pill,
html.reduce-motion #account-hint, html.reduce-motion #recap-hint, html.reduce-motion #changelog, html.reduce-motion #gallery, html.reduce-motion #uma-menu,
html.reduce-motion #account-panel[open], html.reduce-motion #account-panel .pane, html.reduce-motion #picker .group,
html.reduce-motion #save-sheet[open], html.reduce-motion #recap-panel[open], html.reduce-motion #how-panel[open], html.reduce-motion #crowd-panel[open], html.reduce-motion #suggest-panel[open],
html.reduce-motion #reel.entering, html.reduce-motion #reel.tick-kick, html.reduce-motion #reel.landed, html.reduce-motion #reel.exiting,
html.reduce-motion body.reveal-cascade :is(#countdown, #bar, #controls, #share) { animation-duration: .01ms !important; }
html.reduce-motion .has-glide > .glide, html.reduce-motion #account-panel .switch .knob { transition: none !important; }

/* Japanese typography: remove uppercase/tracking on CJK labels and keep micro labels >= 12px. */
:root.lang-ja :is(
  #mode, #suggest-toggle, #changelog h2, #how-panel section h3, #crowd-panel h2, #suggest-panel h2, #suggest-panel .suggest-field, #shared .shared-badge, #shared .tap-sound,
  #score h2, #score .name, #score .drop span, #score .total > span, #score .rank,
  #picker .field, #uma-menu .field, #uma-menu .uma-menu-slot, #save-sheet .field, #picker .duet-card h3,
  #account-panel h2, #account-panel h3, #account-panel [role="tab"], #account-panel .tile span,
  #account-panel .soon, #account-panel .date, #account-panel .btn, #account-panel .view-toggle button,
  #account-panel .cal-grid .wd, #account-panel .cal-card .when, #account-panel .coll-kinds span,
  #account-panel .coll-drawer .drawer-days small, #account-panel .coll-special-sec h4,
  #account-panel .board-history summary, #account-panel .archive-pick .tag,
  #account-panel .alltime .hl-tile span, #account-panel .podium-card .medal,
  #account-panel .my-code small, #account-panel .remove, #collected small
) { letter-spacing: 0; text-transform: none; }
:root.lang-ja :is(
  #score .name, #score .why, #score .pts small, #score .drop span, #score .total > span,
  #picker .field, #uma-menu .field, #uma-menu .uma-menu-slot, #uma-menu .unison-note, #save-sheet .field, #picker .duet-card h3, #picker :is(.move-hint, .duet-hint), #picker #count-warn,
  #gallery .grid button, #gallery .grid span, #gallery .grid .tag, #gallery .grid .note,
  #shared .shared-badge, #shared .tap-sound, #crowd-panel .crowd-note, #suggest-panel .suggest-quota, #suggest-panel .suggest-count, #suggest-panel .suggest-field small,
  #account-panel h3, #account-panel .tile span, #account-panel .tile small, #account-panel .soon,
  #account-panel .pts small, #account-panel .view-toggle button, #account-panel .cal-grid .wd,
  #account-panel .cal-key, #account-panel .cal-card .when, #account-panel .coll-kinds span,
  #account-panel .coll-kinds .sub, #account-panel .coll-drawer .drawer-days small,
  #account-panel .coll-special-sec h4, #account-panel .coll-fk small, #account-panel .coll-badge small,
  #account-panel .coll-badge em.rarity, #account-panel .archive-pick .tag,
  #account-panel .archive-head small, #account-panel .archive-pick .info small,
  #account-panel .alltime .hl-tile span, #account-panel .podium-card .medal,
  #account-panel .podium-card .tag, #account-panel .podium-card .by,
  #account-panel .my-code small, #collected small, #collected i, #badge-toast small
) { font-size: 12px; }
@media (max-width: 560px) {
  :root.lang-ja #account-panel [role="tab"] { font-size: 12px; letter-spacing: 0; }
}

/* Christmas morning's present (index.html showPresent): a wrapped box to unwrap for a reroll token. */
/* In the pop-ups' stack (#toasts), above the bottom bar. */
.xm-present { position: relative; z-index: 2; display: flex; align-items: center; gap: 16px; box-sizing: border-box;
              width: max-content; max-width: 100%; padding: 16px 20px 16px 16px; border: 1px solid var(--border-accent);
              border-radius: 18px; background: var(--surface-panel); backdrop-filter: blur(var(--blur-panel)); box-shadow: 0 8px 30px var(--shade-hover);
              opacity: 0; transform: translateY(14px); transition: opacity .35s, transform .35s cubic-bezier(.2,.8,.3,1.2); }
.xm-present:focus { outline: none; } /* focus rests on the box only while the gift unwraps */
.xm-present.in { opacity: 1; transform: none; }
.xm-present.out { opacity: 0; transform: translateY(10px); pointer-events: none; }
.xm-present .gift { position: relative; flex: none; width: 70px; height: 70px; padding: 0; border: 0; background: none; cursor: pointer; }
.xm-present .gift:disabled { cursor: default; }
.xm-present .gift .body { position: absolute; left: 8px; right: 8px; bottom: 2px; height: 44px; border-radius: 5px;
                          background: linear-gradient(90deg, transparent 42%, #ffd23f 42% 58%, transparent 58%), #d8344a;
                          box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.xm-present .gift .lid { position: absolute; left: 4px; right: 4px; top: 16px; height: 14px; border-radius: 4px;
                         background: linear-gradient(90deg, transparent 42%, #ffd23f 42% 58%, transparent 58%), #e8455b;
                         box-shadow: 0 2px 0 rgba(0,0,0,.15); transition: transform .5s cubic-bezier(.2,.8,.3,1), opacity .5s .2s; }
.xm-present .gift .bow { position: absolute; left: 50%; top: 2px; width: 30px; height: 16px; transform: translateX(-50%);
                         transition: transform .5s cubic-bezier(.2,.8,.3,1), opacity .5s .2s; }
.xm-present .gift .bow::before, .xm-present .gift .bow::after { content: ""; position: absolute; top: 0; width: 14px; height: 14px;
                         border: 4px solid #ffd23f; border-radius: 50% 50% 0 50%; box-sizing: border-box; }
.xm-present .gift .bow::before { left: 0; transform: rotate(-20deg); }
.xm-present .gift .bow::after { right: 0; transform: scaleX(-1) rotate(-20deg); }
.xm-present .gift:not(:disabled):hover .lid, .xm-present .gift:not(:disabled):hover .bow { transform: translate(var(--x, 0), -3px); }
.xm-present .gift .bow { --x: -50%; }
.xm-present .gift .bit { position: absolute; left: 50%; top: 30px; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; }
.xm-present.open .gift .lid { transform: translate(18px, -34px) rotate(28deg); opacity: 0; }
.xm-present.open .gift .bow { transform: translate(-30%, -46px) rotate(40deg); opacity: 0; }
.xm-present.open .gift .body::after { content: "↻"; position: absolute; left: 50%; top: -16px; display: grid; place-items: center;
                         width: 30px; height: 30px; border-radius: 50%; transform: translateX(-50%); background: linear-gradient(#ffe27a, #f6b72c);
                         color: #7a4e12; font: 800 18px/1 system-ui; box-shadow: 0 0 14px rgba(255,210,63,.8); animation: xm-token .6s cubic-bezier(.2,.8,.3,1.4) both; }
@keyframes xm-token { from { transform: translate(-50%, 16px) scale(.3); opacity: 0; } }
.xm-present .words { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--text); max-width: 250px; }
.xm-present .words b { font-size: 17px; color: #d8344a; }
[data-theme="dark"] .xm-present .words b { color: #ff7a8a; }
.xm-present .words span { font-size: 13.5px; line-height: 1.35; }
.xm-present .words small { color: var(--soft); font-size: 12px; }
.xm-present .thanks { margin-top: 6px; padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer; color: #fff;
                      background: linear-gradient(90deg, #e8455b, #c8323f); font: 600 13px system-ui; }
html.reduce-motion .xm-present, html.reduce-motion .xm-present .gift .lid, html.reduce-motion .xm-present .gift .bow { transition: opacity .2s; }

/* Free Mode Music panel and the speed controls shared with the stage menu. */
#group-umas .uma-editor-card { display: flex; flex-direction: column; gap: 10px; }
#group-umas .uma-editor-card .fields > .field:nth-child(n+3) { grid-column: 1 / -1; }
#picker .uma-editor-card .uma-appearance-toggles {
  display: flex; align-items: stretch; padding: 8px 0 0; border: 0; border-top: 1px solid var(--track);
}
#picker .uma-editor-card #pick-hide-ears {
  width: 100%; justify-content: space-between; min-height: 34px; padding: 0 8px 0 12px;
  border: 1px solid var(--track); border-radius: 10px; background: var(--bg); color: var(--text);
}
:is(#group-umas, #uma-menu) .uma-expression .expr-cycle { grid-template-columns: 32px minmax(0, 1fr) 32px; }
:is(#group-umas, #uma-menu) .expr-select-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
:is(#group-umas, #uma-menu) .expr-select-wrap::after {
  content: ""; position: absolute; right: 11px; top: 50%; width: 5px; height: 5px;
  border: solid var(--label); border-width: 0 1.6px 1.6px 0; transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
:is(#pick-expression, #uma-menu-expression) {
  appearance: none; -webkit-appearance: none; width: 100%; height: 34px; padding: 0 28px 0 12px;
  border: 1px solid var(--track); border-radius: 10px; background: var(--bg); color: var(--text);
  font: 13px system-ui, sans-serif; letter-spacing: 0; text-transform: none; cursor: pointer;
}
:is(#pick-expression, #uma-menu-expression):hover { box-shadow: 0 1px 6px var(--shade); }
:is(#pick-expression, #uma-menu-expression):focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
#uma-menu .uma-menu-switches { display: flex; gap: 8px; margin-top: 10px; }
#uma-menu .uma-menu-switches > .switch {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 34px; margin-top: 0; padding: 0 6px 0 12px; box-sizing: border-box;
  border: 1px solid var(--track); border-radius: 999px; background: transparent;
  color: var(--text); font: 700 13px/1 system-ui, sans-serif; cursor: pointer;
}
#uma-menu .uma-menu-switches > .switch[hidden] { display: none; }
#uma-menu .uma-menu-switches > .switch .label { margin-right: auto; }
#group-music .music-sources {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 999px;
  background: var(--pill); box-shadow: 0 1px 6px var(--shade), inset 0 0 0 1px var(--border); overflow: hidden;
}
.music-sources button {
  min-height: 34px; padding: 5px 7px; border: 0; background: transparent; cursor: pointer;
  font: 600 12px/1.2 system-ui, sans-serif; color: var(--label);
}
.music-sources button[aria-pressed="true"] { color: white; background: var(--accent-pill); }
.music-sources button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#group-music .music-source { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
#group-music .music-drop { padding: 12px; border: 1px dashed var(--border-accent); border-radius: 12px; background: var(--pill); }
#group-music small, .speed-editor small { font: 500 11.5px/1.35 system-ui, sans-serif; color: var(--soft); }
#group-music .music-status { color: var(--strong); }
.music-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
:is(#group-music .music-row, #group-music .music-source, #custom-track, .speed-editor) button:not(.switch):not(.music-sources button) {
  min-height: 28px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--pill); color: var(--label); font: 600 11.5px/1.2 system-ui, sans-serif; cursor: pointer;
}
:is(#group-music, #uma-menu) button:disabled { opacity: .48; cursor: default; }
:is(#group-music .music-row, #group-music .music-source, #custom-track, .speed-editor) button:not(.switch):not(:disabled):hover {
  border-color: var(--border-accent-hover); color: var(--strong);
}
:is(#group-music, .speed-editor) :is(input[type="number"], #youtube-url, #track-start, #track-end, select) {
  box-sizing: border-box; width: 5em; height: 30px; border: 1px solid var(--track); border-radius: 8px;
  padding: 3px 6px; background: var(--bg); color: var(--text); font: 13px system-ui, sans-serif;
}
#track-start, #track-end { width: 4.8em; font-variant-numeric: tabular-nums; }
.track-section label { display: inline-flex; align-items: center; gap: 5px; }
.track-cover-thumb {
  width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex: none;
  border: 1px solid var(--border); background: var(--bg);
}
#youtube-form { width: 100%; flex-wrap: nowrap; }
#youtube-form input { flex: 1; min-width: 0; }
#speed-slot { width: auto; max-width: 100%; }
#group-music :is(.music-row, .track-controls) label, #speed-slot-row, .speed-values label {
  font: 600 11.5px/1.3 system-ui, sans-serif; color: var(--label);
}
.music-badge {
  display: inline-flex; align-items: center; align-self: flex-start; padding: 3px 8px;
  border-radius: 999px; background: var(--pill); font: 600 11px/1.35 system-ui, sans-serif;
  color: var(--strong); white-space: nowrap;
}
.track-heading strong { flex: 1 1 8em; min-width: 0; overflow-wrap: anywhere; color: var(--strong); font: 700 14px/1.3 var(--display); }
.track-heading time, .track-offset { font: 600 11px/1.3 system-ui, sans-serif; color: var(--label); font-variant-numeric: tabular-nums; }
.track-offset { display: inline-flex; align-items: center; gap: 4px; }
#track-back, #track-resume { align-self: flex-start; }
#track-resume { border-color: var(--border-accent); }
#track-queue small { min-width: 5.5em; text-align: center; }
.speed-editor { display: grid; gap: 8px; }
#uma-speed { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--track); }
.speed-mode { justify-content: space-between; color: var(--strong); font: 700 11px/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
#music-speed .speed-mode { justify-content: flex-start; }
.speed-controls { display: grid; gap: 8px; min-width: 0; }
.speed-range { min-width: 0; }
.speed-slider { display: block; width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
.speed-ticks { position: relative; height: 16px; margin: 0 7px; font: 600 10px/16px system-ui, sans-serif; color: var(--soft); }
.speed-ticks span { position: absolute; left: var(--pos); transform: translateX(-50%); }
.speed-ticks span::before { content: ""; position: absolute; top: -1px; left: 50%; height: 4px; width: 1px; background: var(--track); }
.speed-ticks span:nth-child(2) { color: var(--strong); }
.speed-values output { font: 700 12px/1.2 system-ui, sans-serif; color: var(--strong); font-variant-numeric: tabular-nums; }
#group-music [hidden], .speed-editor [hidden] { display: none; }
#group-music .auto-setting[hidden] { display: none; }
#mix-sequence { border: 1px solid var(--track); border-radius: 10px; padding: 7px 9px; }
#mix-sequence summary { cursor: pointer; font-weight: 600; padding: 5px 0; }
#mix-sequence > label { display: flex; align-items: center; gap: 6px; min-height: 32px; }
#mix-sequence > label input { accent-color: var(--accent); }
#mix-sequence small { color: var(--soft); }
#mix-sequence ol { display: grid; gap: 7px; list-style: none; padding: 0; margin: 8px 0; }
#mix-sequence li { display: grid; grid-template-columns: minmax(0, 1fr) 48px repeat(3, 32px); gap: 4px; align-items: end; }
#group-music #mix-sequence li :is(select, input) { width: 100%; min-width: 0; height: 34px; }
#group-music #mix-sequence li input { padding: 0 4px; }
#mix-sequence li label { display: grid; gap: 2px; font-size: 11px; }
#mix-sequence .sequence-time { grid-column: 1; }
#picker #mix-sequence .sequence-capture { grid-column: 2 / -1; font-size: inherit; }
#picker #mix-sequence li button { padding: 0; justify-content: center; font-size: 16px; }
#picker #mix-sequence button:disabled { opacity: .45; cursor: default; }
@media (max-width: 600px) {
  #group-music #mix-sequence li :is(select, input) { height: 40px; font-size: 16px; }
  #mix-sequence li { grid-template-columns: minmax(0, 1fr) 46px repeat(3, 36px); }
}

#free-stage-play { position: fixed; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
#free-stage-play i { position: absolute; display: block; translate: -50% -50%; background: var(--paint); }
#free-stage-play .paint-ball { width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff9 0 15%, transparent 21%), var(--paint); box-shadow: 0 2px 4px #56213966; }
#free-stage-play .paint-splat { width: 67px; height: 52px; border-radius: 48% 62% 39% 57% / 55% 41% 66% 51%;
  clip-path: polygon(2% 41%, 21% 31%, 18% 8%, 38% 25%, 54% 2%, 61% 28%, 82% 14%, 79% 39%, 100% 49%, 81% 64%, 90% 88%, 64% 79%, 48% 100%, 37% 76%, 12% 88%, 20% 62%); }
#free-stage-play .paint-drop { width: 8px; height: 11px; border-radius: 52% 70% 54% 63%; }
#free-stage-play .stage-confetti { width: 10px; height: 7px; border-radius: 2px; }
#free-stage-play .stage-star { width: 17px; height: 17px;
  clip-path: polygon(50% 0, 61% 34%, 99% 38%, 70% 62%, 80% 100%, 50% 78%, 20% 100%, 30% 62%, 1% 38%, 39% 34%); }

/* Auto mix uses bordered rows for the playback settings and dance switches. */
#group-music .auto-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#group-music .auto-block[hidden] { display: none; }
#group-music .auto-group { display: flex; flex-direction: column; min-width: 0; overflow: hidden;
                           border: 1px solid var(--track); border-radius: 12px; background: var(--bg); }
#group-music .auto-group:not(:has(> :is(.switch, .auto-setting):not([hidden]))) { display: none; }
#group-music .auto-setting { justify-content: space-between; padding: 8px 12px; gap: 8px; }
#group-music .auto-setting label { display: inline-flex; align-items: center; gap: 5px; }
#group-music .auto-setting label[hidden] { display: none; }
#group-music .auto-setting input[type="checkbox"] { margin: 0; accent-color: var(--accent); }
#group-music .auto-setting select { width: auto; max-width: 100%; }
#auto-random-minutes { max-width: 4em; }
#picker #crowd-audio { padding-inline: 5px; }
#crowd-volume { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
#picker #group-music .auto-switch { position: relative; flex-wrap: wrap; align-items: center; row-gap: 3px; width: 100%; height: auto; min-height: 50px;
                                    padding: 8px 8px 8px 12px; border: 0; border-radius: 0; box-shadow: none; background: transparent;
                                    white-space: normal; text-align: left; transform: none; }
#picker #group-music .auto-switch:hover:not(:disabled) { background: var(--pill); }
#picker #group-music .auto-switch[aria-checked="true"] { background: rgba(224,85,154,.055); }
:root[data-theme="dark"] #picker #group-music .auto-switch[aria-checked="true"] { background: rgba(224,85,154,.12); }
#picker #group-music .auto-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#group-music .auto-switch .label { display: flex; flex: 1 1 0; flex-direction: column; gap: 2px; min-width: 0; overflow: visible; }
#group-music .auto-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
#group-music .auto-switch[aria-checked="true"] .auto-name { color: var(--strong); }
#group-music .auto-switch .auto-desc { display: block; font: 500 11.5px/1.3 system-ui, sans-serif; color: var(--soft); overflow-wrap: anywhere; }
#picker.explain #group-music .auto-switch .auto-desc { display: none; }
/* Indent the new-dance option under autoplay and dim it while autoplay is off. */
#picker #group-music .auto-sub { padding-left: 38px; border-top: 1px solid var(--track); }
#group-music .auto-sub::before { content: ""; position: absolute; left: 19px; top: 0; width: 10px; height: 23px; box-sizing: border-box;
                                 border: solid var(--track); border-width: 0 0 2px 2px; border-bottom-left-radius: 7px; }
#group-music .auto-group:has(#pick-autoplay option[value="off"]:checked) .auto-sub:not(:disabled) { opacity: .72; }
#group-music .auto-block > small:not(.music-badge) { padding: 0 4px; }
#info.shuffle-armed { position: relative; overflow: hidden; }
#info.shuffle-armed .info-song::before { content: "∞ "; }
#info.shuffle-armed .info-song::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: var(--loop-progress, 0%); height: 2px;
  background: var(--accent); opacity: .55; pointer-events: none; transition: width .1s linear;
}
#shuffle-next {
  position: absolute; z-index: 1; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 6px; max-width: min(90%, 340px); padding: 5px 11px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-panel);
  color: var(--label); font: 500 11.5px/1.2 system-ui, sans-serif; white-space: nowrap; pointer-events: none;
}
#shuffle-next strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--strong); }
#music-drop-overlay {
  position: fixed; z-index: 9; inset: 14px; display: grid; place-items: center; pointer-events: none;
  box-sizing: border-box; border: 2px dashed var(--accent); border-radius: 24px; background: var(--surface-panel);
}
#music-drop-overlay span { padding: 14px 20px; border-radius: 999px; background: var(--pill); color: var(--strong); font: 700 16px/1.2 var(--display); }
#shuffle-next[hidden], #music-drop-overlay[hidden] { display: none; }
/* YouTube Listen Along: YouTube's own player, kept visible (as its terms ask) in a small card in the
   top-left corner, clear of the uma, the bar and Customise (which, like the galleries, opens over it
   where they meet), while a YouTube track is up or loading. */
#yt-card {
  position: fixed; z-index: 2; left: 16px; top: calc(58px + var(--safe-top)); width: 256px; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-panel); box-shadow: 0 4px 18px var(--shade);
}
#yt-card[hidden] { display: none; }
#yt-card .yt-head { display: flex; align-items: center; gap: 7px; min-width: 0; height: 30px; padding: 0 4px 0 9px; }
#yt-card .yt-mark { flex: none; width: 16px; height: 16px; }
#yt-card .yt-mark rect { fill: #e62117; }
#yt-card .yt-mark path { fill: #fff; }
#yt-card .yt-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                           color: var(--strong); font: 600 12px/1.2 system-ui, sans-serif; }
#yt-card.loading .yt-head strong { color: var(--label); }
#yt-card .yt-head button { flex: none; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
            font-size: 16px; color: var(--label);
            border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
#yt-card .yt-head button[hidden] { display: none; }
#yt-close svg { width: 14px; height: 14px; stroke: var(--label); }
#yt-card .yt-head button:hover { background: var(--pill); color: var(--strong); }
#yt-close:hover svg { stroke: var(--strong); }
#yt-card .yt-head button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#yt-card .yt-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
#yt-card .yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#yt-card.minimized { width: min(210px, calc(100vw - 24px)); border-radius: 10px; }
#yt-card.minimized .yt-frame { position: absolute; top: 100%; pointer-events: none; }
body.clean #yt-card { top: calc(8px + var(--safe-top)); }
#picker .free-select, #picker .free-preset select, #picker .free-preset input {
  font: inherit; color: var(--text);
}
#picker :is(.free-select select, .free-preset select, .free-preset input) {
  min-height: 34px; min-width: 0; box-sizing: border-box; border: 1px solid var(--track);
  border-radius: 8px; padding: 4px 8px; background: var(--pill); color: var(--text);
}
#picker .free-select { display: flex; gap: 8px; align-items: center; }
#picker .free-preset summary { cursor: pointer; font-weight: 600; }
#picker .free-preset select { width: 100%; }
#picker .free-preset form input { flex: 1; }
#picker .free-preset[open] > :not(summary):not([hidden]) { margin-top: 8px; }
#picker .free-preset small { display: block; color: var(--soft); }
#picker .free-preset small[hidden] { display: none; }
#track-note { display: block; }
@media (max-width: 700px) {
  #yt-card { left: 8px; top: calc(48px + var(--safe-top)); width: 200px; border-radius: 10px; }
  #yt-card.minimized { width: min(188px, calc(100vw - 16px)); }
  #yt-card .yt-head { height: 32px; gap: 4px; }
  #yt-card .yt-head button { width: 28px; height: 30px; }
  #picker :is(.free-select select, .free-preset select, .free-preset input) { font-size: 16px; }
  #group-music .music-sources button { min-height: 40px; }
  #group-music :is(input[type="number"], #youtube-url, select), .speed-editor input[type="number"] { font-size: 16px; height: 34px; }
  #uma-menu { max-height: calc(100dvh - 120px - var(--picker-room, 0px) - var(--safe-bottom)); overflow-y: auto; }
}
html.reduce-motion #info.shuffle-armed .info-song::after { transition: none; }
@media (prefers-reduced-motion: reduce) {
  #info.shuffle-armed .info-song::after { transition: none; }
}
/* The uma menu's own Tall switch (just this uma full-size). */
#uma-menu #uma-menu-tall.busy { opacity: .6; cursor: progress; }
