:root { --ember: #ff7a1a; --ember-deep: #c4410c; --bg: #120c0a; --card: #1d1512; --text: #f5efe8; --muted: #a8988c; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.title { font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.target { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.target b { color: var(--text); font-size: 16px; }
.tgt-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #3a2c25; background: var(--card); color: var(--text); font-size: 18px; }

.stage { position: relative; aspect-ratio: 3 / 4; background: #000 radial-gradient(circle at 50% 40%, #2a1a12, #000 70%); border-radius: 18px; overflow: hidden; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage.mirror video, .stage.mirror canvas { transform: scaleX(-1); }
.count { position: absolute; left: 0; right: 0; top: 10px; text-align: center; text-shadow: 0 2px 18px rgba(0,0,0,.8); pointer-events: none; }
#n { font-size: 112px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.count .of { display: block; color: #e9dcd2; font-size: 18px; font-weight: 600; }
.count.hit #n { color: var(--ember); }
.count.pop #n { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.phase { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: #fff; background: rgba(0,0,0,.45); padding: 4px 8px; border-radius: 8px; }
.phase:empty { display: none; }
.msg { position: absolute; left: 16px; right: 16px; bottom: 44px; text-align: center; background: rgba(0,0,0,.6); padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.msg:empty { display: none; }

.row { display: flex; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1; }
.row .btn.icon { flex: 0 0 56px; }
.btn { min-height: 54px; border: 0; border-radius: 14px; background: linear-gradient(180deg, var(--ember), var(--ember-deep)); color: #fff; font-size: 18px; font-weight: 800; }
.btn.ghost { background: var(--card); border: 1px solid #3a2c25; font-weight: 600; }
.btn:disabled { opacity: .6; }
.row.small .btn { min-height: 44px; font-size: 15px; }

.test { margin-top: 16px; }
.test pre { white-space: pre-wrap; font-size: 11px; color: var(--muted); }
