:root{
  --bg:#0b0d12;
  --panel:#111520;
  --panel2:#151a28;
  --text:#e6e9ef;
  --muted:#a9b0bf;
  --accent:#7dd3fc;
  --accent2:#a78bfa;
  --good:#34d399;
  --bad:#fb7185;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
}

*{box-sizing:border-box;}
body{
  margin:0;
  font-family:system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  background:
    radial-gradient(1200px 800px at 10% -10%, #16203a 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #2a1b41 0%, transparent 55%),
    var(--bg);
  color:var(--text);
  display:grid;
  place-items:center;
  min-height:100vh;
}

.wrap{
  width:min(1020px, 96vw);
  background:linear-gradient(180deg, rgba(255,255,255,.04), transparent);
  border:1px solid rgba(255,255,255,.06);
  border-radius:18px;
  padding:12px;
  box-shadow:var(--shadow);
  position:relative;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:6px 8px 10px;
}

.title{
  font-weight:900;
  letter-spacing:.02em;
  font-size:18px;
  display:flex;
  gap:8px;
  align-items:center;
}
.hud{display:flex; gap:8px; flex-wrap:wrap; font-size:13px; color:var(--muted);}
.pill{
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
}

canvas{
  width:100%;
  height:auto;
  background:var(--panel);
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px;
  display:block;
}

.help{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

.overlay{
  position:absolute; inset:0;
  display:grid; place-items:center;
  background:rgba(5,7,10,.6);
  backdrop-filter: blur(6px);
  border-radius:18px;
}
.card{
  width:min(520px, 92%);
  background:var(--panel);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:16px;
  display:grid; gap:10px;
  text-align:center;
}
.card h1{margin:0; font-size:24px;}
.card p{margin:0; color:var(--muted); font-size:14px;}
.card button{
  appearance:none; border:none; cursor:pointer;
  background:var(--panel2);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  font-weight:900;
  padding:10px 14px;
  border-radius:12px;
  transition:.2s;
}
.card button:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.2);
}
