:root {
  --bg: #0b0618;
  --bg-deep: #05020d;
  --neon-pink: #ff2a6d;
  --neon-cyan: #05d9e8;
  --neon-yellow: #f9f002;
  --neon-purple: #a23bff;
  --neon-orange: #ff8a00;
  --text: #e8e6ff;
  --text-dim: #a59fd0;
  --font-pixel: 'Press Start 2P', monospace;
  --font-term: 'VT323', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-term);
  font-size: 1.4rem;
  line-height: 1.35;
  overflow-x: hidden;
}

body.outside { overflow: hidden; }

h1, h2 {
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.5;
}

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--neon-yellow);
  outline-offset: 4px;
}

/* CRT scanlines and vignette over the whole page */
.crt {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

/* ---------- Outside: the street ---------- */

.street { display: none; }

.js .street {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 18px;
  padding: 16px;
  overflow: hidden auto;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 24%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 7%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 31%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 38%, #fff 50%, transparent 51%),
    linear-gradient(var(--bg-deep) 0%, #120a2a 70%, #1d1136 100%);
  transition: opacity .4s linear 1.5s;
}

.js .street[hidden] { display: none; }

.building {
  width: min(820px, 100%);
  padding: clamp(24px, 4vh, 44px) 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background-color: #1c1230;
  background-image:
    linear-gradient(rgba(0, 0, 0, .4) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0, 0, 0, .4) 2px, transparent 2px);
  background-size: 32px 16px;
  border: 3px solid #2c1d4a;
  border-bottom: 4px solid var(--neon-pink);
  box-shadow: 0 12px 30px -10px var(--neon-pink);
  transform-origin: 50% 82%;
  transition: transform 1s cubic-bezier(.6, 0, .9, .4) .9s;
}

.sign {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  text-align: center;
  font-family: var(--font-pixel);
  background: var(--bg-deep);
  border: 3px solid var(--neon-pink);
  border-radius: 8px;
  box-shadow: 0 0 18px var(--neon-pink), inset 0 0 12px rgba(255, 42, 109, .5);
  animation: flicker 5s infinite;
}

.sign-top {
  font-size: clamp(1.1rem, 6.6vw, 3.6rem);
  color: var(--neon-pink);
  text-shadow: 0 0 6px var(--neon-pink), 0 0 22px var(--neon-pink);
}

.sign-bottom {
  font-size: clamp(.9rem, 4.8vw, 2.4rem);
  letter-spacing: .3em;
  margin-right: -.3em;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan), 0 0 22px var(--neon-cyan);
}

.open-sign {
  font-family: var(--font-pixel);
  font-size: clamp(.6rem, 1.6vw, .9rem);
  padding: 8px 12px;
  color: var(--neon-yellow);
  border: 2px solid var(--neon-yellow);
  text-shadow: 0 0 8px var(--neon-yellow);
  animation: blink 1.4s steps(2, jump-none) infinite;
}

.doorway {
  position: relative;
  width: clamp(150px, 24vw, 240px);
  height: clamp(110px, 24vh, 250px);
  overflow: hidden;
  border: 4px solid var(--neon-cyan);
  border-bottom: 0;
  background: radial-gradient(ellipse at 50% 70%, #fff6c9 0%, var(--neon-yellow) 18%, var(--neon-pink) 50%, #3a0f5c 100%);
  box-shadow: 0 0 22px var(--neon-cyan);
}

.door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(135deg, #1a1236 0%, #0d0820 45%, #22184a 50%, #0d0820 55%);
  border: 2px solid #3a2a66;
  transition: transform .7s ease-in .35s;
}

.door::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 22px;
  background: var(--neon-cyan);
}

.door-left { left: 0; }
.door-left::after { right: 6px; }
.door-right { right: 0; }
.door-right::after { left: 6px; }

