:root {
  --paper: #e6c897;
  --paper-dk: #d9b681;
  --navy: #0b1f4d;
  --navy-dk: #06122e;
  --teal: #0b6073;
  --pink: #d8084f;
  --orange: #f39c1f;
  --red: #e8412c;
  --blue: #1b5fa8;
  --ink: #1d1a2e;
  --pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(160,120,60,.18), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: 'Oswald', system-ui, sans-serif;
  min-height: 100vh;
}

/* ---------- Header: the album itself, as a record sleeve ---------- */
header.site { padding: 32px 16px 8px; text-align: center; overflow-x: clip; }
nav.back { max-width: 1000px; margin: 0 auto; padding: 22px 16px 0; }
nav.back a {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--teal);
}
nav.back a:hover { color: var(--pink); }
h1.caption { font-weight: 500; }
.kicker-line {
  margin: 0 0 22px;
  font-weight: 500;
  font-size: clamp(13px, 2vw, 16px);
  letter-spacing: .45em;
  padding-left: .45em;
  text-transform: uppercase;
  color: var(--teal);
}
.kicker-line span { color: var(--pink); }

.record {
  --size: min(400px, 58vw);
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: 0 auto;
  transform: translateX(calc(var(--size) * -0.245)); /* keep sleeve + record centered */
}
.sleeve {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 18px 34px -10px rgba(60, 30, 0, .45);
}
.vinyl {
  position: absolute;
  top: 3%;
  left: 3%;
  width: 94%;
  height: 94%;
  animation: slide-out 1.3s cubic-bezier(.2, .8, .2, 1) .5s both;
}
@keyframes slide-out { from { transform: translateX(0); } to { transform: translateX(55%); } }
.disc, .shine { position: absolute; inset: 0; border-radius: 50%; }
.disc {
  background:
    /* spindle hole */
    radial-gradient(circle, var(--paper) 0 1.6%, transparent 1.8%),
    /* label: the cover's striped sun */
    radial-gradient(circle, transparent 0 17%, #111 17.4%) ,
    linear-gradient(to bottom, #ffd23f 0 34%, #ffb627 34% 50%, #e8412c 50% 54%, #ff8c1f 54% 62%, #e8412c 62% 68%, #ff8c1f 68% 74%, #e8412c 74% 100%);
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.5);
  animation: spin 1.8s linear infinite; /* 33⅓ rpm */
  animation-play-state: paused;
}
/* Grooves */
.disc::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 18%, rgba(255,255,255,.035) 18% 18.4%, transparent 18.4% 19.2%);
  -webkit-mask: radial-gradient(circle, transparent 0 17.5%, #000 17.6% 97%, transparent 97.2%);
  mask: radial-gradient(circle, transparent 0 17.5%, #000 17.6% 97%, transparent 97.2%);
}
/* Label text ring */
.disc::after {
  content: 'WALKING WONDER';
  position: absolute;
  top: 36%;
  left: 0;
  right: 0;
  text-align: center;
  font: 600 calc(var(--size) * .022) 'Oswald', sans-serif;
  letter-spacing: .3em;
  color: #0b1f4d;
}
.shine {
  pointer-events: none;
  background: conic-gradient(from 30deg, transparent 0 8%, rgba(255,255,255,.12) 12%, transparent 18% 50%, rgba(255,255,255,.08) 62%, transparent 68%);
  -webkit-mask: radial-gradient(circle, transparent 0 17.5%, #000 17.6%);
  mask: radial-gradient(circle, transparent 0 17.5%, #000 17.6%);
}
body.music-playing .disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

.caption {
  margin: 22px 0 0;
  font-size: clamp(15px, 2.2vw, 19px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .75;
}
header.site .links { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .vinyl { animation: none; transform: translateX(55%); }
  .disc { animation: none; }
}

main { max-width: 1000px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- Arcade cabinet ---------- */
.cabinet {
  margin-top: 16px;
  background: var(--navy);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 0 var(--navy-dk), 0 24px 40px rgba(40, 20, 0, .25);
}
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #0b0a2a;
  user-select: none;
  -webkit-user-select: none;
}
#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
/* CRT scanlines + vignette */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.5));
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.8% 2.4%;
  font-family: var(--pixel);
  font-size: clamp(7px, 1.35vw, 13px);
  line-height: 1.7;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
}
.hud[hidden] { display: none; }
.hud .right { text-align: right; }
.hud .mid { display: flex; align-items: center; gap: .8em; color: var(--orange); }
.dim { opacity: .7; }
.hearts { color: var(--pink); letter-spacing: .15em; }
.beat {
  width: 1em; height: 1em;
  border: 2px solid #fff;
  box-shadow: 2px 2px 0 #000;
  transition: background .05s;
}
.beat.on { background: var(--pink); }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9em;
  padding: 4%;
  text-align: center;
  color: #fff;
  font-family: var(--pixel);
  font-size: clamp(7px, 1.3vw, 12px);
  background: rgba(11, 10, 42, .55);
}
.overlay[hidden] { display: none; }
.overlay p { margin: 0; }

