/* Cami's Arcade: a neon-lit room with cabinets built from real 3D faces.
   Each cabinet is 240 x 560 x 220 px; every front panel is a plane laid
   between two points of the side profile, so the sides and front meet. */

:root {
  --wall: #1a1030;
  --wall-deep: #110a22;
  --neon: #ff5fa2;
  --cyan: #4fe3ff;
  --bulb: #ffe7a3;
  --text: #f4ecff;
  --text-soft: #b9addb;

  --sign: "Monoton", "Bungee", sans-serif;
  --display: "Bungee", "Arial Black", sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

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

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--wall-deep);
  color: var(--text);
  font: 400 1rem/1.5 var(--body);
}

/* ---- the back wall and its neon sign */

.wall {
  position: relative;
  padding: clamp(2rem, 6vh, 4rem) 1rem clamp(1rem, 3vh, 2rem);
  text-align: center;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 64px),
    radial-gradient(50rem 22rem at 50% 30%, rgba(255, 95, 162, 0.16), transparent 70%),
    var(--wall);
}

.sign {
  margin: 0;
  font: 400 clamp(2.4rem, 8vw, 5.5rem)/1.05 var(--sign);
  color: #ffd6ea;
  text-shadow: 0 0 0.08em #fff, 0 0 0.25em var(--neon), 0 0 0.6em var(--neon), 0 0 1.2em rgba(255, 95, 162, 0.6);
  animation: power-on 1.6s steps(1, end) 0.2s both;
}
.tagline {
  margin: 0.75rem 0 0;
  font: 400 clamp(0.9rem, 2vw, 1.1rem)/1.3 var(--display);
  color: var(--cyan);
  text-shadow: 0 0 0.6em rgba(79, 227, 255, 0.6);
}

/* the sign stutters on once when the room loads */
@keyframes power-on {
  0% { opacity: 0.15; }
  10% { opacity: 1; }
  16% { opacity: 0.25; }
  24% { opacity: 1; }
  30% { opacity: 0.4; }
  36%, 100% { opacity: 1; }
}

/* ---- the floor: arcade carpet laid back in perspective */

.floor {
  position: relative;
  min-height: 46rem;
  padding: 2.5rem 0 3rem;
  overflow: hidden;
  perspective: 900px;
  perspective-origin: 50% 0;
}
.floor::before {
  content: "";
  position: absolute;
  left: -60%;
  right: -60%;
  top: 0;
  height: 140rem;
  transform: rotateX(80deg);
  transform-origin: 50% 0;
  background:
    linear-gradient(var(--wall-deep), transparent 12%),
    linear-gradient(rgba(17, 10, 34, 0.45), rgba(17, 10, 34, 0.45)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Crect width='160' height='160' fill='%23140b2a'/%3E%3Cpath d='M10 30q15-20 30 0t30 0' fill='none' stroke='%23ff5fa2' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M90 110q12-16 24 0t24 0' fill='none' stroke='%234fe3ff' stroke-width='5' stroke-linecap='round'/%3E%3Ccircle cx='120' cy='40' r='9' fill='none' stroke='%23ffe7a3' stroke-width='4'/%3E%3Ccircle cx='40' cy='120' r='5' fill='%23b06bff'/%3E%3Cpath d='M70 70l4 9 9 1-7 6 2 9-8-5-8 5 2-9-7-6 9-1z' fill='%23ffe7a3'/%3E%3Ccircle cx='150' cy='150' r='3' fill='%234fe3ff'/%3E%3Ccircle cx='15' cy='80' r='3' fill='%23ff5fa2'/%3E%3C/svg%3E") 0 0 / 200px;
}

.lineup {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 3rem);
  margin: 0;
  padding: 0 1rem;
  list-style: none;
}

.slot {
  position: relative;
  flex: 0 0 auto;
  width: 300px;
}

.cabinet {
  display: block;
  perspective: 1100px;
  perspective-origin: 50% 32%;
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* a pool of shadow on the carpet under each machine */
.slot::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 520px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent);
}

/* ---- one cabinet */