.coin-btn {
  font-family: var(--font-pixel);
  font-size: clamp(.7rem, 3.4vw, 1rem);
  line-height: 1.7;
  padding: 14px 20px;
  color: var(--neon-yellow);
  background: var(--bg-deep);
  border: 3px solid var(--neon-yellow);
  border-radius: 6px;
  text-shadow: 0 0 8px var(--neon-yellow);
  box-shadow: 0 0 16px rgba(249, 240, 2, .5);
  animation: pulse 1.2s ease-in-out infinite;
}

.coin-btn:hover { background: var(--neon-yellow); color: var(--bg); text-shadow: none; }

.skip {
  font-family: var(--font-pixel);
  font-size: .55rem;
  padding: 8px;
  color: var(--text-dim);
  background: none;
  border: 0;
  text-decoration: underline;
}

/* Straight in without a name: a guest's games wait in this browser until they pick one */
.street-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 14px; }
.guest-btn {
  font-family: var(--font-pixel);
  font-size: clamp(.55rem, 2.6vw, .75rem);
  line-height: 1.7;
  padding: 10px 16px;
  color: var(--neon-cyan);
  background: none;
  border: 2px solid var(--neon-cyan);
  border-radius: 6px;
  text-shadow: 0 0 6px var(--neon-cyan);
}
.guest-btn:hover { background: var(--neon-cyan); color: var(--bg); text-shadow: none; }
.guest-btn[hidden] { display: none; }

.hint {
  margin: 0;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-dim);
}

.street .coin-btn { font-size: clamp(.75rem, 3.4vw, 1.25rem); padding: 16px 28px; }
.street .nick { margin: 0; }

/* Leaving the arcade: back on the street at once, not the walk-in in reverse */
.street.back,
.street.back * { transition: none !important; }

/* Walking through the door */
.street.entering { opacity: 0; }
.street.entering .building { transform: scale(8); }
.street.entering .door-left { transform: translateX(-100%); }
.street.entering .door-right { transform: translateX(100%); }
.street.entering .coin-btn,
.street.entering .skip,
.street.entering .hint { visibility: hidden; }

/* ---------- HUD ---------- */

.hud {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-pixel);
  font-size: clamp(.5rem, 2.2vw, .75rem);
  background: rgba(5, 2, 13, .94);
  border-bottom: 2px solid var(--neon-purple);
  box-shadow: 0 0 18px rgba(162, 59, 255, .6);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hud-label { color: var(--neon-pink); }

.mute {
  font-family: var(--font-pixel);
  font-size: inherit;
  line-height: 1.6;
  min-height: 36px;
  padding: 6px 8px;
  color: var(--neon-cyan);
  background: none;
  border: 2px solid var(--neon-cyan);
  border-radius: 4px;
}

.mute:hover { background: var(--neon-cyan); color: var(--bg); }

.hud-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.leave { color: var(--neon-pink); border-color: var(--neon-pink); }
.leave:hover { background: var(--neon-pink); color: var(--bg); }
.signup { color: var(--neon-yellow); border-color: var(--neon-yellow); }
.signup:hover { background: var(--neon-yellow); color: var(--bg); }

/* ---------- Your name (on the street) ---------- */

.nick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 0 32px;
}

.nick label {
  font-family: var(--font-pixel);
  font-size: .7rem;
  color: var(--neon-cyan);
}

.nick input {
  width: min(100%, 260px);
  padding: 14px 8px;
  font-family: var(--font-pixel);
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;
  color: var(--neon-yellow);
  background: var(--bg-deep);
  border: 3px solid var(--neon-cyan);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(5, 217, 232, .5);
}

