:root {
  --stage-w: 1600;
  --stage-h: 900;
  --ink: #f6f1dd;
  --red: #ff3f3f;
  --yellow: #ffe65b;
  --cyan: #6fe9ff;
  --panel: rgba(4, 5, 10, .77);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #010104;
}

body {
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  cursor: crosshair;
}

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(19, 20, 42, .45), transparent 58%),
    #010104;
}

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1600px;
  height: 900px;
  overflow: hidden;
  transform-origin: center center;
  background:
    radial-gradient(circle at 19% 18%, rgba(255, 42, 82, .12), transparent 24%),
    radial-gradient(circle at 79% 76%, rgba(0, 195, 255, .10), transparent 28%),
    linear-gradient(145deg, #03030a 0%, #070713 48%, #010104 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 100px rgba(0,0,0,.9);
  isolation: isolate;
}

#birds {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .92;
}

.ambient {
  position: absolute;
  z-index: 0;
  width: 700px;
  height: 700px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  filter: blur(.2px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: inherit;
}

.ambient::after { inset: 27%; }
.ambient-a { left: -240px; top: -280px; animation: slowSpin 36s linear infinite; }
.ambient-b { right: -220px; bottom: -330px; animation: slowSpin 44s linear infinite reverse; }

.grain {
  position: absolute;
  inset: -100px;
  z-index: 4;
  opacity: .10;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 18% 22%, rgba(255,255,255,.6) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(112deg, transparent 0 8px, rgba(255,255,255,.35) 8px 9px, transparent 9px 17px);
  background-size: 14px 14px, 31px 31px;
  mix-blend-mode: overlay;
  animation: grainMove 7s steps(8) infinite;
}

.grid {
  position: absolute;
  z-index: 2;
  left: 82px;
  right: 82px;
  top: 78px;
  bottom: 78px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 22px;
  perspective: 1400px;
}

.card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 2px solid rgba(246, 241, 221, .62);
  background: var(--panel);
  box-shadow:
    0 15px 28px rgba(0,0,0,.5),
    inset 0 0 0 1px rgba(0,0,0,.8),
    inset 0 0 34px rgba(0,0,0,.36);
  transform: translateZ(0);
}

.card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255,255,255,.15);
  pointer-events: none;
  z-index: 8;
}

.game-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  outline: none;
  transition: transform 300ms cubic-bezier(.18,.9,.22,1), border-color 220ms ease, box-shadow 300ms ease;
  will-change: transform;
}

.game-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.08) brightness(.82);
  transform: scale(1.025);
  transition: transform 550ms cubic-bezier(.18,.9,.22,1), filter 350ms ease;
}

.image-wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0,0,0,.02) 0%, rgba(0,0,0,.08) 46%, rgba(0,0,0,.72) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.026) 0 1px, transparent 1px 4px);
  mix-blend-mode: normal;
  transition: background 250ms ease;
}

.card-index {
  position: absolute;
  z-index: 6;
  left: 17px;
  top: 15px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(0,0,0,.64);
  color: #fff;
  font: 700 15px/1 "Courier New", monospace;
  letter-spacing: .12em;
}

.game-title {
  position: absolute;
  z-index: 6;
  left: 24px;
  right: 22px;
  bottom: 48px;
  display: block;
  color: #fff;
  font: 900 28px/.96 Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: -.04em;
  text-shadow: 0 2px 0 #000, 0 0 18px #000;
  opacity: 0;
  transform: translateY(28px) skewY(-2deg);
  transition: opacity 230ms ease, transform 330ms cubic-bezier(.18,.9,.22,1);
}

.launch {
  position: absolute;
  z-index: 7;
  left: 25px;
  bottom: 19px;
  font: 700 12px/1 "Courier New", monospace;
  letter-spacing: .15em;
  color: var(--yellow);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 260ms ease 70ms, transform 300ms ease 70ms;
}

.game-card:hover,
.game-card:focus-visible {
  z-index: 20;
  transform: translateY(-8px) scale(1.026) rotateX(.6deg);
  border-color: rgba(255,255,255,.95);
  box-shadow:
    0 28px 55px rgba(0,0,0,.72),
    0 0 0 4px rgba(255,63,63,.30),
    0 0 46px rgba(255,63,63,.24),
    inset 0 0 0 1px #000;
}

