:root{
  --bg:#070a0f;
  --panel:#0e1623;
  --text:#eaf2ff;
  --muted:#93a4bb;
  --accent:#5eead4;
  --accent2:#60a5fa;
  --border:rgba(255,255,255,.12);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 550px at 15% -10%, rgba(96,165,250,.22), transparent 60%),
    radial-gradient(900px 550px at 90% 10%, rgba(94,234,212,.18), transparent 55%),
    linear-gradient(180deg, #05070b 0%, var(--bg) 55%, #05070b 100%);
  overscroll-behavior: none;
}
.top{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background: rgba(7,10,15,.65);
  backdrop-filter: blur(10px);
  gap:14px;
}
.brand{display:flex; align-items:center; gap:10px}
.mark{width:34px;height:34px;border-radius:12px;background:conic-gradient(from 210deg, var(--accent), var(--accent2), var(--accent))}
.title{font-weight:950}
.subtitle{color:var(--muted); font-weight:650; font-size:.92rem}
.hud{color:var(--muted); font-weight:750; white-space:nowrap}

.stage{max-width:1100px; margin:0 auto; padding:16px; display:grid; gap:12px; position:relative}
canvas{
  width:100%;
  height:auto;
  border:1px solid var(--border);
  border-radius:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  touch-action: none; /* prevent scroll/zoom on the canvas */
}
.help{color:var(--muted); font-size:.95rem; display:grid; gap:6px}
.muted{color:var(--muted)}
.small{font-size:.9rem}

.overlay{
  position:fixed; inset:0;
  display:grid; place-items:center;
  background: rgba(0,0,0,.55);
  padding:16px;
  z-index:20;
  pointer-events:auto;
}
.panel{
  width:min(560px, 96vw);
  border:1px solid var(--border);
  border-radius:20px;
  background: rgba(14,22,35,.92);
  padding:18px;
}
.panel h1{margin:0 0 8px; font-size:1.4rem}
.panel p{margin:0 0 12px; color:var(--muted)}
.row{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-weight:850;
  cursor:pointer;
  touch-action: manipulation;
}
.btn.primary{border-color: rgba(94,234,212,.35); background: linear-gradient(135deg, rgba(94,234,212,.20), rgba(96,165,250,.18))}
.btn:hover{filter:brightness(1.05)}

.touchbar{
  position:fixed;
  left:12px; right:12px; bottom:12px;
  display:none;
  justify-content:space-between;
  gap:12px;
  z-index:10;
  pointer-events:none;
}
.pad{display:flex;gap:10px;pointer-events:auto}
.tbtn{
  width:64px;height:64px;border-radius:18px;
  border:1px solid var(--border);
  background: rgba(14,22,35,.70);
  backdrop-filter: blur(10px);
  color:var(--text);
  font-weight:950;
  font-size:20px;
  display:grid;place-items:center;
  user-select:none;-webkit-user-select:none;
  touch-action:none;
}
.tbtn:active{filter:brightness(1.15)}
.tbtn.big{width:86px;height:86px;border-radius:22px;font-size:18px}

@media (max-width: 900px){
  .touchbar{display:flex}
  .help{font-size:.92rem}
}

@media (max-width: 720px){
  .hud{font-size:.9rem}
}
