/* ============ RockStrings ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg0: #0b0f1a;
  --bg1: #131a2b;
  --panel: #1a2236;
  --panel-edge: #2a3550;
  --text: #e8ecf5;
  --text-dim: #93a0bd;
  --accent: #f5a524;
  --accent-hot: #ff7a1a;
  --good: #4ade80;
  --bad: #ef4444;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  /* The type scale: every text size in the app is one of these (Doug: mixed
     sizes looked jarring). xs: small capital labels; sm: hints and second
     lines; md: body, buttons, values; lg: numbers and big buttons; xl:
     titles; 2xl: display titles. */
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.6rem;
  --fs-2xl: 2.2rem;
}

html, body { height: 100%; overscroll-behavior: none; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #1d2740 0%, var(--bg1) 45%, var(--bg0) 100%) fixed;
  background-color: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button, select, input { font: inherit; touch-action: manipulation; }

.screen {
  display: none; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}
.screen.active { display: flex; }

/* Play screens own the whole viewport: no scroll, zoom, selection or callouts. */
#screen-game.active, #screen-calibrate.active {
  height: 100vh; height: 100dvh; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}

/* ---------- shared ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
}
.bar h2 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: .04em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.bar:has(> h2) > :not(h2) { flex-shrink: 0; }
.bar-nav { display: flex; gap: 8px; } /* Back + Home side by side */

.btn {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: var(--fs-md);
  font-weight: 700; /* every button: one size and weight, sentence case */
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
/* Hover only where there's a pointer: on a touch screen :hover sticks after a
   press that turns into a scroll, until the next tap somewhere. */
@media (hover: hover) { .btn:hover { background: #223050; border-color: #3c4c74; } }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hot) 100%);
  border-color: #b06000;
  color: #221200;
  font-weight: 700;
}
@media (hover: hover) { .btn-primary:hover { background: linear-gradient(180deg, #ffbd45 0%, #ff8b35 100%); } }
.btn-big { font-size: var(--fs-lg); padding: 15px 44px; min-width: 240px; }
.btn-small { font-size: var(--fs-sm); padding: 7px 14px; }
.btn-back { white-space: nowrap; }
/* Drawn icons (icons.js) sit in a line of text like a letter, in its color. */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.16em; flex: none; }

.panel {
  background: rgba(26, 34, 54, .75);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 18px 16px;
}
.prose { max-width: 760px; align-self: center; line-height: 1.65; color: var(--text-dim); }
.prose li { margin: 10px 0 10px 18px; }
.prose ul li { margin: 4px 0 4px 18px; }
.prose strong, .prose b { color: var(--text); }
.prose p { margin-top: 14px; }

.badge {
  background: var(--panel); border: 1px solid var(--panel-edge);
  padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs);
  color: var(--accent); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}

/* ---------- menu ---------- */
.menu-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; padding: 40px 20px;
  text-align: center;
}
.logo {
  font-size: clamp(2.4rem, 11vw, 4.6rem);
  font-weight: 900; letter-spacing: .06em;
  text-shadow: 0 6px 40px rgba(245, 165, 36, .35);
}
.logo span { color: var(--accent); }
.tagline { color: var(--text-dim); font-size: var(--fs-md); max-width: 520px; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.menu-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.res-feedback { align-self: center; margin-top: 14px; padding: 6px; background: none; border: 0; color: var(--text-dim);
  font: inherit; font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.menu-foot { color: var(--text-dim); font-size: var(--fs-sm); }
.res-style { display: grid; gap: 8px; padding: 12px 14px; text-align: center; border-color: rgba(245, 165, 36, .45); }
.res-style p { color: var(--text); line-height: 1.45; }
.res-style-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.credits { color: var(--text-dim); font-size: var(--fs-xs); margin-top: 1.5rem; }
.credits a { color: inherit; }
details.credits summary { cursor: pointer; }
#credits-text { white-space: pre-wrap; font-size: var(--fs-xs); margin: .5rem 0 0; }

.install-card {
  max-width: 420px; background: rgba(26, 34, 54, .9);
  border: 1px solid var(--accent); border-radius: 14px; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); color: var(--text-dim);
}
.install-buttons { display: flex; gap: 10px; justify-content: center; }

/* ---------- instrument cards ---------- */
.cards {
  display: grid; gap: 18px; padding: 10px 18px 30px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 980px; width: 100%; align-self: center;
}
.card {
  background: rgba(26, 34, 54, .8);
  border: 1px solid var(--panel-edge);
  border-radius: 16px; padding: 26px 22px;
  cursor: pointer; text-align: center;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
@media (hover: hover) { .card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 40px rgba(245, 165, 36, .15); } }
.card .emoji { font-size: 3rem; }
.inst-pic .inst-icon { height: 84px; width: auto; display: block; margin: 0 auto; }
.inst-icon { flex: none; }
.game-inst { padding: 2px 8px; }
.game-inst .inst-icon { height: 34px; width: auto; display: block; }
.opt.opt-inst { flex-wrap: wrap; }
.inst-row { display: flex; gap: 6px; flex: 1; min-width: 0; }
.inst-choice { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-width: 0; }
.inst-choice .inst-icon { height: 42px; width: auto; }
.inst-choice small { font-size: var(--fs-xs); color: var(--text); }
/* Instruments to choose from: the picture and its name, with no button
   behind them (Doug: no fill); the chosen one has a gold ring. */
.btn.inst-choice, .btn.inst-choice:active { background: none; border: 2px solid transparent; box-shadow: none; }
.btn.inst-choice.on { border-color: var(--accent); background: none; box-shadow: 0 0 14px rgba(245, 165, 36, .3); }
@media (hover: hover) { .btn.inst-choice:hover { background: rgba(255, 255, 255, .05); border-color: transparent; } }
@media (hover: hover) { .btn.inst-choice.on:hover { border-color: var(--accent); } }
.game-map-bar .chip .inst-icon { height: 26px; width: auto; margin: -4px 2px -4px -4px; vertical-align: middle; }
.card h3 { margin: 12px 0 6px; font-size: var(--fs-lg); }
.card .desc { color: var(--text-dim); font-size: var(--fs-sm); margin-bottom: 14px; }
.card .strings { display: flex; justify-content: center; gap: 8px; }
.card .strings span {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm); color: #10131c;
}

/* ---------- song select ---------- */
.song-options { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: center; padding: 14px 22px; }
.opt { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: var(--fs-sm); }
.opt b { color: var(--text); min-width: 46px; display: inline-block; }
.opt input[type=range] { width: 160px; accent-color: var(--accent); }
.opt select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--panel-edge); border-radius: 8px; padding: 7px 10px;
}
select.btn { padding: 8px 12px; }
.opt.opt-check { cursor: pointer; justify-content: flex-start; }
.opt-check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.opt-check small { color: var(--text-dim); font-size: var(--fs-xs); }
.opt-hint { color: var(--accent); font-size: var(--fs-xs); width: 100%; }

.song-list {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 18px 30px; max-width: 860px; width: 100%; align-self: center;
}
.song-row {
  display: flex; align-items: center; gap: 16px;
  background: rgba(26, 34, 54, .8);
  border: 1px solid var(--panel-edge);
  border-radius: 12px; padding: 14px 18px;
}
.song-row .song-info { flex: 1; min-width: 0; }
.song-row h3 { font-size: var(--fs-md); }
.song-row .song-sub { color: var(--text-dim); font-size: var(--fs-xs); margin-top: 3px; }
.song-row .song-best { color: var(--accent); font-size: var(--fs-xs); white-space: nowrap; }
.level-dots { letter-spacing: 2px; color: var(--accent); font-size: var(--fs-xs); }
.level-dots .off { color: #3a4664; }
.song-row .btn { padding: 8px 16px; }

/* The library: group chips and a sort, then folding group headers. */
.library-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 18px 12px;
  max-width: 860px; width: 100%; align-self: center; }
.lib-groups { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; padding-bottom: 2px; }
.lib-groups::-webkit-scrollbar { display: none; }
.lib-groups .chip { flex: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: var(--fs-sm); letter-spacing: .03em; }
.lib-groups .chip.on { background: linear-gradient(180deg, var(--accent), var(--accent-hot)); color: #1a1205; border-color: transparent;
  box-shadow: 0 0 16px rgba(245, 165, 36, .35); }
