/* Title font: Bungee; everything else: Fredoka. Both are under the SIL Open
   Font License (public/fonts/*-OFL.txt) and kept here rather than loaded
   from Google Fonts, so the page doesn't wait on, or tell, another site. */
@font-face {
  font-family: Bungee;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/bungee-400.woff2) format('woff2');
}

@font-face {
  font-family: Fredoka;
  font-weight: 500;
  font-display: swap;
  src: url(./fonts/fredoka-500.woff2) format('woff2');
}

@font-face {
  font-family: Fredoka;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/fredoka-700.woff2) format('woff2');
}

:root {
  --night: #1b1736;
  --sign: #2a2350;
  --sign-edge: #3d3470;
  --cream: #fff7e6;
  --lilac: #e6ddff;
  --muted: #c9bfea;
  --yellow: #ffc93c;
  --yellow-shadow: #c9951a;
  --pink: #ff5a8a;
  --pink-shadow: #c23a66;
  --teal: #2ec4b6;
  --wood: #6b4430;
  --wood-edge: #553424;
  --plank: #8a5a3b;
  --ink: #1b1736;
  --display: Bungee, Fredoka, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--cream);
  font-family: Fredoka, system-ui, sans-serif;
  font-weight: 500;
}

a {
  color: var(--yellow);
}

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---------- Marquee ---------- */

.marquee {
  background: var(--sign);
  border: 6px solid var(--sign-edge);
  border-radius: 28px;
  padding: 18px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.bulbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.bulbs span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px var(--yellow);
  animation: blink 1.2s infinite;
}

.bulbs span:nth-child(even) {
  animation-delay: 0.6s;
}

/* One row of bulbs on a phone. */
@media (max-width: 480px) {
  .bulbs {
    gap: 12px;
  }

  .bulbs span:nth-child(n + 10) {
    display: none;
  }
}

@keyframes blink {
  50% { opacity: 0.25; }
}

.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1;
  color: var(--yellow);
  text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 var(--night);
}

.tagline {
  margin: 0;
  font-size: 22px;
  color: var(--lilac);
}

/* The tagline on one line on a phone. */
@media (max-width: 480px) {
  .marquee {
    padding-inline: 14px;
  }

  .tagline {
    font-size: 17px;
  }
}

/* ---------- Cabinet + shelf side by side; stacked on small screens ---------- */

.hall {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
}

/* ---------- Arcade cabinet ---------- */

.cabinet {
  flex: 1 1 400px;
  min-width: 0;
  background: var(--pink);
  border-radius: 28px 28px 16px 16px;
  padding: 22px;
  box-shadow: 0 10px 0 var(--pink-shadow);
}

.bezel {
  background: #12101f;
  border: 4px solid #0a0914;
  border-radius: 18px;
  padding: 18px;
}

.screen {
  --screen: #3d3470;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 28px;
  border-radius: 12px;
  background: var(--screen);
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scanline {
  position: absolute;
  inset: 0 0 auto;
  height: 40%;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: scan 4s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  from { transform: translateY(-100%); }
  to { transform: translateY(250%); }
}

.screen-kicker {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
}

.screen-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.05;
  color: #fff;
}

.screen-blurb {
  margin: 0;
  max-width: 46ch;
  font-size: 19px;
  line-height: 1.45;
}

.screen-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.screen-tags li {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.press-start {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 28px;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--yellow-shadow);
}

@media (max-width: 480px) {
  .cabinet {
    padding: 16px;
  }

  .bezel {
    padding: 12px;
  }

  .screen {
    padding: 22px 18px;
  }

  .press-start {
    padding: 14px 20px;
    font-size: 19px;
  }
}

.press-start svg {
  fill: var(--ink);
}

.press-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--yellow-shadow);
}

.press-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--yellow-shadow);
}

.press-start:focus-visible,
.cart:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 4px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 12px 4px;
}

.joystick {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--night);
  box-shadow: inset 0 -4px 0 #000;
}

.stick {
  position: absolute;
  left: 11px;
  bottom: 16px;
  width: 12px;
  height: 40px;
  border-radius: 6px;
  background: var(--night);
}

.arcade-buttons {
  display: flex;
  gap: 12px;
}

.arcade-buttons span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--yellow-shadow);
}

.arcade-buttons span:nth-child(2) {
  background: var(--teal);
  box-shadow: 0 5px 0 #1e8f85;
}

.arcade-buttons span:nth-child(3) {
  background: var(--cream);
  box-shadow: 0 5px 0 #cfc4aa;
}

/* ---------- Shelf ---------- */

.shelf {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shelf-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.shelf-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
}

.shelf-count {
  font-size: 16px;
  color: var(--muted);
}

.shelf-wood {
  padding: 26px 22px 0;
  border-radius: 20px;
  background: var(--wood);
  box-shadow: inset 0 0 0 6px var(--wood-edge);
}

.shelf-grid {
  display: grid;
  /* Four across (two on small screens). */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 16px;
}

@media (max-width: 720px) {
  .shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.shelf-plank {
  height: 18px;
  margin: 14px -22px 0;
  border-radius: 0 0 20px 20px;
  background: var(--plank);
  box-shadow: 0 -4px 0 #a06b48;
}

/* A cartridge: plastic shell with grip ridges on top and a paper label. */
.cart {
  --shell: #5a4f8c;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 26px 10px 14px;
  border: 0;
  border-radius: 12px 12px 6px 6px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)) center 10px / 74px 6px no-repeat,
    var(--shell);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
  font: inherit;
  text-align: left;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.cart {
  cursor: pointer;
}

button.cart:hover {
  transform: translateY(-6px);
}

.cart[aria-pressed='true'] {
  box-shadow: 0 0 0 4px var(--cream), 0 0 0 8px var(--pink), 0 8px 0 rgba(0, 0, 0, 0.35);
}

.cart-label {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--cream);
}

.cart-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 120 / 76;
  border-radius: 6px;
}

.cart-title {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.15;
}

.cart-sub {
  font-size: 13px;
  color: #4a4366;
}

.noscript {
  font-size: 18px;
}

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

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 22px;
  border-top: 2px dashed var(--sign-edge);
  font-size: 16px;
  color: var(--muted);
}

/* ---------- Short windows ---------- */

/* On a laptop the browser window is often only 650-800px tall. Tighten the
   sign and the spacing so Press Start shows without scrolling. Phones stack
   the cabinet first, so they don't need this. */
@media (min-width: 721px) and (max-height: 900px) {
  .page {
    padding-top: 20px;
    gap: 24px;
  }

  .marquee {
    padding: 10px 24px 12px;
    gap: 8px;
  }

  .bulbs span {
    width: 10px;
    height: 10px;
  }

  .logo {
    font-size: clamp(32px, 4.5vw, 52px);
  }

  .tagline {
    font-size: 18px;
  }

  /* A wider cabinet, so long titles and blurbs wrap onto fewer lines. */
  .cabinet {
    flex-basis: 430px;
  }

  .screen-title {
    font-size: clamp(26px, 2.6vw, 34px);
  }

  .screen {
    min-height: 0;
    padding: 22px 24px;
    gap: 10px;
  }

  .screen-blurb {
    font-size: 17px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bulbs span,
  .scanline {
    animation: none;
  }

  .cart,
  .screen {
    transition: none;
  }
}
