:root {
  --bg: #061a20;
  --bg-soft: #0c2530;
  --surface: #0f2d38;
  --surface-2: #163b47;
  --border: #1f4a56;
  --coral: #ff6b4a;
  --coral-dim: #cc4f34;
  --teal: #14b8a6;
  --teal-dim: #0d8c7e;
  --text: #eef8f7;
  --text-muted: #8fb3ae;
  --text-faint: #5e7f7a;
  --good: #7ee787;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-display: 'Baloo 2', 'Arial Rounded MT Bold', sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --shadow-glow: 0 0 40px rgba(20, 184, 166, 0.15), 0 0 80px rgba(255, 107, 74, 0.1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(20, 184, 166, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(255, 107, 74, 0.12), transparent);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); }
.grad-text {
  background: linear-gradient(100deg, var(--coral) 0%, var(--teal) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-header {
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(10px);
  background: rgba(6, 26, 32, 0.75); border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo {
  font-family: var(--font-display); font-size: 19px; letter-spacing: 0.01em;
  text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.logo-mark { width: 26px; height: 26px; }
.main-nav { display: flex; gap: 28px; }
.main-nav a { text-decoration: none; font-size: 14px; font-weight: 700; color: var(--text-muted); transition: color 0.15s ease; }
.main-nav a:hover { color: var(--text); }
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .main-nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--bg-soft);
    border-bottom: 1px solid var(--border); padding: 16px 24px 24px; gap: 16px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle {
    display: block; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  }
}
.btn {
  font-family: var(--font-body); font-weight: 800; font-size: 14px; border-radius: 999px; padding: 12px 22px;
  border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary { background: linear-gradient(100deg, var(--coral), var(--teal)); color: #04141a; box-shadow: 0 8px 24px rgba(255, 107, 74, 0.25); }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 107, 74, 0.4); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--teal-dim); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 50px); line-height: 1.1; margin: 14px 0 18px; }
.hero p.lede { color: var(--text-muted); font-size: 17px; max-width: 44ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cabinet {
  position: relative; background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-glow);
}
.cabinet-marquee {
  display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.cabinet-marquee .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good);
  display: inline-block; margin-right: 6px; animation: blink 1.6s infinite ease-in-out;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.attract-canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-md); background: #04141a; border: 1px solid var(--border); }
.cabinet-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
section { padding: 56px 0; }
.section-head { margin-bottom: 32px; max-width: 60ch; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); margin: 10px 0 10px; }
.section-head p { color: var(--text-muted); margin: 0; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.game-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s ease, transform 0.15s ease; }
.game-card:hover { border-color: var(--teal-dim); transform: translateY(-3px); }
.game-thumb { aspect-ratio: 16 / 10; background: var(--bg-soft); padding: 18px; }
.game-thumb svg { width: 100%; height: 100%; }
.game-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-body h3 { margin: 0; font-size: 17px; }
.game-body p { margin: 0; color: var(--text-muted); font-size: 13.5px; flex: 1; }
.game-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.game-meta .score { color: var(--coral); }
.board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.board-row { display: grid; grid-template-columns: 2fr 1fr 1fr; padding: 14px 20px; border-bottom: 1px solid var(--border); align-items: center; font-size: 14px; }
.board-row:last-child { border-bottom: none; }
.board-row.head { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); background: var(--bg-soft); }
.board-row .val { font-family: var(--font-mono); color: var(--coral); }
.board-note { padding: 12px 20px; font-size: 12.5px; color: var(--text-faint); }
.devlog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.devlog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.devlog-card .date { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.devlog-card h3 { margin: 10px 0 8px; font-size: 16px; }
.devlog-card p { margin: 0; color: var(--text-muted); font-size: 14px; }
.about-block { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 780px) { .about-block { grid-template-columns: 1fr; } }
.about-block p { color: var(--text-muted); }
.stat-row { display: flex; gap: 28px; margin-top: 20px; flex-wrap: wrap; }
.stat-row div strong { display: block; font-family: var(--font-mono); font-size: 24px; color: var(--text); }
.stat-row div span { font-size: 12px; color: var(--text-faint); }
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 24px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-faint); }
.footer-row a { text-decoration: none; color: var(--text-muted); }
.footer-row a:hover { color: var(--text); }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4, 20, 26, 0.85); backdrop-filter: blur(4px); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-glow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 15px; }
.modal-close { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }
.modal-close:hover { color: var(--text); border-color: var(--teal-dim); }
.modal-body { padding: 16px 18px 20px; }
.game-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #04141a; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.game-stage canvas { width: 100%; height: 100%; display: block; }
.game-hud { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; margin: 12px 0; color: var(--text-muted); }
.game-hud .val { color: var(--coral); font-weight: 700; }
.game-controls { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.game-hint { font-size: 12px; color: var(--text-faint); }
.game-overlay {
  position: absolute; inset: 0; background: rgba(4, 20, 26, 0.88); display: none; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 20px;
}
.game-overlay.show { display: flex; }
.game-overlay h4 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.game-overlay p { margin: 0; color: var(--text-muted); font-size: 13px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--surface-2);
  border: 1px solid var(--teal-dim); color: var(--text); padding: 12px 20px; border-radius: 999px; font-size: 13px;
  font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