.nick input::placeholder { color: #6a6490; }

.nick-note { margin: 0; max-width: 560px; text-align: center; font-size: 1.15rem; color: var(--text-dim); }
.nick-note.alert { color: var(--neon-yellow); }

.who { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; width: 100%; }
.who[hidden], .who-known[hidden] { display: none; }
.who-field { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.who-field:last-child input { width: 140px; letter-spacing: .4em; }

.who-known { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.who-known p { margin: 0; font-family: var(--font-pixel); font-size: clamp(.7rem, 3vw, 1rem); color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); }
.who-known span { color: var(--neon-yellow); }

/* ---------- The arcade floor ---------- */

.floor {
  scroll-margin-top: 64px;
  padding: 48px 16px 80px;
  border-block: 2px solid var(--neon-pink);
  /* 80s "cosmic" carpet */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 42, 109, .28) 0%, transparent 60%),
    radial-gradient(circle at 20% 30%, rgba(255, 42, 109, .5) 0 3px, transparent 4px) 0 0 / 120px 120px,
    radial-gradient(circle at 70% 65%, rgba(5, 217, 232, .5) 0 3px, transparent 4px) 0 0 / 160px 160px,
    linear-gradient(45deg, transparent 47%, rgba(249, 240, 2, .2) 47% 53%, transparent 53%) 30px 40px / 90px 90px,
    linear-gradient(-45deg, transparent 47%, rgba(162, 59, 255, .3) 47% 53%, transparent 53%) 0 0 / 130px 130px,
    #120a26;
}

.floor h2 {
  margin: 0 0 40px;
  text-align: center;
  font-size: clamp(.9rem, 3.6vw, 1.5rem);
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan), 0 0 24px var(--neon-cyan);
}

.cabinets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 44px 28px;
  max-width: 1000px;
  margin: 0 auto;
}

.load-error {
  flex-basis: 100%;
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--neon-yellow);
  background: rgba(5, 2, 13, .85);
}

.cabinet {
  --c: var(--neon-cyan);
  --side: color-mix(in srgb, var(--c) 55%, #000);
  flex: 0 1 220px;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: center;
  background: none;
  border: 0;
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, .7));
  transition: transform .2s ease-out;
}

.cabinet:hover,
.cabinet:focus-visible { transform: translateY(-8px); }

.cabinet:focus-visible { outline-offset: 8px; }

.marquee {
  padding: 14px 6px;
  font-family: var(--font-pixel);
  font-size: .7rem;
  line-height: 1.4;
  color: var(--on-fill, var(--bg));
  background: var(--fill, var(--c));
  border-radius: 10px 10px 0 0;
  box-shadow: inset 0 0 0 2px var(--c), 0 0 18px var(--c), inset 0 -4px 0 rgba(0, 0, 0, .25);
}

.bezel,
.panel,
.base {
  border-inline: 8px solid var(--side);
}

.bezel { padding: 12px 14px; background: #14101f; }

.screen {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  image-rendering: pixelated;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 0 0 3px #000;
  transition: box-shadow .2s;
}

.cabinet:hover .screen,
.cabinet:focus-visible .screen { box-shadow: 0 0 0 3px #000, 0 0 26px var(--c); }

.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 40px;
  background: linear-gradient(#2a2140, #191229);
}

.stick {
  position: relative;
  width: 6px;
  height: 14px;
  margin: 8px 14px 0 0;
  background: #888;
}

.stick::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .3);
}

.btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .6);
}

.base {
  display: flex;
  justify-content: center;
  gap: 10px;
  height: 72px;
  padding-top: 16px;
  background: linear-gradient(#191229, #0d0918);
  border-bottom: 6px solid #000;
}

.coin-slot {
  width: 14px;
  height: 22px;
  background: #ff3b3b;
  border: 2px solid #333;
  box-shadow: 0 0 8px #ff3b3b;
  animation: pulse 1.6s ease-in-out infinite;
}

.plate {
  margin-top: 14px;
  padding: 8px 6px;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--c);
  background: rgba(5, 2, 13, .85);
  border-radius: 4px;
}

.online-tag {
  align-self: center;
  margin-top: 8px;
  padding: 6px 8px;
  font-family: var(--font-pixel);
  font-size: .5rem;
  line-height: 1.4;
  color: var(--text-dim);
  background: rgba(5, 2, 13, .85);
  border: 1px solid #3a2a66;
  border-radius: 4px;
}

.online-tag.waiting { color: var(--bg); background: var(--neon-yellow); border-color: var(--neon-yellow); }

