/* Picazzo Arcade — 80s neon playroom */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  --wall: #150a26;       /* deep aubergine wall */
  --carpet: #120b2e;     /* arcade carpet base */
  --pink: #ff3ea5;       /* neon tube pink */
  --cyan: #3ff0ff;       /* neon tube cyan */
  --yellow: #ffe45c;     /* marquee yellow */
  --tube: #fff4fb;       /* hot white core of a tube */
  --dim: #8a7fb0;        /* unlit text */
  --off: #3a3160;        /* unplugged tube */

  --font-sign: "Monoton", "Impact", "Arial Black", sans-serif;
  --font-body: "VT323", "Courier New", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--tube);
  font-family: var(--font-body);
  font-size: 1.35rem;
  line-height: 1.3;
  background-color: var(--carpet);
  /* The animated 80s scene (js/scene.js) is drawn on a fixed canvas behind everything */
}

/* ---------- Wall with neon sign ---------- */

/* The header is fixed; a spacer of its full height keeps the page from jumping.
   When the page scrolls, js/header.js adds .is-compact and it shrinks to a slim bar. */
.wall {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  text-align: center;
  padding: calc(clamp(2rem, 7vh, 4.5rem) + env(safe-area-inset-top, 0px)) 1rem 1.5rem;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: padding .3s ease, background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.wall-spacer { height: var(--wall-h, 300px); }

.sign-main, .sign-sub, .tagline { transition: font-size .3s ease, letter-spacing .3s ease, opacity .2s ease, margin .3s ease; }

.wall.is-compact {
  padding: calc(.45rem + env(safe-area-inset-top, 0px)) 1rem .45rem;
  background-color: rgba(21, 10, 38, .9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--pink);
  box-shadow: 0 0 10px var(--pink), 0 0 30px rgba(255, 62, 165, .3);
}
.wall.is-compact .sign { flex-direction: row; align-items: baseline; gap: .6em; }
.wall.is-compact .sign-main { font-size: clamp(1.6rem, 6vw, 2.3rem); }
.wall.is-compact .sign-sub { font-size: clamp(1.1rem, 4vw, 1.5rem); letter-spacing: .3em; margin-right: -.3em; }
.wall.is-compact .tagline { opacity: 0; margin: 0; height: 0; overflow: hidden; }

.sign {
  margin: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-weight: 400;
}

.sign-main {
  font-family: var(--font-sign);
  font-size: clamp(2.6rem, 11vw, 7rem);
  letter-spacing: .04em;
  line-height: 1.05;
  color: var(--tube);
  text-shadow:
    0 0 4px var(--tube),
    0 0 12px var(--pink),
    0 0 28px var(--pink),
    0 0 60px var(--pink);
  animation: power-on 1.8s steps(1, end) both;
}

.sign-sub {
  font-family: var(--font-body);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: .5em;
  margin-right: -.5em; /* balance the trailing letter-spacing */
  color: var(--tube);
  text-shadow: 0 0 4px var(--tube), 0 0 14px var(--cyan), 0 0 30px var(--cyan);
  animation: power-on 1.8s .5s steps(1, end) both;
}

/* The one orchestrated moment: the sign stutters on like a real neon tube */
@keyframes power-on {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  16%  { opacity: .15; }
  24%  { opacity: 1; }
  30%  { opacity: .3; }
  38%  { opacity: 1; }
  100% { opacity: 1; }
}

.tagline {
  margin: 1.25rem 0 0;
  color: #cfc6ee;
  text-shadow: 0 0 6px #150a26, 0 0 12px #150a26, 0 1px 2px #150a26;
  font-size: 1.5rem;
}

/* ---------- Floor with cabinets ---------- */

.floor {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 2rem) 2rem;
}

.cabinets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 290px));
  justify-content: center;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.cabinet {
  --glow: var(--cyan);
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: #0a0618;
  border: 3px solid var(--glow);
  border-radius: 18px 18px 6px 6px;
  box-shadow:
    0 0 6px var(--glow),
    0 0 22px color-mix(in srgb, var(--glow) 55%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--glow) 25%, transparent);
  transition: transform .15s ease, box-shadow .15s ease;
}

/* Marquee on top of the cabinet */
.marquee {
  padding: .6rem 1rem .5rem;
  border-bottom: 3px solid var(--glow);
  font-size: 2rem;
  line-height: 1;
  text-align: center;
  color: var(--tube);
  text-shadow: 0 0 6px var(--glow), 0 0 16px var(--glow);
}

.screen {
  margin: 1rem 1rem 0;
  aspect-ratio: 4 / 3;
  border-radius: 12px / 16px; /* slight CRT bulge */
  background: radial-gradient(ellipse at center, #1d1240 0%, #07040f 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

/* CRT scanlines */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 2px, transparent 2px 4px);
  pointer-events: none;
}

.screen svg { width: 78%; height: auto; }

.blurb {
  margin: .9rem 1rem 0;
  color: #cfc6ee;
  font-size: 1.25rem;
  flex: 1;
}

.coin {
  margin: 1rem;
  padding: .45rem 0;
  text-align: center;
  font-size: 1.5rem;
  color: var(--yellow);
  border: 2px solid var(--yellow);
  border-radius: 8px;
  text-shadow: 0 0 8px var(--yellow);
}

a.cabinet:hover,
a.cabinet:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 0 10px var(--glow),
    0 0 40px var(--glow),
    inset 0 0 26px color-mix(in srgb, var(--glow) 40%, transparent);
}

a.cabinet:hover .coin,
a.cabinet:focus-visible .coin {
  background: var(--yellow);
  color: #1a0f00;
  text-shadow: none;
}

a.cabinet:focus-visible {
  outline: 3px solid var(--tube);
  outline-offset: 5px;
}

/* Unplugged cabinet (coming soon) */
.cabinet.soon {
  --glow: var(--off);
  box-shadow: none;
  border-style: dashed;
}
.cabinet.soon .marquee { color: var(--dim); text-shadow: none; }
.cabinet.soon .coin { color: var(--dim); border-color: var(--off); text-shadow: none; }
.cabinet.soon .blurb { color: var(--dim); }

/* ---------- Footer ---------- */

.foot {
  text-align: center;
  color: var(--dim);
  padding: 1rem 1rem 2rem;
}
.foot p { margin: 0; }

.note { text-align: center; color: var(--yellow); }

/* ---------- Motion & accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  .sign-main, .sign-sub { animation: none; }
  .wall, .sign-main, .sign-sub, .tagline { transition: none; }
  .cabinet { transition: none; }
  a.cabinet:hover, a.cabinet:focus-visible { transform: none; }
}

@media (max-width: 520px) {
  body { font-size: 1.25rem; }
  .cabinets { grid-template-columns: 1fr; }
}
