@font-face { font-family: "Press Start 2P"; src: url("assets/fonts/press-start-2p.woff2") format("woff2"); font-display: block; }

:root {
  --pink: #ff2fd0;
  --cyan: #28f0ff;
  --yellow: #ffe63c;
  --night: #0b0420;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--night);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  overflow-x: hidden;
  user-select: none;
}

/* ---- backdrop: dusk sky, striped sun, scrolling grid floor ---- */
.sky {
  position: fixed; inset: 0 0 40% 0;
  background: linear-gradient(#0b0420 0%, #2a0a4a 55%, #7a1a6a 100%);
  overflow: hidden;
}
.sky::before { /* stars */
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 81% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 34%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 40%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 6%, var(--cyan) 50%, transparent 51%),
    radial-gradient(2px 2px at 22% 30%, var(--pink) 50%, transparent 51%);
  animation: twinkle 3s steps(2) infinite;
}
.sun {
  position: absolute; left: 50%; bottom: -14vmin;
  width: 56vmin; height: 56vmin; transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(var(--yellow), #ff8a3c 45%, var(--pink) 85%);
  --stripes: linear-gradient(#000 52%, #0000 52% 55%, #000 55% 63%, #0000 63% 67%, #000 67% 74%,
                             #0000 74% 79%, #000 79% 85%, #0000 85% 91%, #000 91%);
  -webkit-mask-image: var(--stripes);
          mask-image: var(--stripes);
  box-shadow: 0 0 80px #ff2fd088;
  opacity: .9;
}
/* mountain ridge on the horizon */
.sky::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22vmin;
  background: #12052b;
  clip-path: polygon(0 100%, 0 62%, 8% 40%, 14% 55%, 22% 22%, 30% 50%, 37% 38%, 44% 60%, 50% 70%,
                     56% 58%, 63% 30%, 69% 48%, 76% 8%, 83% 44%, 90% 30%, 100% 56%, 100% 100%);
  border-top: 2px solid var(--pink);
}
.floor {
  position: fixed; left: -50%; right: -50%; bottom: 0; height: 40%;
  background:
    linear-gradient(transparent 0 0),
    repeating-linear-gradient(90deg, var(--pink) 0 2px, transparent 2px 60px),
    repeating-linear-gradient(0deg, var(--pink) 0 2px, transparent 2px 60px),
    #12052b;
  transform: perspective(300px) rotateX(60deg);
  transform-origin: top center;
  animation: roll 1.2s linear infinite;
  box-shadow: inset 0 40px 60px #12052b;
}

/* ---- layout ---- */
main {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 28px 16px;
}
header { text-align: center; }
h1 {
  margin: 0; font-size: clamp(26px, 6vw, 58px); line-height: 1.15; letter-spacing: 4px;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #4a1080, 0 0 24px #ffe63c88;
}
h1 span { color: var(--cyan); text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #4a1080, 0 0 24px #28f0ff88; }
header p { margin: 18px 0 0; font-size: 13px; color: #fff; text-shadow: 2px 2px 0 var(--pink); }
.blink { animation: blink 1s steps(2) infinite; }
footer { font-size: 9px; line-height: 2; color: #c9a6ff; text-align: center; text-shadow: 1px 1px 0 #000; }

.row { display: flex; gap: clamp(24px, 6vw, 80px); flex-wrap: wrap; justify-content: center; }

/* ---- arcade cabinet ---- */
.cab {
  --c: var(--cyan);
  width: 280px; display: block; text-decoration: none; color: inherit;
  background: #1a0d33;
  border-left: 12px solid #2c1652; border-right: 12px solid #2c1652;
  box-shadow: 0 0 0 3px #000, 0 30px 40px #000a;
  transition: transform .15s steps(3), box-shadow .15s;
  outline: none; cursor: pointer;
}
#cab-berkanoid { --c: #ff4a3c; }
#cab-mm { --c: var(--cyan); }
#cab-rush { --c: #58d04a; }
.cab.sel, .cab:hover, .cab:focus-visible {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 0 0 3px var(--c), 0 0 40px var(--c), 0 30px 40px #000a;
}

.marquee {
  height: 74px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 18px; line-height: 1.4; letter-spacing: 1px;
  border-bottom: 4px solid #000;
}
.marquee.berk {
  background: linear-gradient(#ff4a3c, #b0102a);
  color: #fff; text-shadow: 2px 2px 0 #3a0010, 0 0 10px #ffd;
}
.marquee.mm {
  background:
    repeating-linear-gradient(90deg, #0000 0 10px, #0002 10px 12px),
    linear-gradient(#ffe63c, #e0a000);
  color: #10203a; text-shadow: 2px 2px 0 #fff8;
  font-size: 15px;
}
.marquee.rush {
  background: linear-gradient(#58d04a, #1e7a3a);
  color: #fff; text-shadow: 2px 2px 0 #0c3a1a;
}
.cab.sel .marquee span, .cab:hover .marquee span { animation: flicker 2.4s infinite; }

.bezel {
  position: relative; margin: 14px 14px 0; padding: 14px;
  background: #050208;
  border: 4px solid #000; border-radius: 6px;
  box-shadow: inset 0 0 0 3px #2c1652;
}
.bezel canvas {
  display: block; width: 100%; aspect-ratio: 192 / 224;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border-radius: 10px / 14px;
  background: #000;
}
.glass { /* CRT scanlines + vignette */
  position: absolute; inset: 14px; border-radius: 10px / 14px; pointer-events: none;
  background:
    repeating-linear-gradient(#0000 0 2px, #0006 2px 3px),
    radial-gradient(ellipse at 50% 40%, #fff1 0%, #0000 50%, #000a 100%);
}

.deck {
  height: 54px; margin-top: 14px; position: relative;
  background: linear-gradient(#3a1d6a, #1a0d33);
  border-top: 3px solid #000; border-bottom: 3px solid #000;
  display: flex; align-items: center; justify-content: center; gap: 22px;
}
.deck i { display: block; }
.stick { width: 12px; height: 26px; background: #888; position: relative; top: -8px; }
.stick::before { content: ""; position: absolute; left: -7px; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: #ff4a3c; box-shadow: inset -4px -4px 0 #0005; }
.ball { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #4a8cff 30%, #102060); box-shadow: 0 0 0 3px #000; }
.btn { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 4px 0 #0008, inset -3px -3px 0 #0004; }
.btn.red { background: #ff4a3c; } .btn.yellow { background: var(--yellow); } .btn.blue { background: var(--cyan); } .btn.green { background: #58d04a; }

.body {
  height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: repeating-linear-gradient(135deg, #1a0d33 0 14px, #20103e 14px 28px);
}
.coin { display: flex; gap: 12px; padding: 10px 14px; background: #111; border: 3px solid #000; }
.coin b { width: 22px; height: 30px; background: #300; border: 2px solid #555; position: relative; }
.coin b::after { content: ""; position: absolute; left: 8px; top: 6px; width: 2px; height: 14px; background: #ff3c3c; box-shadow: 0 0 6px #ff3c3c; }
.body em { font-style: normal; font-size: 9px; color: var(--c); text-shadow: 0 0 8px var(--c); opacity: 0; }
.cab.sel .body em, .cab:hover .body em { opacity: 1; animation: blink .6s steps(2) infinite; }

/* no game yet: no reaction to the pointer, coin lights off, a strip of tape across the door */
.cab.soon, .cab.soon:hover { transform: none; box-shadow: 0 0 0 3px #000, 0 30px 40px #000a; cursor: default; }
.cab.soon:hover .marquee span { animation: none; }
.cab.soon .coin b::after { background: #422; box-shadow: none; }
.cab.soon .body em, .cab.soon:hover .body em {
  opacity: 1; animation: none;
  padding: 7px 10px; font-size: 10px; color: #000; text-shadow: none;
  background: var(--yellow); box-shadow: 0 0 0 2px #000; transform: rotate(-3deg);
}

.cab.go { animation: insert .5s steps(4) forwards; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes twinkle { 50% { opacity: .55; } }
@keyframes roll { to { background-position: 0 0, 0 0, 0 60px, 0 0; } }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .4; } 96% { opacity: 1; } 97% { opacity: .6; } }
@keyframes insert { 50% { filter: brightness(2); } 100% { filter: brightness(0); } }

/* three in a row down to phone width */
@media (min-width: 641px) and (max-width: 1040px) {
  .row { flex-wrap: nowrap; gap: 16px; }
  .cab { width: min(280px, calc((100vw - 64px) / 3)); border-left-width: 8px; border-right-width: 8px; }
  .marquee { font-size: 13px; }
  .marquee.mm { font-size: 12px; }
  .bezel { margin: 10px 10px 0; padding: 8px; }
  .glass { inset: 8px; }
}
@media (max-width: 640px) {
  .cab { width: min(280px, 100%); }
  .floor { height: 30%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