.machine {
  --turn: 0deg;
  position: relative;
  display: block;
  width: 240px;
  height: 560px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transform-origin: 120px 280px 110px;
  transform: rotateY(var(--turn)) translateZ(-110px);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.slot:nth-child(1) .machine { --turn: 16deg; }
.slot:nth-child(3) .machine { --turn: -16deg; }

a.cabinet:hover .machine,
a.cabinet:focus-visible .machine { transform: rotateY(calc(var(--turn) * 0.3)) translate3d(0, -6px, -70px); }

.face {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 240px;
  transform-origin: 0 0;
  background: var(--panel);
}

/* the side profile, in (z, y): roof, marquee, hood, screen, control deck, lip, kick plate */
.side {
  width: 220px;
  height: 560px;
  clip-path: polygon(0 0, 190px 0, 190px 85px, 150px 105px, 170px 300px, 220px 320px, 220px 360px, 185px 380px, 185px 560px, 0 560px);
  background: var(--side-art), var(--body);
}
.side.left { transform: rotateY(-90deg); filter: brightness(0.8); }
.side.right { transform: translateX(240px) rotateY(-90deg); filter: brightness(0.65); }

.back   { height: 560px; background: #0d0818; }
.roof   { height: 190px; transform: rotateX(90deg); background: #0d0818; }
.marquee{ height: 85px;  transform: translate3d(0, 0, 190px); }
.hood   { height: 45px;  transform: translate3d(0, 85px, 190px) rotateX(-63.43deg); background: #0b0714; }
.screen { height: 195px; transform: translate3d(0, 105px, 150px) rotateX(5.86deg); }
.deck   { height: 54px;  transform: translate3d(0, 300px, 170px) rotateX(68.2deg); }
.lip    { height: 40px;  transform: translate3d(0, 320px, 220px); }
.under  { height: 41px;  transform: translate3d(0, 360px, 220px) rotateX(-60.26deg); background: #0b0714; }
.door   { height: 180px; transform: translate3d(0, 380px, 185px); }

/* marquee: a backlit sign with the game's name */
.marquee {
  display: grid;
  place-items: center;
  padding: 0.5rem 0.75rem;
  border-top: 6px solid var(--trim);
  background: linear-gradient(var(--marquee-hi), var(--marquee-lo));
  box-shadow: 0 0 1.5rem var(--marquee-glow);
}
.marquee span {
  font: 400 1.3rem/1.05 var(--display);
  text-align: center;
  color: var(--ink);
}

/* screen: a black bezel round the game itself, with scanlines over it */
.screen {
  padding: 16px 18px;
  background: #07040d;
  border-left: 6px solid var(--body);
  border-right: 6px solid var(--body);
}
.screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  filter: brightness(0.82) saturate(0.95);
  transition: filter 0.3s;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 16px 18px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 3px),
    radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.55));
  box-shadow: inset 0 0 1.5rem rgba(0, 0, 0, 0.6);
}
a.cabinet:hover .screen img,
a.cabinet:focus-visible .screen img { filter: brightness(1.08) saturate(1.1); }

/* control deck: a joystick and two buttons, foreshortened by the tilt */
.deck {
  background: linear-gradient(#2a2440, #1a1530);
  border-left: 6px solid var(--body);
  border-right: 6px solid var(--body);
}
.deck i { position: absolute; border-radius: 50%; }
.deck .stick { left: 52px; top: 13px; width: 28px; height: 28px; background: radial-gradient(circle at 35% 30%, #fff, var(--trim) 45%, #000 120%); box-shadow: 0 0 0 6px #0b0714; }
.deck .btn { top: 15px; width: 24px; height: 24px; background: radial-gradient(circle at 35% 30%, #fff, var(--button) 50%, #000 130%); box-shadow: 0 3px 0 #0b0714; }
.deck .btn:nth-of-type(2) { left: 140px; }
.deck .btn:nth-of-type(3) { left: 176px; --button: var(--trim); }

.lip { background: var(--trim); box-shadow: inset 0 -10px 12px rgba(0, 0, 0, 0.35); }

/* coin door on the kick plate */
.door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 26px;
  background: linear-gradient(var(--body), #0d0818 140%);
}
.door .coin {
  width: 70px;
  height: 30px;
  border-radius: 5px;
  background: #1a1420;
  box-shadow: inset 0 0 0 3px #3b3346;
}
.door .coin::after {
  content: "";
  display: block;
  width: 6px;
  height: 16px;
  margin: 7px auto 0;
  border-radius: 2px;
  background: #ff9d3c;
  box-shadow: 0 0 8px #ff9d3c;
}
.door b {
  margin-top: 8px;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--bulb);
  color: #2a1a05;
  font: 400 0.75rem/1.2 var(--display);
}

/* the plaque on the floor under each machine */
.plaque {
  display: block;
  width: 260px;
  margin: 3.5rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(17, 10, 34, 0.85);
  box-shadow: inset 0 0 0 1px rgba(185, 173, 219, 0.25);
  color: var(--text-soft);
  font-size: 0.95rem;
  text-align: center;
}
.plaque strong { display: block; color: var(--text); font: 400 1rem/1.3 var(--display); }
a.cabinet:hover .plaque,
a.cabinet:focus-visible .plaque { box-shadow: inset 0 0 0 2px var(--trim), 0 0 1.5rem var(--marquee-glow); }
a.cabinet:focus-visible .plaque { outline: 3px solid var(--bulb); outline-offset: 4px; }

/* ---- the three machines */

.heart {
  --body: #8e1234;
  --trim: #ff5fa2;
  --button: #ffe7a3;
  --ink: #3a0718;
  --marquee-hi: #ffd0e4;
  --marquee-lo: #ff5fa2;
  --marquee-glow: rgba(255, 95, 162, 0.55);
  --side-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 560'%3E%3Cpath d='M110 330 40 262a42 42 0 0 1 70-46 42 42 0 0 1 70 46z' fill='%23ff5fa2' opacity='.85'/%3E%3Cpath d='M70 470 42 443a17 17 0 0 1 28-18 17 17 0 0 1 28 18z' fill='%23ffd0e4' opacity='.7'/%3E%3C/svg%3E") center / 100% 100%;
}
.archery {
  --body: #2d6a3e;
  --trim: #f5c242;
  --button: #d8452f;
  --ink: #20331f;
  --marquee-hi: #fff1b8;
  --marquee-lo: #f5c242;
  --marquee-glow: rgba(245, 194, 66, 0.5);
  --side-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 560'%3E%3Ccircle cx='100' cy='250' r='70' fill='%23f4efe1'/%3E%3Ccircle cx='100' cy='250' r='56' fill='%232a2a2a'/%3E%3Ccircle cx='100' cy='250' r='42' fill='%232f7fc1'/%3E%3Ccircle cx='100' cy='250' r='28' fill='%23d8452f'/%3E%3Ccircle cx='100' cy='250' r='14' fill='%23f5c242'/%3E%3Cpath d='M30 470 100 250' stroke='%233a2c22' stroke-width='5'/%3E%3Cpath d='M30 470l-6-24 14 8zM30 470l24-6-8 14z' fill='%23d8452f'/%3E%3C/svg%3E") center / 100% 100%;
}
.soon {
  --body: #2a2550;
  --trim: #4a427e;
  --button: #4a427e;
  --ink: #8f88c8;
  --marquee-hi: #322b5c;
  --marquee-lo: #262048;
  --marquee-glow: transparent;
  --side-art: linear-gradient(transparent, transparent);
}
.soon .screen { background: radial-gradient(80% 60% at 30% 25%, rgba(255, 255, 255, 0.06), transparent 60%), #07040d; }

/* ---- walking into a machine: the cabinet comes at you until the screen fills the view */

a.cabinet.entering .machine {
  transition: transform 0.6s cubic-bezier(0.45, 0, 0.7, 0.2);
  transform: rotateY(0deg) translate3d(0, 75px, 900px);
}
.slot:has(.entering) { z-index: 5; }
.curtain {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #07040d;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s 0.45s;
}
.curtain.on { opacity: 1; }

/* ---- narrow screens: the machines line up in a row you swipe along */

@media (max-width: 1000px) {
  .floor { min-height: 0; }
  .lineup {
    justify-content: flex-start;
    gap: 0;
    padding: 0 calc(50vw - 150px) 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .lineup::-webkit-scrollbar { display: none; }
  .slot { scroll-snap-align: center; }
  .slot:nth-child(1) .machine,
  .slot:nth-child(3) .machine { --turn: 0deg; }
}

@media (prefers-reduced-motion: reduce) {
  .sign { animation: none; }
  .machine, .screen img, .curtain { transition: none; }
}
