[hidden] { display: none !important; }
:root {
  --font: "Pretendard Variable", Pretendard, system-ui, -apple-system, sans-serif;
  --ink: #f4f1ea;
  --dim: rgba(244, 241, 234, .72);
  --glass: rgba(14, 26, 31, .42);
  --glass2: rgba(14, 26, 31, .7);
  --line: rgba(255, 255, 255, .16);
  --accent: #ffb36b;
  --rec: #ff4d4d;
  --bg: #0e1a1f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
#cam { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 8px; padding: calc(env(safe-area-inset-top) + 12px) 16px 0; }
.title { flex: 1; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 6px rgba(0,0,0,.45); pointer-events: none; }
.title b { font-size: 20px; letter-spacing: -.02em; }
.title span { font-size: 13px; color: var(--dim); }
.ib { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 21px; border: 1px solid var(--line); }
.ib:active, .pill:active { transform: scale(.95); }

#noisy { position: absolute; top: calc(env(safe-area-inset-top) + 76px); left: 16px; right: 16px; font-size: 12.5px; padding: 8px 12px; border-radius: 10px; background: rgba(120, 60, 20, .55); backdrop-filter: blur(8px); pointer-events: none; }
#meter { position: absolute; right: 10px; top: 30%; height: 34%; width: 6px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; pointer-events: none; }
#meterFill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--accent); border-radius: 3px; transition: height .05s linear; }
#meterThr { display: none; }

#toast { position: absolute; left: 50%; top: 26%; transform: translate(-50%, 8px); padding: 9px 16px; border-radius: 999px; background: var(--glass2); backdrop-filter: blur(10px); font-size: 15px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#banner { position: absolute; left: 16px; right: 16px; top: 18%; text-align: center; pointer-events: none; display: flex; flex-direction: column; gap: 8px; animation: rise .5s cubic-bezier(.2,.9,.3,1.2); }
#banner b { font-size: clamp(24px, 7vw, 40px); letter-spacing: -.03em; line-height: 1.2; text-shadow: 0 2px 18px rgba(0,0,0,.5); word-break: keep-all; }
#banner span { font-size: 14px; color: var(--dim); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }
#stat { position: absolute; left: 16px; bottom: calc(env(safe-area-inset-bottom) + 150px); font-size: 12.5px; color: var(--dim); text-shadow: 0 1px 4px rgba(0,0,0,.6); pointer-events: none; }

.bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 0 calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(to top, rgba(0,0,0,.45), transparent); }
.row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 16px 12px; }
.row > :first-child { justify-self: start; } .row > :last-child { justify-self: end; }
.pill { height: 40px; padding: 0 15px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.pill.ghost { background: rgba(0,0,0,.25); }
.pill.wide { width: 100%; justify-content: center; }
#actBtn:empty { visibility: hidden; }
#recBtn { width: 70px; height: 70px; border-radius: 50%; border: 4px solid rgba(255,255,255,.9); display: grid; place-items: center; position: relative; }
#recBtn i { width: 52px; height: 52px; border-radius: 50%; background: var(--rec); transition: all .2s; }
#recBtn.on i { width: 26px; height: 26px; border-radius: 6px; }
#recTime { position: absolute; top: -26px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; background: var(--rec); padding: 2px 8px; border-radius: 6px; display: none; }
#recBtn.on #recTime { display: block; }
#modes { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 4px; scrollbar-width: none; touch-action: pan-x; }
#modes::-webkit-scrollbar { display: none; }
#modes button { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--dim); background: rgba(0,0,0,.3); border: 1px solid transparent; }
#modes button.on { color: #1b1208; background: var(--accent); }

#intro { position: absolute; inset: 0; overflow-y: auto; touch-action: pan-y; background: radial-gradient(120% 70% at 85% 10%, rgba(255,179,107,.28), transparent 60%), linear-gradient(180deg, #13252c, #0b1418); }
.introIn { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 48px) 24px calc(env(safe-area-inset-bottom) + 32px); display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; max-width: 560px; }
.kicker { margin: 0; font-size: 13px; letter-spacing: .3em; color: var(--accent); text-transform: uppercase; }
#intro h1 { margin: 0; font-size: 96px; line-height: .95; letter-spacing: -.06em; font-weight: 800; }
.lead { margin: 0; font-size: 17px; line-height: 1.6; color: var(--dim); word-break: keep-all; }
.lead em { font-style: normal; color: var(--ink); border-bottom: 2px solid var(--accent); }
.modesList { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.modesList li { font-size: 13px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.go { margin-top: 6px; height: 56px; border-radius: 16px; background: var(--accent); color: #1b1208; font-size: 18px; font-weight: 700; }
.go:active { transform: scale(.98); }
.fine { margin: 0; font-size: 12px; color: rgba(244,241,234,.5); line-height: 1.5; word-break: keep-all; }

#calib { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); }
#calib div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 26px; border-radius: 18px; background: var(--glass2); backdrop-filter: blur(12px); }
#calib span { font-size: 13px; color: var(--dim); }
#calib i { width: 140px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.15); position: relative; overflow: hidden; margin-top: 6px; }
#calib i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: fill 1s linear forwards; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

#sheet, #review { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.sheetIn, .revIn { width: 100%; max-height: 92dvh; overflow-y: auto; touch-action: pan-y; background: #13232a; border-radius: 22px 22px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; gap: 16px; animation: up .28s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheetHead { display: flex; justify-content: space-between; align-items: center; }
.sheetHead b { font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; }
.field em { font-style: normal; color: var(--accent); font-variant-numeric: tabular-nums; }
.field small { font-size: 12px; color: var(--dim); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.live { height: 12px; border-radius: 6px; background: rgba(255,255,255,.1); position: relative; overflow: hidden; }
#liveFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,255,255,.4); }
#liveFill.blow { background: var(--accent); }
#liveThr { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; font-size: 14px; }
.toggles label { display: flex; align-items: center; gap: 8px; }
.toggles input { width: 18px; height: 18px; accent-color: var(--accent); }
.revIn video, .revIn img { width: 100%; max-height: 62dvh; object-fit: contain; border-radius: 14px; background: #000; }
.revIn img[src=""], .revIn img:not([src]) { display: none; }
.revIn .row { padding: 0; grid-template-columns: 1fr 1fr 1fr; }
.revIn .row > * { justify-self: stretch; justify-content: center; }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .35s; }
#flash.on { opacity: .55; transition: none; }

.pill.accent { background: var(--accent); color: #1b1208; border-color: transparent; }
.pill em { font-style: normal; font-weight: 500; opacity: .7; font-size: 12px; }
#learn, #coach { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); padding: 16px; }
#learn > div, #coach > div { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 20px; background: var(--glass2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: 360px; width: 100%; }
#learn b, #coach b { font-size: 18px; }
#learn span, #coach span { font-size: 13.5px; color: var(--dim); line-height: 1.5; word-break: keep-all; }
#learn .bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 8px; position: relative; }
#learnFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }
#learn small { font-size: 12px; color: var(--dim); min-height: 1em; }
.row2 { display: flex; gap: 8px; margin-top: 8px; }
.row2 .pill { flex: 1; justify-content: center; }
