:root{
  /* Layout: one full-bleed canvas (stage with the cats on top, note highway below); DOM menus float in the dark pit under the stage */
  --night:#120a24; --pit:#08040f; --gold:#ffcf6b; --gold-light:#ffe3a0; --gold-deep:#d99a2b; --gold-shade:rgba(186,112,24,.45);
  --cream:#fff4e3; --mist:#c3b3e0; --dim:#a99cc4; --ink:#2a1238; --plum:#2e1548; --card-top:#3a1b58; --card-bottom:#26123d;
  --soft:rgba(255,255,255,.08); --tray:rgba(255,255,255,.06); --pink:#ff7ab6; --danger:#c2334f;
  --f-display:"Secular One","Fredoka","Arial Hebrew",system-ui,sans-serif;
  --f-body:"Fredoka","Rubik","Arial Hebrew",system-ui,sans-serif;
  /* type roles (rem, so the large-text setting scales them together) */
  --t-label:.8125rem; --t-small:.875rem; --t-body:1rem; --t-title:1.125rem; --t-button:1.1875rem; --t-head:1.875rem;
  /* the owner asked for controls that feel soft like a toy: a springy release on press */
  --spring:cubic-bezier(.34,1.56,.64,1); --ease-out:cubic-bezier(.16,1,.3,1);
  --stage-h:45vh;
  color-scheme:dark;
}
/* on iPhone the base size follows the system text size; "גדול" adds a quarter on top of the default */
@supports (font:-apple-system-body){html:not(.big){font:-apple-system-body}}
html.big{font-size:125%}
[hidden]{display:none!important}
html,body{height:100%;margin:0;background:var(--night);overflow:hidden;overscroll-behavior:none}
body{color:var(--cream);font-family:var(--f-body);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
::selection{background:var(--gold);color:var(--ink)}
#app{position:fixed;inset:0;overflow:hidden;background:var(--night)}
#c{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
#safe{position:fixed;top:0;left:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);visibility:hidden;pointer-events:none}
button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
[tabindex="-1"]:focus{outline:none}

/* ---------- HUD ---------- */
#hud{position:absolute;left:0;right:0;top:0;z-index:4;padding:calc(env(safe-area-inset-top,0px) + 12px) 14px 0;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;pointer-events:none}
#hud .iconbtn{pointer-events:auto}
.scorebox{text-align:center;line-height:1}
#score{display:block;font:600 1.75rem/1 var(--f-body);font-variant-numeric:tabular-nums;text-shadow:0 2px 0 rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.4)}
#mult{display:inline-block;margin-top:6px;font-size:var(--t-label);font-weight:700;color:var(--ink);background:var(--gold);border-radius:999px;padding:2px 9px}
.hype{width:6.5rem;display:grid;gap:6px;justify-items:center}
.hype .lbl{font-size:var(--t-label);font-weight:600;color:var(--cream);text-shadow:0 1px 2px rgba(0,0,0,.7)}
.hype .bar{width:100%;height:12px;border-radius:6px;background:rgba(10,4,20,.65);overflow:hidden;box-shadow:inset 0 1px 3px rgba(0,0,0,.6)}
#hypeFill{display:block;height:100%;width:100%;transform-origin:right center;transform:scaleX(.5);background:linear-gradient(to left,var(--gold-light),var(--gold),var(--gold-deep));border-radius:6px;transition:transform .2s var(--ease-out)}
#progWrap{position:absolute;left:0;right:0;top:env(safe-area-inset-top,0px);height:4px;background:rgba(255,255,255,.1);z-index:4}
#prog{height:100%;width:0;background:var(--gold);border-radius:0 2px 2px 0}

/* ---------- screens ---------- */
.screen{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;padding:calc(env(safe-area-inset-top,0px) + 16px) 16px calc(env(safe-area-inset-bottom,0px) + 20px);pointer-events:none;background:linear-gradient(to bottom,rgba(8,4,18,0) 38%,rgba(8,4,18,.6) 52%,rgba(8,4,18,.94) 76%)}
.screen > *{pointer-events:auto}
.panel{width:100%;max-width:440px;max-height:100%;overflow-y:auto;overscroll-behavior:contain;display:grid;grid-template-columns:minmax(0,1fr);gap:14px;box-sizing:border-box;animation:rise .5s var(--ease-out) both}
@keyframes rise{from{transform:translateY(18px);opacity:0}to{transform:none;opacity:1}}
.panel > *,.field > *{min-width:0}

/* title */
.logo{margin:0;text-align:center;font-family:var(--f-display);font-weight:400;line-height:.9}
.logo .l2{display:block;padding-block:.06em .14em;font-size:clamp(3.4rem,16.5vw,6.5rem);color:var(--gold);text-shadow:0 3px 0 #b36d1d,0 7px 0 #5a1236,0 14px 26px rgba(0,0,0,.5)}
.lead{margin:0;text-align:center;text-wrap:balance;font-size:var(--t-body);line-height:1.55;color:var(--cream);max-width:34ch;justify-self:center}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.sr-only:focus{position:static;width:auto;height:auto;margin:0;clip:auto;overflow:visible;white-space:normal;justify-self:center;min-height:2.75rem;padding:0 16px;border-radius:16px;background:var(--soft);color:var(--cream);font-size:var(--t-small)}
.hint{margin:0;text-align:center;font-size:var(--t-small);line-height:1.5;color:var(--mist)}
kbd{font-family:var(--f-body);font-size:var(--t-label);border-radius:6px;padding:1px 6px;color:var(--cream);background:var(--soft);box-shadow:inset 0 -4px 5px -4px rgba(0,0,0,.35)}
@media (pointer:coarse){.kbdhint{display:none}}
.dedication{margin:0;font-family:"Amatic SC","Secular One",var(--f-body);font-weight:700;font-size:clamp(22px,7vw,36px);line-height:1.2;white-space:nowrap;color:var(--cream);text-align:center;text-shadow:0 2px 0 rgba(60,10,40,.75),0 6px 16px rgba(0,0,0,.45)}
.dedication svg{display:inline-block;vertical-align:-.02em;margin-inline:.3em;width:.62em;height:.62em;fill:var(--pink);filter:drop-shadow(0 2px 3px rgba(120,20,60,.6))}
.install{margin:0;justify-self:center;display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:center;font-size:var(--t-small);color:var(--cream);background:rgba(255,207,107,.14);border-radius:14px;padding:10px 14px;text-align:center}
.install svg{width:16px;height:16px;color:var(--gold)}

/* ---------- toy-soft controls ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:24px;padding:.8rem 1.375rem;font-size:var(--t-button);font-weight:600;min-height:3.375rem;transition:transform .32s var(--spring),box-shadow .2s ease,background-color .2s ease}
.btn:active{transform:scale(.93);transition-duration:.08s}
.btn.primary{color:var(--ink);background:linear-gradient(180deg,var(--gold-light),var(--gold) 58%,#f2b84e);box-shadow:inset 0 2px 0 rgba(255,255,255,.65),inset 0 -7px 9px -4px var(--gold-shade),0 12px 22px -10px rgba(0,0,0,.6)}
.btn.primary:active{box-shadow:inset 0 2px 0 rgba(255,255,255,.55),inset 0 -4px 6px -3px var(--gold-shade),0 6px 12px -8px rgba(0,0,0,.6)}
.btn.ghost{color:var(--cream);background:var(--soft);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),inset 0 -6px 7px -4px rgba(0,0,0,.28)}
/* a destructive action reads as one in its label, while the red fill stays for the confirmation */
.btn.ghost.danger{color:#ff9aa9}
.btn.small{min-height:2.75rem;padding:.5rem 1rem;font-size:var(--t-body);border-radius:20px}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row > .btn{flex:1 1 9rem}
.iconbtn{position:relative;width:2.75rem;height:2.75rem;flex:none;border:0;border-radius:16px;background:rgba(18,8,34,.7);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:var(--gold);display:grid;place-items:center;padding:0;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),inset 0 -5px 6px -4px rgba(0,0,0,.35);transition:transform .32s var(--spring)}
.iconbtn:active{transform:scale(.9);transition-duration:.08s}
.iconbtn svg{width:20px;height:20px;fill:currentColor}
.badge{position:absolute;top:-7px;inset-inline-start:-8px;height:20px;border-radius:10px;background:var(--gold);color:var(--ink);font-size:var(--t-label);font-weight:700;display:flex;align-items:center;gap:2px;padding:0 6px 0 5px;font-variant-numeric:tabular-nums;box-shadow:0 2px 4px rgba(0,0,0,.4)}
.badge svg{width:12px;height:12px;fill:var(--ink)}
#scrSelect .selhead{padding-top:8px}

/* segmented control: a sunken tray with a raised, gold thumb */
.seg{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:4px;padding:4px;border-radius:22px;background:var(--tray);box-shadow:inset 0 2px 5px rgba(0,0,0,.4)}
.seg button{min-height:2.75rem;border:0;border-radius:18px;background:transparent;font-size:var(--t-body);color:var(--mist);transition:transform .32s var(--spring),background-color .2s ease,color .2s ease}
.seg button:active{transform:scale(.92);transition-duration:.08s}
.seg button[aria-pressed="true"]{color:var(--ink);font-weight:600;background:linear-gradient(180deg,var(--gold-light),var(--gold));box-shadow:inset 0 -5px 7px -4px var(--gold-shade),0 5px 10px -6px rgba(0,0,0,.55)}
.chip{min-height:3.25rem;border:0;border-radius:22px;padding:0 1rem;font-size:var(--t-body);color:var(--mist);background:var(--tray);box-shadow:inset 0 2px 5px rgba(0,0,0,.4);white-space:nowrap;transition:transform .32s var(--spring)}
.chip:active{transform:scale(.93);transition-duration:.08s}
.chip[aria-pressed="true"]{color:var(--ink);font-weight:600;background:linear-gradient(180deg,var(--gold-light),var(--gold));box-shadow:inset 0 -5px 6px -4px var(--gold-shade)}

/* sliders: a 44px-tall grab area, a soft track that fills from the right (RTL), a round gold knob */
input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:2.75rem;margin:0;background:transparent;--v:50%}
input[type=range]::-webkit-slider-runnable-track{height:10px;border-radius:5px;background:linear-gradient(to left,var(--gold) var(--v),rgba(255,255,255,.14) var(--v));box-shadow:inset 0 1px 2px rgba(0,0,0,.5)}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;margin-top:-9px;border-radius:50%;background:linear-gradient(180deg,#fff6dc,var(--gold));box-shadow:inset 0 -5px 6px -4px var(--gold-shade),0 3px 8px rgba(0,0,0,.45)}
input[type=range]::-moz-range-track{height:10px;border-radius:5px;background:rgba(255,255,255,.14)}
input[type=range]::-moz-range-progress{height:10px;border-radius:5px;background:var(--gold)}
input[type=range]::-moz-range-thumb{width:28px;height:28px;border:0;border-radius:50%;background:linear-gradient(180deg,#fff6dc,var(--gold));box-shadow:0 3px 8px rgba(0,0,0,.45)}

/* ---------- headers ---------- */
.selhead{display:flex;align-items:center;gap:10px}
.selhead h2{margin:0;font-family:var(--f-display);font-weight:400;font-size:var(--t-head);line-height:1.1;color:var(--gold);flex:1;min-width:0}

/* ---------- song select ---------- */
#scrSelect .panel{display:flex;flex-direction:column;max-height:calc(100vh - var(--stage-h) - env(safe-area-inset-bottom,0px) - 30px);max-height:calc(100dvh - var(--stage-h) - env(safe-area-inset-bottom,0px) - 30px);overflow:hidden}
.levelbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;flex:none}
.levelnote{margin:-4px 0 0;font-size:var(--t-small);color:var(--mist);text-align:center;flex:none}
#songList{flex:1 1 auto;min-height:7.5rem;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:10px;overflow-y:auto;overscroll-behavior:contain;padding:10px 2px 26px;margin:-10px -2px -14px;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 12px,#000 calc(100% - 30px),transparent);mask-image:linear-gradient(to bottom,transparent 0,#000 12px,#000 calc(100% - 30px),transparent)}
.song{min-width:0;width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;text-align:start;padding:10px 14px;border:0;border-radius:20px;background:linear-gradient(180deg,var(--card-top),var(--card-bottom));box-shadow:inset 0 1px 0 rgba(255,255,255,.09),inset 0 -6px 7px -4px rgba(0,0,0,.25),0 8px 18px -10px rgba(0,0,0,.7);transition:transform .32s var(--spring)}
.song:active{transform:scale(.97);transition-duration:.08s}
.song .disc{width:2.75rem;height:2.75rem;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#fff 0 6%,var(--c) 42%,#3a1d4a 100%);box-shadow:inset 0 -5px 6px -4px rgba(0,0,0,.25),0 3px 6px rgba(0,0,0,.35)}
.song .disc svg{width:22px;height:22px;fill:rgba(42,18,56,.72)}
.song .main{min-width:0;display:grid;gap:3px}
.song .main b{font-size:var(--t-title);font-weight:600;color:var(--cream);line-height:1.25}
.song .main small{font-size:var(--t-small);color:var(--mist);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.song .meta{display:grid;justify-items:end;gap:5px}
.tag{font-size:var(--t-label);font-weight:600;color:var(--cream);background:var(--soft);border-radius:999px;padding:2px 9px;white-space:nowrap}
.tag.hot{color:var(--ink);background:var(--pink)}
.tags{display:flex;gap:4px}
.mini-stars{display:flex;gap:2px;direction:ltr}
.mini-stars svg{width:16px;height:16px;fill:rgba(255,255,255,.16)}
.mini-stars svg.on{fill:var(--gold)}
.song.add{background:transparent;box-shadow:none;border:2px dashed rgba(255,255,255,.22);cursor:pointer}
.song.add .disc{background:var(--soft);box-shadow:none}
.song.add .disc svg{fill:none;stroke:var(--gold);stroke-width:2.4;stroke-linecap:round}
.songrow{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}
.del{width:3.25rem;border:0;border-radius:18px;background:var(--soft);color:var(--mist);font-size:var(--t-small);padding:0 4px;box-shadow:inset 0 -5px 6px -4px rgba(0,0,0,.28)}
.del[data-armed="1"]{background:var(--danger);color:#fff}

/* ---------- settings ---------- */
#scrSettings{justify-content:flex-start;background:rgba(8,4,18,.92)}
.set{display:grid;gap:10px;padding:8px 0 18px;border-bottom:1px solid rgba(255,255,255,.08)}
.set:last-child{border-bottom:0}
.set > label,.set .lbl{font-size:var(--t-body);font-weight:600;color:var(--cream);display:flex;justify-content:space-between;align-items:baseline}
.set label output{color:var(--gold);font-variant-numeric:tabular-nums;font-weight:600}
.set p{margin:0;font-size:var(--t-small);color:var(--mist);line-height:1.5}
/* the less-used settings fold under one row */
.moreset{border-top:1px solid rgba(255,255,255,.08)}
.moreset > summary{list-style:none;cursor:pointer;min-height:3.5rem;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;padding:6px 0;font-size:var(--t-body);font-weight:600;color:var(--cream)}
.moreset > summary::-webkit-details-marker{display:none}
.moreset > summary span{grid-row:2;font-size:var(--t-small);font-weight:400;color:var(--mist)}
.moreset > summary svg{grid-row:1/3;grid-column:2;width:1rem;height:1rem;fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s var(--ease-out)}
.moreset[open] > summary svg{transform:rotate(180deg)}
.moreset > .set:first-of-type{padding-top:4px}
.set details summary{font-size:var(--t-small);color:var(--mist);cursor:pointer;min-height:2.75rem;display:flex;align-items:center}

/* ---------- import ---------- */
.field{display:grid;gap:8px;grid-template-columns:minmax(0,1fr)}
.field > label{font-size:var(--t-body);font-weight:600;color:var(--cream)}
.field input[type=text],.field select{font:inherit;font-size:1rem;color:var(--cream);background:var(--tray);border:0;border-radius:16px;padding:12px 14px;min-height:2.75rem;width:100%;max-width:100%;box-sizing:border-box;box-shadow:inset 0 2px 5px rgba(0,0,0,.4);text-overflow:ellipsis}
.field select option{background:#24123a;color:var(--cream)}
.fieldnote{margin:0;font-size:var(--t-small);color:var(--mist);line-height:1.5}

/* ---------- wardrobe ---------- */
.wardgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.wardhead{margin:0;text-align:center;font-size:var(--t-small);font-weight:600;color:var(--mist)}
.ward{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;text-align:start;padding:10px 12px;border:0;border-radius:20px;background:var(--soft);min-height:4.25rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.1),inset 0 -6px 7px -4px rgba(0,0,0,.28);transition:transform .32s var(--spring)}
.ward:active{transform:scale(.95);transition-duration:.08s}
.ward svg{width:30px;height:30px;fill:var(--gold)}
.ward b{display:block;font-size:var(--t-small);font-weight:600;line-height:1.25}
.ward small{display:flex;align-items:center;gap:4px;font-size:var(--t-small);color:var(--mist)}
.ward small svg{width:14px;height:14px;fill:var(--mist)}
.ward[aria-pressed="true"]{background:rgba(255,207,107,.18);box-shadow:inset 0 0 0 2px var(--gold),inset 0 -6px 7px -4px rgba(0,0,0,.2)}
.ward[aria-pressed="true"] small{color:var(--gold)}
.ward.locked{background:rgba(255,255,255,.04);cursor:default}
.ward.locked > svg{fill:var(--dim)}
.ward.locked b{color:var(--mist)}

/* ---------- calibration ---------- */
.calib{justify-items:center;text-align:center}
.calib .selhead{width:100%}
.calpad{width:min(44vw,170px);aspect-ratio:1;max-width:100%;border:0;border-radius:50%;background:radial-gradient(circle at 50% 38%,rgba(255,207,107,.22),rgba(20,8,36,.92));box-shadow:inset 0 0 0 4px var(--gold),inset 0 -10px 11px -4px rgba(0,0,0,.35);display:grid;place-items:center;touch-action:manipulation;transition:transform .2s var(--spring)}
.calpad:active{transform:scale(.95)}
/* the dot pulses on every tick: it is the timing signal, so its glow stays */
#calDot{width:38%;aspect-ratio:1;border-radius:50%;background:var(--gold);box-shadow:inset 0 3px 0 rgba(255,255,255,.5),0 10px 24px -8px rgba(0,0,0,.6);transform:scale(.5);opacity:.5}
.calprog{margin:0;font-size:var(--t-body);color:var(--cream);font-variant-numeric:tabular-nums;min-height:1.4em}

/* ---------- pause ---------- */
#scrPause{justify-content:center;background:rgba(8,4,18,.9)}
.pausepanel{align-self:center;margin-block:auto}
.pausettl{margin:0;text-align:center;font-family:var(--f-display);font-weight:400;font-size:var(--t-head);color:var(--gold)}
/* the pause screen is opaque enough that frozen notes never show through the buttons */
.pausepanel .btn.ghost{background:rgba(46,21,72,.96)}

/* ---------- results: a curtain call ---------- */
.res{justify-items:center;text-align:center;gap:12px}
/* the curtain call never covers the cats taking their bow; anything extra scrolls */
#scrResults .panel{max-height:calc(100vh - var(--stage-h) - env(safe-area-inset-bottom,0px) - 24px);max-height:calc(100dvh - var(--stage-h) - env(safe-area-inset-bottom,0px) - 24px)}
.res-song{margin:0;font-size:var(--t-small);color:var(--mist)}
.verdict{margin:0;font-family:var(--f-display);font-weight:400;font-size:1.625rem;line-height:1.2;color:var(--cream);text-wrap:balance;max-width:20ch}
.verdict.win{color:var(--gold)}
.stars{display:flex;gap:8px;justify-content:center;direction:ltr}
.stars svg{width:2.75rem;height:2.75rem;fill:rgba(255,255,255,.12)}
.stars svg.on{fill:var(--gold);filter:drop-shadow(0 4px 6px rgba(0,0,0,.45))}
.stars svg.pop{animation:pop .5s cubic-bezier(.3,1.3,.6,1) both}
@keyframes pop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
.starscore{display:grid;gap:10px;justify-items:center}
.scoreline{display:flex;align-items:center;justify-content:center;gap:10px}
#resScore{font-size:2rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--cream)}
#newBest{white-space:nowrap;font-size:var(--t-label);font-weight:700;color:var(--ink);background:var(--gold);padding:3px 11px;border-radius:999px}
.facts{margin:0;display:flex;justify-content:center;flex-wrap:wrap;gap:6px 16px;font-size:var(--t-small);color:var(--mist);font-variant-numeric:tabular-nums}
.facts b{color:var(--cream);font-weight:600}
.card-note{width:100%;box-sizing:border-box;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;text-align:start;padding:12px 14px;border-radius:20px;background:rgba(255,207,107,.14);box-shadow:inset 0 0 0 2px rgba(255,207,107,.55)}
.card-note > svg{width:34px;height:34px;fill:var(--gold)}
.card-note b{display:block;font-size:var(--t-body);color:var(--cream)}
.card-note span{display:block;font-size:var(--t-small);color:var(--mist)}
.card-note.calm{background:var(--soft);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}
.breakdown{width:100%}
.breakdown summary{min-height:2.75rem;display:flex;align-items:center;justify-content:center;font-size:var(--t-small);color:var(--mist);cursor:pointer;list-style:none;border-radius:14px}
.breakdown .more{display:inline-flex;align-items:center;gap:4px;text-decoration:underline;text-underline-offset:3px;text-decoration-color:rgba(195,179,224,.45)}
.breakdown .more svg{width:.75rem;height:.75rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s var(--ease-out)}
.breakdown[open] .more svg{transform:rotate(180deg)}
.breakdown summary::-webkit-details-marker{display:none}
.stats{width:100%;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:4px}
.stat{border-radius:16px;background:var(--soft);padding:10px 4px;display:grid;gap:2px}
.stat b{font-size:1.375rem;font-variant-numeric:tabular-nums}
.stat span{font-size:var(--t-small);color:var(--mist)}
.stat.p b{color:var(--gold)} .stat.gr b{color:var(--cream)} .stat.go b{color:var(--mist)} .stat.m b{color:var(--dim)}
.res .row{width:100%}
.res .row > .btn{flex:1 1 5.5rem;white-space:nowrap;padding-inline:10px}

/* ---------- floating bars ---------- */
#toast,#updateBar,#confirmBar{position:absolute;left:50%;transform:translateX(-50%);z-index:9;background:var(--plum);color:var(--cream);border-radius:20px;font-size:var(--t-small);max-width:calc(100% - 32px);box-sizing:border-box;box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 12px 30px rgba(0,0,0,.55)}
#toast{bottom:calc(env(safe-area-inset-bottom,0px) + 24px);padding:12px 18px;text-align:center}
#updateBar{top:calc(env(safe-area-inset-top,0px) + 10px)}
/* the confirmation rises from the bottom, close to the button that asked for it */
#confirmBar{bottom:calc(env(safe-area-inset-bottom,0px) + 16px)}
#updateBar,#confirmBar{display:flex;align-items:center;gap:10px;padding:6px 6px 6px 14px;flex-wrap:wrap;justify-content:center}
#confirmBar{width:min(420px,calc(100% - 32px))}
#confirmBar span{flex:1 1 100%;padding:6px 4px}
#confirmBar button{flex:1 1 7rem}
#updateBar button,#confirmBar button{min-height:2.75rem;border:0;border-radius:16px;background:var(--gold);color:var(--ink);font-weight:600;padding:0 14px}
#confirmBar button.no{background:var(--soft);color:var(--cream)}
#confirmBar button.yes{background:var(--danger);color:#fff}

/* ---------- calm mode (system Reduce Motion or the in-game setting) ---------- */
html.calm .panel,html.calm .stars svg.pop{animation:none}
html.calm .btn,html.calm .seg button,html.calm .chip,html.calm .iconbtn,html.calm .song,html.calm .ward,html.calm .calpad{transition:none}
html.calm #hypeFill{transition:none}
@media (prefers-reduced-motion:reduce){.panel,.stars svg.pop{animation:none}}

/* short phones (SE and smaller): a compact song list that shows three cards and a peek of the fourth */
@media (max-height:700px){
  #scrSelect .panel{gap:10px}
  #scrSelect .levelnote{display:none}
  #songList{gap:8px}
  .song{padding:8px 12px;gap:10px}
  .song .disc{width:2.25rem;height:2.25rem}
  .song .disc svg{width:18px;height:18px}
  .song .main small{display:none}
  .song .meta{gap:3px}
  .song .mini-stars svg{width:14px;height:14px}
  .tag{padding:1px 8px}
}

/* song list details */
.song{box-sizing:border-box}
/* the Hebrew credit stays whole; the English name gets the ellipsis at its own end */
.song .main small{display:flex;gap:.35em}
.song .main small .he{flex:none}
.song .main small .en{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr;text-align:right;unicode-bidi:isolate}
.dots{display:flex;gap:3px;direction:ltr;align-items:center;padding:4px 2px}
.dots i{width:.45rem;height:.45rem;border-radius:50%;background:rgba(255,255,255,.18)}
.dots i.on{background:var(--cream)}
/* icon buttons that also say what they are */
.iconbtn.labeled{width:auto;min-width:2.75rem;height:auto;min-height:2.75rem;padding:5px 8px 4px;display:grid;justify-items:center;gap:1px}
.iconbtn .ilbl{font-size:var(--t-label);font-weight:600;color:var(--cream);line-height:1.1}
/* results: the actions stay reachable while the rest scrolls */
.res .row{position:sticky;bottom:0;padding-top:10px;background:linear-gradient(to bottom,rgba(8,4,18,0),rgba(8,4,18,.94) 30%)}
@media (max-height:700px){
  .res{gap:8px}
  .starscore{grid-auto-flow:column;align-items:center;gap:14px}
  .stars svg{width:2.1rem;height:2.1rem}
  .verdict{font-size:1.3rem}
  #resScore{font-size:1.6rem}
}
