:root { --ink: #FFEBD6; --mute: rgba(255, 235, 214, .62); --line: rgba(255, 220, 180, .14); --fire: #FF8A3D; --amber: #FFB547; --bg: #140C0A;
  --font: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; --vh: 100dvh; }
@font-face { font-family: Pretendard; src: url("../../static/fonts/PretendardVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { height: var(--vh); display: flex; flex-direction: column; overflow: hidden; max-width: 760px; margin: 0 auto; }
.bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 6px; }
.bar h1 { margin: 0; flex: 1; font-size: 17px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.bar h1 small { display: block; font-size: 10.5px; font-weight: 700; color: var(--amber); letter-spacing: 0; }
.back { color: var(--mute); text-decoration: none; font-size: 20px; padding: 4px 6px; }
.bar-r { display: flex; gap: 6px; }
.btn { font: 800 13px var(--font); color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer;
  transition: transform .16s ease-out, background .16s ease-out; touch-action: manipulation; }
.btn:active { transform: scale(.97); }
#ft-snd { border-color: rgba(255, 181, 71, .55); color: #FFD08A; } #ft-snd.off { border-color: var(--line); color: var(--mute); }
.stage { position: relative; flex: 1; min-height: 0; margin: 0 8px; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9); }
canvas { display: block; touch-action: manipulation; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: center; gap: 12px; padding: 0; pointer-events: none; transform: translateY(96px); font-size: 11px; color: var(--mute); }
.hud b { color: var(--ink); font-weight: 900; } .hud .dim { opacity: .7; }
body:not(.playing) .hud { opacity: 0; }
.ov { position: absolute; inset: 0; margin: auto; width: min(92%, 420px); height: max-content; max-height: 96%; overflow: auto; padding: 20px 18px 16px; border-radius: 18px;
  background: rgba(24, 14, 10, .95); border: 1px solid rgba(255, 150, 70, .35); box-shadow: 0 0 60px -10px rgba(255, 110, 40, .35); }
.ov.hide { display: none; }
.ov h2 { margin: 0 0 8px; font-size: 28px; font-weight: 900; letter-spacing: -.03em; background: linear-gradient(180deg, #FFE7A0, #FF7A2E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ov .goal { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: #FFD08A; }
.ov .sub { margin: 0 0 12px; font-size: 12.5px; color: var(--mute); line-height: 1.5; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: rgba(0, 0, 0, .35); border-radius: 10px; padding: 3px; }
.seg button { font: 800 12px var(--font); color: var(--mute); background: none; border: 0; border-radius: 8px; padding: 7px 10px; min-height: 34px; cursor: pointer; }
.seg button.on { color: #2A1206; background: var(--amber); }
.btn.primary { width: 100%; padding: 14px; font-size: 18px; color: #2A1206; border: 0; background: linear-gradient(180deg, #FFC15E, #FF7A2E); box-shadow: 0 10px 26px -10px rgba(255, 110, 40, .9); }
.note { font-size: 11px; color: var(--mute); line-height: 1.55; margin: 12px 2px 0; border-left: 2px solid var(--fire); padding-left: 8px; }
.type-bar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
#ft-in { width: 100%; font: 800 20px var(--font); color: var(--ink); background: #22140F; border: 2px solid rgba(255, 150, 70, .45); border-radius: 14px; padding: 12px 14px; outline: none; }
#ft-in:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 181, 71, .2); }
#ft-in.bad { border-color: #FF6A3D; animation: nope .18s; }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { #ft-in.bad { animation: none; } .btn { transition: none; } }
.hud { display: none !important; } /* 시간·타수는 캔버스 안에 그린다 */

/* 공통 머리말이 채워지면(사이트) 내 제목·뒤로 줄은 숨기고 소리·다시 단추만 남긴다 */
#siteHead:not(:empty) + .bar h1, #siteHead:not(:empty) + .bar .back { display: none; }
#siteHead:not(:empty) + .bar { justify-content: flex-end; padding-top: 4px; }
#siteFoot { display: none; }
.ov-row { display: flex; gap: 8px; margin-top: 10px; } .ov-row .btn { flex: 1; text-align: center; text-decoration: none; padding: 11px 10px; }
.ov .result-big { font-size: 40px; }
.ov-row[hidden] { display: none; }
