/* ================================================================
   SHAKER HERO — 2006 metal-game menu styles
   Carbon fiber, chrome bevel type, flames. Played completely
   straight, for an egg shaker. Hard edges everywhere.
   ================================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100dvh;
}

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Tokens ---------- */
:root {
  --carbon:        #0a0a0a;
  --carbon-2:      #141414;
  --flame-orange:  #ff6a00;
  --flame-yellow:  #ffd23f;
  --chrome-light:  #d8d8d8;
  --chrome-dark:   #3a3a3a;
  --electric-blue: #00d9ff;
  --red-hot:       #ff2a1a;

  --font-metal: 'Metal Mania', Impact, 'Arial Black', sans-serif;
  --font-ui:    -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:  ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* chrome bevel: light above, dark below, pit-black drop */
  --chrome-bevel:
    0 -1px 0 #ffffff,
    0 1px 0 var(--chrome-dark),
    0 2px 0 #262626,
    0 3px 0 #000000,
    0 6px 10px rgba(0, 0, 0, 0.85);
}

/* ---------- Base ---------- */
html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--chrome-light);
  background-color: var(--carbon);
  /* carbon-fiber crosshatch — pure CSS, no image */
  background-image:
    repeating-linear-gradient(45deg,  rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg,   rgba(0, 0, 0, 0.5) 0 2px, transparent 2px 4px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Chrome bevel display type */
.metal {
  font-family: var(--font-metal);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--chrome-light);
  text-shadow: var(--chrome-bevel);
}

/* Lock scroll during the gig */
body[data-state="soundcheck"],
body[data-state="countdown"],
body[data-state="playing"],
body[data-state="paused"] {
  overflow: hidden;
}

/* ================================================================
   STATE-DRIVEN VISIBILITY — body[data-state] owns everything.
   10 states: title setlist unsupported permission-denied
   calibrating soundcheck countdown playing paused results
   ================================================================ */
#screen-title,
#screen-setlist,
#screen-unsupported,
#screen-permission-denied,
#screen-calibrating,
#screen-gig,
#screen-results {
  display: none;
}

body[data-state="title"]             #screen-title             { display: flex; }
body[data-state="setlist"]           #screen-setlist           { display: flex; }
body[data-state="unsupported"]       #screen-unsupported       { display: flex; }
body[data-state="permission-denied"] #screen-permission-denied { display: flex; }
body[data-state="calibrating"]       #screen-calibrating       { display: flex; }
/* the gig container stays mounted for all four in-gig states */
body[data-state="soundcheck"]        #screen-gig               { display: flex; }
body[data-state="countdown"]         #screen-gig               { display: flex; }
body[data-state="playing"]           #screen-gig               { display: flex; }
body[data-state="paused"]            #screen-gig               { display: flex; }
body[data-state="results"]           #screen-results           { display: flex; }

/* back-link.js already hides #bloff-back for playing/calibrating;
   these three gig states are ours to cover */
body[data-state="soundcheck"] #bloff-back,
body[data-state="countdown"]  #bloff-back,
body[data-state="paused"]     #bloff-back { display: none; }

/* ================================================================
   TITLE SCREEN
   ================================================================ */
#screen-title {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(32px + var(--safe-top)) 20px calc(32px + var(--safe-bottom));
  gap: clamp(28px, 7vw, 48px);
  text-align: center;
}

.title-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 3vw, 18px);
  animation: flame-flicker 1.7s ease-in-out infinite;
}

.skull-mark {
  width: clamp(96px, 28vw, 150px);
  height: auto;
}

#title-logo {
  font-size: clamp(58px, 18vw, 130px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  max-width: 8ch;
}

