/* 한곡조 공통 UI — 중장년 기준. 큰 글자·큰 버튼·색+말로 상태·제스처 없음.
   테마: body.night(참여자 폰: 반주기 화면 검정) / body.paper(스트리머·설치: 종이색) */
:root {
  --night: #0E0F12; --night-2: #1A1C21; --night-3: #26292F; --night-line: #3A3E46;
  --paper: #F6F4EE; --paper-2: #FFFFFF; --paper-line: #D9D6CE;
  --ink: #1B1D20; --ink-2: #5A5F66; --snow: #FFFFFF; --snow-2: rgba(255,255,255,.74);
  --lyric: #FFD84D; --lyric-ink: #3A2E00;
  --go: #2B6FE6; --go-ink: #FFFFFF;
  --ok: #23A559; --wait: #F2B01E; --stop: #E5484D;
  --radius: 18px; --radius-s: 12px;
  --fs-body: 20px; --fs-label: 16px; --fs-big: 28px; --fs-hero: 40px; --fs-btn: 26px;
  --tap: 72px;
  --mascot: 140px; /* 캐릭터 박스 한 변. 모든 화면 동일 (정사각 480 캔버스, 발 하단 정렬) */
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; font-size: var(--fs-body); line-height: 1.45; font-weight: 500; word-break: keep-all; }
body.night { background: var(--night); color: var(--snow); }
body.paper { background: var(--paper); color: var(--ink); }
.display { font-family: "Black Han Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-weight: 400; letter-spacing: .01em; }
.num { font-variant-numeric: tabular-nums; }
.label { font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; }
.night .label { color: var(--lyric); } .paper .label { color: var(--ink-2); }
.muted { opacity: .74; }
h1, h2, h3, p { margin: 0; }

/* 화면 틀: 세로 1열, 상단 안전영역, 하단 버튼 존 */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; gap: 14px; padding: calc(20px + var(--safe-t)) 20px calc(18px + var(--safe-b)); overflow-y: auto; }
.screen.on { display: flex; }
.top { display: flex; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px; font-size: var(--fs-label); font-weight: 700; }
.night .chip { background: var(--night-2); color: var(--snow-2); }
.brandmark { width: 44px; height: 44px; flex: none; object-fit: contain; }
.spacer { flex: 1; }

/* 버튼: 화면당 하나가 primary */
.btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: var(--tap); border: 0; border-radius: var(--radius); font: inherit; font-size: var(--fs-btn); font-weight: 800; padding: 14px 18px; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2; }
.btn:focus-visible { outline: 4px solid var(--lyric); outline-offset: 2px; }
.btn.go { background: var(--go); color: var(--go-ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.lyric { background: var(--lyric); color: var(--lyric-ink); }
.btn.quiet { background: transparent; font-weight: 700; font-size: var(--fs-body); min-height: 56px; }
.night .btn.quiet { color: var(--snow-2); border: 2px solid var(--night-line); }
.paper .btn.quiet { color: var(--ink); border: 2px solid var(--paper-line); background: var(--paper-2); }
.btn:disabled, .btn.off { background: var(--night-3); color: var(--snow-2); cursor: default; }
.paper .btn:disabled { background: #EEEBE2; color: #5A5F66; }
.btn.big { min-height: 96px; font-size: 32px; }
.btn svg { width: 30px; height: 30px; flex: none; }
.dock { margin-top: auto; display: grid; gap: 10px; padding-top: 8px; }

/* 상태 띠: 색 + 말 + 점 */
.band { display: flex; align-items: center; gap: 12px; border-radius: var(--radius-s); padding: 14px 16px; font-size: var(--fs-body); font-weight: 800; }
.band i { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.band.ok { background: rgba(35,165,89,.16); } .band.ok i { background: var(--ok); }
.band.wait { background: rgba(242,176,30,.18); } .band.wait i { background: var(--wait); }
.band.stop { background: rgba(229,72,77,.18); } .band.stop i { background: var(--stop); }
.paper .band.ok { background: #E4F5EA; } .paper .band.wait { background: #FFF1CC; } .paper .band.stop { background: #FDE2E3; }

/* 번호표 — 시그니처. 은행·병원 번호표처럼 큰 동그라미 숫자 */
.ticket { display: flex; align-items: center; gap: 14px; border-radius: var(--radius); padding: 12px 14px; min-height: var(--tap); }
.night .ticket { background: var(--night-2); border: 2px solid var(--night-line); }
.paper .ticket { background: var(--paper-2); border: 1.5px solid var(--paper-line); }
.ticket .no { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: "Black Han Sans", "Malgun Gothic", sans-serif; font-size: 26px; }
.night .ticket .no { background: var(--night-3); color: var(--snow); } .paper .ticket .no { background: #EEEBE2; color: var(--ink); }
.ticket .who { flex: 1; min-width: 0; font-size: var(--fs-body); font-weight: 800; line-height: 1.3; }
.ticket .who small { display: block; font-weight: 500; opacity: .78; font-size: 17px; }
.ticket.now { border-color: var(--lyric); } .ticket.now .no { background: var(--lyric); color: var(--lyric-ink); }
.ticket.me { outline: 3px solid var(--go); border-color: transparent; }
.ticket .act { display: flex; gap: 6px; flex: none; }
.ticket .act button { min-height: 52px; padding: 0 14px; border-radius: 10px; border: 2px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; }

/* 입력 */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-label); font-weight: 700; }
.field input { width: 100%; min-height: var(--tap); font: inherit; font-size: 26px; font-weight: 700; padding: 12px 16px; border-radius: var(--radius-s); border: 2px solid var(--night-line); background: var(--night-2); color: var(--snow); }
.paper .field input { background: var(--paper-2); border-color: var(--paper-line); color: var(--ink); }
.field input:focus { outline: none; border-color: var(--go); box-shadow: 0 0 0 4px rgba(43,111,230,.25); }
.err { color: #FF8A80; font-weight: 800; min-height: 1.4em; font-size: 18px; }
.paper .err { color: var(--stop); }

/* 카드 (종이 테마) */
.card { background: var(--paper-2); border: 1.5px solid var(--paper-line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px; }
.card h2 { font-size: 22px; font-weight: 800; }

/* 내 차례 — 맥박 하나만 */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.turn-hero { border-radius: 24px; background: var(--lyric); color: var(--lyric-ink); padding: 26px 20px; text-align: center; animation: pulse 1.6s ease-in-out infinite; }
.turn-hero .display { font-size: 56px; line-height: 1; }
.turn-hero .song { font-size: 24px; font-weight: 800; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .turn-hero { animation: none; } }

/* 캐릭터 — 항상 같은 박스. 크기는 --mascot 하나로 */
.gokjo { width: var(--mascot); height: var(--mascot); flex: none; object-fit: contain; }

/* 접근성 */
:focus-visible { outline: 4px solid var(--lyric); outline-offset: 2px; }
@media (max-width: 360px) { :root { --fs-btn: 23px; --fs-hero: 34px; } }
