:root {
  --night: #140c33;
  --deep: #0b0720;
  --violet: #a78bfa;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --gold: #fde047;
  --ink: #f5f3ff;
  --muted: #c4b5fd;
  --blue-team: #38bdf8;
  --orange-team: #fb923c;
  --pixel: "Press Start 2P", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 10%, #3b1d7a 0%, var(--night) 45%, var(--deep) 100%) fixed;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Backdrop ---------- */
.sky { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow: hidden; z-index: 0; }

.stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: twinkle 3s ease-in-out infinite;
}

.sun {
  position: absolute;
  left: 50%;
  bottom: 34%;
  width: 46vmin;
  height: 46vmin;
  margin-left: -23vmin;
  border-radius: 50%;
  background: linear-gradient(180deg, #fde047 0%, #f472b6 55%, #8b5cf6 100%);
  opacity: 0.22;
  filter: blur(2px);
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 20px);
  mask-image: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 20px);
}

/* A neon waffle iron rolling toward you. */
.floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 36%;
  perspective: 320px;
  perspective-origin: 50% 0%;
  border-top: 2px solid rgba(244, 114, 182, 0.8);
  box-shadow: 0 -10px 40px rgba(244, 114, 182, 0.45);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.35), rgba(11, 7, 32, 0) 70%);
}

.grid {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 300%;
  transform-origin: 50% 0%;
  transform: rotateX(62deg);
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.75) 3px, transparent 3px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.75) 3px, transparent 3px),
    radial-gradient(circle at 50% 50%, rgba(253, 224, 71, 0.16) 0 30%, transparent 62%);
  background-size: 64px 64px;
  animation: roll 2.4s linear infinite;
}

.drifters span {
  position: absolute;
  bottom: -60px;
  opacity: 0.5;
  animation: drift linear infinite;
}

.drifters svg { display: block; }

/* ---------- HUD ---------- */
.hud {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  font-family: var(--pixel);
  font-size: clamp(0.55rem, 1.1vw, 0.85rem);
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
}

.hud > span { white-space: nowrap; }
.hud b { color: var(--pink); font-weight: normal; }
.hud span span { color: var(--gold); }

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding: 0 clamp(1rem, 4vw, 3rem) 2rem;
}

.hero {
  flex: 1 1 340px;
  max-width: 560px;
  text-align: center;
}

.games {
  flex: 1 1 380px;
  max-width: 560px;
}

/* ---------- Waffle ---------- */
.badge {
  position: relative;
  display: block;
  width: min(72vw, 44vh, 420px);
  height: min(72vw, 44vh, 420px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  animation: bob 4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.badge img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
  user-select: none;
  -webkit-user-drag: none;
}

.halo {
  position: absolute;
  top: -7%;
  left: -7%;
  width: 114%;
  height: 114%;
  border-radius: 50%;
  background: conic-gradient(var(--cyan), var(--purple), var(--pink), var(--gold), var(--cyan));
  filter: blur(18px);
  opacity: 0.75;
  animation: spin 9s linear infinite;
}

.badge.boop img { animation: boop 0.45s ease; }
.badge:focus-visible { outline: 4px solid var(--gold); outline-offset: 10px; }

.bubble {
  position: absolute;
  top: 2%;
  right: -6%;
  padding: 0.7em 0.9em;
  font-family: var(--pixel);
  font-size: clamp(0.6rem, 1.2vw, 0.85rem);
  color: var(--deep);
  background: #fff;
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--pink);
  opacity: 0;
  transform: translateY(8px) scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  pointer-events: none;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -10px;
  border: 6px solid transparent;
  border-top-color: #fff;
  border-left-color: #fff;
}

.bubble.show { opacity: 1; transform: none; }

.title {
  margin: 1.4rem 0 0.6rem;
  font-family: var(--pixel);
  font-weight: normal;
  font-size: clamp(1.3rem, 3.6vw, 2.6rem);
  line-height: 1.3;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--purple), 0 0 24px rgba(253, 224, 71, 0.5);
}

.title span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.42em;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}

.tagline {
  margin: 0 auto;
  max-width: 30em;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  line-height: 1.5;
  color: var(--muted);
  text-shadow: 0 2px 6px #0b0720, 0 0 14px #0b0720;
}

.press {
  margin: 1.2rem 0 0;
  font-family: var(--pixel);
  font-size: clamp(0.6rem, 1.1vw, 0.8rem);
  color: var(--pink);
}

/* ---------- Game cabinet ---------- */
.shelf-title {
  margin: 0 0 1rem;
  text-align: center;
  font-family: var(--pixel);
  font-weight: normal;
  font-size: clamp(0.75rem, 1.4vw, 1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.9);
}

.shelf-title span { color: var(--gold); }

.cabinet {
  position: relative;
  padding: 0 1.2rem 1.4rem;
  border-radius: 22px 22px 16px 16px;
  background: linear-gradient(180deg, #2a1660, #1a0f40 60%, #140b33);
  border: 3px solid var(--purple);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35), 0 0 40px rgba(139, 92, 246, 0.55), 0 24px 50px rgba(0, 0, 0, 0.5);
}

.marquee {
  margin: -3px -1.2rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 20px 20px 0 0;
  text-align: center;
  font-family: var(--pixel);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  color: #fff;
  background: linear-gradient(90deg, var(--blue-team), #60a5fa 45%, #fdba74 55%, var(--orange-team));
  text-shadow: 3px 3px 0 rgba(15, 23, 42, 0.6);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 0 26px rgba(56, 189, 248, 0.5);
}

.screen {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 6px solid #0b0720;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 0 2px #3b2a7a;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #3b82d6, #7dbcef 55%, #d8eefb);
}

.scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 4px);
  pointer-events: none;
}

