/* The arcade hub at play.glitchonsol.com: a neon sign over two cabinets on a dark arcade floor.
   The games' own colours (the site's tokens): Heat Run's cyan, the Rat's pink, the night purple.
   Everything moves a little (sign flicker, light sweep, "press start") and nothing moves under
   prefers-reduced-motion. */

@font-face {
  font-family: Anton;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/hub/fonts/anton-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/hub/fonts/barlow-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: Barlow;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/hub/fonts/barlow-latin-600-normal.woff2') format('woff2');
}

:root {
  --night: #0f0722;
  --violet: #2a0f3f;
  --deep: #1b0a4a;
  --cream: #fff3dc;
  --muted: rgb(255 243 220 / 0.62);
  --pink: #f0489a;
  --cyan: #0beaf8;
  --gold: #e9c34b;
  --font-display: Anton, Impact, 'Arial Narrow Bold', sans-serif;
  --font-body: Barlow, 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 18px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 70% 40% at 20% 0%, rgb(11 234 248 / 0.16), transparent 70%),
    radial-gradient(ellipse 70% 45% at 85% 10%, rgb(240 72 154 / 0.2), transparent 70%),
    var(--night);
  color: var(--cream);
  font: 400 1rem/1.5 var(--font-body);
}

a {
  color: inherit;
}

/* ---------- The floor: a neon grid falling away into the dark, and a light that sweeps it ---------- */

.floor {
  position: absolute;
  inset: auto 0 0;
  height: min(52vh, 34rem);
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to top, rgb(15 7 34 / 0) 0%, rgb(15 7 34 / 0.85) 70%, var(--night) 100%),
    repeating-linear-gradient(90deg, rgb(240 72 154 / 0.22) 0 1px, transparent 1px 7.5%),
    repeating-linear-gradient(0deg, rgb(11 234 248 / 0.2) 0 1px, transparent 1px 3.2rem),
    linear-gradient(to bottom, var(--violet), #140730);
  transform: perspective(28rem) rotateX(58deg);
  transform-origin: bottom center;
}

.sweep {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgb(255 243 220 / 0.045) 45%, rgb(11 234 248 / 0.06) 50%, transparent 65%);
  background-size: 220% 100%;
  animation: sweep 11s linear infinite;
}

@keyframes sweep {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--night);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus-visible {
  top: 0.75rem;
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

/* ---------- Top and bottom ---------- */

.top,
.hall,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) var(--gutter) 0;
  font-size: 0.9rem;
}

.top-site {
  font-weight: 600;
  text-decoration: none;
  opacity: 0.85;
}

.top-site:hover,
.top-site:focus-visible {
  opacity: 1;
}

.top-note {
  display: none;
  margin: 0;
  color: var(--muted);
  text-align: right;
  text-wrap: balance;
}

@media (width >= 44em) {
  .top-note {
    display: block;
  }
}