.title-wrap { display: flex; align-items: center; gap: 5%; width: 100%; max-width: 820px; }
.cover {
  width: 34%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 6px 6px 0 var(--pink);
  image-rendering: auto;
}
.title-copy { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1em; }
.kicker { color: var(--orange); letter-spacing: .2em; text-shadow: 2px 2px 0 #000; }
.game-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .25em;
  font-size: clamp(16px, 4.4vw, 42px);
  line-height: 1.1;
  color: #ffd23f;
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--navy-dk);
}
.game-title.small { font-size: clamp(12px, 3vw, 30px); }
.blurb { line-height: 1.8; max-width: 30em; text-shadow: 2px 2px 0 #000; }
.controls { opacity: .8; line-height: 1.8; }
.final { font-size: 1.3em; text-shadow: 2px 2px 0 #000; }

.btn {
  font-family: var(--pixel);
  font-size: clamp(9px, 1.6vw, 15px);
  color: #fff;
  background: var(--pink);
  border: 0;
  padding: 1em 1.5em;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a0c36, 4px 8px 0 rgba(0,0,0,.4);
}
.btn:hover { background: #ff2a6d; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a0c36; }
.btn:focus-visible, .chip:focus-visible, .touch button:focus-visible { outline: 3px solid #ffd23f; outline-offset: 3px; }
.btn.start { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- Controls under the screen ---------- */
.touch { display: none; gap: 10px; margin-top: 12px; }
.touch button {
  flex: 1;
  height: 64px;
  font-family: var(--pixel);
  font-size: 18px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 5px 0 #0d2f6e;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.touch button.dance { flex: 1.6; font-size: 13px; background: var(--pink); box-shadow: 0 5px 0 #8a0c36; }
.touch button.pressed { transform: translateY(4px); box-shadow: none; }
@media (pointer: coarse), (max-width: 700px) { .touch { display: flex; } }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.chip {
  font-family: var(--pixel);
  font-size: 9px;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255,255,255,.5);
  padding: 8px 10px;
  cursor: pointer;
}
.chip:hover { border-color: #fff; }
.chip.off { opacity: .5; }
.tip { margin-left: auto; color: rgba(255,255,255,.65); font-size: 14px; letter-spacing: .03em; }

/* ---------- Listen section ---------- */
.listen { margin-top: 40px; text-align: center; }
.section-title {
  margin: 0 0 16px;
  font-weight: 500;
  font-size: clamp(18px, 3vw, 26px);
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--teal);
}
.section-title em { font-style: normal; color: var(--pink); }
.embed { max-width: 640px; margin: 0 auto; }
.embed iframe { border-radius: 12px; }
.embed .placeholder {
  padding: 20px;
  border: 2px dashed var(--teal);
  border-radius: 12px;
  color: var(--teal);
  font-size: 15px;
  line-height: 1.6;
}
.embed code { background: rgba(31,111,134,.12); padding: 1px 5px; border-radius: 4px; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.stream {
  display: inline-block;
  padding: 12px 22px;
  font-size: 16px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.stream[hidden] { display: none; }
.stream.spotify { background: #1db954; }
.stream.apple { background: var(--pink); }
.stream:hover { filter: brightness(1.08); }

footer.site { text-align: center; padding: 24px 16px 40px; color: var(--teal); letter-spacing: .3em; font-size: 13px; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .cover, .blurb, .controls, .kicker { display: none; }
  .overlay { gap: .6em; }
  .title-copy { gap: .8em; }
  .tip { display: none; }
  .cabinet { padding: 8px; }
}

/* ---------- Beat calibration tool (only with ?calibrate) ---------- */
.calib {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  width: min(320px, calc(100vw - 32px));
  padding: 14px;
  background: var(--navy);
  color: #fff;
  border: 3px solid var(--pink);
  border-radius: 10px;
  font: 14px/1.5 system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.calib p { margin: 6px 0 10px; opacity: .85; }
.calib kbd { background: #fff; color: var(--navy); border-radius: 3px; padding: 0 4px; }
.calib-tap {
  width: 100%;
  height: 64px;
  font: 18px var(--pixel);
  color: #fff;
  background: var(--pink);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  touch-action: none;
}
.calib-tap:active { transform: translateY(2px); }
.calib-out { margin: 10px 0; }
.calib-out pre { margin: 6px 0 0; padding: 8px; background: rgba(255,255,255,.1); border-radius: 6px; user-select: all; }
.calib-reset { font: inherit; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; padding: 4px 10px; cursor: pointer; }

/* Home link with the WW mark */
.home-link { display: inline-flex; align-items: center; gap: 10px; }
.ww-icon { width: 30px; height: auto; flex: none; overflow: visible; }

/* ---------- EP details + tracklist ---------- */
.album-meta {
  margin: 8px 0 0;
  font-size: 14px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .6;
}
/* "Play game" button on the End Times Disco row */
.game-toggle {
  grid-column: 3;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1;
  padding: 10px 12px;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--navy-dk);
  white-space: nowrap;
}
.game-toggle:hover { background: #142c66; }
.game-toggle:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy-dk); }
.game-toggle[aria-expanded="true"] { background: var(--pink); box-shadow: 0 3px 0 #8a0c36; }
.game-toggle:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

/* The game folds out under its row */
.game-row { list-style: none; }
.game-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s ease;
}
.game-panel.open { grid-template-rows: 1fr; }
.game-panel.instant { transition: none; }
.game-panel-inner { min-height: 0; overflow: hidden; }
.game-panel .cabinet { margin: 12px 0 20px; }

@media (max-width: 560px) {
  .game-toggle { font-size: 0; padding: 9px 10px; }
  .game-toggle span[aria-hidden] { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-panel { transition: none; }
}