@keyframes flame-flicker {
  0%, 100% {
    filter: drop-shadow(0 4px 10px rgba(255, 106, 0, 0.55))
            drop-shadow(0 0 26px rgba(255, 106, 0, 0.30));
  }
  30% {
    filter: drop-shadow(0 6px 14px rgba(255, 210, 63, 0.55))
            drop-shadow(0 0 20px rgba(255, 106, 0, 0.45));
  }
  55% {
    filter: drop-shadow(0 3px 8px rgba(255, 106, 0, 0.65))
            drop-shadow(0 0 32px rgba(255, 210, 63, 0.25));
  }
  80% {
    filter: drop-shadow(0 5px 12px rgba(255, 106, 0, 0.5))
            drop-shadow(0 0 24px rgba(255, 106, 0, 0.4));
  }
}

.title-tagline {
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

.title-fineprint {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.9;
  color: var(--chrome-light);
  opacity: 0.55;
  max-width: 340px;
}

/* ================================================================
   SETLIST SCREEN — skewed steel gig plates
   ================================================================ */
#screen-setlist {
  flex-direction: column;
  align-items: stretch;
  min-height: 100dvh;
  padding: calc(28px + var(--safe-top)) clamp(20px, 6vw, 40px) calc(28px + var(--safe-bottom));
  gap: clamp(18px, 5vw, 28px);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.setlist-header {
  border-bottom: 3px solid var(--chrome-dark);
  padding-bottom: clamp(12px, 3vw, 18px);
}

.setlist-header h2 {
  font-size: clamp(38px, 11vw, 60px);
  line-height: 1;
}

.setlist-sub {
  margin-top: 8px;
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

#setlist-list {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3.5vw, 18px);
  padding: 0 6px; /* room for the skew */
}

.setlist-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 84px;
  padding: 12px 18px 14px;
  text-align: left;
  background: var(--carbon-2);
  border: 2px solid var(--chrome-dark);
  border-left: 8px solid var(--flame-orange);
  border-radius: 0;
  transform: skewX(-5deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.7),
    4px 4px 0 #000;
  -webkit-tap-highlight-color: transparent;
}

.setlist-row > * { transform: skewX(5deg); }

.setlist-row:active,
.setlist-row:focus-visible {
  border-color: var(--electric-blue);
  border-left-color: var(--electric-blue);
  outline: none;
}

.setlist-gig-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

.setlist-song-title {
  font-family: var(--font-metal);
  font-size: clamp(26px, 7.5vw, 36px);
  line-height: 1.05;
  color: var(--chrome-light);
  text-shadow: var(--chrome-bevel);
}

.setlist-artist {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chrome-light);
  opacity: 0.65;
}

.setlist-best {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--electric-blue);
}

/* Cancelled gigs — grayed steel, red stamp */
.setlist-row[data-song-status="cancelled"] {
  filter: grayscale(1);
  opacity: 0.5;
  pointer-events: none;
  border-left-color: var(--chrome-dark);
}

.setlist-row[data-song-status="cancelled"] .setlist-song-title {
  text-decoration: line-through;
}

.setlist-cancelled-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red-hot);
}

.setlist-footnote {
  margin-top: auto;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.45;
}

/* ================================================================
   UNSUPPORTED SCREEN (desktop QR)
   ================================================================ */
#screen-unsupported {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 40px 24px;
  gap: 26px;
  text-align: center;
}

.unsupported-heading {
  font-size: clamp(34px, 8vw, 64px);
  line-height: 1.05;
  max-width: 700px;
}

.unsupported-sub {
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--flame-yellow);
  max-width: 560px;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px;
  background: #ffffff;
  border: 3px solid var(--chrome-light);
  box-shadow:
    inset 0 0 0 2px #000,
    6px 6px 0 #000;
}

#qr-image {
  width: 160px;
  height: 160px;
  background: #ffffff;
}

.qr-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--carbon);
}

/* ================================================================
   PERMISSION DENIED SCREEN
   ================================================================ */
#screen-permission-denied {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 40px 24px;
  gap: 24px;
  text-align: center;
}

#denied-message {
  font-family: var(--font-metal);
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--chrome-light);
  text-shadow: var(--chrome-bevel);
  max-width: 620px;
}