.pitch { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
.pitch i { position: absolute; display: block; }

.pitch::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 22%;
  bottom: 12%;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, #5fae4e 0 10%, #56a246 10% 20%);
  box-shadow: 0 8px 0 #7a5a3c, 0 14px 18px rgba(0, 0, 0, 0.25);
}

.cloud { width: 22%; height: 14%; background: #fff; border-radius: 999px; box-shadow: 18px -8px 0 2px #fff; opacity: 0.9; }
.c1 { left: 6%; top: 6%; animation: float-x 9s ease-in-out infinite; }
.c2 { right: 10%; top: 3%; width: 16%; animation: float-x 11s ease-in-out infinite reverse; }

.line { left: 50%; top: 22%; bottom: 12%; width: 2px; background: rgba(255, 255, 255, 0.7); }
.circle { left: 50%; top: 55%; width: 14%; padding-top: 14%; margin: -7% 0 0 -7%; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 50%; }
.goal { top: 44%; width: 3%; height: 22%; border: 3px solid #fff; }
.gl { left: 6.5%; border-right: 0; border-color: var(--blue-team); }
.gr { right: 6.5%; border-left: 0; border-color: var(--orange-team); }

.p { width: 7%; padding-top: 7%; border-radius: 4px; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), 0 4px 0 rgba(0, 0, 0, 0.2); }
.blue { background: var(--blue-team); }
.orange { background: var(--orange-team); }
.b1 { left: 26%; top: 36%; animation: jog-a 3.2s ease-in-out infinite; }
.b2 { left: 34%; top: 64%; animation: jog-b 2.6s ease-in-out infinite; }
.o1 { left: 62%; top: 40%; animation: jog-b 3s ease-in-out infinite; }
.o2 { left: 70%; top: 62%; animation: jog-a 2.8s ease-in-out infinite; }

.ball {
  left: 49%;
  top: 52%;
  width: 3.4%;
  padding-top: 3.4%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  animation: ball 4s ease-in-out infinite;
}

.panel {
  position: relative;
  height: 46px;
  margin: 0.9rem 0.6rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #4b4f63, #2d3042);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.15);
}

.panel i { position: absolute; display: block; border-radius: 50%; }
.stick { left: 16%; top: -14px; width: 26px; height: 26px; background: var(--violet); box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.25), 0 14px 0 -9px #1f2130; }
.btn { top: 11px; width: 30px; height: 20px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.3); }
.btn.cyan { right: 76px; background: var(--cyan); }
.btn.violet { right: 32px; background: var(--purple); }

.info p { margin: 0 0 0.9rem; line-height: 1.5; color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.actions a {
  flex: 1 1 200px;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.02rem;
  transition: transform 0.12s, box-shadow 0.12s;
}

.play {
  color: #1a0f40;
  background: var(--gold);
  box-shadow: 0 6px 0 #ca8a04, 0 0 24px rgba(253, 224, 71, 0.45);
}

.join {
  color: var(--ink);
  background: rgba(34, 211, 238, 0.14);
  border: 2px solid var(--cyan);
  box-shadow: 0 6px 0 rgba(8, 145, 178, 0.7);
}

.actions a:hover, .actions a:focus-visible { transform: translateY(-3px); }
.actions a:active { transform: translateY(4px); box-shadow: none; }
.actions a:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }

.footer {
  position: relative;
  z-index: 1;
  padding: 1rem;
  text-align: center;
  font-family: var(--pixel);
  font-size: 0.6rem;
  color: rgba(196, 181, 253, 0.75);
}

.blink { animation: blink 1.1s steps(2, start) infinite; }

/* ---------- Motion ---------- */
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes roll { from { background-position: 0 0; } to { background-position: 0 64px; } }
@keyframes drift { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-115vh) rotate(8deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes boop { 0% { transform: scale(1); } 30% { transform: scale(0.9) rotate(-4deg); } 60% { transform: scale(1.06) rotate(3deg); } 100% { transform: scale(1); } }
@keyframes blink { to { visibility: hidden; } }
@keyframes float-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }
@keyframes jog-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(22px, 10px); } }
@keyframes jog-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-18px, -12px); } }
@keyframes ball {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-280%, -150%); }
  50% { transform: translate(260%, 120%); }
  75% { transform: translate(560%, -60%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Laptops and short screens: keep both games buttons above the fold. */
@media (min-width: 900px) and (max-height: 860px) {
  .badge { width: min(40vh, 420px); height: min(40vh, 420px); }
  .title { margin-top: 1rem; }
  .games { max-width: 470px; }
  .shelf-title { margin-bottom: 0.6rem; }
  .marquee { padding: 0.6rem 1rem; margin-bottom: 0.7rem; }
  .panel { height: 34px; margin: 0.8rem 0.6rem 0.8rem; }
  .info p { font-size: 0.92rem; margin-bottom: 0.6rem; }
  .chips { margin-bottom: 0.9rem; }
  .chips li { font-size: 0.78rem; padding: 0.28rem 0.6rem; }
  .actions a { padding: 0.75rem 0.8rem; font-size: 0.95rem; }
}

@media (max-width: 760px) {
  .hud .credits { display: none; }
  .stage { padding-top: 0.5rem; }
}