/* ---------- Hall of fame (in each machine's legend) ---------- */

.fame {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  text-align: center;
  border-top: 2px dashed var(--c);
}

.fame h3 { margin: 0; font-family: var(--font-pixel); font-size: .8rem; font-weight: 400; color: var(--c); text-shadow: 0 0 10px var(--c); }

.fame table[hidden], .fame [hidden] { display: none; }

.fame-sub { margin: -6px 0 0; font-family: var(--font-pixel); font-size: .45rem; color: var(--text-dim); }
.fame tbody tr.me td:nth-child(3)::after { content: ' <'; }

.fame-empty { margin: 0; font-family: var(--font-pixel); font-size: .55rem; line-height: 1.8; color: var(--text-dim); }

.fame table {
  margin: 0 auto;
  border-collapse: collapse;
  font-family: var(--font-pixel);
  font-size: clamp(.5rem, 2.3vw, .65rem);
  text-align: left;
}

.fame th,
.fame td { padding: .6em .7em; }

.fame th { color: var(--text); font-weight: 400; }

.fame tbody tr:nth-child(4n + 1) { color: var(--neon-yellow); }
.fame tbody tr:nth-child(4n + 2) { color: var(--neon-cyan); }
.fame tbody tr:nth-child(4n + 3) { color: var(--neon-pink); }
.fame tbody tr:nth-child(4n + 4) { color: var(--neon-orange); }
.fame tbody tr:first-child { animation: blink 1s steps(2, jump-none) infinite; }

/* ---------- Legend dialog ---------- */

.legend {
  --c: var(--neon-cyan);
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--text);
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px),
    #07030f;
  border: 3px solid var(--c);
  border-radius: 12px;
  box-shadow: 0 0 40px var(--c);
}

.legend::backdrop { background: rgba(5, 2, 13, .86); }

.legend-inner {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px 20px;
}

.legend-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-family: var(--font-pixel);
  font-size: .7rem;
  color: var(--c);
  background: none;
  border: 2px solid var(--c);
  border-radius: 4px;
}

.legend-close:hover { background: var(--fill, var(--c)); color: var(--on-fill, var(--bg)); }

.legend h2 {
  margin: 0 48px 0 0;
  font-size: clamp(1rem, 4.5vw, 1.6rem);
  color: var(--c);
  text-shadow: 0 0 10px var(--c);
}

.legend-tagline { margin: 0; color: var(--neon-yellow); }

.legend-body {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  align-items: center;
}

.legend .screen { border: 2px solid var(--c); }

.stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  margin: 0;
  font-family: var(--font-pixel);
  font-size: .6rem;
  line-height: 1.5;
}

.stats dt { color: var(--text-dim); }
.stats dd { margin: 0; color: var(--c); }

.pips { display: inline-flex; gap: 4px; }

.pip {
  width: 10px;
  height: 10px;
  border: 2px solid var(--c);
}

.pip.on { background: var(--c); box-shadow: 0 0 6px var(--c); }

.lore { margin: 0; font-size: 1.5rem; cursor: pointer; }
.lore-rest { color: transparent; }

.play {
  justify-self: center;
  padding: 16px 22px;
  font-family: var(--font-pixel);
  font-size: clamp(.8rem, 3.6vw, 1.1rem);
  color: var(--on-fill, var(--bg));
  background: var(--fill, var(--c));
  border-radius: 6px;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--c), 0 0 20px var(--c);
  animation: pulse 1.2s ease-in-out infinite;
}