#denied-hint {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.65;
  max-width: 480px;
  line-height: 1.8;
}

/* ================================================================
   CALIBRATING SCREEN
   ================================================================ */
#screen-calibrating {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 40px 24px;
  gap: clamp(14px, 4vw, 26px);
  text-align: center;
}

.calib-heading {
  font-size: clamp(30px, 9vw, 48px);
  letter-spacing: 0.06em;
}

.calib-instruction {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--flame-yellow);
  line-height: 1.9;
}

#calib-countdown {
  font-size: clamp(110px, 34vw, 190px);
  line-height: 1;
  color: var(--flame-orange);
  text-shadow:
    0 -1px 0 var(--flame-yellow),
    0 3px 0 #7a3300,
    0 5px 0 #000,
    0 8px 18px rgba(255, 106, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

#calib-status {
  font-family: var(--font-mono);
  font-size: clamp(11px, 2.8vw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ================================================================
   GIG SCREEN — stage (video) / HUD / highway canvas + overlays
   ================================================================ */
#screen-gig {
  flex-direction: column;
  align-items: stretch;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  padding-top: var(--safe-top);
  background-color: var(--carbon);
}

/* The stage — fixed 16:9 box, video is a backing track, not a UI */
.stage-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 34dvh;
  background: #000;
  border-bottom: 2px solid var(--chrome-dark);
  overflow: hidden;
}

/* YT.Player replaces this div with an iframe carrying the same id */
#yt-stage-mount {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  pointer-events: none; /* controls disabled; the stage is not tappable */
}

/* HUD strip */
#hud {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 2px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hud-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#hud-gig-name {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--flame-yellow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hud-song-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--chrome-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-crowd {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-crowd-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

#hud-crowd-bar {
  width: clamp(80px, 24vw, 140px);
  height: 14px;
  background: #000;
  border: 2px solid var(--chrome-dark);
  transform: skewX(-12deg);
  overflow: hidden;
}

#hud-crowd-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, var(--flame-orange), var(--flame-yellow));
}

/* Combo — massive, readable while the phone is being shaken */
#hud-combo {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  font-family: var(--font-metal);
  font-size: clamp(64px, 21vw, 120px);
  line-height: 1;
  color: #ffffff;
  text-shadow:
    0 -1px 0 var(--electric-blue),
    0 3px 0 #003b46,
    0 5px 0 #000,
    0 0 24px rgba(0, 217, 255, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Note highway — script.js owns the pixel buffer, CSS owns the box */
#highway-canvas {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: block;
  touch-action: none;
}

/* The instrument itself — sits below the hit line, swings on every shake.
   script.js writes the transform each frame; CSS only owns placement. */
#shaker-rig {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(4px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

body[data-state='playing'] #shaker-rig,
body[data-state='countdown'] #shaker-rig {
  display: flex;
}

#shaker-body {
  width: clamp(38px, 11vw, 54px);
  height: auto;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.75));
  will-change: transform;
}

.shaker-egg {
  paint-order: stroke;
}

/* Live ROLL coverage — the mechanic was invisible before: you couldn't tell
   whether you were sustaining it until after the bar had already been judged. */
#roll-meter {
  width: clamp(84px, 26vw, 130px);
  height: 9px;
  border: 2px solid var(--chrome-dark);
  background: rgba(0, 0, 0, 0.75);
  opacity: 0;
  transition: opacity 120ms linear;
}

#roll-meter.is-active {
  opacity: 1;
  border-color: var(--flame-yellow);
}

#roll-meter.is-holding {
  border-color: var(--electric-blue);
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.7);
}

#roll-meter-fill {
  height: 100%;
  width: 0%;
  background: var(--flame-yellow);
  transition: width 80ms linear;
}

#roll-meter.is-holding #roll-meter-fill {
  background: var(--electric-blue);
}

@media (prefers-reduced-motion: reduce) {
  #shaker-body { transition: none; }
}