.lib-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-dim); font-size: var(--fs-xs);
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lib-sort .cycler { letter-spacing: 0; text-transform: none; } /* the label is in capitals; its value reads like every other */
.lib-head { display: flex; align-items: baseline; gap: 10px; width: 100%; margin-top: 8px; padding: 10px 4px 4px;
  background: none; border: 0; border-bottom: 2px solid rgba(245, 165, 36, .35); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.lib-title { font: 800 var(--fs-lg)/1.2 var(--display); letter-spacing: .03em; }
.lib-count { color: var(--text-dim); font-size: var(--fs-xs); }
.lib-fold { margin-left: auto; color: var(--accent); font-size: var(--fs-lg); transform: rotate(90deg); transition: transform .2s; }
.lib-head[aria-expanded="false"] .lib-fold { transform: none; }

/* ---------- game ---------- */
.hud { background: rgba(10, 14, 24, .6); flex-wrap: nowrap; }
.hud-stats { display: flex; gap: 26px; justify-content: center; min-width: 0; }
.hud-item { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.hud-item span:last-child { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-label { color: var(--text-dim); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; }

.game-song-line {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 4px 18px 10px; color: var(--text-dim); font-size: var(--fs-sm); min-width: 0;
}
#game-song-title {
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto;
}
.game-song-line #game-song-title { min-width: min(40%, 12ch); }
@media (max-width: 520px) {
  .game-song-line { flex-wrap: wrap; row-gap: 2px; }
  .game-song-line #game-song-title { flex: 1 1 100%; text-align: center; }
}
#game-mode-badge { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* The stage holds the highway and (for touch play) the fingerboard pad. In
   portrait the pad sits below with one column per string; in landscape it
   sits left of the hit line with one row per string. */
.stage {
  position: relative; flex: 1; min-height: 0; min-width: 0;
  display: flex; gap: 6px; margin: 0 12px 10px; touch-action: none;
}
.stage.vertical { flex-direction: column; }
.stage.horizontal { flex-direction: row-reverse; }
.highway-wrap { position: relative; flex: 1; min-height: 0; min-width: 0; }
/* The tempo light (beatlight.js): a dark lamp, lit by --beat; gold on a bar's first beat. */
.beat-light { position: absolute; z-index: 6; left: var(--light-x, 10px); top: var(--light-y, 10px); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none;
  background: #1c2238; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.beat-light::after { content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: var(--beat, 0);
  background: #9bdcff; box-shadow: 0 0 10px 3px rgba(155, 220, 255, .8); }
.beat-light.down::after { background: var(--gold-hi); box-shadow: 0 0 12px 4px rgba(245, 165, 36, .9); }
.beat-light[hidden] { display: none; }
/* On the sheet music page: beside Pause, only while the music plays. */
.sheet-actions .beat-light { position: relative; top: auto; left: auto; flex: none; align-self: center; margin: 0 6px 0 0; display: none; }
#screen-classic-sheet.running .sheet-actions .beat-light:not([hidden]) { display: block; }
.highway-wrap canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 14px; border: 1px solid var(--panel-edge);
  background: #0d1322; touch-action: none;
}

.touchpad, .fingerpad { display: grid; gap: 4px; flex: none; touch-action: none; }
.touchpad, .touchpad *, .fingerpad, .fingerpad * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stage.vertical .touchpad.normal { height: min(40%, 320px); }
.stage.vertical .touchpad.easy, .stage.vertical .touchpad.bow { height: min(24%, 150px); }
.stage.horizontal .touchpad.normal { width: min(44%, 380px); }
.stage.horizontal .touchpad.easy, .stage.horizontal .touchpad.bow { width: min(24%, 170px); }
/* Bow only: the lanes join into one surface to tap anywhere. */
.touchpad.bow { position: relative; gap: 0; overflow: hidden; border-radius: 12px; }
/* Bow only: no strings, no lanes, and not a neck: one area across the whole
   width (the highway above has the one string), with the bow lying on it. */
.stage.vertical .touchpad.bow { height: min(26%, 170px); margin: 0 -12px -10px; border-radius: 0; }
.stage.horizontal .touchpad.bow { margin: 0 0 -10px -12px; border-radius: 0; }
.touchpad.bow, .touchpad.bow.wood-ebony, .touchpad.bow.wood-rosewood {
  background: linear-gradient(180deg, #241c3e, #120f22);
  box-shadow: inset 0 2px 0 rgba(245, 165, 36, .55), inset 0 10px 20px rgba(0, 0, 0, .45); }
.touchpad.bow .cell, .touchpad.bow .cell.down { background: transparent; border: 0; }
.touchpad.bow .cell::before { display: none; }
.bow-string { position: absolute; z-index: 1; pointer-events: none; background: var(--sc); box-shadow: 1px 1px 2px rgba(0, 0, 0, .6); }
.touchpad.vertical .bow-string { left: 50%; top: 0; bottom: 0; width: var(--sw); transform: translateX(-50%); }
.touchpad.horizontal .bow-string { top: 50%; left: 0; right: 0; height: var(--sw); transform: translateY(-50%); }
.touchpad.bow .ripple { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 3px solid var(--accent); pointer-events: none; opacity: 0; animation: ripple .7s ease-out both; }
@keyframes ripple {
  0% { transform: scale(.3); opacity: .95; }
  100% { transform: scale(5); opacity: 0; border-width: 1px; }
}
@media (prefers-reduced-motion: reduce) { .touchpad.bow .ripple { display: none; } }
.touchpad.bow.vertical .cell, .touchpad.bow.horizontal .cell { border: 0; border-radius: 0; }
.touchpad.bow .cell:first-child { border-radius: 12px 0 0 12px; }
.touchpad.bow .cell:last-child { border-radius: 0 12px 12px 0; }
.touchpad.bow.horizontal .cell:first-child { border-radius: 12px 12px 0 0; }
.touchpad.bow.horizontal .cell:last-child { border-radius: 0 0 12px 12px; }
.touchpad.bow::after { content: attr(data-hint); position: absolute; inset: 0; display: grid; place-items: start center; padding: 6px 8px;
  text-align: center; font-weight: 700; font-size: var(--fs-xs); color: var(--text-dim); pointer-events: none; }
.touchpad.bow.horizontal::after { place-items: end center; }
/* The bow lies across the strings and follows the finger (touchpad.js sets
   --bl its length, --bx how far along it has moved, --by where it crosses);
   across the pad in portrait, up and down it in landscape. */
.touchpad .bow { position: absolute; z-index: 2; pointer-events: none; width: var(--bl, 60%); height: 22px;
  left: 50%; top: var(--by, 60%); transform: translate(-50%, -50%) translateX(var(--bx, 0px));
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
.touchpad.horizontal .bow { left: var(--by, 60%); top: 50%; transform: translate(-50%, -50%) translateY(var(--bx, 0px)) rotate(90deg); }
.touchpad .bow.auto { transition: transform var(--bt, .4s) ease-in-out; }
.touchpad .bow svg { display: block; width: 100%; height: 100%; overflow: visible; transform: scaleX(-1); } /* frog on the right */
.bow .hair { fill: #e9dfc6; transition: fill .1s; }
.bow .stick { fill: none; stroke: #8a3c1a; stroke-width: 5px; stroke-linecap: round; }
.bow .frog { fill: #14100e; }
.bow .eye { fill: #e8e2f5; opacity: .85; }
.bow .button { fill: #c8c4bc; }
.bow .tip { fill: #f1ead8; }
.bow.on .hair { fill: #fff6dc; }
.bow.on { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)) drop-shadow(0 0 6px rgba(245, 165, 36, .75)); }
/* Bow only, a note on its way: the bow pulses to be picked up. */
.bow.cue:not(.on) { animation: bow-cue .5s ease-in-out infinite alternate; }
@keyframes bow-cue {
  from { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)) drop-shadow(0 0 1px rgba(245, 165, 36, .4)); }
  to { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)) drop-shadow(0 0 10px rgba(245, 165, 36, 1)); }
}
@media (prefers-reduced-motion: reduce) { .bow.cue:not(.on) { animation: none; } }
/* The surface doesn't light up under the finger: the bow does. */
.touchpad.bow .cell.down { background: rgba(10, 14, 26, .5); transform: none; }
/* A hit: the bow flares gold (touchpad.js flash), then settles back. */
.bow.hit { animation: bow-hit .4s ease-out; }
.bow.hit .hair { animation: hair-hit .4s ease-out; }
@keyframes bow-hit {
  from { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)) drop-shadow(0 0 14px rgba(255, 204, 77, 1)) drop-shadow(0 0 4px rgba(255, 244, 214, .9)); }
}
@keyframes hair-hit { from { fill: #ffe7a0; } }
@media (prefers-reduced-motion: reduce) { .touchpad .bow.auto { transition: none; } }

/* Two-hand: finger zones for one thumb, a bow cell per string for the other.
   Landscape: [fingers | highway → | bow]. Portrait: the finger column runs
   up the left side, the bow pad sits under the highway's lanes. */
.stage.twohand.horizontal { flex-direction: row; }
.stage.twohand.horizontal .fingerpad { order: 0; width: min(30%, 250px); }
.stage.twohand.horizontal .highway-wrap { order: 1; }
.stage.twohand.horizontal .touchpad { order: 2; width: min(20%, 150px); }
.stage.twohand.vertical {
  display: grid; grid-template-columns: minmax(64px, 24%) 1fr; grid-template-rows: 1fr auto;
}
.stage.twohand.vertical .highway-wrap { grid-column: 2; grid-row: 1; }
.stage.twohand.vertical .touchpad { grid-column: 2; grid-row: 2; height: min(22vh, 140px); }
.stage.twohand.vertical .fingerpad {
  grid-column: 1; grid-row: 1 / 3; align-self: end; height: min(100%, 64vh, 440px);
}
.fingerpad { --c: #c4b5fd; }
.fingerpad.vertical .cell { border-top: 3px solid var(--c); }
.fingerpad.horizontal .cell { border-left: 3px solid var(--c); }
.fingerpad .cell.open { opacity: .8; }
.cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-width: 0; min-height: 0; overflow: hidden;
  background: rgba(26, 34, 54, .92);
  border: 1px solid var(--panel-edge); border-radius: 10px;
  color: var(--text); cursor: pointer;
  transition: background .06s linear, transform .06s linear;
}
.touchpad.vertical .cell { border-top: 3px solid var(--c); }
.touchpad.horizontal .cell { border-left: 3px solid var(--c); }
.cell b { font-size: clamp(16px, 4.2vmin, 26px); font-weight: 800; line-height: 1; }
.cell small { font-size: var(--fs-xs); color: var(--text-dim); }
.cell.open b { color: var(--c); }
.cell.target { box-shadow: inset 0 0 0 2px var(--c); }
.cell.demo { background: #2a3452; background: color-mix(in srgb, var(--c) 40%, #1a2236); }
.cell.down { background: var(--c); color: #10131c; transform: scale(.96); }
.cell.down b, .cell.down small { color: #10131c; }
.cell.hit { animation: cell-hit .35s ease-out; }
/* The place to play the next note (touchpad.js: cue) pulses: its edges
   breathe with light while a ring closes in on it. */
.cell.cue { outline: 2px solid transparent; animation: cue-ring 1s ease-out infinite; }
.cell.cue.hit { animation: cell-hit .35s ease-out, cue-ring 1s ease-out infinite; }
.cell.cue::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  animation: cue-glow .5s ease-in-out infinite alternate; }
.cell.cue.down, .cell.cue.down::after { animation: none; outline: 0; }
@keyframes cue-ring {
  0% { outline-color: var(--c); outline-offset: 0; }
  100% { outline-color: transparent; outline-offset: -16px; }
}
@keyframes cue-glow {
  from { box-shadow: inset 0 0 0 2px var(--c), inset 0 0 4px 0 var(--c); }
  to { box-shadow: inset 0 0 0 3px var(--c), inset 0 0 20px 5px var(--c); }
}
@media (prefers-reduced-motion: reduce) {
  .cell.cue, .cell.cue.hit { animation: none; }
  .cell.cue::after { animation: none; box-shadow: inset 0 0 0 3px var(--c), inset 0 0 14px 3px var(--c); }
}

/* A hit: the button played pulses gold. */
@keyframes cell-hit {
  from { box-shadow: 0 0 0 3px #ffd36b, 0 0 26px 8px rgba(255, 204, 77, .85), inset 0 0 18px 4px rgba(255, 220, 130, .55); }
  to { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent, inset 0 0 0 0 transparent; }
}

.game-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 0 max(12px, var(--safe-r)) 6px max(12px, var(--safe-l)); }
.game-foot .pitch-readout { flex: 1; min-width: 0; }
.btn-pause { flex: none; min-width: 64px; min-height: 46px; font-size: var(--fs-md); }
.btn-pause .lbl { display: inline; }
/* A phone on its side has no height to spare: Pause floats in the corner. */
@media (orientation: landscape) and (max-height: 600px) {
  .btn-pause { position: absolute; z-index: 30; right: max(10px, var(--safe-r)); bottom: calc(12px + var(--safe-b)); min-height: 44px; }
  .btn-pause .lbl { display: none; }
}
.pitch-readout { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px; }
#screen-game[data-input="touch"] .pitch-readout,
#screen-game[data-input="listen"] .pitch-readout { display: none; }
.pitch-meter {
  position: relative; width: 260px; max-width: 60vw; height: 14px;
  background: linear-gradient(90deg, #7f1d1d 0%, #14532d 42%, #14532d 58%, #7f1d1d 100%);
  border-radius: 999px; border: 1px solid var(--panel-edge); overflow: hidden;
}
.pitch-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.8); }
.pitch-needle {
  position: absolute; top: 1px; bottom: 1px; width: 8px; border-radius: 4px;
  background: var(--accent); left: 50%; transform: translateX(-50%);
  transition: left .06s linear; opacity: 0;
}
.pitch-note { min-width: 70px; font-weight: 700; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }

/* An in-song notice (toast() during a song): one quiet line under the song
   bar, no box, clear of the Encore meter, and never in the way of a tap
   (Doug: the boxed toast sat over the pad's buttons). */
.game-notice { position: absolute; z-index: 7; top: 34px; left: 84px; right: 84px; pointer-events: none; user-select: none;
  -webkit-user-select: none; text-align: center; font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .7); animation: game-notice 4.5s ease-out both; }
.game-notice .icon { vertical-align: -2px; }
@keyframes game-notice { 0% { opacity: 0; transform: translateY(-4px); } 6% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .game-notice { animation: none; } }
/* The song bar (songbar.js), across the top of the highway: a start post,
   the stretches played so far colored by how they went, an end flag, and
   an oversized playhead. */
.song-bar { position: absolute; z-index: 7; top: 8px; left: 16px; right: 28px; height: 18px; pointer-events: none; --p: 0;
  --bar-good: var(--good); --bar-some: #f5a524; --bar-bad: var(--bad); --bar-rest: rgba(255, 255, 255, .3); }
.song-bar canvas { position: absolute; left: 0; top: 5px; width: 100%; height: 8px; border-radius: 4px;
  background: rgba(0, 0, 0, .6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.song-bar-start, .song-bar-end { position: absolute; top: -1px; width: 3px; height: 20px; border-radius: 2px; background: #efe4c8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.song-bar-start { left: -5px; }
.song-bar-end { right: -5px; }
.song-bar-end::after { content: ''; position: absolute; left: 3px; top: 0; border-left: 10px solid #efe4c8;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.song-bar-head { position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e6, var(--accent) 55%, #8a5208);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 0 12px rgba(245, 165, 36, .75); }

/* ---------- overlay ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(5, 8, 15, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
#mic-dialog, #part-dialog, #import-dialog { position: fixed; } /* opened from far down a long page: stay on screen */
#import-dialog .overlay-card { max-height: 100%; overflow-y: auto; } /* a long list of problems scrolls inside */

/* Import songs dialog. */
#import-dialog { position: fixed; z-index: 40; }
.import-card { max-width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; text-align: left; }
.import-list { display: flex; flex-direction: column; gap: 10px; }
.import-row {
  border: 1px solid var(--panel-edge); border-radius: 12px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.import-row h4 { font-size: var(--fs-md); overflow-wrap: anywhere; }
.import-row.import-bad { border-color: var(--bad); }
.import-problems { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
.import-problems .err { color: var(--bad); }
.import-problems .warn { color: var(--text-dim); }
.import-modes { display: flex; gap: 18px; }
.import-msg { color: var(--accent); font-size: var(--fs-sm); }
.import-msg:empty { display: none; }
.import-buttons { display: flex; gap: 10px; justify-content: flex-end; }
.song-row.song-row-off { opacity: .55; }
/* Not yet earned in Just Play: listed so you see what's ahead, dimmed, with why. */
.song-row.song-row-locked .song-info { opacity: .6; }
.song-lock { margin-top: 3px; font-size: var(--fs-xs); color: var(--text-dim); }

/* ---------- song maker ---------- */
.maker-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-self: center;
  width: calc(100% - 36px); max-width: 940px; padding: 8px 0 14px;
}
#maker-dialog, #sheet-dialog { position: fixed; z-index: 40; }
#sheet-dialog select, #sheet-dialog .sheet-bars input {
  font: inherit; color: var(--text); background: var(--bg0); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 8px 10px;
}
#sheet-dialog .sheet-bars { display: flex; align-items: center; gap: 8px; }
#sheet-dialog .sheet-bars input { width: 5em; text-align: center; }
.maker-field { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: var(--fs-sm); }
.maker-field input[type=text], .maker-part input[type=text], .maker-part select {
  font: inherit; color: var(--text); background: var(--bg0);
  border: 1px solid var(--panel-edge); border-radius: 8px; padding: 8px 10px;
}
.maker-transport {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; align-self: center;
  width: calc(100% - 36px); max-width: 940px; padding-bottom: 12px;
}
.maker-time { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.maker-parts { display: flex; flex-direction: column; gap: 12px; align-self: center; width: calc(100% - 36px); max-width: 940px; }
.maker-part {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.maker-part-head, .maker-part-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.maker-part-head input[type=text] { flex: 1; min-width: 140px; font-weight: 700; }
.maker-part-foot { color: var(--text-dim); font-size: var(--fs-sm); }
.maker-part-foot .grow { flex: 1; }
.maker-lane {
  position: relative; height: 84px; border-radius: 8px; background: var(--bg0);
  overflow: hidden; cursor: pointer;
}
.maker-lane canvas { display: block; width: 100%; height: 100%; }
.maker-lane.empty { display: flex; align-items: center; justify-content: center; cursor: default; color: var(--text-dim); }
.maker-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
/* Beat grid panel, and the bar-1 marker you can drag along a lane. */
.maker-grid {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; align-self: center;
  width: calc(100% - 36px); max-width: 940px; padding: 10px 14px; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
}
.maker-grid input[type=number] {
  width: 5.2em; font: inherit; color: var(--text); background: var(--bg0);
  border: 1px solid var(--panel-edge); border-radius: 8px; padding: 6px 8px;
}
.grid-hint { color: var(--text-dim); font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 6px; }
.grid-hint b { color: var(--text); }
.grid-break { flex-basis: 100%; height: 0; }
.grid-bar1 {
  position: absolute; top: 0; bottom: 0; width: 14px; margin-left: -7px; cursor: ew-resize; touch-action: none;
}
.grid-bar1.locked { cursor: default; } /* a tempo map sets bar 1 */
.grid-bar1::before { content: ''; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; background: #f97316; }
.grid-bar1::after {
  content: '1'; position: absolute; top: 2px; left: 9px; font-size: var(--fs-xs); font-weight: 800; color: #f97316;
}
.maker-part.muted .maker-lane canvas { opacity: .35; }
/* Speed, zoom and the note editor. */
.maker-speed input[type=range] { width: 120px; accent-color: var(--accent); }
.maker-speed b { min-width: 3.2em; font-variant-numeric: tabular-nums; }
.maker-zoom {
  display: flex; align-items: center; gap: 8px; align-self: center;
  width: calc(100% - 36px); max-width: 940px; margin-bottom: 10px;
}
.maker-zoom-label { color: var(--text-dim); font-size: var(--fs-sm); }
.maker-parts.editing, .maker-zoom.editing { max-width: 1280px; }
.maker-part.strip { padding: 6px 12px; gap: 6px; }
.maker-part.strip .maker-lane { height: 34px; }
.maker-part.strip .maker-part-foot { display: none; }
.maker-part.editing { border-color: var(--accent); }
.maker-part.editing .maker-lane { height: 120px; border-radius: 8px 8px 0 0; }
.maker-roll {
  position: relative; margin-top: -8px; /* flush under the waveform: one playhead line */
  background: #0b1220; border-radius: 0 0 8px 8px; overflow: hidden;
}
.maker-roll canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.maker-roll-help { color: var(--text-dim); font-size: var(--fs-xs); }
.maker-roll-help kbd {
  font: inherit; font-size: var(--fs-xs); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--panel-edge); background: var(--bg0); color: var(--text);
}
.overlay.hidden { display: none; }
.overlay-card {
  background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: 16px; padding: 30px 36px; text-align: center;
  display: flex; flex-direction: column; gap: 12px; max-width: min(420px, 92vw);
}
.overlay-card h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
#pause-overlay .overlay-card { max-height: 100%; overflow-y: auto; }
.pause-opts {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  padding: 10px 0; border-top: 1px solid var(--panel-edge); border-bottom: 1px solid var(--panel-edge);
}
.pause-opts .opt { justify-content: space-between; }
.pause-opts .opt.opt-check { justify-content: flex-start; }
.pause-opts select { flex: 1; min-width: 0; max-width: none; }
.pause-note { color: var(--accent) !important; font-size: var(--fs-sm) !important; }
.overlay-card p { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5; }

/* ---------- results ---------- */
.stars { font-size: var(--fs-2xl); letter-spacing: 8px; color: var(--accent); text-shadow: 0 4px 30px rgba(245,165,36,.4); }
.stars .off { -webkit-text-stroke: 1px #3a4664; color: transparent; }
.results-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; text-align: center; }
.results-grid div { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; min-width: 0; } /* a label on two lines: the numbers still line up */
.results-grid .hud-label { font-size: var(--fs-xs); letter-spacing: .08em; }
.results-grid b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
/* Results: what happened and what next on one phone screen, no scrolling
   (Doug: there's enough room). Tighter gaps, one row of numbers, and the
   buttons two to a row under the one that glows. */
#screen-results .menu-wrap { justify-content: flex-start; gap: 7px; width: 100%; max-width: 560px; margin: 0 auto; padding: 6px 16px 14px; }
#screen-results #results-title { margin: 0; font-size: var(--fs-xl); line-height: 1.15; text-wrap: balance; }
#screen-results .stars { font-size: var(--fs-2xl); letter-spacing: 6px; line-height: 1; }
#screen-results .journey-note { width: 100%; padding: 7px 12px; font-size: var(--fs-sm); line-height: 1.35; }
#screen-results .menu-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 0; }
#screen-results .res-practice { display: contents; }
#screen-results .menu-buttons .btn { min-width: 0; margin: 0; }
#screen-results .menu-buttons .btn-next { grid-column: 1 / -1; }
#screen-results .menu-buttons .btn:not(.btn-next) { padding: 11px 8px; font-size: var(--fs-md); }
#screen-results :is(.results-grid, .res-xp, .challenges, .res-style) { width: 100%; margin: 0; padding: 10px 12px; }
#screen-results .challenges { gap: 3px; }
#screen-results .res-feedback { margin-top: 0; }

/* ---------- classic (sheet music) ---------- */
.section-label {
  align-self: center; width: 100%; max-width: 980px; padding: 8px 18px 0;
  color: var(--text-dim); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.song-hint { color: var(--text-dim); text-align: center; padding: 10px; }

/* Paper-white page with black engraving, like a printed part. */
.sheet {
  align-self: center; width: calc(100% - 36px); max-width: 940px; margin-bottom: 30px;
  background: #fbf8f1; color: #111; border-radius: 10px; padding: 22px 20px 30px;
}
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 4px 12px;
  grid-template-areas: "part title composer";
  font-family: Georgia, 'Times New Roman', serif; margin-bottom: 4px;
}
.sheet-part { grid-area: part; font-style: italic; }
.sheet-title { grid-area: title; font-size: var(--fs-xl); font-weight: 600; text-align: center; }
.sheet-composer { grid-area: composer; text-align: right; }
/* Phones: title on its own line, instrument and composer beneath it. */
@media (max-width: 600px) {
  .sheet { padding: 16px 10px 24px; }
  .sheet-head { grid-template-columns: 1fr 1fr; grid-template-areas: "title title" "part composer"; }
  .sheet-title { font-size: var(--fs-lg); }
}
.sheet-music { overflow-x: auto; position: relative; }
.sheet-music svg { display: block; }
/* Reading aids laid over a part shown as printed (its imported score). */
.printed-aid {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  font: bold 11px Arial, sans-serif; color: #111;
}
.printed-aid.own { font: italic 13px Georgia, serif; color: #64748b; }
.sheet-note { margin: 4px 0 10px; text-align: center; color: #b45309; font-size: var(--fs-sm); }
/* The playing position: a thin line laid over the music. */
.sheet-cursor {
  position: absolute; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: rgba(245, 120, 36, .85); pointer-events: none;
}
.sheet-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  align-self: center; width: calc(100% - 36px); max-width: 940px; padding: 0 0 12px;
}
.sheet-status { flex: 1 1 220px; color: var(--accent); font-size: var(--fs-sm); }
.sheet-status:empty { display: none; }
/* The settings fold away (by default on a phone), and everything but Pause
   steps aside while playing, so the music has the screen. */
#screen-classic-sheet.tools-folded .sheet-tools > .opt,
#screen-classic-sheet.tools-folded #classic-display,
#screen-classic-sheet.tools-folded .finger-tools,
#screen-classic-sheet.running .sheet-tools > .opt,
#screen-classic-sheet.running #classic-display,
#screen-classic-sheet.running .finger-tools,
#screen-classic-sheet.running .sheet-tools > .pace,
#screen-classic-sheet.running #classic-settings,
#screen-classic-sheet.running #classic-loop,
/* A run from a song's card: chosen there, so no setup bar, and no help strip. */
#screen-classic-sheet.is-run .sheet-tools > .opt,
#screen-classic-sheet.is-run #classic-display,
#screen-classic-sheet.is-run .finger-tools,
#screen-classic-sheet.is-run .sheet-tools > .pace,
#screen-classic-sheet.is-run #classic-settings,
#screen-classic-sheet.is-run #classic-loop,
#screen-classic-sheet.is-run #pace-help,
#screen-classic-sheet.is-run #pace-help-show { display: none; }
/* Loop + Start/Pause stay together at the right, and wrap as a pair. */
.sheet-actions { display: flex; gap: 10px; margin-left: auto; }
#classic-start { min-width: 110px; }

/* Played notes: green = right, red = missed. Beats VexFlow's fill attributes. */
.sheet-music .mark-hit, .sheet-music .mark-hit * { fill: #15803d; stroke: #15803d; }
.sheet-music .mark-miss, .sheet-music .mark-miss * { fill: #dc2626; stroke: #dc2626; }
/* Practice: right after a wrong try first. */
.sheet-music .mark-amber, .sheet-music .mark-amber * { fill: #d97706; stroke: #d97706; }

/* Display ▾: a small dropdown of how the sheet looks. */
.display-menu { position: relative; }
.display-menu summary { list-style: none; cursor: pointer; }
.display-menu summary::-webkit-details-marker { display: none; }
.display-panel {
  position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; min-width: 210px;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* Fingerings: an on/off button, then Edit and the edit tools beside it. */
.finger-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.toggle.on { background: var(--accent); border-color: var(--accent); color: #1a1205; font-weight: 700; }

/* Edit my fingerings: tappable notes, and the little picker beside a note. */
#screen-classic-sheet.editing .sheet-music { cursor: pointer; }
.finger-picker {
  position: fixed; z-index: 25; display: flex; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transform: translateX(-50%);
}
.finger-picker button {
  min-width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  background: var(--bg1); color: var(--text); border: 1px solid var(--panel-edge);
  font: inherit; font-weight: 700;
}
@media (hover: hover) { .finger-picker button:hover { border-color: var(--accent); } }
.finger-picker .finger-clear { font-weight: 500; padding: 0 8px; color: var(--text-dim); }

/* Pace switch: Perform | Practice. */
.pace { display: flex; }
.pace .btn { border-radius: 0; }
.pace .btn:first-child { border-radius: 10px 0 0 10px; }
.pace .btn:last-child { border-radius: 0 10px 10px 0; border-left: none; }
.pace .btn.on { background: var(--accent); border-color: var(--accent); color: #1a1205; font-weight: 700; }
#screen-classic-sheet.practice [data-perform-only] { display: none; }

/* How the selected pace works: a strip between the toolbar and the paper. */
.pace-help {
  position: relative; align-self: center; width: calc(100% - 36px); max-width: 940px;
  margin-bottom: 12px; padding: 12px 64px 12px 16px;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px;
  color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.45;
}
.pace-help p + p { margin-top: 4px; }
.pace-help b { color: var(--text); }
#screen-classic-sheet.practice [data-help="perform"],
#screen-classic-sheet:not(.practice) [data-help="practice"] { display: none; }
.pace-help .dot {
  display: inline-block; width: .7em; height: .7em; border-radius: 50%;
  margin-right: .35em; vertical-align: baseline;
}
.dot-hit { background: #15803d; }
.dot-miss { background: #dc2626; }
.dot-amber { background: #d97706; }
.pace-help-link {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font: inherit; font-size: var(--fs-sm); padding: 4px 6px;
}
.pace-help #pace-help-hide { position: absolute; top: 8px; right: 8px; }
.pace-help-show { align-self: center; width: calc(100% - 36px); max-width: 940px; text-align: left; margin: -4px 0 8px; }

/* Pause menu and summary: a card pinned to the bottom of the screen. */
.sheet-card {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(18px + var(--safe-b, 0px)); width: min(560px, calc(100% - 24px));
  background: var(--panel); border: 1px solid var(--accent); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  padding: 18px 20px; text-align: center; display: flex; flex-direction: column; gap: 8px;
}
.sheet-card h3 { font-size: var(--fs-lg); }
.sheet-card p { color: var(--text-dim); }
.sheet-card .summary-acc b { color: var(--text); font-size: var(--fs-2xl); display: block; }
.sheet-card .summary-best { color: var(--accent); }
.sheet-card-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.sheet-card-buttons small { color: var(--text-dim); font-size: var(--fs-xs); }
.sheet-card-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 12px; text-align: left; }
.sheet-card-opts .opt { margin: 0; }
.map-sheet-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
.map-sheet-opts .opt { margin: 0; }
.map-sheet-style { justify-content: space-between; margin-bottom: 8px; }
/* Loop a section: the bar pickers, and the chosen bars shaded on the paper. */
.section-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
.section-pick label { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.section-pick input {
  width: 3.4em; text-align: center; font: inherit; font-weight: 700;
  background: var(--bg0); color: var(--text); border: 1px solid var(--panel-edge);
  border-radius: 8px; padding: 6px 4px;
}
.bar-shade {
  position: absolute; pointer-events: none; border-radius: 4px;
  background: rgba(245, 165, 36, .22); outline: 2px solid rgba(245, 165, 36, .55);
}
#screen-classic-sheet.picking .sheet-music { cursor: pointer; }

/* Page turns: the help strip steps aside while playing, and a heavier seam
   marks where the top half has already turned to the next page. */
#screen-classic-sheet.paging .pace-help,
#screen-classic-sheet.paging .pace-help-show { display: none; }
.page-seam {
  position: absolute; left: 0; right: 0; height: 0; margin-top: -2px;
  border-top: 4px double #8a7a5a; pointer-events: none;
}

/* Room to scroll the last lines above an open card. */
#screen-classic-sheet.has-card .sheet { margin-bottom: 240px; }
.song-row .song-best { margin-right: 4px; }

/* ---------- tuner ---------- */
.tuner-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 10px 18px 34px;
}
#tuner-canvas { max-width: 94vw; height: auto; }
.tuner-note { font-size: 3rem; font-weight: 800; min-height: 1.2em; }
.tuner-cents { color: var(--text-dim); font-size: var(--fs-md); min-height: 1.4em; text-align: center; }
.tuner-ref { display: flex; align-items: center; gap: 10px; color: var(--text-dim); }
.tuner-ref-box {
  display: flex; align-items: center; gap: 4px; padding: 6px 10px;
  border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--panel);
}
.tuner-ref-box input {
  width: 3.2ch; border: none; background: none; color: var(--text);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right;
  -moz-appearance: textfield; appearance: textfield; /* hide the browser's own spinner */
}
.tuner-ref-box input::-webkit-inner-spin-button,
.tuner-ref-box input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tuner-ref-box input:focus { outline: none; }
.tuner-ref-box:focus-within { border-color: var(--accent); }
.tuner-strings { display: flex; gap: 12px; }
.tuner-strings button {
  width: 58px; height: 58px; border-radius: 50%;
  font-weight: 800; font-size: var(--fs-md);
  border: 2px solid var(--panel-edge); background: var(--panel); color: var(--text);
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.tuner-strings button.near {
  border-color: var(--accent); box-shadow: 0 0 24px rgba(245,165,36,.35);
}
.tuner-strings button.in-tune { border-color: var(--good); box-shadow: 0 0 24px rgba(74,222,128,.4); }

/* ---------- tap timing ---------- */
.calib-help { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5; padding: 0 18px 10px; max-width: 760px; align-self: center; }
.calib-stage { margin: 0 18px 10px; }
.calib-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 18px; padding: 0 18px 16px;
}
#calib-status { color: var(--text); font-size: var(--fs-sm); text-align: center; }
.calib-buttons { display: flex; gap: 10px; }

/* ---------- phones ---------- */
@media (pointer: coarse) {
  .btn, .opt select { min-height: 44px; }
  .btn-small { min-height: 40px; }
}

@media (max-width: 640px) {
  .bar { padding: 10px 12px; gap: 8px; }
  .bar h2 { font-size: var(--fs-md); text-align: center; }
  .wide-only { display: none; }
  .btn-big { min-width: 220px; }
  .hud { padding: 6px 10px; }
  .hud .lbl { display: none; }
  .hud .btn { padding: 8px 12px; }
  .hud-stats { gap: 10px; }
  .hud-item { min-width: 44px; }
  .hud-item span:last-child { font-size: var(--fs-md); }
  .hud-label { font-size: var(--fs-xs); letter-spacing: .06em; }
  .game-song-line { padding: 2px 12px 6px; font-size: var(--fs-sm); }
  .stage { margin: 0 8px 8px; }
  .panel { margin: 0 12px 12px; padding: 14px 16px; }
  .song-options { gap: 12px; }
  .opt { width: 100%; justify-content: space-between; }
  .opt select { max-width: 68%; }
  .opt input[type=range] { flex: 1; width: auto; }
  .song-list { padding: 0 12px 24px; }
  .song-row { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .song-row .song-info { flex-basis: 100%; }
  .song-row .btn { flex: 1; }
  /* Two across, so all six instruments are on the first screen. */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px 12px 24px; gap: 10px; }
  .card { padding: 14px 8px 12px; }
  .card h3 { margin: 8px 0 4px; font-size: var(--fs-md); }
  .card .desc { margin-bottom: 10px; font-size: var(--fs-xs); line-height: 1.3; }
  .card .desc .tuning { display: none; } /* the strings below say it */
  .card .strings { gap: 4px; flex-wrap: wrap; }
  .card .strings span { width: 24px; height: 24px; font-size: var(--fs-xs); }
  .inst-pic .inst-icon { height: 72px; }
}

@media (max-height: 560px) {
  .game-song-line { display: none; }
  .overlay-card { padding: 16px 22px; gap: 8px; }
  .overlay-card h3 { margin-bottom: 0; }
  .hud { padding: 4px 10px; }
  .pitch-readout { padding: 4px; }
  .calib-help { display: none; }
}

/* ---------- desktop / keyboard / custom song ---------- */
/* A game controller's highlight (gamepad.js): shown only while the controller
   is in use, on whatever the D-pad has moved to. */
html.pad-nav :focus {
  outline: 3px solid #f0d68c !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(240, 214, 140, 0.28) !important;
}
.keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  padding: 6px 14px;
  font-size: var(--fs-sm);
  color: var(--dim);
  backdrop-filter: blur(4px);
  margin-top: 4px;
  user-select: none;
}
.keyboard-hint b { color: var(--accent, #60a5fa); }
/* A wide screen (a desktop, a tablet on its side): the stage lies sideways
   with height to spare. Each string grows to fit the window (up to 140px; a
   phone on its side keeps 68px), the finger pad widens with it, and the
   keyboard hint leaves the stage's row, where it stood as a full-height
   column, for the strip under the stage, across from Pause. */
@media (min-width: 1000px) and (min-height: 600px) {
  .stage.horizontal { --lane-px: clamp(68px, calc((100dvh - 250px) / var(--lanes, 4)), 140px); }
  .stage.horizontal:not(.twohand):not(.is-measuring):has(> .touchpad:not([hidden]):not(.bow)) {
    flex: 0 1 auto; height: calc(var(--lanes, 4) * var(--lane-px) + 16px); max-height: 100%; margin-block: auto; }
  .stage.horizontal .touchpad.normal { width: min(44%, calc(var(--lane-px) * 5.6)); }
  .stage.horizontal .touchpad.easy { width: min(24%, calc(var(--lane-px) * 2.2)); }
  .stage.horizontal .keyboard-hint { position: absolute; z-index: 5; left: 0; top: calc(100% + 10px); max-width: calc(100% - 160px); margin: 0; }
}
.keyboard-hint small { color: var(--dim); }
.kb-badge {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Choosing your part of a song-maker song. */
.part-list { display: flex; flex-direction: column; gap: 8px; }
.part-list .btn { justify-content: space-between; text-align: left; display: flex; gap: 12px; }
.part-list .btn small { color: var(--text-dim); font-weight: 400; }
.part-with { color: var(--text-dim); font-size: var(--fs-sm); margin: 0; }
.part-mix { display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: var(--fs-sm); }
.part-mix-title { display: flex; justify-content: space-between; gap: 12px; }
.part-mix-title b { color: var(--text); font-variant-numeric: tabular-nums; }
.part-mix-row { display: flex; align-items: center; gap: 10px; }
.part-mix-row small { font-size: var(--fs-xs); white-space: nowrap; }
.part-mix-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }

/* ---------- Journey ---------- */
.view-tabs { justify-content: center; margin: 0 18px 12px; }
.view-tabs .btn { flex: 1; max-width: 220px; }
.journey-intro { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5; margin: 0 18px 12px; max-width: 860px; align-self: center; }
.stage-card {
  background: rgba(26, 34, 54, .55); border: 1px solid var(--panel-edge); border-radius: 14px;
  padding: 12px 16px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px;
}
.stage-card h3 { font-size: var(--fs-md); display: flex; align-items: center; gap: 10px; }
.stage-card h3 .stage-num {
  background: var(--accent); color: #1a1205; border-radius: 999px; font-size: var(--fs-xs);
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
}
.stage-card.locked h3 .stage-num { background: #3a4664; color: var(--text-dim); }
.stage-card p { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.45; }
.stage-progress { height: 6px; background: #1c2438; border-radius: 999px; overflow: hidden; }
.stage-progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hot)); }
.stage-meta { color: var(--text-dim); font-size: var(--fs-xs); }
.stage-card.complete .stage-meta { color: var(--good); }
.song-row.locked { opacity: .45; }
.song-level { color: var(--accent); font-size: var(--fs-xs); white-space: nowrap; }
.journey-note {
  color: var(--text); background: rgba(245,165,36,.12); border: 1px solid rgba(245,165,36,.4);
  border-radius: 12px; padding: 10px 14px; max-width: 520px; line-height: 1.5;
}

.song-settings-toggle {
  margin: 0 18px 12px; align-self: stretch; max-width: 860px; text-align: left;
  display: flex; justify-content: space-between; gap: 10px; color: var(--text-dim); font-size: var(--fs-sm);
}
.song-settings-toggle b { color: var(--text); font-weight: 600; }
@media (min-width: 900px) { .song-settings-toggle { align-self: center; width: calc(100% - 36px); } }
@media (max-width: 640px) { .song-settings-toggle { margin: 0 12px 10px; } }
.song-settings-toggle > span:last-child { white-space: nowrap; color: var(--accent); }

/* ---------- Daily practice ---------- */
.practice-card { width: min(100%, 360px); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.practice-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.practice-card .streak { font-weight: 700; }
.practice-top .today { margin-left: auto; }
.practice-card .streak.cold { color: var(--text-dim); font-weight: 600; }
.practice-card .today { color: var(--text-dim); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.practice-card .today.met { color: var(--good); }
.today-bar { height: 6px; background: #1c2438; border-radius: 999px; overflow: hidden; }
.today-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hot)); transition: width .4s; }
.today-bar.met > div { background: var(--good); }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 40px; }
.week-bars .day { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.week-bars .day i { display: block; width: 100%; max-width: 22px; min-height: 2px; border-radius: 3px; background: #2a3550; }
.week-bars .day.met i { background: var(--good); }
.week-bars .day.some i { background: var(--accent); }
.week-bars .day span { font-size: var(--fs-xs); color: var(--text-dim); }
.week-bars .day.today span { color: var(--text); font-weight: 700; }
.practice-card .goal { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-dim); font-size: var(--fs-sm); }
.practice-card select {
  background: var(--panel); color: var(--text); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 6px 8px;
}

/* ---------- Results: grades, the bar map, tips ---------- */
.res-grades { color: var(--text-dim); font-size: var(--fs-sm); }
.res-grades b { color: var(--text); }
.res-grades .combo {
  display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: var(--fs-xs);
  letter-spacing: .06em; color: #06281a; background: linear-gradient(90deg, #4ade80, #22d3ee);
}
.song-map { display: grid; grid-template-columns: repeat(var(--cols, 16), minmax(0, 1fr)); grid-auto-rows: 22px; gap: 3px; width: min(100%, 520px); }
.song-map.rows { grid-auto-rows: 15px; } /* a long song: rows of 16 bars */
.song-map .map-bar { min-width: 0; display: flex; gap: 1px; border-radius: 4px; overflow: hidden; background: #1c2438; outline-offset: 2px; }
.song-map .map-bar.worst { outline: 2px solid var(--accent); }
.song-map .map-bar i { display: block; min-width: 1px; background: #2a3550; }
.song-map .map-bar i.hit { background: rgba(74, 222, 128, .55); }
.song-map .map-bar i.perfect { background: var(--good); }
.song-map .map-bar i.miss { background: var(--bad); }
.res-tips { list-style: none; display: flex; flex-direction: column; gap: 6px; max-width: 520px; text-align: left; }
.res-tips li { font-size: var(--fs-sm); line-height: 1.45; padding-left: 22px; position: relative; color: var(--text); }
.res-tips li::before { content: '♪'; position: absolute; left: 4px; color: var(--accent); }
.res-today { color: var(--text-dim); font-size: var(--fs-sm); }
.res-today.met { color: var(--good); }
.awards-note { border-color: rgba(74, 222, 128, .45); background: rgba(74, 222, 128, .1); }
.res-practice { display: flex; gap: 10px; }
.res-practice .btn { flex: 1; }

/* ---------- Journey: summary, warm-up, recital ---------- */
.journey-summary { color: var(--text-dim); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.journey-summary b { color: var(--accent); }
.warmup-card { border-color: rgba(245, 165, 36, .45); }
.warmup-card h3 .stage-num { background: none; font-size: var(--fs-md); }
.warmup-card.done { border-color: rgba(74, 222, 128, .45); }
.warmup-card .warmup-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.warmup-card .warmup-done { color: var(--good); font-size: var(--fs-sm); margin-right: auto; }
.stage-recital { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-recital .trophy { color: var(--accent); font-size: var(--fs-sm); }
.song-badges { margin-left: 4px; }

/* ---------- Achievements ---------- */
.awards-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
  padding: 0 18px 24px; max-width: 980px; width: 100%; align-self: center;
}
.award {
  display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: center;
  background: rgba(26, 34, 54, .55); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 12px 14px;
}
.award .icon { grid-row: span 3; font-size: var(--fs-xl); text-align: center; }
.award h3 { font-size: var(--fs-sm); }
.award p { color: var(--text-dim); font-size: var(--fs-xs); }
.award .award-progress { height: 4px; background: #1c2438; border-radius: 999px; overflow: hidden; }
.award .award-progress > div { height: 100%; background: var(--accent); }
.award.locked .icon { filter: grayscale(1); opacity: .45; }
.award.done { border-color: rgba(245, 165, 36, .5); }
.award.done .icon { color: var(--accent); }
.award.done .award-progress { display: none; }
.bar-note { color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------- Toast & confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--accent); color: var(--text); border-radius: 12px;
  padding: 10px 16px; max-width: min(92vw, 440px); z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  font-size: var(--fs-sm); text-align: center;
}
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 59; }
.confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation: confetti-fall var(--fall, 2.2s) cubic-bezier(.25,.6,.4,1) forwards;
}
@keyframes confetti-fall {
  to { transform: translate(var(--drift, 0), 105vh) rotate(var(--spin, 540deg)); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* ============ The night world: home, launch screen and Game map ============ */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
:root {
  --gold-hi: #ffd27a;
  --gem: #1c9be0;
  --gem-hi: #8fe0ff;
  --sky: #0a1026;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}

/* The moving sky: an aurora and clouds drifting across, as in our other apps'
   aurora: soft tongues of color, screen-blended so they glow like light,
   moved with transforms only (painted once, then the GPU moves them), at prime
   durations so the field never visibly repeats. Slow and green, and behind
   the scenery, so it only shows in the sky. */
.aurora, .drift { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.aurora { mix-blend-mode: screen; opacity: .62; }
.aurora i { position: absolute; left: -40%; top: -40%; width: 180%; height: 180%; will-change: transform;
  transform-origin: 50% 40%; animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-direction: alternate; }
.aurora .a { background: radial-gradient(ellipse 15% 46% at 30% 30%, rgba(74, 222, 128, .7), transparent 68%); animation-name: au-a; animation-duration: 37s; }
.aurora .b { background: radial-gradient(ellipse 11% 52% at 60% 28%, rgba(45, 212, 191, .62), transparent 66%); animation-name: au-b; animation-duration: 43s; }
.aurora .c { background: radial-gradient(ellipse 19% 40% at 46% 34%, rgba(56, 189, 248, .42), transparent 70%); animation-name: au-c; animation-duration: 41s; }
.aurora .d { background: radial-gradient(ellipse 10% 48% at 80% 26%, rgba(167, 139, 250, .5), transparent 64%); animation-name: au-d; animation-duration: 53s; }
.aurora .e { background: radial-gradient(ellipse 13% 44% at 12% 32%, rgba(74, 222, 128, .5), transparent 66%); animation-name: au-e; animation-duration: 47s; }
@keyframes au-a { 0% { transform: translate3d(-8%, 3%, 0) skewX(9deg) rotate(-5deg); } 50% { transform: translate3d(11%, -4%, 0) scaleY(1.25) scaleX(.85) skewX(-10deg) rotate(5deg); } 100% { transform: translate3d(-3%, 5%, 0) scaleY(1.08) scaleX(1.1) skewX(6deg) rotate(-3deg); } }
@keyframes au-b { 0% { transform: translate3d(10%, -3%, 0) scaleY(1.1) skewX(-8deg) rotate(6deg); } 50% { transform: translate3d(-13%, 4%, 0) scaleY(.85) scaleX(1.22) skewX(12deg) rotate(-7deg); } 100% { transform: translate3d(6%, -5%, 0) scaleY(1.22) scaleX(.9) skewX(-5deg) rotate(4deg); } }
@keyframes au-c { 0% { transform: translate3d(2%, 5%, 0) scaleX(1.15) skewX(7deg) rotate(3deg); } 50% { transform: translate3d(-11%, -4%, 0) scaleY(1.3) scaleX(.88) skewX(-9deg) rotate(-5deg); } 100% { transform: translate3d(9%, 3%, 0) scale(.94) skewX(4deg) rotate(5deg); } }
@keyframes au-d { 0% { transform: translate3d(5%, -4%, 0) scaleY(.92) skewX(-11deg) rotate(4deg); } 50% { transform: translate3d(-15%, 3%, 0) scaleY(1.3) scaleX(1.08) skewX(9deg) rotate(-6deg); } 100% { transform: translate3d(3%, -2%, 0) scaleY(1.04) skewX(-6deg) rotate(2deg); } }
@keyframes au-e { 0% { transform: translate3d(-6%, 2%, 0) scaleY(1.15) skewX(8deg) rotate(-5deg); } 50% { transform: translate3d(12%, -3%, 0) scaleY(.9) scaleX(1.15) skewX(-10deg) rotate(6deg); } 100% { transform: translate3d(-2%, 4%, 0) scaleY(1.2) skewX(5deg) rotate(-2deg); } }
.drift i { position: absolute; left: -60%; width: 60%; border-radius: 50%; will-change: transform;
  background: radial-gradient(closest-side, rgba(196, 208, 245, .13), rgba(196, 208, 245, 0)); animation: drift linear infinite; }
.drift i:nth-child(1) { top: 12%; height: 16%; animation-duration: 131s; animation-delay: -20s; }
.drift i:nth-child(2) { top: 26%; height: 12%; width: 45%; left: -45%; animation-duration: 157s; animation-delay: -95s; }
.drift i:nth-child(3) { top: 40%; height: 14%; animation-duration: 173s; animation-delay: -60s; }
.drift i:nth-child(4) { top: 6%; height: 10%; width: 50%; left: -50%; animation-duration: 199s; animation-delay: -150s; }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(100vw + 100%), 0, 0); } }

/* ---------- home: the hero (the picture, who's playing, settings, the
   title), then the ways in, all one kind of button ---------- */
.sky { position: absolute; inset: 0; background:
  radial-gradient(120% 60% at 50% 105%, #2b2552 0%, rgba(43, 37, 82, 0) 60%),
  linear-gradient(180deg, var(--sky) 0%, #121a3d 45%, #1d1f48 70%, var(--bg0) 100%); }
.night, .skyline { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.living-sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#screen-menu.home { position: relative; padding: 0; isolation: isolate; overflow-x: hidden; overflow-y: auto; }
.home > .sky, .home > .night { z-index: -2; }
.home > .living-sky { z-index: -1; }
.home-hero { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; min-height: 38vh; min-height: 38dvh;
  padding: calc(10px + var(--safe-t)) max(14px, var(--safe-r)) 20px max(14px, var(--safe-l)); }
.home-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
/* Night: the skyline darkens toward the title, so the words stand out. */
.home-art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 24, 0) 30%, rgba(8, 11, 24, .55) 62%, rgba(8, 11, 24, .9)); }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* Who's playing: the avatar, top left (opens their card); settings: the cog, top right. */
.who-btn { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 64%; padding: 4px 14px 4px 4px; cursor: pointer;
  border: 1px solid rgba(245, 165, 36, .5); border-radius: 999px; background: rgba(14, 19, 38, .78); color: var(--text); font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .3); }
.who-btn .avatar { width: 40px; height: 40px; font-size: var(--fs-lg); box-shadow: 0 0 0 2px #ffe3a6; }
.who-name { min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name::after { content: " ▾"; font-size: .8em; opacity: .7; }
.gear-btn { display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(245, 165, 36, .5); background: rgba(14, 19, 38, .78); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .3); }
.gear-btn svg { width: 26px; height: 26px; fill: currentColor; }
:is(.who-btn, .gear-btn):active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(0, 0, 0, .35); }
.hero-text { margin-top: auto; padding-top: 16px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.home .tagline { font-size: var(--fs-sm); max-width: 36ch; color: #d3d9ea; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.home-actions { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px max(16px, var(--safe-r)) calc(18px + var(--safe-b)) max(16px, var(--safe-l)); }
.home-actions .btn-big { width: min(100%, 380px); min-width: 0; padding-inline: 16px; }
.btn-game, .btn-continue { display: grid; gap: 2px; }
:is(.btn-game, .btn-continue) small { font-size: var(--fs-xs); font-weight: 600; opacity: .8; }
.home-section { width: min(100%, 380px); margin: 8px 0 -2px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim); text-align: left; }
.home-row { display: flex; gap: 10px; width: min(100%, 380px); }
.home-row .btn { flex: 1; padding: 12px 6px; }
/* A phone on its side: the hero down the left, the ways in on the right. */
@media (orientation: landscape) and (max-height: 600px) {
  #screen-menu.home.active { flex-direction: row; }
  .home-hero { flex: 0 0 46%; min-height: 0; height: 100dvh; position: sticky; top: 0; padding-bottom: calc(14px + var(--safe-b)); }
  .home-actions { justify-content: center; padding-top: calc(12px + var(--safe-t)); min-width: 0; flex: 1 1 0; }
  .home-hero { min-width: 0; }
  .home .logo { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .home .tagline { display: none; }
  /* The player's card side by side, so it fits the short screen. */
  .popwin:not(.pop-menu) { width: min(calc(100vw - 24px), 660px); display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .popwin:not(.pop-menu) .pop-head { grid-column: 1 / -1; margin-bottom: 8px; }
  .popwin:not(.pop-menu) .practice-card { margin: 0; }
}

/* The one thing to tap next glows: New Game or Continue on Home, Resume
   when paused, the next song after one ends. Opacity only, so the phone
   just fades a layer it already has. */
.btn-next { position: relative; }
.btn-next::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 196, 80, .95), 0 0 18px 6px rgba(245, 165, 36, .6);
  opacity: .2; will-change: opacity; animation: next-glow 1.6s ease-in-out infinite alternate; }
@keyframes next-glow { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .btn-next::after { animation: none; opacity: .8; } }
/* Nobody has touched the screen for a while: everything holds still (main.js idle). */
html.is-idle *, html.is-idle *::before, html.is-idle *::after { animation-play-state: paused !important; }

/* The player's card and the settings menu, under the button that opens them. */
.pop-backdrop { position: fixed; inset: 0; z-index: 950; background: rgba(3, 5, 12, .45); }
.popwin { position: fixed; z-index: 960; top: var(--pop-top, 70px); overflow-y: auto; overscroll-behavior: contain;
  max-height: calc(100vh - var(--pop-top, 70px) - 12px); max-height: calc(100dvh - var(--pop-top, 70px) - 12px - var(--safe-b));
  width: min(calc(100vw - 24px), 380px); padding: 14px; border-radius: 16px; color: var(--text);
  background: linear-gradient(180deg, #1c2542, #10162b); border: 1px solid rgba(245, 165, 36, .45); box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  animation: pop-in .16s ease-out; }
.pop-left { left: max(12px, var(--safe-l)); transform-origin: 30px 0; }
.pop-right { right: max(12px, var(--safe-r)); transform-origin: calc(100% - 24px) 0; }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .popwin { animation: none; } }
.pop-menu { width: min(calc(100vw - 24px), 290px); display: grid; gap: 8px; }
.pop-menu .btn { text-align: left; padding: 12px 14px; }
.pop-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 12px; }
.pop-head .avatar { width: 62px; height: 62px; font-size: var(--fs-xl); }
.pop-who h2 { font-size: var(--fs-lg); line-height: 1.15; margin-bottom: 4px; outline: none; overflow-wrap: anywhere; }
.pop-who .player-level { margin: 0; grid-template-columns: 1fr; gap: 2px; }
.practice-card .goal .cycler { flex: 0 0 168px; margin-left: 0; }
.pop-close { align-self: start; width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: var(--fs-lg); line-height: 1; }
.popwin .practice-card { width: 100%; margin: 0 0 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--panel-edge); }
.pop-buttons { display: grid; gap: 8px; }
.pop-buttons .btn small { margin-left: 4px; font-weight: 600; opacity: .8; }
#btn-reminder.on small { color: var(--good); }

/* ---------- the Game map screen ---------- */
#screen-map { padding: 0; position: relative; }
/* The top of the map: who's playing and settings, what to do next (a tap
   goes there), and the four maps' tabs. The map below gets the rest. */
.map-top { position: relative; z-index: 10; flex: none; display: flex; flex-direction: column;
  background: linear-gradient(#0d1226, #111833); border-bottom: 1px solid #1f2847; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.map-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
  width: 100%; max-width: 980px; margin: 0 auto; padding: 2px max(14px, var(--safe-r)) 10px max(14px, var(--safe-l)); }
.map-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.map-goal { position: relative; width: 100%; display: grid; align-content: center; gap: 2px; min-height: 64px; padding: 9px 52px 9px 16px;
  text-align: left; cursor: pointer; border-radius: 14px; border: 1px solid rgba(245, 165, 36, .55); color: var(--text); font: inherit;
  background: linear-gradient(180deg, rgba(28, 37, 64, .94), rgba(15, 20, 36, .94)); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.map-goal > * { min-width: 0; max-width: 100%; }
.map-goal small { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.map-goal b { font-size: var(--fs-lg); line-height: 1.2; }
.map-goal span { color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.3; }
/* The way in: a round key on the right, so the box reads as something to tap. */
.map-goal::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-lg); font-weight: 800; line-height: 1; color: #2a1600;
  background: linear-gradient(#ffd27a, var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 #8a4a00; }
.map-goal:disabled::after { content: none; }
.map-goal:disabled { cursor: default; padding-right: 16px; }
.map-goal:active:not(:disabled) { transform: translateY(1px); }
/* Explore: a link laid over the bottom of the map. */
.map-explore { position: absolute; z-index: 5; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%);
  min-height: 44px; padding: 8px 14px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: var(--fs-md); font-weight: 700; color: var(--gold-hi); text-decoration: underline; text-underline-offset: 4px;
  text-decoration-thickness: 1.5px; text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .7); }
.map-explore[hidden] { display: none; }
.map-explore:active { transform: translateX(-50%) translateY(1px); }
.map-explore-bar { flex: 1; width: 100%; padding: 10px 12px 12px; border-radius: 14px; border: 1px solid rgba(245, 165, 36, .55);
  background: linear-gradient(180deg, rgba(28, 37, 64, .95), rgba(15, 20, 36, .95)); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.map-explore-bar[hidden] { display: none; }
/* The stage in view: its badge, big; a tap shows what's in it. */
.map-region { display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 0; padding: 0; border: 0; background: none;
  color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.map-region .sm-medal { --s: 1; width: min(100%, 132px); }
.map-region-num { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi); margin-top: 4px; }
.map-region-place { max-width: 100%; font: 800 var(--fs-md)/1.15 var(--display); text-wrap: balance; }
/* The same height for every stage's name (three lines, never more): the map
   below is sized to what's left, so a name that grew or shrank the top would
   re-zoom the map, bring another stage into view, and change the name back,
   flickering between the two. */
.map-region-place { --lines: 3; height: calc(var(--lines) * 1.15em); overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines); line-clamp: var(--lines); }
.map-region.is-locked .sm-medal { filter: grayscale(1) brightness(.6); }
.map-region:active { transform: scale(.97); }
/* Phones sideways: the bar and the panel share the top in two short rows. */
@media (orientation: landscape) and (max-height: 600px) {
  .map-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 8px; gap: 10px; align-items: center; }
  .map-goal { min-height: 0; padding: 7px 46px 7px 14px; gap: 1px; }
  .map-goal b { font-size: var(--fs-md); }
  .map-goal span { font-size: var(--fs-xs); line-height: 1.25; }
  .map-region { grid-template-columns: auto auto; column-gap: 8px; text-align: left; justify-items: start; }
  .map-region .sm-medal { grid-row: span 2; width: 56px; }
  .map-region-num { margin: 0; align-self: end; }
  .map-region-place { align-self: start; --lines: 2; }
  .map-explore-hint { display: none; }
}
.game-map-bar { position: relative; z-index: 10; gap: 8px; background: none;
  /* The map screen drops the safe-area padding to fill the screen; its bar keeps it, clear of the clock and notch. */
  padding-top: calc(10px + var(--safe-t)); padding-left: max(12px, var(--safe-l)); padding-right: max(12px, var(--safe-r)); }
.game-map-bar .chip { min-height: 40px; padding: 4px 10px; font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; }
.map-stars { margin-left: auto; }
.game-map-bar .who-btn { max-width: 40%; }
.game-map-bar .who-btn .avatar { width: 34px; height: 34px; font-size: var(--fs-md); }
.game-map-bar .gear-btn { width: 42px; height: 42px; }
@media (max-width: 480px) {
  .game-map-bar .who-btn { padding-right: 4px; }
  .game-map-bar .who-name { display: none; }
}
.map-stars::after { content: " ›"; color: var(--text-dim); }
.chip-style { min-width: 0; }
.chip-style small, .chip-style b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* A phone hasn't room for all four: How you play needs its width, and the
   instrument's picture says enough. */
@media (max-width: 480px) {
  .game-map-bar { gap: 6px; }
  .game-map-bar .chip { padding: 4px 8px; }
  #map-instrument .inst-icon { height: 28px; margin: -4px 0; }
}
@media (max-width: 390px) { .game-map-bar .chip-style b { font-size: var(--fs-xs); } }
/* The journey chip: instrument, Quick or Normal, and a › to say it opens. */
#map-instrument { display: inline-flex; align-items: center; gap: 6px; }
#map-instrument > i { font-style: normal; font-weight: 800; color: var(--accent); }
.map-stars b { font-weight: 800; color: var(--gold-hi); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip-style { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; line-height: 1.15; text-align: left; }
.chip-style small { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.map-area { position: relative; flex: 1; min-height: 0; }

.stagemap { --s: .75; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, #0a1026 0%, #121a3d 38%, #22224c 58%, #0b0f1a 100%); }
.sm-scroller { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.sm-scroller::-webkit-scrollbar { display: none; }
.sm-world { position: relative; overflow: hidden; overflow: clip; width: calc(var(--w) * var(--s) * 1px); height: calc(1000 * var(--s) * 1px); }
.sm-layer { position: absolute; inset: 0; }
.sm-panel, .sm-roads { position: absolute; top: 0; left: calc(var(--x) * var(--s) * 1px); width: calc(var(--w) * var(--s) * 1px); height: 100%; }
.sm-panel { transition: filter 3s ease; }
.sm-panel.is-locked { filter: saturate(.25) brightness(.55); }
.sm-road-edge { fill: none; stroke: #05070f; stroke-opacity: .55; stroke-width: 46; stroke-linecap: round; stroke-linejoin: round; }
.sm-road { fill: none; stroke: #1c2446; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.sm-sea { fill: none; stroke: #0a1a2e; stroke-opacity: .5; stroke-width: 26; }
.sm-dots { fill: none; stroke: #4a5690; stroke-width: 7; stroke-dasharray: 0 22; stroke-linecap: round; }
.sm-lit-glow { fill: none; stroke: #ffb347; stroke-opacity: .3; stroke-width: 22; stroke-linecap: round; }
.sm-lit { fill: none; stroke: var(--gold-hi); stroke-width: 7; stroke-linecap: round; }
.sm-spur .sm-lit, .sm-spur .sm-lit-glow { display: none; }
.sm-spur.is-lit .sm-lit, .sm-spur.is-lit .sm-lit-glow { display: inline; }

.sm-node, .sm-sign, .sm-warmup, .sm-spark { position: absolute; left: calc(var(--x) * var(--s) * 1px); top: calc(var(--y) * var(--s) * 1px); }
.sm-node { z-index: 3; width: calc(88 * var(--s) * 1px); height: calc(88 * var(--s) * 1px); transform: translate(-50%, -50%);
  border: 0; padding: 0; background: none; cursor: pointer; color: inherit; font: inherit; }
.sm-disc { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  font: 850 calc(32 * var(--s) * 1px)/1 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: #7d89b3;
  background: radial-gradient(circle at 50% 35%, #2a3458, #141a30); border: calc(5 * var(--s) * 1px) solid #3a4570;
  box-shadow: 0 calc(6 * var(--s) * 1px) calc(14 * var(--s) * 1px) rgba(0, 0, 0, .55); }
.sm-disc > * { grid-area: 1 / 1; }
.sm-lock { width: 42%; height: 42%; display: none; }
.sm-node.is-locked .sm-disc b { visibility: hidden; }
.sm-node.is-locked .sm-lock { display: block; }
.sm-node.is-open .sm-disc { color: #2a1600; border-color: #fff4d6; background: radial-gradient(circle at 50% 32%, #ffe3a0, var(--accent) 58%, #c86f10);
 }
/* Its ring pulses outward: a fading, growing layer (opacity and scale
   only), so nothing is repainted while it moves. */
.sm-node.is-open .sm-disc::after { content: ""; position: absolute; inset: calc(-4 * var(--s) * 1px); border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 calc(8 * var(--s) * 1px) rgba(255, 190, 80, .55); will-change: transform, opacity;
  animation: sm-ring 2.6s ease-out infinite; }
@keyframes sm-ring { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sm-node.is-open .sm-disc::after { animation: none; opacity: .6; } }
.sm-node.is-passed .sm-disc { color: #3a2200; border-color: #ffe7a6; background: radial-gradient(circle at 50% 32%, #fff4d0, #f0b43c 55%, #b9700e); }
.sm-node.is-skipped .sm-disc { color: var(--accent); border-style: dashed; border-color: var(--accent); }
/* The song to play next is bigger and says so. */
.sm-node.is-open { z-index: 4; width: calc(112 * var(--s) * 1px); height: calc(112 * var(--s) * 1px); }
.sm-node.is-open .sm-disc b { font-size: calc(30 * var(--s) * 1px); letter-spacing: .02em; }
.sm-label { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: grid; justify-items: center;
  padding: 3px 9px 4px; border-radius: 9px; background: rgba(6, 9, 20, .78); white-space: nowrap; font-size: max(10.5px, calc(21 * var(--s) * 1px)); font-weight: 650; line-height: 1.25; color: var(--text); }
.sm-stars { color: var(--gold-hi); font-size: var(--fs-xs); letter-spacing: 1px; }
.sm-stars:empty { display: none; }
.sm-node.is-locked .sm-label { color: var(--text-dim); }
.sm-real { position: absolute; right: -8px; bottom: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-xs); background: #0e1530; border: 2px solid var(--gold-hi); }
.sm-real .inst-icon { width: auto; height: 78%; }
.sm-recital .sm-disc { border-radius: 26%; transform: rotate(45deg) scale(.86); }
.sm-recital .sm-disc > * { transform: rotate(-45deg); font-size: calc(30 * var(--s) * 1px); }
.sm-recital.is-open .sm-disc { animation: none; background: radial-gradient(circle at 50% 32%, #d7c4ff, #8b5cf6 58%, #4c2a9e); border-color: #efe6ff;
  box-shadow: 0 0 calc(30 * var(--s) * 1px) rgba(167, 139, 250, .6); }
.sm-node.is-popping { animation: sm-pop 1.3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes sm-pop { 0% { transform: translate(-50%, -50%) scale(.5); } 60% { transform: translate(-50%, -50%) scale(1.2); } 100% { transform: translate(-50%, -50%) scale(1); } }

.sm-crest-track { position: absolute; z-index: 5; left: calc(var(--x) * var(--s) * 1px); top: calc(var(--y) * var(--s) * 1px);
  width: calc(var(--w) * var(--s) * 1px); display: flex; align-items: flex-start; pointer-events: none; }
.sm-crest { position: sticky; left: 10px; transform: translateY(-50%); display: grid; justify-items: center; pointer-events: none; }
.sm-crest .sm-medal, .sm-crest .sm-ribbon { pointer-events: auto; cursor: pointer; }
.sm-crest:focus-visible { outline: none; }
.sm-crest:focus-visible .sm-medal { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Exploring: the fog thins and the stages ahead come up out of the dark. */
.sm-fog, .sm-panel { transition: opacity .9s ease, filter .9s ease; }
.is-exploring .sm-fog:not(.is-gone) { opacity: .18; }
.is-exploring .sm-panel.is-locked { filter: saturate(.75) brightness(.85); }
.is-exploring .sm-crest.is-locked .sm-medal { filter: grayscale(.4) brightness(.85); }
.sm-medal { width: calc(150 * var(--s) * 1px); aspect-ratio: 1; border-radius: 50%; padding: calc(7 * var(--s) * 1px);
  background: conic-gradient(from 200deg, #fff1c4, #c98a1e, #ffe08a, #a0650c, #fff1c4);
  box-shadow: 0 0 calc(46 * var(--s) * 1px) rgba(255, 190, 90, .38); transition: filter 2.4s ease, box-shadow 2.4s ease; }
.sm-medal img, .sm-medal svg { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.sm-medal.is-emblem svg { background: radial-gradient(circle at 50% 40%, #26305a, #10152c); }
.sm-ribbon { position: relative; margin-top: calc(-20 * var(--s) * 1px); display: grid; justify-items: center;
  padding: calc(7 * var(--s) * 1px) calc(30 * var(--s) * 1px) calc(9 * var(--s) * 1px);
  background: linear-gradient(#26305a, #161c38); clip-path: polygon(0 0, 100% 0, 95% 50%, 100% 100%, 0 100%, 5% 50%); }
.sm-num { font-size: calc(14 * var(--s) * 1px); font-weight: 750; line-height: 1.3; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hi); }
.sm-place { font: 800 calc(31 * var(--s) * 1px)/1.1 var(--display); white-space: nowrap; }
.sm-crest.is-locked .sm-medal { filter: grayscale(1) brightness(.55); box-shadow: none; }
.sm-crest.is-locked .sm-num::after { content: " · locked"; color: var(--text-dim); }
.sm-crest.is-new .sm-medal { animation: sm-shine 2.6s ease; }
@keyframes sm-shine { 0% { transform: scale(.7); } 50% { transform: scale(1.08); box-shadow: 0 0 calc(90 * var(--s) * 1px) rgba(255, 210, 122, .9); } 100% { transform: scale(1); } }

.sm-sign { z-index: 3; transform: translate(-50%, -100%); padding: 4px 10px; border-radius: 6px; background: #3a2a1a;
  border: 2px solid #6b4e2e; color: #ffe2b0; font-size: var(--fs-xs); font-weight: 750; line-height: 1.2; white-space: nowrap; box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.sm-warmup { z-index: 4; transform: translate(-50%, -50%); padding: 5px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 2px solid #ffe2a8; background: linear-gradient(#ffb84d, #f08a1c); color: #2a1600; font-size: var(--fs-xs); font-weight: 800; line-height: 1.2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45); transition: opacity .3s; }
.sm-warmup.is-away, .sm-warmup.is-done { opacity: 0; pointer-events: none; }
.sm-fog { position: absolute; top: 0; height: 100%; z-index: 4; pointer-events: none;
  left: calc(var(--x) * var(--s) * 1px); width: calc(var(--w) * var(--s) * 1px); transition: opacity 3s ease .4s; }
.sm-fog::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(36, 44, 80, 0), rgba(36, 44, 80, .62) calc(160 * var(--s) * 1px)); }
.sm-cloud { position: absolute; left: calc(var(--x) * var(--s) * 1px); top: calc(var(--y) * var(--s) * 1px);
  width: calc(var(--r) * 2 * var(--s) * 1px); height: calc(var(--r) * 1.1 * var(--s) * 1px); transform: translate(-50%, -50%);
  transition: transform 3.4s cubic-bezier(.3, .1, .2, 1), opacity 3s ease; }
.sm-cloud::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(176, 190, 232, .42), rgba(176, 190, 232, 0));
  animation: fog-roll var(--t, 23s) ease-in-out infinite alternate; }
@keyframes fog-roll { from { transform: translate3d(-6%, 2%, 0) scale(1); } to { transform: translate3d(8%, -3%, 0) scale(1.12); } }
.sm-fog.is-lifting { opacity: 0; }
.sm-fog.is-lifting .sm-cloud { transform: translate(calc(-50% + var(--dx) * 1px), -60%) scale(1.5); opacity: 0; }
.sm-fog.is-gone { display: none; }
.sm-marker { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; will-change: transform; }
.sm-gem { position: absolute; left: calc(-25 * var(--s) * 1px); bottom: calc(50 * var(--s) * 1px); width: calc(50 * var(--s) * 1px);
  height: calc(42 * var(--s) * 1px); border-radius: calc(13 * var(--s) * 1px);
  background: linear-gradient(var(--gem-hi), var(--gem)); border: calc(4 * var(--s) * 1px) solid #fff;
  box-shadow: 0 0 calc(24 * var(--s) * 1px) rgba(56, 189, 248, .8); display: grid; place-items: center;
  color: #0b1530; font-size: calc(24 * var(--s) * 1px); font-weight: 900; line-height: 1; animation: sm-bob 2.4s ease-in-out infinite; }
.sm-marker.is-walking .sm-gem { animation: none; }
.sm-shadow { position: absolute; left: calc(-18 * var(--s) * 1px); top: calc(-5 * var(--s) * 1px); width: calc(36 * var(--s) * 1px);
  height: calc(10 * var(--s) * 1px); border-radius: 50%; background: rgba(0, 0, 0, .45); }
.sm-marker:not(.is-walking) .sm-shadow { display: none; }
@keyframes sm-bob { 50% { transform: translateY(calc(-7 * var(--s) * 1px)); } }
.sm-bursts { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.sm-spark { width: 9px; height: 9px; border-radius: 2px; animation: sm-spark 1.6s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes sm-spark { from { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx) * var(--s) * 1px), calc(-50% + var(--dy) * var(--s) * 1px)) rotate(240deg); opacity: 0; } }

/* the song sheet, the new-stage card, the "Playing with" menu and its pointer */
.map-sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(3, 5, 12, .55); }
.map-sheet { position: fixed; z-index: 61; left: 50%; bottom: 0; width: min(100%, 520px); transform: translateX(-50%);
  padding: 10px max(18px, var(--safe-l)) calc(18px + var(--safe-b)) max(18px, var(--safe-r));
  border-radius: 22px 22px 0 0; background: linear-gradient(#1a2238, #121828); border: 1px solid var(--panel-edge); border-bottom: 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .5); animation: map-sheet-rise .3s ease; }
@keyframes map-sheet-rise { from { transform: translate(-50%, 30px); opacity: 0; } }
/* A song card with its settings fills the screen; the content keeps a readable column and Play sits at the bottom. */
.map-sheet.is-full { inset: 0; width: auto; transform: none; border: 0; border-radius: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; animation: map-sheet-full .25s ease;
  padding: calc(10px + var(--safe-t)) max(18px, var(--safe-r), calc(50% - 280px)) calc(18px + var(--safe-b)) max(18px, var(--safe-l), calc(50% - 280px)); }
@keyframes map-sheet-full { from { transform: translateY(24px); opacity: 0; } }
.map-sheet.is-full .map-sheet-grip { display: none; }
.map-sheet-back { align-self: flex-start; margin-bottom: 16px; }
.map-sheet.is-full .map-sheet-actions { margin-top: auto; padding-top: 12px; }
.map-sheet.is-full .map-sheet-skip { align-self: center; }
/* How you play and Backing read the same way: the name on top, the choice below it. */
#song-sheet :is(.map-sheet-style, .map-sheet-backing) { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 10px; }
#song-sheet :is(.map-sheet-style, .map-sheet-backing) .cycler { margin-left: 0; flex: none; }
#song-sheet .map-sheet-style > span:first-child { white-space: normal; }
.map-sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #33405f; margin: 0 auto 12px; }
.map-sheet-kicker { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.map-sheet h2 { margin-top: 4px; font: 800 var(--fs-lg)/1.15 var(--display); text-wrap: balance; }
.map-sheet-by { margin: 4px 0 14px; color: var(--text-dim); }
.map-sheet-levels { display: grid; gap: 2px; margin-bottom: 12px; text-align: center; }
.map-sheet-levels .sheet-best { margin: 0; color: var(--gold-hi); letter-spacing: 1px; font-size: var(--fs-sm); }
.map-sheet-levels:empty { display: none; }
.map-sheet-backing { justify-content: space-between; margin-bottom: 14px; }
.map-sheet-backing select { flex: 1; max-width: 220px; min-height: 40px; }
.map-sheet-levels > div { padding: 7px 4px; border-radius: 10px; text-align: center; background: #10162a; border: 1px solid #263055; font-size: var(--fs-xs); color: var(--text-dim); }
.map-sheet-levels b { display: block; font-size: var(--fs-xs); color: var(--text); }
.map-sheet-levels .st { color: var(--gold-hi); letter-spacing: 1px; font-size: var(--fs-xs); }
.map-sheet-levels .next { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.map-sheet-levels .done b { color: var(--gold-hi); }
.map-sheet-levels .levels-label { grid-column: 1 / -1; margin: 0; color: var(--text-dim); font-size: var(--fs-xs); text-align: center; }
/* A song's three challenges: on its map card and the results screen. */
.challenges { display: grid; gap: 5px; margin-bottom: 12px; }
.challenges.panel { padding: 12px 16px; text-align: left; align-self: stretch; }
.challenges-head { margin: 0 0 2px; color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.challenge { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; font-size: var(--fs-sm); color: #c3cbe0; }
.challenge i { font-style: normal; text-align: center; color: var(--text-dim); }
.challenge small { color: var(--text-dim); font-size: var(--fs-xs); }
.challenge.is-done i, .challenge.is-done small { color: var(--gold-hi); }
.challenge.is-new { animation: challenge-new 1.2s ease 2; }
.challenge.is-new span { color: var(--text); font-weight: 700; }
@keyframes challenge-new { 30% { text-shadow: 0 0 12px rgba(255, 210, 122, .9); } }
.map-sheet-note { margin-bottom: 12px; color: #c3cbe0; font-size: var(--fs-sm); }
.map-sheet-note:empty { display: none; }
.map-sheet-note .inst-icon { width: auto; height: 1.5em; vertical-align: -0.4em; } /* passed on your own instrument */
.map-sheet-actions { display: flex; gap: 8px; }
.map-sheet-actions .btn { flex: 1; }
.map-sheet-actions .btn-primary { flex: 2; }
.stage-card-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; cursor: pointer; padding: 24px;
  background: radial-gradient(70% 55% at 50% 45%, rgba(10, 16, 38, .9), rgba(3, 5, 12, .96)); animation: fade-in .8s ease; }
@keyframes fade-in { from { opacity: 0; } }
.stage-card-overlay .inner { display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 34ch; }
.stage-card-overlay .sm-medal { width: 168px; padding: 7px; box-shadow: 0 0 80px rgba(255, 200, 100, .55); animation: medal-in 1.6s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes medal-in { from { transform: scale(.5) rotate(-20deg); opacity: 0; } }
.stage-card-overlay .num { margin-top: 14px; color: var(--gold-hi); font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-size: var(--fs-xs); }
.stage-card-overlay h2 { font: 800 var(--fs-2xl)/1.05 var(--display); text-wrap: balance; }
.stage-card-overlay .learn { margin-top: 6px; color: #c3cbe0; }
.stage-card-overlay .tap { margin-top: 14px; color: var(--text-dim); font-size: var(--fs-xs); }
.style-menu { position: fixed; z-index: 62; top: calc(60px + var(--safe-t)); right: max(10px, var(--safe-r)); width: min(270px, calc(100vw - 24px));
  padding: 6px; border-radius: 14px; background: #161d31; border: 1px solid var(--panel-edge); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.style-menu p { margin: 6px 10px 4px; color: var(--text-dim); font-size: var(--fs-xs); }
.style-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 9px; background: none; color: inherit; font: inherit; cursor: pointer; }
.style-menu button[aria-checked="true"] { background: #232c4a; color: var(--gold-hi); font-weight: 750; }
.coach { position: fixed; z-index: 63; top: calc(64px + var(--safe-t)); right: max(10px, var(--safe-r)); width: min(300px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 14px; background: #fff4d6; color: #2a1600; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); font-size: var(--fs-sm); }
.coach::before { content: ""; position: absolute; top: -8px; right: 46px; width: 16px; height: 16px; background: #fff4d6; transform: rotate(45deg); }
.coach p { margin-bottom: 8px; }
.coach button { border: 0; border-radius: 10px; padding: 7px 14px; background: #2a1600; color: #fff4d6; font-weight: 750; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .aurora i, .drift i, .sm-cloud::before, .sm-gem, .sm-node.is-open .sm-disc { animation: none; }
}
.map-sheet-skip { margin-top: 10px; }
.journey-sheet { max-height: 86dvh; display: flex; flex-direction: column; }
.journey-total { margin-top: 10px; }
.journey-bar { height: 8px; border-radius: 4px; background: #10162a; border: 1px solid #263055; overflow: hidden; }
.journey-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c98a1e, var(--gold-hi)); }
.journey-total .map-sheet-by { margin: 8px 0 12px; }
.journey-stages { list-style: none; overflow-y: auto; min-height: 0; margin: 0 -6px; padding: 0 6px; display: grid; gap: 8px; }
.journey-stages button { width: 100%; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px 8px 8px;
  border-radius: 14px; background: #10162a; border: 1px solid #263055; color: var(--text); text-align: left; cursor: pointer; }
.journey-stages .is-here button { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.journey-stages .is-locked button { opacity: .55; }
.journey-medal { width: 52px; height: 52px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, #fff1c4, #c98a1e, #ffe08a, #a0650c, #fff1c4); }
.journey-stages .is-locked .journey-medal { background: #33405f; }
.journey-medal img, .journey-medal svg { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; background: radial-gradient(circle at 50% 40%, #26305a, #10152c); }
.journey-stages small { display: block; color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.journey-stages b { display: block; font-weight: 700; }
.journey-stages .meta { display: block; color: var(--text-dim); font-size: var(--fs-xs); }
.journey-stages .songbar { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: #1f2847; overflow: hidden; }
.journey-stages .songbar i { display: block; height: 100%; background: var(--gold-hi); }
.journey-stages .trophy { font-size: var(--fs-lg); }
.journey-stages .trophy.is-off { filter: grayscale(1); opacity: .35; }
.journey-stages .trophy:not(.is-off) { color: var(--accent); } /* won: gold, as the emoji was */
.reminder-time { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 10px 12px;
  border-radius: 12px; background: #10162a; border: 1px solid #263055; font-weight: 650; }
.reminder-time input { background: var(--panel); color: var(--text); border: 1px solid var(--panel-edge); border-radius: 8px;
  padding: 6px 8px; font: inherit; color-scheme: dark; }

/* ---------- the lesson: the Game's tutorial ---------- */
#screen-lesson, #screen-journey { padding: 0; isolation: isolate; overflow: hidden; }
#screen-lesson .bar, #screen-journey .bar, #screen-sound .bar { position: relative; z-index: 1; padding-top: calc(8px + var(--safe-t)); }
#screen-journey { overflow-y: auto; }
.lesson-body { position: relative; flex: 1; display: grid; place-items: center; padding: 16px max(16px, var(--safe-r)) calc(16px + var(--safe-b)) max(16px, var(--safe-l)); }
.lesson-card { width: min(100%, 460px); padding: 22px 20px; display: grid; gap: 10px; text-align: center;
  background: rgba(14, 19, 38, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lesson-count { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.lesson-card h3 { font: 800 var(--fs-xl)/1.15 var(--display); text-wrap: balance; }
.lesson-card p { color: #c3cbe0; line-height: 1.5; }
.lesson-score { color: var(--gold-hi) !important; font-weight: 700; }
.lesson-score:empty { display: none; }
.lesson-picks { display: grid; gap: 8px; text-align: left; }
.lesson-pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.lesson-pick span { color: var(--gold-hi); letter-spacing: 1px; }
.lesson-pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(245, 165, 36, .12); }
.lesson-actions { display: grid; gap: 8px; margin-top: 6px; }
.jp-card { gap: 12px; }
.jp-inst .inst-choice { padding: 10px 2px 8px; }
.jp-inst .inst-choice .inst-icon { height: 60px; }
.jp-kinds { display: grid; gap: 8px; text-align: left; }
.jp-kind { text-align: left; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; }
.jp-icon { font-size: var(--fs-xl); line-height: 1; }
.jp-text { display: grid; gap: 2px; min-width: 0; }
.jp-text b { font: 800 var(--fs-lg)/1.1 var(--display); letter-spacing: .02em; }
.jp-text small { color: var(--text-dim); font-size: var(--fs-xs); line-height: 1.35; }
.jp-progress { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.jp-kind.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px rgba(245, 165, 36, .25); background: rgba(245, 165, 36, .12); }
.jp-kind.is-soon { opacity: .55; }
.jp-kind.is-soon .jp-progress { color: var(--text-dim); }
.btn.btn-link { background: none; border-color: transparent; box-shadow: none; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.sm-lesson .sm-disc > b { font-size: calc(34 * var(--s) * 1px); }

/* ---------- game menus: console-style option rows ----------
   Each setting is a row: its name on the left in small capitals, the
   value on the right as ‹ value › (gamemenu.js), switches that glow when on. */
.opt { background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; padding: 8px 10px 8px 14px; min-height: 52px; }
.opt > span:first-child, .opt.opt-check > span, .pause-label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: #b8c2db; }
.opt > span:first-child small, .opt.opt-check > span small { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.opt b { color: var(--accent); }
.song-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.song-options .opt-hint { grid-column: 1 / -1; }
.pause-opts { gap: 8px; border: 0; }
.pause-opts .opt.opt-check, .opt.opt-check { justify-content: space-between; }

.cycler { display: flex; align-items: center; margin-left: auto; flex: 0 1 230px; min-width: 0;
  background: rgba(5, 8, 16, .55); border: 1px solid rgba(245, 165, 36, .3); border-radius: 10px; }
.pause-opts .cycler, .opt-wide .cycler { flex-basis: 260px; }
.cycler-arrow { flex: none; width: 36px; height: 40px; display: grid; place-items: center; cursor: pointer;
  color: var(--accent); font-size: var(--fs-lg); font-weight: 800; user-select: none; -webkit-user-select: none; border-radius: 9px; }
.cycler-arrow:focus-visible { background: rgba(245, 165, 36, .15); outline: none; }
@media (hover: hover) { .cycler-arrow:hover { background: rgba(245, 165, 36, .15); } }
.cycler-arrow:active { transform: scale(.9); }
.cycler-value { position: relative; flex: 1; min-width: 0; text-align: center; }
.cycler-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
  font-weight: 700; font-size: var(--fs-md); padding: 0 2px; }
.cycler-value select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  min-height: 0 !important; padding: 0; border: 0; }
.cycler.is-off { opacity: .45; }
label.goal .cycler { flex: 0 1 140px; }
/* A phone's pause menu: each setting's name above its value, so the value gets the whole width. */
@media (max-width: 520px) {
  :is(.pause-opts, .map-sheet-opts, .sheet-card-opts) .opt:not(.opt-check), .map-sheet-style { flex-direction: column; align-items: stretch; gap: 6px; }
  :is(.pause-opts, .map-sheet-opts, .sheet-card-opts, .map-sheet-style) .cycler { margin-left: 0; flex: none; }
  .pause-opts .opt input[type=range] { margin-left: 0; }
}

/* ON/OFF switches */
.opt-check input[type=checkbox] { order: 2; appearance: none; -webkit-appearance: none; flex: none; width: 54px; height: 30px;
  border-radius: 999px; background: #0a0f1c; border: 1px solid #34405c; position: relative; cursor: pointer; transition: background .2s, box-shadow .2s; }
.opt-check input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #5d6a88; transition: transform .2s, background .2s; }
.opt-check input[type=checkbox]:checked { background: linear-gradient(180deg, var(--accent), var(--accent-hot)); border-color: transparent;
  box-shadow: 0 0 14px rgba(245, 165, 36, .45); }
.opt-check input[type=checkbox]:checked::after { transform: translateX(24px); background: #fff7e6; }
.opt-check input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sliders: a glowing bar */
.opt input[type=range] { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 999px; margin-left: auto;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot)); box-shadow: 0 0 10px rgba(245, 165, 36, .3); }
.opt input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff7e6; border: 3px solid var(--accent); box-shadow: 0 0 10px rgba(245, 165, 36, .6); }
.opt input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff7e6; border: 3px solid var(--accent); }

/* Menu cards: a title with a glow, big menu buttons */
.overlay-card h3 { font: 800 var(--fs-xl)/1.1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 0 18px rgba(245, 165, 36, .45); }
/* The pause menu: one surface over the whole game screen, no card inside it
   and no box around each setting (Doug: boxes in boxes wasted the room).
   Actions two to a row; settings in a two-column grid; it all fits a phone
   without scrolling. */
#pause-overlay { position: fixed; inset: 0; z-index: 40; align-items: flex-start; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(14, 19, 36, .96), rgba(8, 11, 22, .97)); }
#pause-overlay .overlay-card { width: 100%; max-width: 520px; max-height: none; margin: 0 auto; overflow: visible; gap: 10px;
  padding: calc(14px + var(--safe-t)) max(16px, var(--safe-r)) calc(16px + var(--safe-b)) max(16px, var(--safe-l));
  background: none; border: 0; border-radius: 0; box-shadow: none; }
#pause-overlay .overlay-card h3 { margin: 0; }
.pause-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* Leave the song: Songs, Map, Home side by side, under a label like the settings'. */
.pause-leave { display: grid; gap: 6px; text-align: left; }
.pause-go { display: flex; gap: 8px; }
.pause-go .btn { flex: 1; min-width: 0; margin: 0; padding: 10px 6px; }
.pause-go .btn[hidden] { display: none; }
/* ...then a check, in place of the menu. */
.overlay-card.is-confirming > :not(h3, .pause-confirm) { display: none !important; }
#pause-overlay .overlay-card.is-confirming { margin: auto; max-width: 420px; }
#pause-overlay:has(.is-confirming) { align-items: center; }
.pause-confirm { display: grid; gap: 14px; padding-top: 8px; }
.pause-confirm[hidden] { display: none; }
.pause-confirm-text { margin: 0; color: var(--text) !important; font-size: var(--fs-md) !important; line-height: 1.45; text-wrap: balance; }
.pause-actions .btn { min-width: 0; margin: 0; padding: 10px 8px; }
#pause-overlay .pause-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 12px; padding: 4px 0 0; border: 0; }
#pause-overlay .pause-opts > * { min-width: 0; }
/* Upright, the settings come first, then the sound, then the switches. */
.pause-side { display: contents; }
#pause-overlay .pause-sound { order: 1; }
#pause-overlay .pause-toggles { order: 2; }
#pause-overlay .pause-confirm { order: 3; }
#pause-overlay .pause-opts .opt { background: none; border: 0; border-radius: 0; padding: 0; min-height: 0; }
#pause-overlay .pause-opts .opt:not(.opt-check) { grid-column: 1 / -1; flex-direction: column; align-items: stretch; gap: 6px; }
#pause-overlay .pause-opts .opt:not(.opt-check) > span:first-child { white-space: normal; }
#pause-overlay .pause-opts .opt.opt-half { grid-column: auto; } /* the sound sliders, two to a row */
#pause-overlay .pause-opts .opt > span:first-child small { display: none; } /* the style's one-line hint: its name says enough here */
#pause-overlay .pause-opts .cycler { margin-left: 0; flex: none; }
#pause-overlay .pause-opts .opt input[type=range] { width: 100%; margin: 8px 0; height: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot)) 0 0 / var(--v, 100%) 100% no-repeat, rgba(255, 255, 255, .12); }
#pause-overlay .pause-opts .opt.opt-check { gap: 8px; }
/* Instruments: two rows of three, the picture beside the name. */
#pause-inst { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#pause-inst .inst-choice { grid-auto-flow: column; justify-content: center; align-items: center; gap: 6px; padding: 6px 4px; min-height: 44px; }
#pause-inst .inst-choice .inst-icon { height: 28px; }
#pause-inst .inst-choice small { font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
#pause-inst .inst-choice .inst-icon { align-self: center; margin: 0; }
/* Short phones: a little tighter. */
@media (max-height: 720px) {
  #pause-overlay .overlay-card { gap: 7px; }
  #pause-overlay .overlay-card h3 { font-size: var(--fs-lg); }
  .pause-actions .btn { padding: 8px; }
  #pause-inst .inst-choice { min-height: 38px; padding: 4px; }
  #pause-overlay .pause-opts { gap: 8px 12px; }
  #pause-overlay .pause-opts .opt input[type=range] { margin: 4px 0; }
}
/* Phones sideways: the actions on the left, the settings on the right. */
@media (orientation: landscape) and (max-height: 600px) {
  #pause-overlay .overlay-card { max-width: 980px; padding-top: calc(6px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-auto-rows: min-content; column-gap: 22px; align-items: start; }
  #pause-overlay .overlay-card > :not(.pause-side) { grid-column: 1; }
  #pause-overlay .pause-side { grid-column: 2; grid-row: 1 / span 8; display: flex; flex-direction: column; gap: 10px; }
  #pause-overlay .pause-opts { padding: 0; gap: 8px 14px; }
  #pause-overlay .pause-opts .opt input[type=range] { margin: 4px 0; }
}
.opt:has(.cycler) > span:first-child { white-space: nowrap; flex: none; }
@media (max-width: 520px) {
  :is(.pause-opts, .map-sheet-opts, .sheet-card-opts) .opt > span:first-child, .map-sheet-style > span:first-child { white-space: normal; }
}
.cycler { min-width: 130px; }
.settings-toggle { display: flex; align-items: center; gap: 10px; width: calc(100% - 36px); max-width: 824px; align-self: center;
  margin: 0 0 12px; padding: 12px 16px; text-align: left; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-sm); }
.settings-toggle small { flex: 1; min-width: 0; color: var(--text-dim);
  font-weight: 600; letter-spacing: 0; text-transform: none; font-size: var(--fs-xs); }
.settings-toggle i { font-style: normal; color: var(--accent); font-size: var(--fs-lg); transition: transform .2s; }
.settings-toggle[aria-expanded="true"] i { transform: rotate(90deg); }
.song-options[hidden] { display: none; }

/* Count-in (main.js: updateCountIn): each beat's number pops in over the
   highway with a ring bursting out behind it; the way of playing and what
   to do sit small underneath. --beat: how long a beat's pop takes. */
.count-in { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 0 20px; text-align: center;
  background: radial-gradient(closest-side, rgba(5, 8, 15, .6), rgba(5, 8, 15, 0)); }
.count-num { position: relative; font-size: clamp(84px, 26vmin, 150px); font-weight: 900; line-height: 1; padding: 0 .08em;
  background: linear-gradient(180deg, #fff 15%, #ffd27a 55%, #f5a524 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 18px rgba(245, 165, 36, .7)) drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.count-num::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.15em; height: 1.15em; border-radius: 50%;
  border: 4px solid var(--accent); opacity: 0; transform: translate(-50%, -50%); }
.count-num.pop { animation: count-pop var(--beat, .5s) cubic-bezier(.2, .9, .3, 1.3) both; }
.count-num.pop::after { animation: count-ring var(--beat, .5s) ease-out both; }
@keyframes count-pop {
  0% { transform: scale(2.4); opacity: 0; }
  35% { transform: scale(.92); opacity: 1; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes count-ring {
  0% { transform: translate(-50%, -50%) scale(.45); opacity: .95; }
  100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; border-width: 1px; }
}
.count-mode { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
.count-tip { max-width: 30ch; padding: 6px 12px; border-radius: 12px; background: rgba(10, 13, 22, .78);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; color: var(--text); }
.count-in.go .count-num.pop { animation: count-go .7s ease-out both; }
.count-in.go .count-mode, .count-in.go .count-tip { opacity: 0; transition: opacity .3s; }
@keyframes count-go {
  0% { transform: scale(.6); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .count-num.pop, .count-num.pop::after, .count-in.go .count-num.pop { animation: none; }
}

/* When notes keep going by untouched, or a tap lands on the notes, an arrow
   points at the pad and a ring lights it (main.js: showPadNudge). --l --t
   --w --h: the pad's box in the stage. */
.pad-nudge { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.pad-nudge-ring { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h); border-radius: 14px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 26px 6px rgba(245, 165, 36, .55); animation: nudge-glow .6s ease-in-out infinite alternate; }
.pad-nudge-ring::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid var(--accent);
  animation: tour-pulse 1.2s ease-out infinite; }
@keyframes nudge-glow { to { box-shadow: 0 0 0 3px var(--accent), 0 0 40px 12px rgba(245, 165, 36, .8); } }
.pad-nudge-arrow { position: absolute; display: flex; align-items: center; gap: 2px; }
.pad-nudge-arrow b { padding: 5px 10px; border-radius: 999px; background: var(--accent); color: #1a1206;
  font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
.pad-nudge-arrow span { color: var(--accent); font-size: var(--fs-xl); line-height: 1; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.pad-nudge-arrow .ico { display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7)); }
.pad-nudge.down .pad-nudge-arrow { flex-direction: column; left: calc(var(--l) + var(--w) / 2); top: calc(var(--t) - 4px); transform: translate(-50%, -100%); }
/* The arrow always sits next to the pad, the label beyond it. */
.pad-nudge.left .pad-nudge-arrow { flex-direction: row-reverse; left: calc(var(--l) + var(--w) + 4px); top: calc(var(--t) + var(--h) / 2); transform: translateY(-50%); }
.pad-nudge.right .pad-nudge-arrow { left: calc(var(--l) - 4px); top: calc(var(--t) + var(--h) / 2); transform: translate(-100%, -50%); }
.pad-nudge.down .pad-nudge-arrow span { animation: nudge-down .5s ease-in-out infinite alternate; }
.pad-nudge.left .pad-nudge-arrow span { animation: nudge-left .5s ease-in-out infinite alternate; }
.pad-nudge.right .pad-nudge-arrow span { animation: nudge-right .5s ease-in-out infinite alternate; }
@keyframes nudge-down { to { transform: translateY(8px); } }
@keyframes nudge-left { to { transform: translateX(-8px); } }
@keyframes nudge-right { to { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) {
  .pad-nudge-ring, .pad-nudge-ring::after, .pad-nudge-arrow span { animation: none !important; }
}

/* ---------- how to play (coach.js) ---------- */
.tour { position: fixed; inset: 0; z-index: 1000; opacity: 0; transition: opacity .25s; }
.tour.on { opacity: 1; }
.tour-ring { position: fixed; pointer-events: none; transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, border-radius .35s;
  box-shadow: 0 0 0 9999px rgba(4, 7, 14, .74), 0 0 0 3px var(--accent), 0 0 26px 6px rgba(245, 165, 36, .5); }
.tour-ring::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid var(--accent);
  animation: tour-pulse 1.4s ease-out infinite; }
@keyframes tour-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.18); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tour-ring::after { animation: none; } .tour-ring { transition: none; } }
.tour-bubble { position: fixed; display: grid; gap: 6px; padding: 14px 16px 12px; border-radius: 16px; text-align: left;
  background: linear-gradient(180deg, #1f2945, #141b2e); border: 1px solid rgba(245, 165, 36, .55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.tour-count { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.tour-title { font: 800 var(--fs-lg)/1.15 var(--display); }
.tour-text { color: #c3cbe0; font-size: var(--fs-sm); line-height: 1.45; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.tour-actions .btn-primary { padding: 10px 20px; }

/* ---------- player level (xp.js) ---------- */
.player-level { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.lvl-name { font: 800 var(--fs-md)/1.2 var(--display); letter-spacing: .03em; color: var(--gold-hi); }
.lvl-next { color: var(--text-dim); font-size: var(--fs-xs); }
.lvl-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  box-shadow: 0 0 10px rgba(245, 165, 36, .5); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.res-xp { display: grid; gap: 6px; padding: 12px 16px; }
.res-xp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.res-xp-top b { font: 800 var(--fs-lg)/1 var(--display); color: var(--accent); text-shadow: 0 0 14px rgba(245, 165, 36, .45); }
.res-xp-parts { color: var(--text-dim); font-size: var(--fs-xs); }
.res-xp-up { color: var(--gold-hi); font-weight: 800; }
.encore-note { color: var(--gold-hi); font-weight: 700; }
.extra-note { color: #f2998a; }

/* ---------- Encore ---------- */
/* A light, not a button: dim while it fills, bright while an Encore plays. */
.encore-btn { position: absolute; top: 36px; right: 10px; z-index: 2; width: 64px; height: 64px; border-radius: 50%;
  pointer-events: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--fill, 0) * 360deg), rgba(255, 255, 255, .1) 0); opacity: .45; transition: opacity .3s; }
.encore-btn::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #10162a; }
.encore-btn span { position: relative; display: grid; gap: 3px; justify-items: center; font: 800 .58rem/1 system-ui, sans-serif; letter-spacing: .08em; color: var(--text-dim); }
.encore-btn small { font-size: .5rem; font-weight: 700; letter-spacing: .02em; }
.encore-btn.on span { color: var(--gold-hi); }
.encore-btn.on { opacity: 1; box-shadow: 0 0 26px 6px rgba(245, 165, 36, .65); animation: encore-on 1.2s ease-in-out infinite; }
@keyframes encore-on { 50% { box-shadow: 0 0 34px 9px rgba(245, 165, 36, .8); transform: scale(1.06); } }
.stage.encore .highway-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 12px;
  box-shadow: inset 0 0 40px 6px rgba(245, 165, 36, .45), inset 0 0 0 2px rgba(255, 196, 80, .8); animation: encore-glow 1.2s ease-in-out infinite; }
@keyframes encore-glow { 50% { box-shadow: inset 0 0 60px 10px rgba(245, 165, 36, .6), inset 0 0 0 2px rgba(255, 220, 120, 1); } }
/* The multiplier, while it's above ×1: bare text under the Encore meter. */
.mult-tag { position: absolute; top: 80px; right: 10px; z-index: 2; width: 64px; text-align: center; pointer-events: none;
  font: 900 var(--fs-lg)/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--gold-hi);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 8px rgba(0, 0, 0, .6); }
#hud-mult.encore { color: var(--gold-hi); text-shadow: 0 0 12px rgba(245, 165, 36, .8), 0 1px 3px rgba(0, 0, 0, .95); }
@media (prefers-reduced-motion: reduce) { .encore-btn.on, .stage.encore .highway-wrap::after { animation: none; } }

/* ---------- the pads are the neck too ----------
   The fingerboard's wood under them (ebony, or the guitar's rosewood), each
   string running through its lane at its real thickness (touchpad.js sets
   --sw/--sc), and in Two-hand the finger pad's strings along its length. */
.touchpad, .fingerpad { position: relative; padding: 4px; border-radius: 14px; --grain: 90deg; }
.touchpad.horizontal, .fingerpad.horizontal { --grain: 0deg; }
.wood-ebony {
  background: repeating-linear-gradient(var(--grain), rgba(72, 54, 42, .22) 0 1px, transparent 1px 4px, rgba(0, 0, 0, .3) 4px 5px, transparent 5px 9px),
    linear-gradient(var(--grain), #0c0907, #1d1612 50%, #0c0907);
}
.wood-rosewood {
  background: repeating-linear-gradient(var(--grain), rgba(120, 64, 38, .25) 0 1px, transparent 1px 4px, rgba(10, 4, 2, .35) 4px 5px, transparent 5px 9px),
    linear-gradient(var(--grain), #22110a, #3d2014 50%, #22110a);
}
.touchpad .cell, .fingerpad .cell { position: relative; background: rgba(10, 14, 26, .5); }
.touchpad .cell b, .touchpad .cell small, .fingerpad .cell b, .fingerpad .cell small {
  position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
/* Labels sit on the string like markers: a small dark tag behind each. */
.touchpad:not(.bow) .cell b, .touchpad:not(.bow) .cell small,
.fingerpad .cell b, .fingerpad .cell small {
  background: rgba(10, 13, 22, .82); border-radius: 5px; padding: 1px 5px;
}
.touchpad .cell.down b, .touchpad .cell.down small, .fingerpad .cell.down b, .fingerpad .cell.down small { background: transparent; }
.touchpad .cell.down, .fingerpad .cell.down { background: var(--c); }
.touchpad .cell.down b, .touchpad .cell.down small, .fingerpad .cell.down b, .fingerpad .cell.down small { text-shadow: none; }
.touchpad .cell::before {
  content: ""; position: absolute; pointer-events: none; background: var(--sc, #d5d8df); opacity: .9;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, .6);
}
.touchpad.vertical .cell::before { left: 50%; top: 0; bottom: 0; width: var(--sw); transform: translateX(-50%); }
.touchpad.horizontal .cell::before { top: 50%; left: 0; right: 0; height: var(--sw); transform: translateY(-50%); }
.touchpad.bow::after { z-index: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.neck-strings { position: absolute; inset: 4px; pointer-events: none; }
.neck-strings i { position: absolute; background: var(--sc); opacity: .9; box-shadow: 1px 1px 1px rgba(0, 0, 0, .6); }
.fingerpad.vertical .neck-strings i { top: 0; bottom: 0; width: var(--sw); transform: translateX(-50%); }
.fingerpad.horizontal .neck-strings i { left: 0; right: 0; height: var(--sw); transform: translateY(-50%); }

/* Your own instrument: the pad as a fingering chart, lighting where the next note is. */
.touchpad.guide { pointer-events: none; }
.stage.vertical .touchpad.normal.guide { height: min(30%, 240px); }
.touchpad.guide .cell.demo { background: var(--c); box-shadow: 0 0 18px 2px var(--c); }
.touchpad.guide .cell.demo b, .touchpad.guide .cell.demo small { background: rgba(10, 13, 22, .55); color: #fff; }

/* ---------- motion around the game (main.js: setGameSky, streakFx, countUp) ---------- */
/* The game's sky, in the stage's colors (--sky1..3, 'r,g,b'), behind the
   bar and around the highway; it flares in an Encore. */
#screen-game { position: relative; isolation: isolate; --sky1: 74, 222, 128; --sky2: 45, 212, 191; --sky3: 167, 139, 250; }
.game-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(120% 50% at 50% 0%, rgba(var(--sky1), .14), rgba(var(--sky1), 0) 70%),
    linear-gradient(180deg, var(--sky) 0%, #0e1430 50%, var(--bg0) 100%); }
/* Still, and not blended, under a song: three screen-sized layers moving and
   blending every frame were the biggest load on the phone's graphics chip, for
   a sky that only shows around the notes. The canvas's own aurora moves instead. */
.game-sky .aurora { opacity: .5; transition: opacity 1.2s; mix-blend-mode: normal; }
.game-sky .aurora i { animation: none; will-change: auto; }
.game-sky .aurora .d, .game-sky .aurora .e { display: none; } /* three tongues are plenty under a song */
.game-sky .aurora .a { background: radial-gradient(ellipse 15% 46% at 30% 30%, rgba(var(--sky1), .7), transparent 68%); }
.game-sky .aurora .b { background: radial-gradient(ellipse 11% 52% at 62% 28%, rgba(var(--sky2), .62), transparent 66%); }
.game-sky .aurora .c { background: radial-gradient(ellipse 19% 40% at 46% 34%, rgba(var(--sky3), .5), transparent 70%); }
#screen-game.encore .game-sky .aurora { opacity: 1; }

/* Song list, settings and results: the moving sky, still while the page scrolls. */
[data-sky] { isolation: isolate; }
.screen-sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.screen-sky .aurora { opacity: .45; }
/* The pause card floats on an aurora. */
#pause-overlay .aurora { opacity: .55; }
#pause-overlay .overlay-card { position: relative; }

/* A streak milestone: one line at the top of the highway, no box, out of
   the way of the notes (Doug: the big burst hid the whole highway). */
.streak-burst { position: absolute; left: 50%; top: 10px; z-index: 3; pointer-events: none; max-width: 62%;
  display: flex; align-items: baseline; justify-content: center; gap: 6px; white-space: nowrap;
  transform: translateX(-50%); text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .6); }
.streak-burst b { font-size: var(--fs-xl); font-weight: 900; line-height: 1; color: var(--gold-hi); }
.streak-burst span { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-hi); }
.streak-burst.pop { animation: streak-burst 1.4s ease-out both; }
@keyframes streak-burst {
  0% { transform: translateX(-50%) scale(.6); opacity: 0; }
  14% { transform: translateX(-50%) scale(1.08); opacity: 1; }
  24% { transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { transform: translateX(-50%); opacity: 0; }
}
/* The multiplier pops as it rises; the streak shakes when it's lost. */
#hud-streak { display: inline-block; }
#hud-mult.pop { animation: hud-pop .5s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes hud-pop { 0% { transform: scale(1.9); color: var(--gold-hi); text-shadow: 0 0 14px rgba(245, 165, 36, .9); } 100% { transform: none; } }
#hud-streak.shake { animation: hud-shake .45s ease-out; }
@keyframes hud-shake {
  0%, 100% { transform: none; }
  15% { transform: translateX(-6px); color: #f87171; }
  35% { transform: translateX(5px); color: #f87171; }
  55% { transform: translateX(-3px); }
  75% { transform: translateX(2px); }
}

/* Results: each star stamps down with a burst; a new best lands like a medal. */
.stars i { position: relative; display: inline-block; font-style: normal; }
.stars i.off { -webkit-text-stroke: 1px #3a4664; color: transparent; }
.stars i.on { animation: star-stamp .5s cubic-bezier(.2, .9, .3, 1.4) both; animation-delay: calc(.35s + var(--k) * .28s); }
.stars i.on::after { content: ""; position: absolute; left: 50%; top: 55%; width: 1.3em; height: 1.3em; margin: -.65em 0 0 -.65em;
  border-radius: 50%; border: 3px solid var(--gold-hi); opacity: 0; pointer-events: none;
  animation: star-ring .6s ease-out both; animation-delay: calc(.5s + var(--k) * .28s); }
@keyframes star-stamp {
  0% { transform: scale(2.8) rotate(-30deg); opacity: 0; }
  55% { transform: scale(.88) rotate(6deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes star-ring { 0% { transform: scale(.3); opacity: .95; } 100% { transform: scale(1.6); opacity: 0; } }
#res-best.is-new { position: relative; width: fit-content; margin-inline: auto; overflow: hidden; padding: 6px 16px; border-radius: 999px;
  color: #2a1600; font-weight: 850; font-size: var(--fs-sm); background: linear-gradient(#ffd27a, var(--accent) 60%, #e8890f);
  box-shadow: 0 0 0 2px rgba(255, 244, 214, .45), 0 6px 20px rgba(245, 165, 36, .45);
  animation: best-in .7s cubic-bezier(.2, .9, .3, 1.4) 1.6s both; }
#res-best.is-new::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%);
  transform: translateX(-100%); animation: best-shine 2.8s ease-in-out 2.2s infinite; }
@keyframes best-in { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes best-shine { 0% { transform: translateX(-100%); } 40%, 100% { transform: translateX(100%); } }
.res-grades .combo { animation: best-in .6s cubic-bezier(.2, .9, .3, 1.4) 1.4s both; box-shadow: 0 0 14px rgba(74, 222, 128, .55); }

/* Song list: a song still to pass catches the light now and then. */
.song-row.to-play { position: relative; overflow: hidden; }
.song-row.to-play::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 226, 160, .1) 50%, transparent 62%);
  transform: translateX(-100%); animation: row-shine 8s ease-in-out var(--shine, 0s) infinite; }
@keyframes row-shine { 0%, 78% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Map: a passed song with challenges left twinkles. */
.sm-node.has-challenges::after { content: "✦"; position: absolute; right: -8%; top: -12%; pointer-events: none;
  font-size: calc(38 * var(--s) * 1px); line-height: 1; color: #fff4d0; text-shadow: 0 0 8px rgba(255, 210, 122, .95);
  opacity: 0; animation: sm-twinkle 6s ease-in-out var(--tw, 0s) infinite; }
@keyframes sm-twinkle {
  0%, 80%, 100% { opacity: 0; transform: scale(.4) rotate(0); }
  87% { opacity: 1; transform: scale(1.15) rotate(45deg); }
  94% { opacity: .2; transform: scale(.7) rotate(90deg); }
}

/* The scenery's slow motion (map-art.js tags it): windmill sails and the
   big wheel turn, boats bob, kites and flags stir, water glints, stars
   twinkle. Slow on purpose: a living picture, not a busy one. */
.art-spin { transform-box: view-box; animation: art-spin 40s linear infinite; }
.art-bob { animation: art-bob 5s ease-in-out infinite alternate; }
.art-float { animation: art-float 7s ease-in-out infinite alternate; }
.art-sway { transform-box: view-box; animation: art-sway 6s ease-in-out infinite alternate; }
.art-flap { transform-box: view-box; animation: art-flap 2.6s ease-in-out infinite alternate; }
.art-glint { animation: art-glint 4s ease-in-out infinite alternate; }
.art-burst { animation: art-glint 3.2s ease-in-out infinite alternate; }
.art-fall { animation: art-fall 9s ease-in-out infinite alternate; }
.art-twinkle { animation: art-glint 6s ease-in-out infinite alternate; }
.art-t1 { animation-duration: 8s; animation-delay: -3s; }
.art-t2 { animation-duration: 11s; animation-delay: -6s; }
@keyframes art-spin { to { transform: rotate(360deg); } }
@keyframes art-bob { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes art-float { from { transform: translateY(6px); } to { transform: translateY(-8px); } }
@keyframes art-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes art-flap { from { transform: scaleX(1); } to { transform: scaleX(.78) skewY(4deg); } }
@keyframes art-glint { from { opacity: 1; } to { opacity: .4; } }
@keyframes art-fall { from { transform: translate(-4px, -6px); } to { transform: translate(5px, 8px); } }

@media (prefers-reduced-motion: reduce) {
  .art-spin, .art-bob, .art-float, .art-sway, .art-flap, .art-glint, .art-burst, .art-fall, .art-twinkle { animation: none; }
  .streak-burst.pop, #hud-mult.pop, #hud-streak.shake, .stars i.on, .stars i.on::after,
  #res-best.is-new, #res-best.is-new::after, .res-grades .combo, .song-row.to-play::after { animation: none; }
  .sm-node.has-challenges::after { animation: none; opacity: .85; }
  .screen-sky .aurora i, #pause-overlay .aurora i { animation: none; }
}

/* ---------- sound ---------- */
.sound-card { gap: 16px; width: min(520px, 100%); }
.sound-row { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; }
.sound-row span { color: var(--text); font-weight: 600; }
.sound-row b { min-width: 0; margin-left: 6px; color: var(--accent); font-weight: 600; }
.sound-row small { display: block; color: var(--text-dim); font-size: var(--fs-xs); font-weight: 400; }
.opt.sound-row input[type=range] { width: 100%; margin: 6px 0; height: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot)) 0 0 / var(--v, 100%) 100% no-repeat, rgba(255, 255, 255, .12); }
.sound-card .opt-hint { color: var(--text-dim); margin: 0; }
.sound-row.opt-check { grid-template-columns: 1fr auto; align-items: center; }

/* Home and the map from every screen (navBar in main.js): icons on phones. */
.nav-btn .nav-label { margin-left: 4px; }
@media (max-width: 520px) {
  .nav-btn { min-width: 40px; padding-left: 10px; padding-right: 10px; }
  .nav-btn .nav-label { display: none; }
}
.res-nav { justify-self: start; width: 100%; margin-bottom: 4px; }
#screen-results .menu-wrap > .res-nav { display: flex; }

/* Exploring the map. */
.map-explore-head { display: flex; align-items: center; justify-content: space-between; }
.map-explore-head small { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.map-explore-hint { margin: 2px 0 8px; color: var(--text-dim); font-size: var(--fs-xs); }
.map-explore-stages { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.map-explore-stages::-webkit-scrollbar { display: none; }
.map-explore-stages button { flex: none; display: grid; gap: 1px; min-width: 92px; max-width: 132px; padding: 7px 10px; text-align: left;
  border-radius: 12px; border: 1px solid #263055; background: #10162a; color: var(--text); cursor: pointer; }
.map-explore-stages button small { color: var(--text-dim); font-size: var(--fs-xs); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.map-explore-stages button b { font-size: var(--fs-xs); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-explore-stages .is-here { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.map-explore-stages .is-locked b { color: var(--text-dim); }
@media (orientation: landscape) and (max-height: 600px) {
  .map-explore-bar { top: calc(64px + var(--safe-t)); bottom: auto; }
  .map-explore-hint { display: none; }
}

/* A stage's songs, on its card. */
.stage-songs { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; text-align: left; }
.stage-songs li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 10px; background: #10162a; border: 1px solid #263055; }
.stage-songs .n { color: var(--text-dim); font-size: var(--fs-xs); font-weight: 800; text-align: center; }
.stage-songs b { display: block; font-size: var(--fs-sm); }
.stage-songs small { color: var(--text-dim); font-size: var(--fs-xs); }
.stage-songs .st { color: var(--gold-hi); font-size: var(--fs-xs); letter-spacing: 1px; white-space: nowrap; }
.stage-songs .is-here { border-color: var(--accent); }
.stage-songs li[data-song] { cursor: pointer; }
@media (hover: hover) { .stage-songs li[data-song]:hover { border-color: #3a4775; } }
.stage-songs .is-locked b { color: var(--text-dim); }

/* Who's playing: avatars, and the profile screen. */
.avatar { display: grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 50%;
  font: 800 var(--fs-xl)/1 var(--display); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  background: linear-gradient(145deg, hsl(var(--avatar-hue, 32) 80% 60%), hsl(var(--avatar-hue, 32) 70% 34%));
  box-shadow: 0 0 0 2px #ffe3a6, 0 4px 14px rgba(0, 0, 0, .45); }
.profile-screen { position: fixed; inset: 0; z-index: 900; overflow-y: auto; text-align: center;
  padding: calc(14px + var(--safe-t)) max(18px, var(--safe-r)) calc(24px + var(--safe-b)) max(18px, var(--safe-l));
  background: radial-gradient(90% 60% at 50% 22%, #1d2750, #0b1020 62%, #05070f); color: var(--text); }
.profile-screen[hidden] { display: none; }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px; }
.profile-head #player-edit { margin-left: auto; }
.profile-screen h2 { margin: 18px 0 4px; font: 800 clamp(1.9rem, 8vw, 2.6rem)/1.1 var(--display); outline: none; color: var(--gold-hi); }
.profile-note { margin: 0 auto 22px; max-width: 34ch; color: var(--text-dim); font-size: var(--fs-sm); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 168px)); justify-content: center; gap: 12px; margin: 0 auto; padding: 0; list-style: none; max-width: 720px; }
.profile-tile { display: grid; grid-template-rows: 1fr auto; gap: 6px; }
.profile-pick { display: grid; justify-items: center; align-content: start; gap: 4px; width: 100%; height: 100%; min-height: 178px; padding: 16px 8px 12px; cursor: pointer;
  border: 1px solid #2a3560; border-radius: 18px; background: rgba(20, 27, 54, .8); color: var(--text); font: inherit; transition: transform .15s, border-color .15s; }
.profile-pick:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
@media (hover: hover) { .profile-pick:hover { border-color: var(--accent); transform: translateY(-2px); } }
.profile-pick:active { transform: scale(.97); }
.profile-pick .avatar { width: 84px; height: 84px; margin-bottom: 8px; font-size: var(--fs-2xl); }
.profile-pick b { max-width: 100%; font-size: var(--fs-md); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-pick small { color: var(--text-dim); font-size: var(--fs-xs); line-height: 1.25; text-wrap: balance; }
.profile-tile.is-active .profile-pick { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 26px rgba(245, 165, 36, .22); }
.profile-pick .playing { margin-top: 3px; color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.profile-new .profile-pick { border-style: dashed; background: none; }
.profile-new .avatar { font-family: inherit; font-size: 3rem; font-weight: 500; color: var(--gold-hi); text-shadow: none; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28); }
.profile-tools { display: flex; gap: 6px; justify-content: center; }
.profile-tools .btn { flex: 1; padding-inline: 4px; }
.profile-foot { margin: 22px auto 0; max-width: 36ch; color: var(--text-dim); font-size: var(--fs-xs); }
.player-add { display: flex; gap: 8px; max-width: 420px; margin: 18px auto 0; }
.player-add[hidden] { display: none; }
.player-skip { display: block; margin: 14px auto 0; }
.player-add input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid #263055;
  background: #10162a; color: var(--text); font: inherit; }

/* ---------- the walkthrough (walkthrough.js): a hand showing each way of
   playing on the real game screen, and a card saying what it is ---------- */
.walk-layer { position: fixed; inset: 0; z-index: 940; } /* the demo plays itself: taps go nowhere but the card */
.walk-layer[hidden] { display: none; }
.walk-card { position: fixed; z-index: 945; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%);
  width: min(calc(100vw - 20px), 560px); padding: 12px 14px; border-radius: 14px; color: var(--text);
  background: #0f1529; border: 1px solid rgba(245, 165, 36, .55); box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  animation: pop-in .2s ease-out; }
.walk-card[hidden] { display: none; }
.walk-kicker { color: var(--gold-hi); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.walk-card h3 { margin: 2px 0 4px; font-size: var(--fs-lg); line-height: 1.15; }
#walk-text { margin: 0 0 10px; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.35; }
.walk-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
#walk-skip { margin-right: auto; }
/* The hand: its fingertip on the spot (translate from walkthrough.js), the
   hand coming up from below; it presses in when it plays. */
.walk-hand { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.walk-hand[hidden] { display: none; }
.walk-hand svg { display: block; width: 46px; height: auto; margin: -5px 0 0 -23px; transform-origin: 23px 5px;
  transform: rotate(-14deg); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); transition: transform .12s ease; }
.walk-hand.is-thumb-l svg, .walk-hand.is-thumb-r svg { width: 54px; margin: -5px 0 0 -27px; transform-origin: 27px 5px; }
.walk-hand.is-thumb-l svg { transform: rotate(24deg); }
.walk-hand.is-thumb-r svg { transform: rotate(-24deg); }
.walk-hand.down svg { transform: rotate(-14deg) translateY(4px) scale(.93); }
.walk-hand.is-thumb-l.down svg { transform: rotate(24deg) translateY(4px) scale(.93); }
.walk-hand.is-thumb-r.down svg { transform: rotate(-24deg) translateY(4px) scale(.93); }
.walk-hand .skin { fill: #f2c9a6; stroke: #a7714f; stroke-width: 2.5; }
.walk-hand .nail { fill: #fbe5d6; stroke: #d3a487; stroke-width: 1.5; }
.walk-hand .crease { fill: none; stroke: #c48c6a; stroke-width: 2; stroke-linecap: round; opacity: .7; }
/* Where it presses: a ring spreads from the fingertip. */
.walk-hand::after { content: ""; position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(255, 214, 120, .95); opacity: 0; transform: scale(.4); }
.walk-hand.down::after { animation: walk-tap .45s ease-out; }
@keyframes walk-tap { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.5); } }
.walk-hand.is-keys::after, .walk-hand.is-sing::after { display: none; }
.walk-keys { display: flex; align-items: center; gap: 6px; transform: translate(-50%, -150%); }
.walk-keys kbd { display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 10px; border-radius: 9px;
  font: 800 var(--fs-lg)/1 system-ui, sans-serif; color: #1d2333; background: linear-gradient(#fdfdfd, #d9dde6);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 4px 0 #8a92a6, 0 8px 14px rgba(0, 0, 0, .4); transition: transform .1s, box-shadow .1s; }
.walk-keys i { font-style: normal; font-weight: 800; color: var(--text); }
.walk-hand.down .walk-keys kbd { transform: translateY(3px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 1px 0 #8a92a6, 0 3px 6px rgba(0, 0, 0, .4); }
.walk-sing { display: grid; place-items: center; width: 54px; height: 54px; transform: translate(-50%, -140%); border-radius: 50%;
  font-size: var(--fs-xl); color: #2a1600; background: linear-gradient(#ffd27a, var(--accent)); box-shadow: 0 6px 14px rgba(0, 0, 0, .45); }
.walk-hand.down .walk-sing { animation: walk-sing .5s ease-in-out infinite alternate; }
@keyframes walk-sing { to { transform: translate(-50%, -160%) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .walk-hand.down::after, .walk-hand.down .walk-sing { animation: none; } }
/* A demo on the game screen: no buttons of its own (the card has them), and no taps. */
#screen-game.is-demo .hud .btn, #screen-game.is-demo .btn-pause, #screen-game.is-demo #btn-encore,
#screen-game.is-demo .count-tip { visibility: hidden; }
#screen-game.is-demo .stage { pointer-events: none; }
/* The list: carry on, all of them, or one. */
.walk-pick { display: grid; gap: 10px; }
.walk-pick-text { color: var(--text-dim); line-height: 1.4; }
.walk-pick .btn-big { width: 100%; min-width: 0; }
.walk-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.walk-style { display: grid; gap: 2px; padding: 12px 14px; text-align: left; }
.walk-style small { font-size: var(--fs-xs); font-weight: 500; opacity: .85; }
/* A phone: the six instruments in two rows of three, so their names fit. */
@media (max-width: 520px) {
  #pause-inst, .jp-inst { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}

/* ---------- mini games ---------- */
.home-games { flex-wrap: wrap; }

/* Drone Garden */
.garden-wrap { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 24px; max-width: 760px; width: 100%; margin: 0 auto; }
.garden-bed { width: 100%; height: clamp(110px, 20vh, 220px); border-radius: 14px; border: 1px solid var(--panel-edge); background: var(--panel); touch-action: manipulation; }
.garden-count { color: var(--text-dim); font-size: var(--fs-sm); text-align: center; margin: 0; }
.garden-play { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.garden-play:has(.garden-strip:not([hidden])) { grid-template-columns: 1fr 92px; }
.garden-main { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.garden-settings { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; color: var(--text-dim); }
.garden-settings label { display: flex; align-items: center; gap: 8px; }
.garden-settings[hidden] { display: none; }
.garden-lock {
  --p: 0; --warm: 0;
  width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; padding: 10px;
  background: conic-gradient(var(--good) calc(var(--p) * 360deg), rgba(255, 255, 255, .08) 0);
  box-shadow: 0 0 calc(var(--warm) * 46px) rgba(240, 190, 90, calc(var(--warm) * .8));
  transition: box-shadow .12s linear;
  position: relative;
}
/* Higher / Lower, inside the ring: at its top pointing up, or its bottom pointing down. */
.garden-hint {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--accent); font-size: var(--fs-md); font-weight: 800; line-height: 1; letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none;
  animation: garden-nudge-up 1.1s ease-in-out infinite;
}
.garden-hint[hidden] { display: none; }
.garden-hint svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); }
.garden-hint[data-way="lower"] { top: auto; bottom: 14px; flex-direction: column-reverse; animation-name: garden-nudge-down; }
.garden-hint[data-way="lower"] svg { transform: rotate(180deg); }
@keyframes garden-nudge-up { 50% { transform: translate(-50%, -3px); } }
@keyframes garden-nudge-down { 50% { transform: translate(-50%, 3px); } }
@media (prefers-reduced-motion: reduce) { .garden-hint { animation: none; } }
html[data-theme="concert"] .garden-hint { color: var(--brass-hi); }
.garden-prompt {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: var(--panel); border: 1px solid var(--panel-edge); padding: 12px;
  font-family: var(--display); font-size: var(--fs-lg); font-weight: 700; line-height: 1.15;
}
.garden-detail, .garden-status { margin: 0; text-align: center; color: var(--text-dim); min-height: 1.3em; }
.garden-status { color: var(--text); }
.garden-meter { position: relative; width: min(320px, 100%); height: 28px; border-radius: 14px; background: linear-gradient(90deg, rgba(239,68,68,.35), rgba(74,222,128,.45) 50%, rgba(239,68,68,.35)); }
.garden-meter[hidden] { display: none; }
.garden-meter i { --x: 50%; position: absolute; top: -4px; bottom: -4px; left: var(--x); width: 4px; margin-left: -2px; border-radius: 2px; background: var(--accent); transition: left .06s linear; }
.garden-meter i.in { background: var(--good); }
.garden-meter i.off { opacity: .25; }
.garden-meter b { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); color: var(--text); }
.garden-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.garden-help { text-align: center; max-width: 520px; }
/* The whole octave fits on screen under the bed, so the top of the string is never scrolled away. */
.garden-strip { height: clamp(300px, calc(100dvh - 330px), 560px); border-radius: 46px; background: var(--panel); border: 1px solid var(--panel-edge); touch-action: none; user-select: none; -webkit-user-select: none; position: sticky; top: 12px; }
.garden-strip[hidden] { display: none; }
.garden-strip canvas { width: 100%; height: 100%; display: block; }
html[data-theme="concert"] .garden-strip { background: var(--maple) center / cover; }

/* Busking Corner */
.busk-wrap { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 28px; max-width: 760px; width: 100%; margin: 0 auto; }
.busk-case { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; text-align: center; }
.busk-case b { font-family: var(--display); font-size: 2.2rem; color: var(--accent); }
.busk-case small { color: var(--text-dim); }
.busk-recent { list-style: none; margin: 8px 0 0; padding: 0; color: var(--text-dim); font-size: var(--fs-sm); }
.busk-recent[hidden] { display: none; }
#busk-bring { align-self: flex-start; }
.busk-row .btn { flex-shrink: 0; }
.res-busk { padding: 12px 16px; text-align: center; color: var(--text); margin: 4px 0; }
.res-busk[hidden] { display: none; }
/* The grown-up's gate. The number pad covers the lower half of a phone and
   the iOS app doesn't resize for it, so the card sits near the top, where
   all of it stays above the keys. */
#gate-dialog { position: fixed; z-index: 50; align-items: flex-start; padding: calc(var(--safe-t) + 4vh) 16px 16px; }
.gate-card { width: min(420px, 100%); }
.gate-answer { align-self: center; font-size: 1.4rem; text-align: center; width: 8em; padding: 8px; border-radius: 10px; border: 1px solid var(--panel-edge); background: var(--panel); color: var(--text); }
.gate-card .gate-msg { color: var(--bad); margin: 0; }
.gate-msg:empty { display: none; }
.gate-actions { display: flex; gap: 10px; }
.gate-actions .btn { flex: 1; }

/* ---------- the compact look (Nov 10): one top bar, smaller buttons ----------
   Doug: buttons felt bloated, and players should always know where they are.
   Every screen's bar (setupTopBars in main.js): Back, Home and the map on
   the left; the instrument you play, your profile and Settings on the right;
   the page's title under them on a phone, between them on a wide screen. */
.btn { padding: 7px 14px; font-size: var(--fs-sm); border-radius: 9px; }
.btn-big { font-size: var(--fs-md); padding: 11px 28px; min-width: 200px; }
.btn-small { font-size: var(--fs-xs); padding: 5px 11px; }

.bar.topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "nav title tools";
  align-items: center; gap: 8px 10px; padding: 10px max(14px, var(--safe-r)) 8px max(14px, var(--safe-l)); }
.topbar > .bar-nav { grid-area: nav; }
.topbar > h2 { grid-area: title; text-align: center; }
.topbar > .bar-tools { grid-area: tools; }
.bar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.bar-tools > .btn { padding: 6px 10px; }
.nav-back .nav-label { display: inline !important; } /* Back keeps its word, even on a phone */
.nav-btn svg { width: 20px; height: 20px; display: block; }
.nav-btn:not(.nav-back) { display: inline-grid; place-items: center; }
.topbar .who-mini { padding: 2px; max-width: none; }
.topbar .who-mini .avatar { width: 32px; height: 32px; font-size: var(--fs-md); }
.topbar .gear-btn { width: 38px; height: 38px; }
.topbar .gear-btn svg { width: 22px; height: 22px; }
#tuner-instrument { display: none; } /* the tuner follows the instrument chip */
@media (max-width: 700px) {
  .bar.topbar { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "nav tools" "title title"; }
  .topbar > h2 { text-align: left; padding: 0 2px; }
}

/* The instrument chip: its picture and name; tap to switch. */
.inst-chip { display: inline-flex; align-items: center; gap: 5px; min-width: 0; height: 38px; padding: 3px 8px 3px 5px; cursor: pointer;
  border: 1px solid rgba(245, 165, 36, .5); border-radius: 999px; background: rgba(14, 19, 38, .78); color: var(--text);
  font: 700 var(--fs-sm)/1 var(--sans, system-ui), sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .35); }
.inst-chip .inst-icon { height: 28px; width: auto; flex: none; }
.inst-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-chip .chev { width: 14px; height: 14px; flex: none; opacity: .75; }
.inst-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.home .top-row .inst-chip { height: 48px; padding-right: 12px; margin-left: auto; }
.home .top-row .inst-chip .inst-icon { height: 36px; }
@media (max-width: 400px) { .topbar .inst-chip > span { max-width: 4.5em; } }

/* The instrument picker and the Settings sheet (popwin). */
.inst-pop { width: min(calc(100vw - 24px), 360px); }
.inst-pop-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inst-pop-list .inst-choice { padding: 8px 2px 6px; }
#inst-pop-journey { margin-top: 10px; width: 100%; }
.sheet-section { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin: 2px 2px 8px; }
.sheet-section ~ .sheet-section { margin-top: 16px; }
.settings-sheet { width: min(calc(100vw - 24px), 440px); }
.settings-sheet .song-options { display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; }
.settings-sheet .song-options .opt { width: 100%; justify-content: space-between; }
.settings-sheet .song-options > .btn-small { align-self: flex-start; }
.pop-menu-items { display: grid; gap: 6px; }
.pop-menu-items .btn { text-align: left; padding: 9px 12px; }

/* How you play, as pictures (styleicons.js). */
.style-pick { padding: 0 18px 10px; max-width: 860px; width: 100%; align-self: center; }
.style-row { display: flex; flex-wrap: wrap; gap: 6px; }
.style-icon { display: grid; place-items: center; width: 46px; height: 42px; padding: 0; cursor: pointer; border-radius: 10px;
  border: 1px solid var(--panel-edge); background: var(--panel); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 rgba(0, 0, 0, .35); }
.style-icon svg { width: 26px; height: 26px; }
.style-icon.on { background: linear-gradient(180deg, var(--accent), var(--accent-hot)); color: #1a1205; border-color: transparent;
  box-shadow: 0 0 12px rgba(245, 165, 36, .4); }
.style-icon:active { transform: translateY(1px); }
.style-caption { margin: 6px 2px 0; font-size: var(--fs-xs); color: var(--text-dim); }
.style-caption b { color: var(--text); }
.style-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#song-sheet .map-sheet-style { display: block; margin: 8px 0; }
#song-sheet .map-sheet-style[hidden] { display: none; }

/* Group and sort: plain words, like a list's filter line, not buttons. */
.library-bar { gap: 4px 14px; padding: 0 18px 8px; font-size: var(--fs-sm); }
.lib-groups { gap: 2px 12px; align-items: baseline; }
.lib-groups::before { content: "Group"; color: var(--text-dim); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-right: 2px; }
.lib-groups .chip, .lib-groups .chip.on { padding: 2px 0; border: 0; border-radius: 0; background: none !important; box-shadow: none !important;
  color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; text-shadow: none; transform: none; }
.lib-groups .chip.on { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.lib-sort { gap: 6px; margin-left: 0; letter-spacing: .1em; }
.lib-sort select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: var(--text); padding: 2px 16px 2px 0;
  font-family: inherit; font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; letter-spacing: 0; text-transform: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-size: 5px 5px; background-position: right 5px center, right 0 center; background-repeat: no-repeat; }

/* Song rows: Listen and Play the same size, wherever the best score sits. */
.song-row { padding: 10px 14px; gap: 10px; }
.song-row .btn { flex: 0 0 84px; padding: 6px 0; text-align: center; }
.song-row .song-best { margin-left: auto; }
@media (max-width: 640px) {
  .song-row { gap: 8px 8px; padding: 10px 12px; }
  .song-row .btn { flex: 0 0 84px; }
}

.screen-prompt { text-align: center; color: var(--text-dim); font-size: var(--fs-sm); margin: 0 0 8px; }

/* The crowded bars (Back, Home, the map, a tool, the chip, you, Settings) on a phone. */
.topbar .nav-btn:not(.nav-back), .bar-tools > .icon-btn { width: 36px; min-width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; display: block; }
.topbar .who-mini { flex: none; }
.topbar .bar-nav { gap: 6px; }
.opt.opt-style { flex-direction: column; align-items: stretch; gap: 6px; }
.topbar .bar-tools { gap: 4px; }
.topbar .gear-btn { width: 34px; height: 34px; }
.topbar .gear-btn svg { width: 20px; height: 20px; }
.topbar .who-mini .avatar { width: 28px; height: 28px; font-size: var(--fs-sm); }
.topbar .nav-btn:not(.nav-back), .bar-tools > .icon-btn { width: 34px; min-width: 34px; height: 34px; }
.topbar .nav-back { padding: 6px 10px; }
.topbar .inst-chip { height: 34px; gap: 3px; padding: 2px 7px 2px 3px; }
.topbar .inst-chip .inst-icon { height: 24px; }
@media (max-width: 440px) { .topbar .inst-chip .chev { display: none; } .topbar .inst-chip > span { max-width: none; } }
.lib-groups { flex: 1 1 auto; }
.view-tabs .btn { padding: 7px 10px; }
.settings-sheet .opt.opt-wide { flex-wrap: wrap; gap: 6px; }
.settings-sheet .opt.opt-wide > span:first-child { flex: 1 1 100%; white-space: normal; }
.settings-sheet .opt.opt-wide .cycler { flex: 1 1 100%; margin-left: 0; }
.settings-sheet :is(#btn-songs-calibrate, #btn-songs-fs) { display: none !important; } /* both are under App */

/* Exploring the map: the top panel shrinks to one slim row, Done and the
   stages to fly to, so most of the screen is the map (Doug). */
.map-is-exploring .map-region { display: none; }
.map-is-exploring .map-panel { grid-template-columns: minmax(0, 1fr); padding-bottom: 6px; }
.map-is-exploring .map-explore-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; }
.map-is-exploring .map-explore-head { display: contents; }
.map-is-exploring .map-explore-head small, .map-is-exploring .map-explore-hint { display: none; }
.map-is-exploring .map-explore-stages { order: 2; flex: 1; min-width: 0; padding-bottom: 0; }
.map-is-exploring .map-explore-stages button { min-width: 0; padding: 4px 9px; }
.map-is-exploring .map-explore-stages button small { display: none; }
.map-is-exploring .map-top { min-height: 0; }
.map-is-exploring .map-panel { flex: none; }
.map-is-exploring .map-explore-bar { flex: none; }

/* ---------- the Practice Room (practiceroom.js): above the map, nothing scored ---------- */
.practice-body { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 720px; align-self: center;
  padding: 0 max(14px, var(--safe-r)) calc(24px + var(--safe-b)) max(14px, var(--safe-l)); }
.practice-intro { color: var(--text-dim); font-size: var(--fs-sm); margin: 0; }
.practice-head { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin: 8px 2px 0; }
.practice-stations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.station { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 6px 10px; text-align: center; min-width: 0; }
.station svg { width: 34px; height: 34px; }
.station b { font-size: var(--fs-sm); line-height: 1.15; }
.station small { font-size: var(--fs-xs); font-weight: 500; opacity: .8; line-height: 1.2; }
.practice-warmups { display: flex; flex-direction: column; gap: 6px; }
.pr-warmup { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--panel-edge); background: rgba(26, 34, 54, .6); }
.pr-warmup span { flex: 1; min-width: 0; font-weight: 700; }
.pr-warmup .btn { flex: 0 0 76px; padding: 6px 0; text-align: center; }
.screen.enter-down { animation: enter-down .38s cubic-bezier(.2, .7, .3, 1); }
@keyframes enter-down { from { transform: translateY(-36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .screen.enter-down { animation: none; } }

/* The map's way up to it: hanging below the top panel, over the map. */
.map-practice { position: absolute; z-index: 6; left: max(12px, var(--safe-l)); bottom: -42px; display: inline-flex; align-items: center; gap: 4px; }
.map-practice svg { width: 16px; height: 16px; }

/* Chords to tap, the progression's chords, and what's playing now. */
.pr-chords, .pr-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-chords[hidden], .pr-own[hidden] { display: none; }
.pr-chord, .pr-step { display: inline-grid; justify-items: center; min-width: 46px; padding: 5px 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--panel-edge); background: var(--panel); color: var(--text); font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 rgba(0, 0, 0, .35); }
.pr-chord small { font-size: var(--fs-xs); opacity: .75; line-height: 1; }
.pr-chord b, .pr-step b { font-size: var(--fs-md); line-height: 1.2; }
.pr-chord.on, .pr-step.on { background: linear-gradient(180deg, var(--accent), var(--accent-hot)); color: #1a1205; border-color: transparent; }
.pr-step { grid-auto-flow: column; gap: 6px; align-items: center; }
.pr-step i { font-style: normal; opacity: .7; padding: 0 2px; }
.pr-any { align-self: flex-start; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--panel-edge); background: var(--panel); color: var(--text); font: inherit; }
.pr-own { display: flex; flex-direction: column; gap: 6px; }
.pr-caption, .pr-hint { margin: 0; font-size: var(--fs-xs); color: var(--text-dim); }
.pr-hint { text-align: center; }
.cp-now { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; }
.cp-now > div { display: grid; align-content: center; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--panel-edge); background: rgba(26, 34, 54, .6); }
.cp-now small { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.cp-now-box b { font-size: var(--fs-2xl); line-height: 1.05; color: var(--accent); }
.cp-next-box b { font-size: var(--fs-xl); line-height: 1.1; opacity: .8; }
.cp-shape { font: 700 var(--fs-sm)/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; color: var(--text-dim); }
.cp-shape[hidden] { display: none; }
.cp-transport { display: flex; justify-content: center; gap: 8px; }
.cp-transport .btn { min-width: 48px; }
#cp-play { min-width: 120px; }

/* The fingerboard (fingerboard.js): strings side by side, open notes at the top. */
.fingerboard { display: grid; grid-template-columns: 44px repeat(var(--strings, 4), minmax(0, 1fr)); align-items: center;
  padding: 6px 8px 10px 4px; border-radius: 12px; border: 1px solid var(--panel-edge);
  background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 44px), linear-gradient(180deg, #2b1c12, #1b120c); }
.fb-corner, .fb-side, .fb-string-name { text-align: center; font-size: var(--fs-xs); font-weight: 800; color: #d8c7a4; }
.fb-string-name { padding: 2px 0 4px; font-size: var(--fs-sm); }
.fb-string-name.is-muted { color: #e57373; font-size: var(--fs-md); }
.fb-side { color: #a8987a; font-weight: 700; }
.fb-side.is-open { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.fb-cell { position: relative; display: grid; place-items: center; height: 42px;
  background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(236, 226, 205, .7) calc(50% - 1px), rgba(236, 226, 205, .7) calc(50% + 1px), transparent calc(50% + 1px)); }
.fb-cell.is-open { border-bottom: 4px solid #eadfc4; } /* the nut */
.fingerboard.fretted .fb-cell:not(.is-open) { border-bottom: 2px solid rgba(200, 200, 205, .55); } /* frets */
.fb-note { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid #eadfc4; background: #fbf4e2; color: #2a1a0e; font: 800 12px/1 var(--sans, system-ui), sans-serif; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.fb-note b { font-weight: 800; }
.fb-note.is-root { box-shadow: 0 0 0 3px var(--accent), 0 2px 4px rgba(0, 0, 0, .5); }
.fb-note.is-lit { background: var(--accent); border-color: #fff1c9; color: #1a1205; }
.fb-note.is-lit.is-root { box-shadow: 0 0 0 3px #fff1c9, 0 0 12px rgba(245, 165, 36, .8); }
.fb-note.is-dim { background: rgba(251, 244, 226, .28); border-color: rgba(234, 223, 196, .45); color: #fbf4e2; box-shadow: none; }
.fb-note.is-sounding { animation: fb-sound .5s ease-out; }
@keyframes fb-sound { 0% { transform: scale(1.25); box-shadow: 0 0 0 6px rgba(245, 165, 36, .55); } }
@media (prefers-reduced-motion: reduce) { .fb-note.is-sounding { animation: none; } }
.fb-side { font-size: 10px; line-height: 1.1; white-space: normal; }

/* ---------- the Practice Room on the map (map.js buildZone) ----------
   The journey slides down out of view and the room comes down from above. */
.sm-scroller, .sm-zone { transition: transform .7s cubic-bezier(.45, 0, .2, 1); }
.stagemap.zone-instant :is(.sm-scroller, .sm-zone) { transition: none; }
.sm-zone { position: absolute; inset: 0; z-index: 8; overflow: hidden; transform: translateY(-100%);
  background: linear-gradient(180deg, #0a1026 0%, #141c40 60%, #0b0f1a 100%); }
.stagemap.zone-up .sm-scroller { transform: translateY(100%); }
.stagemap.zone-up .sm-zone { transform: none; }
@media (prefers-reduced-motion: reduce) { .sm-scroller, .sm-zone { transition: none; } }
.sm-zone-art, .sm-zone-roads { position: absolute; inset: 0; width: 100%; height: 100%; }
.sm-zone-hub { position: absolute; z-index: 4; transform: translate(-50%, -50%); display: grid; justify-items: center; pointer-events: none; }
.sm-zone-hub .sm-medal { width: calc(120 * var(--s) * 1px); }
.stagemap .sm-zone-hub .sm-place { font-size: calc(26 * var(--s) * 1px); white-space: nowrap; }
.stagemap.is-concert .sm-zone-hub .sm-place { font-size: calc(40 * var(--s) * 1px); line-height: 1.1; }
.sm-station .sm-disc b { display: grid; place-items: center; width: 62%; height: 62%; }
.sm-station .sm-disc svg { width: 100%; height: 100%; }
.sm-station .sm-label { max-width: calc(170 * var(--s) * 1px); white-space: normal; text-align: center; }
.sm-zone-down { position: absolute; z-index: 9; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sm-zone-down svg { width: 16px; height: 16px; }
/* In the room, the journey's goal and stage medal step aside, and so do the ways off the journey. */
.map-in-zone .map-panel, .map-in-zone .map-explore, .map-in-zone .map-practice { display: none !important; }

/* ---------- the map's top, compact (Doug: it took half the screen) ---------- */
.map-top { min-height: 0; }
.map-panel { grid-template-columns: minmax(0, 1fr); gap: 7px; padding-bottom: 8px; }
.map-goal { min-height: 0; padding: 7px 44px 7px 12px; gap: 1px; border-radius: 12px; }
.map-goal small { font-size: 10px; }
.map-goal b { font-size: var(--fs-md); line-height: 1.15; }
.map-goal span { font-size: var(--fs-xs); line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.map-goal::after { width: 28px; height: 28px; right: 9px; font-size: var(--fs-md); }
.map-region { display: grid; grid-template-columns: auto; justify-items: center; gap: 0; max-width: 112px; }
.map-region .sm-medal { width: 50px; padding: 3px; }
.map-region-num { font-size: 10px; margin: 2px 0 0; }
.map-region-place { --lines: 2; font-size: var(--fs-sm); line-height: 1.1; text-align: center; }
html[data-theme="concert"] .map-region-place { font-size: var(--fs-md); line-height: 1.1; }
html[data-theme="concert"] .map-region .sm-medal { padding: 4px; }
.map-practice { bottom: -40px; }

/* ---------- where you are: always moving, so the eye finds it (Doug) ---------- */
.sm-gem { width: calc(58 * var(--s) * 1px); height: calc(58 * var(--s) * 1px); left: calc(-29 * var(--s) * 1px); border-radius: 50%;
  animation: sm-bob 2.4s ease-in-out infinite, sm-here 1.5s ease-in-out infinite; }
.sm-gem::after { content: ""; position: absolute; inset: calc(-5 * var(--s) * 1px); border-radius: 50%; pointer-events: none;
  border: calc(4 * var(--s) * 1px) solid #ffd27a; animation: sm-ring 1.5s ease-out infinite; }
@keyframes sm-here {
  0%, 100% { scale: 1; filter: brightness(1); box-shadow: 0 0 calc(20 * var(--s) * 1px) rgba(56, 189, 248, .75); }
  50% { scale: 1.2; filter: brightness(1.3) saturate(1.25); box-shadow: 0 0 calc(44 * var(--s) * 1px) rgba(255, 196, 80, .95); }
}
@keyframes sm-ring { from { scale: 1; opacity: .9; } to { scale: 1.9; opacity: 0; } }
html[data-theme="concert"] .sm-gem { border-radius: 50%; }
/* Even when nothing else moves (main.js idle), this one keeps going. */
html.is-idle .sm-gem, html.is-idle .sm-gem::after { animation-play-state: running !important; }
.sm-marker.is-walking .sm-gem::after { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .sm-gem::after { animation: none; opacity: .8; } }

/* ---------- the welcome screen (js/splash.js) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  text-align: center; color: #eef1fa;
  background:
    radial-gradient(120% 60% at 20% 0%, rgba(80, 220, 190, .18), transparent 60%),
    radial-gradient(90% 50% at 85% 10%, rgba(150, 110, 255, .18), transparent 60%),
    linear-gradient(180deg, #0b0f1a 0%, #141a33 100%);
  transition: opacity .45s ease;
}
.splash[hidden] { display: none; }
.splash.splash-out { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 520px); animation: splash-in .7s ease both; }
@keyframes splash-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.splash .logo { margin: 0; }
.splash-tag { margin: 0; font-size: var(--fs-md); color: #d3d9ea; }
.splash-hello { margin: 6px 0 0; font-size: var(--fs-lg); font-weight: 600; color: var(--accent); min-height: 1.3em; }
.splash-asking .splash-hello { margin-bottom: 8px; }
.splash-pick { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.splash-pick[hidden] { display: none; }
.splash-q { margin: 0; font-size: var(--fs-lg); }
.splash-looks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.splash-looks button {
  display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px; overflow: hidden; cursor: pointer;
  font: inherit; color: inherit; text-align: center; border-radius: 16px;
  background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .15s ease, border-color .15s ease;
}
.splash-looks button:active { transform: scale(.97); }
.splash-looks button.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 165, 36, .45), 0 6px 18px rgba(0, 0, 0, .35); }
.splash-looks img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 100%; margin-bottom: 8px; }
.splash-looks b { font-size: var(--fs-md); }
.splash-looks small { font-size: var(--fs-xs, .8rem); opacity: .8; padding: 0 8px; }
.splash-fine { margin: 0; font-size: var(--fs-sm); opacity: .75; }
html[data-theme="concert"] .splash {
  color: #fbf3df;
  background:
    linear-gradient(180deg, rgba(24, 13, 5, .55) 0%, rgba(24, 13, 5, .35) 35%, rgba(24, 13, 5, .85) 100%),
    url(../img/concert/vauxhall.jpg) 50% 38% / cover, #2a170c;
}
html[data-theme="concert"] .splash-tag { color: #f1e6cc; font-style: italic; text-shadow: 0 1px 3px rgba(10, 5, 0, .8); }
html[data-theme="concert"] .splash-hello { color: #f3d58c; text-shadow: 0 1px 3px rgba(10, 5, 0, .8); }
html[data-theme="concert"] .splash-looks button { background: rgba(42, 23, 12, .78); border-color: rgba(243, 213, 140, .45); }
html[data-theme="concert"] .splash-looks button.on { border-color: #f3d58c; box-shadow: 0 0 0 3px rgba(243, 213, 140, .5), 0 6px 18px rgba(0, 0, 0, .4); }
@media (prefers-reduced-motion: reduce) { .splash, .splash-inner { animation: none; transition: none; } }
@media (orientation: landscape) and (max-height: 500px) {
  .splash .logo { font-size: clamp(2rem, 9vh, 3.4rem); }
  .splash-inner { gap: 4px; }
  .splash-hello { margin: 0; }
  .splash-pick { gap: 8px; }
  .splash-looks { width: min(100%, 460px); }
  .splash-looks img { aspect-ratio: 5 / 2; }
}