.play:hover { color: var(--bg); background: #fff; }

.legend-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.play-online {
  padding: 13px 18px;
  font-family: var(--font-pixel);
  font-size: clamp(.7rem, 3.2vw, .9rem);
  color: var(--c);
  background: none;
  border: 3px solid var(--c);
  border-radius: 6px;
  box-shadow: 0 0 12px var(--c);
}

.play-online:hover { color: var(--on-fill, var(--bg)); background: var(--fill, var(--c)); }
.play-online[hidden] { display: none; }

/* The legend has two screens: the machine itself, and PLAY ONLINE */

.legend-view { display: grid; gap: 16px; }
.legend-view[hidden] { display: none; }

.legend-back {
  justify-self: start;
  margin-right: 48px;
  padding: 10px 12px;
  font-family: var(--font-pixel);
  font-size: .6rem;
  color: var(--c);
  background: none;
  border: 2px solid var(--c);
  border-radius: 4px;
}

.legend-back:hover { background: var(--fill, var(--c)); color: var(--on-fill, var(--bg)); }

.online {
  display: grid;
  gap: 12px;
  font-family: var(--font-pixel);
  font-size: .6rem;
  line-height: 1.6;
}

.online[hidden] { display: none; }

.online h3 { margin: 4px 0 0; font-size: clamp(.9rem, 4vw, 1.3rem); font-weight: 400; color: var(--c); text-shadow: 0 0 10px var(--c); }
.online h4 { margin: 8px 0 0; font-size: .6rem; font-weight: 400; color: var(--text-dim); }

.online-notice {
  margin: 0;
  padding: 12px;
  color: var(--bg);
  background: var(--neon-yellow);
  border-radius: 6px;
}

.online-notice:empty { display: none; }

.online-rooms { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.online-empty { padding: 14px 12px; color: var(--text-dim); border: 2px dashed #3a2a66; border-radius: 6px; }

.room {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 2px solid var(--c);
  border-radius: 6px;
}

button.room:hover { background: color-mix(in srgb, var(--c) 18%, var(--bg-deep)); }

.room.closed { border-style: dashed; opacity: .7; }

.room-count { grid-column: 1; color: var(--text-dim); }

.room-action {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 10px 12px;
  color: var(--on-fill, var(--bg));
  background: var(--fill, var(--c));
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--c);
}

.room.closed .room-action { color: var(--text-dim); background: none; border: 2px solid #3a2a66; }

.code-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

.code-form label { color: var(--text-dim); }

.code-form input {
  width: 7.5em;
  padding: 10px 4px 10px 12px;
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: .35em;
  text-align: center;
  color: var(--neon-yellow);
  background: var(--bg-deep);
  border: 2px solid var(--c);
  border-radius: 6px;
}

.code-form input::placeholder { color: #4f4878; }

.code-form button,
.host-btn {
  padding: 12px 14px;
  font-family: var(--font-pixel);
  font-size: .6rem;
  line-height: 1.4;
  color: var(--c);
  background: none;
  border: 2px solid var(--c);
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
}

.code-form button:hover,
.host-btn:hover { color: var(--on-fill, var(--bg)); background: var(--fill, var(--c)); }

.online-host { display: flex; flex-wrap: wrap; gap: 10px; }
.host-btn { flex: 1 1 140px; }

.online-hint { margin: 0; font-family: var(--font-term); font-size: 1.15rem; line-height: 1.3; color: var(--text-dim); }

/* ---------- Costume shop ---------- */

canvas.bomber { image-rendering: pixelated; image-rendering: crisp-edges; }

.shop-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -16px auto 40px;
  padding: 8px 18px 8px 10px;
  font-family: var(--font-pixel);
  font-size: clamp(.6rem, 2.8vw, .8rem);
  color: var(--neon-pink);
  background: var(--bg-deep);
  border: 3px solid var(--neon-pink);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(255, 42, 109, .5);
}

.shop-btn:hover { color: var(--bg); background: var(--neon-pink); }
.shop-btn canvas { width: 30px; height: 39px; }

.shop { --c: var(--neon-pink); width: min(860px, calc(100% - 32px)); }

.shop-wallet {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: .7rem;
  color: var(--text-dim);
}

.shop-wallet span { margin-left: 8px; font-size: 1rem; color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow); }

.shop-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }

.shop-game {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  font-family: var(--font-pixel);
  font-size: .5rem;
  line-height: 1.4;
  color: var(--c);
  background: none;
  border: 2px solid var(--c);
  border-radius: 6px;
  opacity: .65;
}

.shop-game:hover { opacity: 1; }
.shop-game[aria-pressed="true"] { color: var(--on-fill, var(--bg)); background: var(--fill, var(--c)); opacity: 1; box-shadow: 0 0 14px var(--c); }
.shop-game-count { font-size: .45rem; opacity: .8; }

.shop-empty {
  margin: 0;
  padding: 32px 16px;
  font-family: var(--font-pixel);
  font-size: .6rem;
  line-height: 1.8;
  text-align: center;
  color: var(--text-dim);
  border: 2px dashed #3a2a66;
  border-radius: 8px;
}

.shop-items[hidden], .shop-empty[hidden] { display: none; }

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  text-align: center;
  background: rgba(255, 255, 255, .03);
  border: 2px solid #3a2a66;
  border-radius: 8px;
}