/* SOUND CHECK banner — shown pre-song and mid-song while buffering */
#soundcheck-banner {
  display: none;
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) skewX(-5deg);
  z-index: 20;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  background: #000;
  border: 3px solid var(--flame-yellow);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.8);
  font-size: clamp(16px, 4.8vw, 24px);
  font-weight: 800;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-transform: uppercase;
  color: var(--flame-yellow);
  white-space: nowrap;
  animation: soundcheck-blink 1.1s steps(2, end) infinite;
}

body[data-state="soundcheck"] #soundcheck-banner,
body.buffering               #soundcheck-banner { display: flex; }

@keyframes soundcheck-blink {
  0%   { opacity: 1; }
  50%  { opacity: 0.45; }
  100% { opacity: 1; }
}

/* COUNTDOWN overlay — 3-2-1 (also the post-pause count-in) */
#countdown-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  background: rgba(10, 10, 10, 0.6);
}

body[data-state="countdown"] #countdown-overlay { display: flex; }

.countdown-label {
  font-size: clamp(12px, 3.4vw, 16px);
  font-weight: 800;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

/* Note-type legend — taught during the count-in, because the roll and tacet
   mechanics are not guessable from the highway alone. */
.note-legend {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: clamp(10px, 2.9vw, 13px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--chrome-light);
}

.note-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
}

.legend-key {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.legend-shake {
  background: var(--flame-orange);
  border: 2px solid var(--flame-yellow);
  transform: rotate(45deg) scale(0.78);
}

.legend-roll {
  width: 11px;
  height: 24px;
  background: var(--flame-yellow);
  border: 2px solid var(--flame-orange);
}

.legend-tacet {
  background: rgba(227, 50, 36, 0.35);
  border: 2px solid var(--red-hot);
}

#countdown-number {
  font-size: clamp(140px, 48vw, 240px);
  line-height: 1;
  color: var(--flame-orange);
  text-shadow:
    0 -2px 0 var(--flame-yellow),
    0 4px 0 #7a3300,
    0 7px 0 #000,
    0 10px 26px rgba(255, 106, 0, 0.6);
  font-variant-numeric: tabular-nums;
}

/* PAUSE overlay */
#pause-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3.5vw, 20px);
  padding: 32px 24px;
  text-align: center;
  background: rgba(10, 10, 10, 0.94);
}

body[data-state="paused"] #pause-overlay { display: flex; }

.pause-heading {
  font-size: clamp(48px, 15vw, 84px);
  line-height: 1;
}

.pause-sub {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

#pause-combo-so-far {
  font-family: var(--font-mono);
  font-size: clamp(13px, 3.6vw, 16px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--electric-blue);
}
#pause-combo-so-far:empty { display: none; }

#pause-overlay #btn-resume-gig {
  margin-top: clamp(8px, 2vw, 14px);
  min-width: min(280px, 80vw);
}

/* JUDGMENT FLASH — full-screen color pulse, readable mid-shake */
#judgment-flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
}

#judgment-flash.flash-perfect {
  background: var(--electric-blue);
  animation: judgment-pulse 200ms ease-out;
}

#judgment-flash.flash-late {
  background: var(--flame-yellow);
  animation: judgment-pulse 200ms ease-out;
}

#judgment-flash.flash-ghosted {
  background: var(--red-hot);
  animation: judgment-pulse 300ms ease-out;
}

@keyframes judgment-pulse {
  0%   { opacity: 0.5; }
  100% { opacity: 0; }
}

/* ================================================================
   RESULTS SCREEN — the session pay stub
   ================================================================ */
#screen-results {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  padding: calc(28px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
  gap: clamp(18px, 5vw, 26px);
}

.paystub {
  width: 100%;
  max-width: 440px;
  padding: clamp(18px, 5vw, 28px);
  background: var(--carbon-2);
  border: 3px solid var(--chrome-light);
  box-shadow:
    inset 0 0 0 2px #000,
    inset 0 0 0 4px var(--chrome-dark),
    8px 8px 0 #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 3vw, 16px);
  text-align: center;
}

