:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin:0; width:100%; height:100%; overflow:hidden; background:#05070b; }
body { touch-action:none; overscroll-behavior:none; }
button, a { font:inherit; }
#app {
  position:fixed;
  left:50%;
  top:50%;
  width:393px;
  height:852px;
  transform:translate(-50%, -50%) scale(var(--game-scale, 1));
  transform-origin:center center;
  overflow:hidden;
  background:#080b12;
  box-shadow:0 24px 80px rgba(0,0,0,.55);
}
#game {
  display:block;
  width:393px;
  height:852px;
  touch-action:none;
  cursor:crosshair;
}

.score {
  position:absolute; z-index:5; top:calc(64px + var(--safe-top)); left:50%; transform:translateX(-50%);
  font-size:24px; line-height:24px; font-weight:600; color:rgba(245,245,248,.90);
  font-variant-numeric: tabular-nums; pointer-events:none; text-shadow:0 0 10px rgba(0,0,0,.48);
}

.dodge-hud {
  position:absolute; z-index:5; left:23px; top:50%; transform:translateY(-50%);
  display:flex; align-items:flex-start; gap:12px; pointer-events:none;
}
.dodge-track {
  position:relative; width:10px; height:min(32vh, 180px);
  border:1px solid rgba(148,180,226,.46);
  background:rgba(255,255,255,.04);
  box-shadow:0 0 0 rgba(0,0,0,0);
}
.dodge-fill {
  position:absolute; left:0; right:0; bottom:0; height:100%;
  background:rgba(92,209,255,.84);
  transform-origin:center bottom;
}
.dodge-word {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%) rotate(-90deg);
  color:rgba(250,250,252,.98); font-size:13px; font-weight:800; letter-spacing:1.6px;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,.78), 1px -1px 0 rgba(0,0,0,.78),
    -1px 1px 0 rgba(0,0,0,.78), 1px 1px 0 rgba(0,0,0,.78);
  white-space:nowrap;
}
.dodge-status { color:rgba(212,217,224,.82); font-size:12px; white-space:nowrap; padding-top:1px; }

.level-hud {
  position:absolute; z-index:5; left:50%; bottom:calc(34px + var(--safe-bottom));
  width:min(320px, calc(100% - 52px)); transform:translateX(-50%); pointer-events:none; text-align:center;
}
.level-label { margin-bottom:8px; font-size:12px; line-height:14px; font-weight:600; color:rgba(245,245,248,.92); }
.level-track {
  position:relative; height:8px; overflow:hidden; border:1px solid rgba(148,180,226,.22);
  border-radius:999px; background:rgba(255,255,255,.05);
}
.level-fill { height:100%; width:0%; border-radius:999px; background:rgba(92,209,255,.78); }

.game-overlay {
  position:absolute; z-index:10; inset:0; display:none; align-items:center; justify-content:center;
  flex-direction:column; text-align:center; pointer-events:none;
}
.game-overlay.visible { display:flex; }
.game-overlay h1 {
  margin:0 0 8px; font-size:30px; line-height:34px; font-weight:500; color:rgba(245,245,248,.96);
}
.game-overlay > p { margin:0 0 18px; font-size:16px; color:rgba(210,213,220,.72); }
.game-overlay button, .game-overlay a { pointer-events:auto; }
.game-overlay button, .game-overlay a {
  min-height:42px;
  padding:0 18px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(10,13,19,.78);
  color:#f7f7f8;
  text-decoration:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  line-height:1;
}
.game-overlay.modal { background:rgba(3,5,9,.68); backdrop-filter:blur(5px); }
.demo-card {
  width:min(390px, calc(100% - 36px)); padding:24px; border:1px solid rgba(255,255,255,.12);
  background:rgba(10,13,20,.94); box-shadow:0 24px 80px rgba(0,0,0,.55);
}
.demo-card > span { font-size:9px; letter-spacing:.22em; color:rgba(255,255,255,.38); }
.demo-card h2 { margin:8px 0; font-size:28px; font-weight:600; }
.demo-card p { color:rgba(255,255,255,.62); line-height:1.5; }
.actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }


.disclaimer-overlay {
  position:absolute;
  z-index:60;
  top:0;
  left:0;
  width:100%;
  height:100%;
  display:none;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(72,97,138,.12), rgba(0,0,0,0) 42%),
    #05070b;
  text-align:center;
  overflow:hidden;
}
.disclaimer-overlay.visible { display:grid; }
.disclaimer-overlay[hidden] { display:none !important; }

.disclaimer-card {
  width:min(337px, 100%);
  padding:30px 24px 26px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(10,13,20,.96);
  box-shadow:0 24px 70px rgba(0,0,0,.62);
}
.disclaimer-card > span {
  display:block;
  margin-bottom:10px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.22em;
  color:rgba(255,255,255,.44);
}
.disclaimer-card h1 {
  margin:0 0 14px;
  font-size:28px;
  line-height:32px;
  font-weight:600;
  color:rgba(248,248,250,.97);
}
.disclaimer-card p {
  margin:0 0 24px;
  font-size:14px;
  line-height:1.55;
  color:rgba(222,225,231,.76);
}
.disclaimer-card button {
  min-height:44px;
  padding:0 20px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.07);
  color:#f7f7f8;
  font:inherit;
  cursor:pointer;
}
