:root {
  --bg: #05070a;
  --surface: #0b0f15;
  --surface-2: #101720;
  --line: rgba(255,255,255,.085);
  --text: #edf7ff;
  --muted: #8999aa;
  --cyan: #32e6ff;
  --purple: #9b6cff;
  --red: #ff4d6d;
  --green: #65f7aa;
  --shadow: 0 20px 80px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(50,230,255,.08), transparent 32rem),
    radial-gradient(circle at 90% 15%, rgba(155,108,255,.08), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(5,7,10,.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { min-height: 70px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand { display:flex; align-items:center; gap:12px; font-weight:900; letter-spacing:.16em; font-size:.9rem; }
.brand-mark { width:30px; height:30px; display:grid; place-items:center; border:1px solid rgba(50,230,255,.55); border-radius:8px; box-shadow: inset 0 0 18px rgba(50,230,255,.12), 0 0 22px rgba(50,230,255,.08); color:var(--cyan); }
.nav-links { display:flex; gap:22px; color:var(--muted); font-size:.92rem; }
.nav-links a:hover, .nav-links a.active { color:var(--text); }
.nav-play { padding:10px 15px; border-radius:10px; background:var(--text); color:#081016; font-weight:800; }

.hero { min-height: 76vh; display:grid; grid-template-columns: 1.05fr .95fr; align-items:center; gap:64px; padding:90px 0 70px; }
.kicker { color:var(--cyan); letter-spacing:.18em; font-size:.78rem; font-weight:800; text-transform:uppercase; }
h1 { margin:14px 0 16px; font-size:clamp(3.6rem, 9vw, 7.4rem); line-height:.84; letter-spacing:-.065em; }
.hero-copy { color:var(--muted); max-width:610px; font-size:1.12rem; line-height:1.7; }
.actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:30px; }
.button { background:transparent; color:var(--text); cursor:pointer; font:inherit; display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:0 20px; border:1px solid var(--line); border-radius:12px; font-weight:800; transition:.18s ease; }
.button.primary { color:#041014; background:linear-gradient(135deg, #baf7ff, var(--cyan)); border-color:transparent; box-shadow:0 10px 35px rgba(50,230,255,.16); }
.button:hover { transform:translateY(-2px); border-color:rgba(255,255,255,.2); }

.hero-grid {
  aspect-ratio: 1;
  border:1px solid var(--line);
  border-radius:28px;
  background-color:#071018;
  background-image:
    linear-gradient(rgba(50,230,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50,230,255,.07) 1px, transparent 1px);
  background-size:32px 32px;
  position:relative;
  overflow:hidden;
  box-shadow: var(--shadow), inset 0 0 70px rgba(50,230,255,.035);
}
.hero-territory { position:absolute; border:1px solid; opacity:.82; box-shadow:inset 0 0 25px currentColor, 0 0 25px color-mix(in srgb, currentColor 30%, transparent); }
.hero-territory.a { color:var(--cyan); left:10%; top:48%; width:32%; height:25%; background:rgba(50,230,255,.12); }
.hero-territory.b { color:var(--purple); right:10%; top:14%; width:25%; height:22%; background:rgba(155,108,255,.12); }
.hero-trail { position:absolute; left:40%; top:48%; width:34%; height:2px; background:var(--cyan); box-shadow:0 0 14px var(--cyan); transform-origin:left; transform:rotate(-28deg); }
.hero-dot { width:12px; height:12px; border-radius:3px; position:absolute; left:69%; top:31%; background:#fff; box-shadow:0 0 14px #fff, 0 0 25px var(--cyan); }
.hero-label { position:absolute; left:26px; bottom:24px; font:700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color:rgba(237,247,255,.5); letter-spacing:.14em; }

.section { padding:80px 0; border-top:1px solid var(--line); }
.section-head { display:flex; justify-content:space-between; gap:28px; align-items:end; margin-bottom:28px; }
h2 { margin:6px 0 0; font-size:clamp(2rem,4vw,3.2rem); letter-spacing:-.04em; }
.section-note { color:var(--muted); max-width:500px; line-height:1.6; }

.cards { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.card { padding:24px; min-height:200px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.012)); }
.card-index { color:var(--cyan); font:700 .75rem/1 ui-monospace, monospace; letter-spacing:.12em; }
.card h3 { margin:40px 0 9px; font-size:1.25rem; }
.card p { margin:0; color:var(--muted); line-height:1.65; }

.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; border:1px solid var(--line); border-radius:18px; overflow:hidden; background:var(--line); }
.stat { padding:24px; background:var(--surface); }
.stat strong { display:block; font-size:1.65rem; }
.stat span { color:var(--muted); font-size:.85rem; }

.page-hero { padding:80px 0 48px; }
.page-hero h1 { font-size:clamp(3.2rem,8vw,6rem); }
.page-hero p { color:var(--muted); max-width:700px; font-size:1.06rem; line-height:1.7; }

.update-list { display:grid; gap:16px; padding-bottom:80px; }
.update { display:grid; grid-template-columns:150px 1fr; gap:28px; padding:26px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.018); }
.update-meta { color:var(--muted); font:600 .78rem/1.7 ui-monospace, monospace; }
.update h3 { margin:0 0 10px; font-size:1.35rem; }
.update p, .update li { color:var(--muted); line-height:1.65; }
.update ul { padding-left:20px; margin-bottom:0; }

.dev-card { display:grid; grid-template-columns:220px 1fr; gap:40px; align-items:center; padding:34px; border:1px solid var(--line); border-radius:22px; background:var(--surface); margin-bottom:80px; }
.avatar { aspect-ratio:1; border-radius:20px; display:grid; place-items:center; font-weight:950; font-size:3rem; letter-spacing:-.08em; background:linear-gradient(135deg, rgba(50,230,255,.16), rgba(155,108,255,.16)); border:1px solid rgba(50,230,255,.22); }
.dev-card p { color:var(--muted); line-height:1.75; }
.badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.badge { border:1px solid var(--line); border-radius:999px; padding:8px 11px; color:var(--muted); font-size:.82rem; }

.footer { border-top:1px solid var(--line); padding:28px 0 40px; color:var(--muted); font-size:.86rem; }
.footer-inner { display:flex; justify-content:space-between; gap:24px; }

@media (max-width: 820px) {
  .nav-links { display:none; }
  .hero { grid-template-columns:1fr; padding-top:60px; gap:36px; }
  .hero-grid { max-width:600px; width:100%; }
  .cards { grid-template-columns:1fr; }
  .stats { grid-template-columns:1fr 1fr; }
  .update { grid-template-columns:1fr; gap:10px; }
  .dev-card { grid-template-columns:1fr; }
  .avatar { width:150px; }
}

@media (max-width: 520px) {
  .site-shell { width:min(100% - 22px, 1160px); }
  h1 { font-size:3.6rem; }
  .stats { grid-template-columns:1fr; }
  .section { padding:58px 0; }
  .nav-play { padding:9px 12px; }
  .footer-inner { flex-direction:column; }
}

/* Device + safe-area improvements */
html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: anywhere; }
.nav-inner, .footer-inner { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.button, .nav-play, .game-link { touch-action: manipulation; }

@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero-grid { justify-self: center; }
  .page-hero { padding-top: 58px; }
}

@media (max-width: 680px) {
  .site-shell { width: min(100% - 20px, 1160px); }
  .nav-inner { min-height: 62px; }
  .hero { padding: 48px 0 54px; }
  .hero-copy { font-size: 1rem; line-height: 1.6; }
  .actions .button { flex: 1 1 150px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .card { min-height: auto; }
  .card h3 { margin-top: 26px; }
  .page-hero { padding: 48px 0 34px; }
  .update { padding: 20px; }
  .dev-card { padding: 22px; gap: 24px; }
}

@media (max-width: 430px) {
  h1 { font-size: clamp(3rem, 17vw, 4rem); }
  .brand { gap: 8px; }
  .nav-play { font-size: .82rem; }
  .hero-grid { border-radius: 20px; }
}