.game-card:hover img,
.game-card:focus-visible img {
  filter: saturate(1.12) contrast(1.07) brightness(.68);
  transform: scale(1.095);
}

.game-card:hover .image-wash,
.game-card:focus-visible .image-wash {
  background:
    linear-gradient(180deg, rgba(255,40,70,.08), rgba(0,0,0,.22) 42%, rgba(0,0,0,.92) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 4px);
}

.game-card:hover .game-title,
.game-card:focus-visible .game-title,
.game-card:hover .launch,
.game-card:focus-visible .launch {
  opacity: 1;
  transform: none;
}

.game-card:focus-visible { outline: 5px solid var(--yellow); outline-offset: -5px; }

.title-card {
  background:
    radial-gradient(circle at 20% 16%, rgba(255,255,255,.13), transparent 24%),
    linear-gradient(128deg, rgba(121,7,27,.88), rgba(14,6,18,.92) 52%, rgba(0,74,91,.82));
}

.title-card::before {
  content: "";
  position: absolute;
  inset: -60px;
  z-index: 0;
  background:
    repeating-conic-gradient(from 7deg at 38% 52%, rgba(255,234,74,.15) 0 2deg, transparent 2deg 10deg),
    radial-gradient(circle at 38% 52%, transparent 0 25%, rgba(255,255,255,.09) 26% 26.5%, transparent 27% 100%);
  animation: titleOrbit 18s linear infinite;
}

.title-noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    repeating-linear-gradient(96deg, transparent 0 18px, rgba(255,255,255,.08) 18px 20px, transparent 20px 37px),
    repeating-linear-gradient(-7deg, transparent 0 31px, rgba(255,52,52,.18) 31px 33px, transparent 33px 51px);
  animation: titleNoise 8s linear infinite;
}

.title-lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: .72;
  background:
    linear-gradient(23deg, transparent 0 42%, var(--red) 42.3% 42.8%, transparent 43.1%),
    linear-gradient(-16deg, transparent 0 58%, var(--cyan) 58.3% 58.7%, transparent 59%),
    linear-gradient(81deg, transparent 0 67%, var(--yellow) 67.2% 67.6%, transparent 68%);
}

.title-copy {
  position: absolute;
  z-index: 4;
  inset: 24px 25px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.eyebrow,
.subtitle,
.instruction { margin: 0; }

.eyebrow {
  margin-bottom: 10px;
  padding: 6px 8px 5px;
  background: var(--yellow);
  color: #130008;
  font: 900 12px/1 "Courier New", monospace;
  letter-spacing: .17em;
  transform: rotate(-1deg);
}

.title-copy h1 {
  margin: 0;
  color: #fff;
  font: 1000 66px/.78 Arial Black, Arial, sans-serif;
  letter-spacing: -.075em;
  text-shadow: 4px 4px 0 rgba(0,0,0,.82), -2px 2px 0 var(--red);
  transform: skewY(-2deg);
}

.subtitle {
  margin-top: 20px;
  color: #fff;
  font: 900 23px/.9 "Courier New", monospace;
  letter-spacing: -.04em;
  text-shadow: 2px 2px 0 #000;
}

.instruction {
  position: absolute;
  right: -2px;
  bottom: 1px;
  color: var(--cyan);
  font: 700 10px/1 "Courier New", monospace;
  letter-spacing: .14em;
  writing-mode: vertical-rl;
}

.edge-note {
  position: absolute;
  z-index: 5;
  top: 50%;
  color: rgba(255,255,255,.35);
  font: 700 10px/1 "Courier New", monospace;
  letter-spacing: .32em;
  pointer-events: none;
}
.edge-note-left { left: 25px; transform: translateY(-50%) rotate(-90deg); }
.edge-note-right { right: 21px; transform: translateY(-50%) rotate(90deg); }

@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes grainMove {
  0% { transform: translate3d(0,0,0); }
  25% { transform: translate3d(18px,-11px,0); }
  50% { transform: translate3d(-13px,18px,0); }
  75% { transform: translate3d(7px,12px,0); }
  100% { transform: translate3d(0,0,0); }
}
@keyframes titleOrbit { to { transform: rotate(360deg) scale(1.04); } }
@keyframes titleNoise { to { background-position: 122px 0, -93px 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .game-card, .game-card img, .game-title, .launch { transition-duration: .001ms !important; }
}
