:root {
  --bg: light-dark(#edf4f3,#0a141a);
  --panel: light-dark(#fff,#101f27);
  --panel2: light-dark(#f0f7f6,#142832);
  --ink: light-dark(#11242c,#edf9f8);
  --muted: light-dark(#405a62,#a8c1c5);
  --line: light-dark(#cddedc,#2e4651);
  --forest: #0d2029; --forest2: #1a3945;
  --leaf: #64e0be; --leafd: light-dark(#005f50,#75e6cc);
  --shadow: 0 2px 5px #09181f0b; --r: 12px;
  --accent: #78e7ca; --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
body { background-image: linear-gradient(90deg,#578e8e0b 1px,transparent 1px),linear-gradient(#578e8e0b 1px,transparent 1px); background-size: 32px 32px; }
.rail { border-right: 1px solid #324b54; padding: 28px 16px 18px; }
.brand { letter-spacing: -.045em; }
.brand img { width: 38px; height: 38px; border: 1px solid #40636b; border-radius: 9px; }
.brand small,.eyebrow { font: 700 .72rem/1.45 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.nav { border: 1px solid transparent; border-radius: 8px; }
.nav[aria-current=page] { background: #1a383f; color: #aff6e5; border-color: #3b6567; box-shadow: inset 2px 0 #78e7ca; }
.nav[aria-current=page] svg { color: var(--accent); }
.rankcard { border: 1px solid #35505b; background: #112932; }
.rankcard .xpbar i { background: linear-gradient(90deg,#4eaba9,var(--accent)); }
.btn,.chip,.qcard,.dom,.fig,.plate,.gamewrap { border-radius: 10px; }
.btn.pri:not(:disabled) { background: #72e2c4; border-color: #72e2c4; color: #082d27; }
.btn.pri:not(:disabled):hover { background: #a4f7e2; }
.screen .btn.pri:not(:disabled) { box-shadow: 0 3px 0 #216b61,0 8px 20px #0005; }
.qcard { box-shadow: 0 10px 30px #10252d17; }
.qcard .pill { color: #243c43; background: #eef6f5; border-color: #cfdedc; }
.hero { border: 1px solid #365760; border-radius: 14px; min-height: 365px; grid-template-columns: minmax(0,1.37fr) minmax(0,1fr); }
.hero .art { background: radial-gradient(ellipse at 79% 43%,#1c414b,#0d2029 69%); }
.hero .art::after { content:''; position:absolute; inset:0; background-image:linear-gradient(#a1e7e50d 1px,transparent 1px),linear-gradient(90deg,#a1e7e50d 1px,transparent 1px); background-size:28px 28px; mask-image:linear-gradient(90deg,transparent,#000 44%); }
.hero .copy { z-index: 1; padding: clamp(22px,4vw,50px); gap: 18px; }
.hero .eyebrow { color: #9fead8; }
.hero h1 { font-size: clamp(2.35rem,4.65vw,5rem); font-weight: 780; letter-spacing: -.065em; text-wrap: initial; line-height: .99; }
.hero h1 span { display:block; color:#9fead8; }
.hero p { color:#c1d6da; }
.hero .ringwrap { position:relative; min-height: 260px; background: url('../img/contours.svg') center / min(105%,430px) auto no-repeat; }
.ring { width: min(196px,52vw); background:#0c242de8; box-shadow:0 0 0 1px #8ce8d12d; }
.ring .lbl b,.stat b,.dom .pct,.timer { font-family: var(--mono); font-variant-numeric:tabular-nums; }
.ring .lbl span { color:#b2cfd3; }
.hero .instrument-id { position:absolute; bottom:14px; right:16px; color:#a3c5ca; font: 650 .68rem var(--mono); letter-spacing:.08em; }
.stat { border-top: 2px solid light-dark(#4c9185,#548982); }
.sechead { padding-bottom:10px; border-bottom:1px solid var(--line); }
.bar { border-radius:3px; }
.bar i { border-radius:2px; }
.install-trigger { min-height:44px; white-space:nowrap; }
.topbar .install-trigger { background:#1b3a44; border-color:#536c74; color:#d9f8ef; padding:6px 10px; font-size:.75rem; }
.install-guide:not([open]) { display:none; }
.install-guide { max-width: min(420px,calc(100vw - 24px)); background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:14px; padding:22px; }
.install-guide::backdrop { background:#06161dc9; }
.install-guide p { margin:12px 0; }
.install-guide form { margin-top:16px; }
[hidden] { display:none !important; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0,1fr) minmax(0,.6fr); }
  .topbar .brand { flex: 1; }
  .tabbar button[aria-current=page] { box-shadow: inset 0 2px var(--leafd); }
}
@media (max-width: 640px) {
  main { padding-bottom:calc(88px + env(safe-area-inset-bottom)); }
  .hero { grid-template-columns: minmax(0,1fr); }
  .hero .ringwrap { min-height:240px; padding:0 0 18px; background-size:300px; }
  .hero .instrument-id { bottom:8px; }
  .hero .copy { gap:12px; }
  .hero .btn { min-height:48px; }
  .touch button { min-width:49px; min-height:49px; touch-action:none; }
  .touch .pad { gap:6px; }
}
@media (max-width: 360px) { .topbar .xp { display:none; } }
