/* =========================================================
   Arcade theme
   Colors and fonts live here at the top.
   Change these variables to re-skin the whole site.
   ========================================================= */

:root {
  --bg: #0e0c1c;          /* night sky behind the arcade */
  --surface: #191633;     /* cabinet body */
  --surface-2: #221e45;   /* cabinet screen bezel */
  --line: #2e2960;        /* thin outlines */
  --amber: #ffb648;       /* marquee bulbs */
  --amber-dim: #7a5a2a;
  --cyan: #53e0d2;        /* score glow */
  --red: #ff5c7a;         /* danger, delete, game over */
  --text: #f2eefc;
  --muted: #9d95c4;
  --radius: 14px;
  --font-display: "Bungee", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

/* The page is a column: header, content, footer. The content
   stretches, so the footer stays at the bottom even when the
   page is short. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; }
a { color: var(--cyan); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.marquee {
  background: linear-gradient(180deg, #241f4d 0%, #161231 100%);
  border-bottom: 2px solid var(--line);
  position: relative;
  overflow: hidden;
}

/* the row of chasing light bulbs along the top edge */
.bulbs {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 10px 0 0;
}

.bulbs span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber-dim);
  animation: chase 1.2s infinite;
}

.bulbs span:nth-child(3n+1) { animation-delay: 0s; }
.bulbs span:nth-child(3n+2) { animation-delay: 0.4s; }
.bulbs span:nth-child(3n)   { animation-delay: 0.8s; }

@keyframes chase {
  0%, 100% { background: var(--amber-dim); box-shadow: none; }
  50% { background: var(--amber); box-shadow: 0 0 10px 2px rgba(255, 182, 72, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .bulbs span { animation: none; background: var(--amber); }
}

.marquee-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 22px;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  margin: 0;
  letter-spacing: 1px;
  color: var(--amber);
  text-shadow: 0 0 24px rgba(255, 182, 72, 0.35);
}

.site-title a { color: inherit; text-decoration: none; }

.nav { display: flex; gap: 18px; align-items: center; }

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--amber);
  background: var(--amber);
  color: #241a05;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.08); }

.btn.ghost {
  background: transparent;
  color: var(--amber);
}

.btn.small { padding: 6px 12px; font-size: 0.85rem; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Game cabinet cards ---------- */

.hero {
  padding: 44px 0 10px;
}

.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  margin: 0 0 6px;
}

.hero p { color: var(--muted); margin: 0; max-width: 56ch; }

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  padding: 30px 0 60px;
}

.cabinet {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cabinet:hover {
  transform: translateY(-4px);
  border-color: var(--amber);
}

.cabinet .screen {
  background: radial-gradient(circle at 50% 35%, #2c2666 0%, var(--surface-2) 70%);
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  height: 150px;
  border-bottom: 2px solid var(--line);
}

.cabinet .panel { padding: 16px; }

.cabinet h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--amber);
}

.cabinet p { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }

.cabinet .play-hint {
  font-weight: 700;
  color: var(--cyan);
  font-size: 0.9rem;
}

.cabinet.soon {
  opacity: 0.65;
  border-style: dashed;
}

.cabinet.soon:hover { transform: none; border-color: var(--line); }

/* ---------- Game page ---------- */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 26px;
  padding: 30px 0 60px;
  align-items: start;
}

@media (max-width: 800px) {
  .game-layout { grid-template-columns: 1fr; }
}

.game-frame-box {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.game-frame-box iframe {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  background: #000;
}

.game-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 0 4px;
  flex-wrap: wrap;
}

.game-title-row h2 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--amber);
}

.score-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border: 2px solid var(--cyan);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.score-banner.visible { display: flex; }

.score-banner strong { color: var(--cyan); font-size: 1.15rem; }

/* ---------- Leaderboard ---------- */

.board {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.board h3 {
  font-family: var(--font-display);
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--amber);
}

.board ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.board li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.board li:last-child { border-bottom: 0; }

.board li .rank { color: var(--muted); min-width: 2ch; }
.board li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .pts { color: var(--cyan); font-weight: 700; }

.board .note { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }

/* ---------- Sign in area ---------- */

.signin {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 22px;
}

.signin h3 {
  font-family: var(--font-display);
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--amber);
}

.signin input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.signin .who { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }
.signin .who b { color: var(--text); }
.signin .verified { color: var(--cyan); font-size: 0.78rem; white-space: nowrap; }
.signin .upgrade { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.signin .or { color: var(--muted); text-align: center; margin: 14px 0 8px; font-size: 0.85rem; }

/* ---------- Share menu ---------- */

.share-menu {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.share-menu.open { display: flex; }

/* ---------- About page ---------- */

.about {
  max-width: 640px;
  padding: 40px 0 70px;
}

.about h2 {
  font-family: var(--font-display);
  color: var(--amber);
}

.about .card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 18px;
}

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

.footer {
  border-top: 2px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 2px solid var(--cyan);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 50;
}

.toast.show { opacity: 1; }
