:root {
  --black: #0b0b0c; --ink: #141416; --line: #2a2a2e; --white: #ffffff;
  --red: #e3001b; --red-d: #b30016; --grey: #9a9aa2;
  --cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--white); font-family: var(--text); }
body { display: flex; flex-direction: column; min-height: 100dvh; overscroll-behavior: none; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 14px; }

header { padding-top: max(10px, env(safe-area-inset-top)); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 10px; }
.logo { font-family: var(--cond); font-weight: 800; font-size: 28px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.logo b { color: var(--red); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--white); width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }

.hud { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hud div { padding: 6px 8px 7px; border-right: 1px solid var(--line); }
.hud div:last-child { border-right: 0; }
.hud small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--grey); }
.hud strong { font-family: var(--cond); font-weight: 700; font-size: 24px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hud .hot strong { color: var(--red); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

main { flex: 1; display: flex; min-height: 0; }
.stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px 0; min-height: 0; }
canvas { display: block; touch-action: none; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,.6); cursor: crosshair; }

.overlay { position: absolute; inset: 10px 0; display: flex; align-items: center; justify-content: center; padding: 18px; }
.overlay[hidden] { display: none; }
.card { width: 100%; max-width: 360px; background: rgba(11,11,12,.92); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px 20px; text-align: center; }
.card h1, .card h2 { font-family: var(--cond); font-weight: 800; text-transform: uppercase; margin: 0; line-height: .95; }
.card h1 { font-size: 64px; letter-spacing: .01em; }
.card h1 b, .card h2 b { color: var(--red); }
.card h2 { font-size: 44px; }
.card p { color: #d6d6da; font-size: 15px; line-height: 1.45; margin: 12px 0 0; }
.how { text-align: left; margin: 16px 0 4px; padding: 0; list-style: none; font-size: 14px; color: #d6d6da; }
.how li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.how li span:first-child { flex: 0 0 74px; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--white); }
.btn { margin-top: 18px; width: 100%; border: 0; border-radius: 10px; background: var(--red); color: var(--white); font-family: var(--cond); font-weight: 800; font-size: 22px; letter-spacing: .06em; text-transform: uppercase; padding: 13px 16px; cursor: pointer; }
.btn:active { background: var(--red-d); transform: translateY(1px); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.stats small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--grey); }
.stats strong { font-family: var(--cond); font-size: 28px; font-weight: 700; }
.best { margin-top: 10px; font-size: 13px; color: var(--grey); }
.best.new { color: var(--red); font-weight: 600; }
.err { color: #ffb3bb; }

footer { padding: 6px 0 max(12px, env(safe-area-inset-bottom)); font-size: 12px; color: var(--grey); }
footer .wrap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
footer a { color: var(--grey); text-decoration: none; }
footer a:hover { color: var(--white); }
.heart { width: 11px; height: 11px; vertical-align: -1px; fill: var(--red); }

@media (pointer: fine) { .touch-only { display: none; } }
@media (pointer: coarse) { .mouse-only { display: none; } }
