:root {
  --bg: #030817;
  --bg-2: #07142d;
  --panel: rgba(8, 26, 62, 0.88);
  --panel-strong: #081f49;
  --line: rgba(66, 143, 255, 0.34);
  --text: #f4fbff;
  --muted: #9bbfe9;
  --cyan: #5eeaff;
  --lime: #92ff4f;
  --yellow: #ffe34f;
  --orange: #ffab2e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button, canvas { user-select: none; }

.site-background {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 4%, rgba(28, 100, 217, 0.34), transparent 34%),
    radial-gradient(circle at 14% 32%, rgba(0, 224, 255, 0.10), transparent 25%),
    linear-gradient(180deg, #061a3d 0%, #040d21 42%, #020611 100%);
}
.site-grid {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    linear-gradient(rgba(86, 146, 226, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 146, 226, .08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 92%);
}
.site-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .2; }
.site-glow-a { width: 400px; height: 400px; left: -120px; top: 28vh; background: #00d5ff; }
.site-glow-b { width: 460px; height: 460px; right: -160px; top: 55vh; background: #72ff44; opacity: .10; }

.shell { width: min(1480px, 96vw); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(85, 151, 255, .18);
  background: rgba(2, 7, 20, .84);
  backdrop-filter: blur(18px) saturate(130%);
}
.nav { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ffb536;
  text-decoration: none;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .12em;
  text-shadow: 0 2px 0 #5b3100;
}
.brand-mark {
  width: 19px;
  height: 19px;
  border: 3px solid #ffb536;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 3px rgba(255,181,54,.16), 0 0 14px rgba(255,181,54,.18);
}
.links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.links a {
  position: relative;
  color: #acd0fa;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition: color .2s ease;
}
.links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 2px;
  background: var(--cyan);
  transition: right .2s ease;
}
.links a:hover { color: #fff; }
.links a:hover::after { right: 0; }

.hero { padding: 68px 0 28px; text-align: center; }
.eyebrow {
  display: inline-block;
  color: #8bb9ef;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .23em;
  text-transform: uppercase;
}
.logo {
  margin: 14px 0 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(56px, 10vw, 120px);
  line-height: .88;
  letter-spacing: .055em;
  color: var(--lime);
  -webkit-text-stroke: 3px #173308;
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 #d9ff8c,
    0 9px 0 #2d6716,
    0 14px 0 #122807,
    0 28px 48px rgba(0,0,0,.52),
    0 0 40px rgba(141,255,78,.12);
  transform: skew(-2deg);
}
.logo span { color: var(--cyan); -webkit-text-stroke-color: #08313c; text-shadow: 0 4px 0 #d9fbff, 0 9px 0 #17667b, 0 14px 0 #0a2932, 0 28px 48px rgba(0,0,0,.52); }
.tagline { max-width: 760px; margin: 24px auto 0; color: #bdd6f5; font-size: clamp(14px, 2vw, 17px); font-weight: 650; line-height: 1.65; }

.game-shell {
  width: min(1380px, 100%);
  max-width: none;
  margin: 26px auto 0;
  overflow: hidden;
  border: 1px solid rgba(93, 160, 255, .55);
  border-radius: 16px;
  background: #06142e;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 0 0 7px rgba(0, 0, 0, .18),
    0 30px 90px rgba(0,0,0,.52),
    0 0 50px rgba(33, 112, 255, .08);
}
.game-toolbar, .game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(8, 24, 53, .98), rgba(4, 15, 35, .98));
  color: #a7c8ee;
  font-size: 12px;
  font-weight: 750;
}
.game-toolbar { border-bottom: 1px solid rgba(67, 142, 245, .30); }
.game-footer { border-top: 1px solid rgba(67, 142, 245, .30); }
.toolbar-label { margin-right: 9px; color: var(--cyan); font-size: 10px; letter-spacing: .14em; font-weight: 950; }
.game-toolbar strong { color: #fff; font-size: 13px; }
.game-stats { display: flex; gap: 17px; color: #d8ebff; font-variant-numeric: tabular-nums; }
#best { color: var(--yellow); }
#crystalCount { color: var(--lime); }
.canvas-wrap { position: relative; background: #0a2d67; overflow: hidden; }
#game { display: block; width: 100%; aspect-ratio: 1280 / 656; min-height: 520px; cursor: pointer; touch-action: none; }
.scanline {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: .10;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.06) 0, rgba(255,255,255,.06) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: soft-light;
}
kbd {
  display: inline-block;
  min-width: 24px;
  margin: 0 2px;
  padding: 2px 6px 3px;
  border: 1px solid #476d9d;
  border-bottom-width: 3px;
  border-radius: 5px;
  color: #fff;
  background: #0c254d;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.feature-grid { max-width: 1080px; margin: 22px auto 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-card, .panel, .about-card {
  border: 1px solid rgba(62, 134, 233, .33);
  background: linear-gradient(150deg, rgba(13, 48, 105, .86), rgba(5, 20, 49, .92));
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 16px 36px rgba(0,0,0,.20);
}
.feature-card { position: relative; overflow: hidden; padding: 21px; border-radius: 14px; }
.feature-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -30px; top: -35px; border-radius: 50%; background: rgba(70, 189, 255, .08); filter: blur(2px); }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 14px; border: 1px solid rgba(108, 182, 255, .25); border-radius: 10px; background: rgba(2, 14, 34, .42); font-size: 21px; box-shadow: inset 0 0 16px rgba(65, 162, 255, .08); }
.feature-card h2 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { min-height: 67px; margin: 0; color: #a9c9ed; font-size: 13px; line-height: 1.55; }
.pill { display: inline-block; margin-top: 15px; padding: 7px 9px; border: 1px solid rgba(94, 156, 228, .35); border-radius: 7px; background: rgba(2, 11, 27, .48); color: #dcebff; font-size: 9px; font-weight: 950; letter-spacing: .11em; }

.content-section { max-width: 1080px; margin: 0 auto 48px; }
.section-heading { text-align: center; margin-bottom: 20px; }
.section-heading h2 { margin: 7px 0 0; font-size: 28px; }
.info-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.panel { border-radius: 14px; padding: 18px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 13px; border-bottom: 1px solid rgba(80, 139, 213, .22); font-weight: 900; }
.panel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.news-item { padding: 15px 0; border-bottom: 1px solid rgba(80, 139, 213, .18); }
.news-item:last-child, .board-row:last-child { border-bottom: 0; }
.news-item time { color: #6fa9e3; font-size: 10px; font-weight: 800; }
.news-item strong { display: block; margin: 4px 0 4px; font-size: 14px; }
.news-item p { margin: 0; color: #a9c6e9; font-size: 12px; line-height: 1.5; }
.board-row { display: grid; grid-template-columns: 44px 1fr 80px; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid rgba(80, 139, 213, .18); font-size: 13px; }
.rank { color: var(--yellow); font-weight: 950; }
.score { color: var(--cyan); font-weight: 950; text-align: right; font-variant-numeric: tabular-nums; }

.about-card { max-width: 1080px; margin: 0 auto 58px; padding: 24px; border-radius: 14px; display: grid; grid-template-columns: .7fr 1.3fr; align-items: center; gap: 26px; }
.about-card h2 { margin: 5px 0 0; }
.about-card p { margin: 0; color: #abc8ea; font-size: 13px; line-height: 1.65; }

footer { border-top: 1px solid rgba(63, 124, 204, .22); background: rgba(2, 8, 20, .88); }
.footer-inner { padding: 28px 0 34px; text-align: center; color: #6f96c2; font-size: 11px; }
.footer-inner p { margin: 8px 0; }
.socials { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.socials span { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(76, 138, 211, .38); border-radius: 7px; background: #082758; color: #fff; font-weight: 900; box-shadow: inset 0 1px rgba(255,255,255,.05); }

.modal { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(10px); }
.modal.show { display: grid; }
.modal-card { width: min(540px, 92vw); padding: 29px; border: 1px solid rgba(86, 165, 255, .68); border-radius: 18px; text-align: center; background: linear-gradient(150deg, #0a3472, #061731 72%); box-shadow: 0 28px 90px #000, inset 0 1px rgba(255,255,255,.08); }
.modal-badge { display: inline-block; padding: 6px 9px; border-radius: 6px; background: rgba(135,255,75,.12); color: var(--lime); font-size: 9px; font-weight: 950; letter-spacing: .16em; }
.modal-card h2 { margin: 13px 0 8px; font-size: 30px; }
.modal-card p { margin: 0 0 22px; color: #afd0f4; }
.button { border: 0; border-radius: 9px; padding: 12px 20px; cursor: pointer; color: #102d08; background: var(--lime); font-weight: 950; box-shadow: 0 5px 0 #3d7b1d, 0 0 24px rgba(143,255,79,.16); }
.button:active { transform: translateY(2px); box-shadow: 0 3px 0 #3d7b1d; }

@media (max-width: 820px) {
  #game { min-height: 0; }
  .nav { align-items: flex-start; padding: 12px 0; }
  .links { justify-content: flex-end; gap: 10px 14px; }
  .hero { padding-top: 46px; }
  .feature-grid, .info-grid, .about-card { grid-template-columns: 1fr; }
  .feature-card p { min-height: 0; }
  .game-toolbar, .game-footer { font-size: 10px; }
  .game-stats { gap: 9px; }
}
@media (max-width: 560px) {
  .brand { font-size: 11px; }
  .links a { font-size: 11px; }
  .links a:nth-child(2), .links a:nth-child(5) { display: none; }
  .logo { -webkit-text-stroke-width: 2px; }
  .game-toolbar { align-items: flex-start; }
  .game-stats { flex-direction: column; gap: 2px; text-align: right; }
  .game-footer { flex-direction: column; align-items: flex-start; gap: 7px; }
  .about-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .links a::after { transition: none; }
}