.foot {
  margin-top: auto;
  padding: 2rem var(--gutter) max(1.5rem, env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.foot p {
  margin: 0.25rem 0;
}

/* ---------- The sign ---------- */

.hall {
  width: min(100%, 72rem);
  margin-inline: auto;
  padding: clamp(0.75rem, 4vw, 2.5rem) var(--gutter) 1rem;
}

.sign {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.sign-mascot {
  grid-row: 1 / 3;
  width: 3.25rem;
  height: auto;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px var(--night),
    0 0 0 4px var(--cyan),
    0 0 1.5rem rgb(11 234 248 / 0.5);
}

.sign-text {
  margin: 0;
  font: 400 clamp(1.9rem, 8.5vw, 2.6rem)/0.95 var(--font-display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Wide screens: the full neon sign. */
@media (width >= 44em) {
  .sign {
    column-gap: clamp(0.75rem, 2.5vw, 1.5rem);
    margin-bottom: clamp(1.25rem, 4vw, 2.5rem);
  }

  .sign-mascot {
    width: clamp(4.5rem, 12vw, 8rem);
    box-shadow:
      0 0 0 3px var(--night),
      0 0 0 5px var(--cyan),
      0 0 2.5rem rgb(11 234 248 / 0.5);
  }

  .sign-text {
    font-size: clamp(2.6rem, 10vw, 6.5rem);
  }
}

.neon {
  display: inline-block;
}

.neon-cyan {
  color: #e8fdff;
  text-shadow:
    0 0 0.02em #fff,
    0 0 0.12em var(--cyan),
    0 0 0.35em var(--cyan),
    0 0 0.8em rgb(11 234 248 / 0.7);
  animation: flicker-cyan 7s linear infinite;
}

.neon-pink {
  color: #ffe6f2;
  text-shadow:
    0 0 0.02em #fff,
    0 0 0.12em var(--pink),
    0 0 0.35em var(--pink),
    0 0 0.8em rgb(240 72 154 / 0.7);
  animation: flicker-pink 9s linear infinite 1.3s;
}

/* A real tube: steady, with a stutter now and then. */
@keyframes flicker-cyan {
  0%, 18%, 21%, 23%, 100% {
    opacity: 1;
  }

  19%, 22% {
    opacity: 0.55;
    text-shadow: 0 0 0.02em #fff, 0 0 0.1em var(--cyan);
  }
}

@keyframes flicker-pink {
  0%, 46%, 48%, 100% {
    opacity: 1;
  }

  47% {
    opacity: 0.6;
    text-shadow: 0 0 0.02em #fff, 0 0 0.1em var(--pink);
  }
}

.sign-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: clamp(0.8rem, 2.2vw, 1.15rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* "Insert coin" pulses rather than vanishing, so the line always reads. */
.blink {
  color: var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

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

/* ---------- The cabinets ---------- */

.cabinets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.6rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cabinet {
  --glow: var(--cyan);
  --glow-soft: rgb(11 234 248 / 0.4);
  --glow-faint: rgb(11 234 248 / 0.14);
}

.cabinet-rat {
  --glow: var(--pink);
  --glow-soft: rgb(240 72 154 / 0.4);
  --glow-faint: rgb(240 72 154 / 0.14);
}

.cabinet-link {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgb(255 243 220 / 0.14);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, #1a0b33, #120826 60%, #0f0722);
  color: var(--cream);
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgb(255 243 220 / 0.08),
    0 0 0 1px rgb(15 7 34 / 0.9),
    0 0 3rem var(--glow-faint),
    0 30px 60px -30px rgb(0 0 0 / 0.9);
  transition:
    translate 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.cabinet-link:hover,
.cabinet-link:focus-visible {
  translate: 0 -0.35rem;
  border-color: var(--glow);
  box-shadow:
    inset 0 1px 0 rgb(255 243 220 / 0.08),
    0 0 0 1px rgb(15 7 34 / 0.9),
    0 0 3.5rem var(--glow-soft),
    0 30px 60px -30px rgb(0 0 0 / 0.9);
  outline: none;
}

.cabinet-link:focus-visible .cabinet-cta {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

/* The lit strip across the top of a cabinet. */
.marquee {
  display: grid;
  place-items: center;
  padding: 0.5rem 0.5rem;
  background: linear-gradient(180deg, var(--glow), color-mix(in srgb, var(--glow) 70%, var(--night)));
  color: var(--night);
  box-shadow:
    inset 0 -3px 0 rgb(0 0 0 / 0.25),
    0 0 1.5rem var(--glow-soft);
}

.marquee-text {
  font: 400 clamp(0.95rem, 3.2vw, 1.8rem)/1 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The screen: the game's own title scene behind curved glass, with a "press start" over it. */
.screen {
  position: relative;
  display: block;
  margin: 0.5rem 0.5rem 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 3px solid #05020c;
  border-radius: 10px;
  background: var(--night);
  box-shadow: 0 0 0 2px rgb(255 243 220 / 0.1);
}

.screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1);
  transition: scale 500ms ease, filter 300ms ease;
}

.screen-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0.18) 0 1px, transparent 1px 3px),
    linear-gradient(115deg, rgb(255 255 255 / 0.14) 0%, rgb(255 255 255 / 0.03) 35%, transparent 55%);
  mix-blend-mode: screen;
}

.screen-start {
  position: absolute;
  left: 50%;
  bottom: 0.5rem;
  translate: -50% 0;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgb(15 7 34 / 0.75);
  color: var(--cream);
  font: 600 clamp(0.55rem, 1.8vw, 0.75rem)/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: blink 1.2s steps(1) infinite;
}

.cabinet-link:hover .screen img,
.cabinet-link:focus-visible .screen img {
  scale: 1.04;
  filter: saturate(1.25) brightness(1.08);
}

/* The control panel: a stick and three buttons, in the cabinet's colour. */
.panel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.5rem 0.1rem;
  scale: 0.8;
}

@media (width >= 44em) {
  .panel {
    gap: 1.5rem;
    padding: 0.6rem 1rem 0.25rem;
    scale: 1;
  }
}

.stick {
  position: relative;
  width: 2.6rem;
  height: 0.9rem;
  border-radius: 999px;
  background: #06030f;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.8);
}

.stick i {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  width: 0.26rem;
  height: 1.3rem;
  translate: -50% 0;
  background: #3b3350;
}

.stick i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -0.6rem;
  width: 0.95rem;
  height: 0.95rem;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0, var(--pink) 45%, #7a1d4e 100%);
}

.buttons {
  display: flex;
  gap: 0.5rem;
}

.buttons i {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0, var(--glow) 45%, color-mix(in srgb, var(--glow) 45%, black) 100%);
  box-shadow: 0 0.2rem 0 rgb(0 0 0 / 0.6);
}

.buttons i:nth-child(2) {
  --glow: var(--gold);
}

.buttons i:nth-child(3) {
  --glow: var(--pink);
}

.cabinet-rat .buttons i:nth-child(3) {
  --glow: var(--cyan);
}

.cabinet-body {
  display: grid;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem 0.9rem;
}

.cabinet-tag {
  color: var(--glow);
  font-size: clamp(0.6rem, 1.9vw, 0.8rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cabinet-title {
  font: 400 clamp(1.25rem, 4.5vw, 2.8rem)/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* The hook only fits once the cabinets have room. */
.cabinet-hook {
  display: none;
  color: var(--muted);
  font-size: 1rem;
}

@media (width >= 44em) {
  .cabinet-body {
    gap: 0.35rem;
    padding: 0.6rem 1.1rem 1.25rem;
  }

  .cabinet-hook {
    display: block;
  }
}

.cabinet-cta {
  justify-self: start;
  margin-top: 0.35rem;
  padding: clamp(0.55rem, 2vw, 0.75rem) clamp(1.1rem, 4vw, 1.8rem);
  border-radius: 999px;
  background: var(--glow);
  color: var(--night);
  font: 400 clamp(1rem, 3.5vw, 1.3rem)/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0.3rem 0 color-mix(in srgb, var(--glow) 40%, black), 0 0 1.5rem var(--glow-soft);
}

/* ---------- 404 ---------- */

.hall-lost {
  text-align: center;
}

.hall-lost .title {
  margin: 0;
  font: 400 clamp(3rem, 11vw, 6.5rem)/0.95 var(--font-display);
}

.title-glitch {
  color: var(--cyan);
  text-shadow: 0 0 1.5rem rgb(11 234 248 / 0.45);
}

.kicker {
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lost-links {
  margin-top: 1.5rem;
}

.lost .cabinet-cta {
  display: inline-block;
  background: var(--pink);
}

@media (prefers-reduced-motion: reduce) {
  .sweep,
  .neon-cyan,
  .neon-pink,
  .blink,
  .screen-start {
    animation: none;
  }

  .cabinet-link,
  .screen img {
    transition: none;
  }

  .cabinet-link:hover,
  .cabinet-link:focus-visible {
    translate: none;
  }

  .cabinet-link:hover .screen img,
  .cabinet-link:focus-visible .screen img {
    scale: none;
  }
}

/* ---------- Coming soon: a cabinet that isn't a link yet ---------- */

.cabinet-soon:hover {
  translate: none;
  border-color: rgb(255 243 220 / 0.14);
}

.cabinet-soon .screen img,
.cabinet-soon:hover .screen img {
  scale: none;
  filter: saturate(0.35) brightness(0.7);
}

.cabinet-soon .cabinet-cta {
  background: transparent;
  color: var(--glow);
  box-shadow: inset 0 0 0 2px var(--glow);
}