.paystub-header {
  width: 100%;
  border-bottom: 2px solid var(--chrome-dark);
  padding-bottom: clamp(10px, 3vw, 14px);
}

.paystub-title {
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1;
}

.paystub-subtitle {
  margin-top: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

.paystub-gig {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#results-gig-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--flame-yellow);
}

#results-song-title {
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--chrome-light);
}

#results-grade {
  font-size: clamp(88px, 30vw, 150px);
  line-height: 0.95;
  color: var(--flame-orange);
  text-shadow:
    0 -2px 0 var(--flame-yellow),
    0 4px 0 #7a3300,
    0 6px 0 #000,
    0 9px 22px rgba(255, 106, 0, 0.55);
}

#results-pay-lines {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.paystub-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(216, 216, 216, 0.25);
  font-family: var(--font-mono);
  font-size: clamp(11px, 3.2vw, 13px);
}

.paystub-line-label {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.paystub-line-amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.paystub-total-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(8px, 2.5vw, 12px);
  border-top: 3px double var(--chrome-light);
}

.paystub-total-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

#results-pay-total {
  font-family: var(--font-metal);
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1;
  color: var(--flame-yellow);
  text-shadow:
    0 -1px 0 #fff,
    0 2px 0 #7a5a00,
    0 4px 0 #000,
    0 6px 14px rgba(255, 210, 63, 0.45);
  font-variant-numeric: tabular-nums;
}

#results-best-note {
  display: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--electric-blue);
}

#results-best-note.visible {
  display: block;
  animation: soundcheck-blink 1.1s steps(2, end) infinite;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  align-items: stretch;
}

.results-actions button { width: 100%; }

/* ================================================================
   BUTTONS — skewed steel plates, hard edges, huge tap targets
   ================================================================ */
button {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chrome-light);
  background: var(--carbon-2);
  border: 2px solid var(--chrome-light);
  border-radius: 0;
  padding: 16px 28px;
  min-height: 58px;
  min-width: 44px;
  transform: skewX(-5deg);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -3px 0 rgba(0, 0, 0, 0.65),
    4px 4px 0 #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: skewX(-5deg) translate(2px, 2px);
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.4),
    2px 2px 0 #000;
}

button:focus-visible {
  outline: 3px solid var(--electric-blue);
  outline-offset: 3px;
}

.btn-flame {
  background: var(--flame-orange);
  color: #0a0a0a;
  border-color: #000;
  box-shadow:
    inset 0 2px 0 var(--flame-yellow),
    inset 0 -3px 0 rgba(0, 0, 0, 0.55),
    4px 4px 0 #000;
}

.btn-flame:active {
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.35),
    2px 2px 0 #000;
}

/* ================================================================
   LANDSCAPE WARNING — CSS only, phones only
   ================================================================ */
#landscape-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--carbon);
  color: var(--flame-yellow);
  font-family: var(--font-metal);
  font-size: clamp(24px, 6vh, 40px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  line-height: 1.4;
  text-shadow: 0 3px 0 #000, 0 6px 14px rgba(255, 106, 0, 0.4);
}

@media (orientation: landscape) and (max-width: 900px) {
  #landscape-warning { display: flex; }
  body > *:not(#landscape-warning):not(script) { visibility: hidden; }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* keep flicker-dependent elements fully visible */
  #soundcheck-banner, #results-best-note.visible { opacity: 1; }
}

/* ================================================================
   SMALL VIEWPORT TWEAKS (≤360px)
   ================================================================ */
@media (max-width: 360px) {
  #screen-setlist { padding-left: 14px; padding-right: 14px; }
  .setlist-row { padding: 10px 14px 12px; min-height: 76px; }
  button { padding: 14px 20px; letter-spacing: 0.12em; }
  #hud { padding: 6px 10px; }
}