.shop-item.owned { border-color: var(--neon-cyan); }
.shop-item.wearing { border-color: var(--neon-yellow); box-shadow: 0 0 14px rgba(249, 240, 2, .45); }
.shop-item canvas { width: 60px; height: 78px; }

.shop-name { font-family: var(--font-pixel); font-size: .6rem; line-height: 1.5; color: var(--c); }
.shop-blurb { flex: 1; font-size: 1.1rem; line-height: 1.2; color: var(--text-dim); }

.shop-action {
  width: 100%;
  padding: 10px 6px;
  font-family: var(--font-pixel);
  font-size: .55rem;
  white-space: pre;
  color: var(--neon-yellow);
  background: none;
  border: 2px solid var(--neon-yellow);
  border-radius: 6px;
}

.shop-action:hover { color: var(--bg); background: var(--neon-yellow); }
.shop-action.short { color: var(--text-dim); border-color: #3a2a66; }
.shop-action.short:hover { color: var(--text-dim); background: none; }
.shop-item.owned .shop-action { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.shop-item.owned .shop-action:hover { color: var(--bg); background: var(--neon-cyan); }
.shop.busy .shop-action { opacity: .5; cursor: progress; }
.shop-item.wearing .shop-action { color: var(--bg); background: var(--neon-yellow); border-color: var(--neon-yellow); cursor: default; }

/* "+3 CREDITS FROM SWARM STRIKE" after coming back from a game */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 150;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 14px 18px;
  font-family: var(--font-pixel);
  font-size: clamp(.6rem, 2.8vw, .8rem);
  line-height: 1.5;
  text-align: center;
  color: var(--bg);
  background: var(--neon-yellow);
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(249, 240, 2, .6);
  transform: translate(-50%, 160%);
  visibility: hidden;
  transition: transform .4s, visibility .4s;
  pointer-events: none;
}

.toast.on { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Animations ---------- */

@keyframes flicker {
  0%, 18%, 22%, 62%, 66%, 100% { opacity: 1; }
  20%, 64% { opacity: .55; }
}

@keyframes blink {
  0% { opacity: 1; }
  100% { opacity: .25; }
}

@keyframes pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(.6); }
}

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
  .cabinet { flex-basis: min(260px, 100%); }

  .legend-body { grid-template-columns: 1fr; justify-items: center; }
  .legend .screen { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Footer and about page ---------- */

.site-footer {
  padding: 24px 16px 40px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-dim);
}
.site-footer p { max-width: 640px; margin: 0 auto 8px; }
.site-footer a,
.about a { color: var(--neon-cyan); }

.about {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}
.about h1 {
  margin: 0 0 32px;
  font-size: clamp(.9rem, 4vw, 1.4rem);
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink);
}
.about h2 {
  margin: 32px 0 8px;
  font-size: clamp(.7rem, 3vw, .9rem);
  color: var(--neon-cyan);
}
.about p { margin: 0 0 12px; }
.about-back { margin-top: 40px !important; font-family: var(--font-pixel); font-size: .75rem; }
