/*
  너도? — 같은 답 찾기 · 디자인 시스템 v3
  (레퍼런스: Headspace의 따뜻한 톤·도형 + Headway의 정돈된 선택 화면 + How We Feel의 전환 효과)

  원칙
  1. 그림자 박스 금지 — 면은 평평하게, 구분은 얇은 선(1.5px)이나 옅은 바탕색으로만.
  2. 굵기 절제 — 본문 400~500, 제목 700. 크기로 위계를 만든다.
  3. 색은 주황이 메인, 하늘·노랑·분홍·라벤더가 보조. 선택지 가~마에 색을 하나씩 고정해 화면마다 같은 규칙으로 쓴다.
  4. 밝은 색은 "면"에만. 글자는 늘 진한 색(빔프로젝터에서 밝은 글씨는 날아간다).
  5. 결정적 순간(결과 공개·주인공·최종 순위)에만 화면 전체가 화려해진다.

  빔프로젝터: 밝은 바탕 하나로 고정. --ink #33302C on --bg #FAF6F1 ≈ 12.9:1.
*/
:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --tint: #f3ece4;
  --line: #e6dcd1;
  --ink: #33302c;
  --ink-2: #6a615a;
  --accent: #f47d31;
  --accent-deep: #b9561a;
  --accent-tint: #fde9d9;
  --hill: #f2742a;
  --sky: #5fb4ef;
  --sun: #ffc83d;
  --rose: #f59ac0;
  --lilac: #a28cf0;
  --good: #3f8f63;
  --good-tint: #e3f1e8;
  --danger: #b83b33;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
  font-feature-settings: 'tnum' 1;
  overflow-x: hidden;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

.screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 32px;
  animation: fade-up 0.45s cubic-bezier(.2,.7,.2,1);
}
.screen.wide { max-width: 1120px; padding: 32px 32px 40px; }
.screen.has-nav { padding-bottom: 96px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow, .brand { font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-bottom: 10px; }
.eyebrow.en { letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--accent-deep); text-transform: uppercase; }

h1 { font-size: 28px; font-weight: 700; margin: 0 0 12px; line-height: 1.38; letter-spacing: -0.025em; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; line-height: 1.45; letter-spacing: -0.015em; }
p.lead { color: var(--ink-2); font-size: 15px; margin: 0 0 28px; line-height: 1.7; }
.hint { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 22px; margin-bottom: 14px; }
.section { margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.field .hint { margin-top: 7px; }

input[type=text], input[type=number], input[type=password], input[type=tel], input[type=search] {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: #b3a89e; font-weight: 400; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 22px;
  border-radius: 999px; border: none;
  font-family: var(--font); font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #e96f22; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: #d6c8ba; }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1.5px solid var(--line); }
.btn-on-hill { background: #fff; color: var(--accent-deep); }
.btn-sm { min-height: 40px; width: auto; padding: 0 16px; font-size: 14px; }
.text-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* 라운드 수 선택 */
.round-select { display: flex; gap: 8px; }
.round-pill {
  flex: 1; height: 54px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: 18px; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
}
.round-pill.selected { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-deep); }
.round-pill:disabled { opacity: 0.3; cursor: not-allowed; }

/* 문항 진도 */
.stepper { display: flex; gap: 6px; margin-bottom: 10px; }
.stepper .seg { flex: 1; height: 5px; border-radius: 3px; background: var(--tint); }
.stepper .seg.done, .stepper .seg.now { background: var(--accent); }
.stepper .seg.now { opacity: 0.5; }
.stepper-caption { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 26px; }

.question-title { font-size: 26px; font-weight: 700; line-height: 1.42; margin: 0 0 26px; letter-spacing: -0.03em; }
.question-title .qn { color: var(--accent); margin-right: 6px; }

/* 선택지 — 가)~마) + 색 점 + 오른쪽 네모 체크 */
.cdot { display: inline-block; width: max(11px, 0.62em); height: max(11px, 0.62em); border-radius: 50%; flex-shrink: 0; background: var(--c); }
.c0 { --c: var(--accent); } .c1 { --c: var(--sky); } .c2 { --c: var(--sun); } .c3 { --c: var(--rose); } .c4 { --c: var(--lilac); }
.choice-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.choice-btn {
  text-align: left; min-height: 58px; padding: 14px 16px 14px 18px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: 16.5px; font-weight: 500; line-height: 1.45; letter-spacing: -0.01em;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.choice-btn:hover { border-color: #d6c8ba; }
.choice-btn .idx { font-weight: 600; color: var(--ink-2); flex-shrink: 0; width: 26px; }
.choice-btn .text { flex: 1; }
.choice-btn .check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #d3c6b8; background: var(--surface); flex-shrink: 0; position: relative; transition: all 0.15s ease; }
.choice-btn.selected { border-color: var(--c, var(--accent)); background: var(--accent-tint); background: color-mix(in srgb, var(--c, var(--accent)) 16%, white); }
.choice-btn.selected .idx { color: var(--ink); }
.choice-btn.selected .check { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.choice-btn.selected .check::after { content: ''; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg); }
.choice-btn.c2.selected .check::after { border-color: #5a4300; } /* 노랑 위 흰 체크는 안 보임 */
.choice-btn:disabled { cursor: default; }

/* 결과 막대 — 답안 글(한 줄 통째) / 막대 / 표시+숫자 (리뷰 2·3번: 표시가 답안 자리를 다투지 않게) */
.result-list { display: flex; flex-direction: column; gap: 16px; }
.result-row .rtext { display: flex; align-items: baseline; gap: 8px; font-size: 15.5px; font-weight: 500; line-height: 1.45; margin-bottom: 7px; }
.result-row .rtext .cdot { align-self: center; }
.result-row .rtext .idx { color: var(--ink-2); font-weight: 600; flex-shrink: 0; }
.result-row .rtext .t { flex: 1; }
.result-row .track { height: 10px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.result-row .fill { height: 100%; border-radius: 999px; background: var(--c, var(--accent)); opacity: 0.45; transform-origin: left; animation: grow 0.9s cubic-bezier(.2,.8,.2,1) both; }
.result-row:nth-child(2) .fill { animation-delay: 0.08s; } .result-row:nth-child(3) .fill { animation-delay: 0.16s; }
.result-row:nth-child(4) .fill { animation-delay: 0.24s; } .result-row:nth-child(5) .fill { animation-delay: 0.32s; }
.result-row.top .fill { opacity: 1; }
.result-row .rmeta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; min-height: 20px; }
.result-row .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.result-row .n { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.result-row.top .n { color: var(--ink); }
.tag { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; line-height: 1.5; }
.tag.mine { background: var(--ink); color: #fff; }
.tag.top { background: var(--accent-tint); color: var(--accent-deep); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 응답 현황 막대 */
.progress-wrap { margin-top: auto; padding-top: 24px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 9px; }
.progress-label b { color: var(--ink); font-weight: 600; }
.progress-track { height: 8px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.7s cubic-bezier(.2,.8,.2,1); }

.my-answers { display: flex; flex-wrap: wrap; gap: 6px; }
.my-answers .row { font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: var(--tint); border-radius: 8px; padding: 6px 10px; }
.my-answers .row b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.sub-label { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 4px 0 8px; }

.pill { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 8px; background: var(--tint); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.pill.accent { background: var(--accent-tint); color: var(--accent-deep); }

.center-msg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.center-msg strong { color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.center-msg .big { font-size: 56px; font-weight: 700; color: var(--accent-deep); letter-spacing: -0.03em; }

/* 시그니처: 화면 아래에서 솟아오르는 큰 오렌지 언덕 (좁은 칼럼을 뚫고 화면 양끝까지) */
.hill {
  position: relative;
  margin: auto calc(50% - 50vw) -32px;
  padding: 72px max(28px, calc(50vw - 50% + 4px)) 40px;
  min-height: 34vh;
  background: var(--hill);
  border-radius: 50% 50% 0 0 / 64px 64px 0 0;
  color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  animation: hill-rise 0.8s cubic-bezier(.2,.8,.2,1) both;
}
.screen.has-nav .hill { margin-bottom: -96px; padding-bottom: 112px; }
.hill .hill-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.45; }
.hill .hill-text { font-size: 15px; line-height: 1.65; color: rgba(255,255,255,0.92); }
.hill .hint, .hill a { color: rgba(255,255,255,0.92); }
@keyframes hill-rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────── 도형 무리 · 표정 ───────── */
.shapes { position: relative; width: 240px; height: 190px; margin: 0 auto; }
.shapes .sh { position: absolute; animation: bob 4.8s ease-in-out infinite; }
.shapes .sh svg { display: block; width: 100%; height: 100%; overflow: visible; }
.shapes .sh:nth-child(2) { animation-delay: -1.1s; animation-duration: 5.4s; }
.shapes .sh:nth-child(3) { animation-delay: -2.3s; animation-duration: 4.4s; }
.shapes .sh:nth-child(4) { animation-delay: -0.6s; animation-duration: 5.8s; }
.shapes .sh:nth-child(5) { animation-delay: -3.1s; animation-duration: 5s; }
.shapes .sh:nth-child(6) { animation-delay: -1.7s; animation-duration: 6.2s; }
.shapes .sh:nth-child(7) { animation-delay: -2.8s; animation-duration: 4.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-9px) rotate(4deg); } }
.shapes-wrap { display: flex; justify-content: center; margin: 4px 0 -18px; position: relative; z-index: 1; }
.face { transform-box: fill-box; transform-origin: center; }
.face-nod { animation: nod 1.6s ease-in-out infinite; }
.face-glad, .face-joy { animation: wiggle 2.4s ease-in-out infinite; }
.face-wow { animation: pop 2.6s ease-in-out infinite; }
@keyframes nod { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(5px); } 50% { transform: translateY(0); } 75% { transform: translateY(4px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* 참여자 도형 아바타 */
.ava { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.ava svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ava.md { width: 44px; height: 44px; }
.ava.xl { width: 64px; height: 64px; }
.cmp-hero { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 20px; background: var(--accent-tint); margin: 6px 0 4px; }
.cmp-hero > .ava { width: 76px; height: 76px; }
.cmp-hero .score { font-size: 44px; font-weight: 700; color: var(--accent-deep); letter-spacing: -0.03em; line-height: 1.05; }
.cmp-hero .score small { font-size: 0.45em; color: var(--ink-2); font-weight: 600; }
.cmp-hero .msg { font-size: 15px; font-weight: 600; margin-top: 4px; line-height: 1.45; }
.rank-row .ava { width: 1.35em; height: 1.35em; margin-right: 0.15em; }
.participant-row .ava { width: 22px; height: 22px; }

/* How We Feel식 무지개 고리 */
.ring {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto;
  background: conic-gradient(from 0deg, var(--accent), var(--sun), var(--rose), var(--lilac), var(--sky), var(--lilac), var(--rose), var(--accent));
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%);
          mask: radial-gradient(circle, transparent 54%, #000 55%);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── 주인공 공개 — 스포트라이트 무대(리뷰 6번) ─────────
   무지개 고리가 계속 돌고, 빛줄기가 회전하고, 방울이 계속 떠올라서 공개 후에도 화면이 살아 있다. */
.spot {
  position: relative; width: 100%; align-self: stretch; flex: 1;
  min-height: 420px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #ffb36b 0%, var(--hill) 46%, #e2601c 100%);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 36px 20px;
  animation: reveal-in 0.6s ease both;
}
.spot .rays {
  position: absolute; left: 50%; top: 40%; width: 220%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.16) 0deg 9deg, rgba(255,255,255,0) 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0,0,0,0.6) 30%, transparent 62%);
          mask: radial-gradient(circle, #000 0%, rgba(0,0,0,0.6) 30%, transparent 62%);
  animation: rays-spin 24s linear infinite;
}
@keyframes rays-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.spot .floaters { position: absolute; inset: 0; pointer-events: none; }
.spot .floaters i { position: absolute; bottom: -40px; border-radius: 50%; opacity: 0.85; animation: float-up linear infinite; }
.spot .floaters i::after { content: ''; position: absolute; left: 22%; top: 18%; width: 28%; height: 22%; border-radius: 50%; background: rgba(255,255,255,0.55); transform: rotate(-30deg); }
@keyframes float-up { from { transform: translateY(0); } to { transform: translateY(-120vh); } }
.spot > *:not(.rays):not(.floaters) { position: relative; z-index: 1; }
.spot .kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.22em; color: rgba(255,255,255,0.92); }
.spot .halo { position: relative; width: 170px; height: 170px; display: flex; align-items: center; justify-content: center; margin: 6px 0 4px; animation: pop-bounce 0.9s 0.15s cubic-bezier(.2,1.5,.4,1) both; }
.spot .halo .ring { position: absolute; inset: 0; width: auto; height: auto; animation-duration: 4s; }
.spot .halo .ava { width: 62%; height: 62%; filter: drop-shadow(0 8px 0 rgba(120,40,0,0.18)); }
.spot .name { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; animation: name-in 0.7s 0.45s cubic-bezier(.2,1.2,.4,1) both; text-shadow: 0 3px 0 rgba(120,40,0,0.18); }
.spot .team { font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.95); background: rgba(255,255,255,0.18); padding: 4px 12px; border-radius: 999px; }
.spot .crown { width: 64px; height: 40px; margin-bottom: -18px; z-index: 2; position: relative; animation: crown-drop 0.8s 0.7s cubic-bezier(.2,1.5,.4,1) both; }
.spot .halo::before { content: ''; position: absolute; inset: 20%; border-radius: 50%; background: rgba(255,255,255,0.28); }
.spot .halo .ava { position: relative; }
.spot .multi { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 28px; margin: 10px 0; }
.spot .multi .mp { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: pop-bounce 0.8s cubic-bezier(.2,1.5,.4,1) both; }
.spot .multi .ava { width: 84px; height: 84px; }
.spot .multi .name { font-size: 26px; }
.spot .spot-note { margin-top: 10px; font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.95); max-width: 30ch; line-height: 1.55; }
.screen.present .spot .multi .ava { width: calc(var(--u) * 8); height: calc(var(--u) * 8); }
.screen.present .spot .multi .name { font-size: calc(var(--u) * 3.2); }
.screen.present .spot .spot-note { font-size: calc(var(--u) * 1.5); max-width: 50ch; }
@keyframes crown-drop { from { transform: translateY(-60px) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes reveal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes name-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes pop-bounce { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }

/* ───────── 구슬 레이스 ───────── */
.race-holder { position: relative; width: 100%; align-self: stretch; }
.race { position: relative; width: 100%; height: 64vh; border-radius: 22px; overflow: hidden; background: var(--bg); }
.race canvas { display: block; }
.race-loading { display: flex; align-items: center; justify-content: center; height: 40vh; color: var(--ink-2); font-weight: 600; }
.race-prep { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 0; }

/* ───────── 참여자 비교표(리뷰 9번): 문항별 주인공 답 | 내 답 ───────── */
.cmp { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.cmp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
.cmp-row { border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.cmp-row.same { border-color: var(--accent); background: var(--accent-tint); }
.cmp-q { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.cmp-q .no { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.cmp-row.same .cmp-q .no { background: var(--accent); color: #fff; }
.cmp-q .qt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-q .ox { font-size: 13px; font-weight: 700; color: var(--accent-deep); flex-shrink: 0; }
.cmp-a { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-a span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.cmp-a span em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-a span b { color: var(--ink); flex-shrink: 0; }

/* 팝업(바텀시트): 문항 원문 + 선택지 전체 */
.sheet-back { position: fixed; inset: 0; background: rgba(51,48,44,0.38); z-index: 900; display: flex; align-items: flex-end; justify-content: center; animation: reveal-in 0.2s ease; }
.sheet { width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 22px 22px 30px; animation: sheet-up 0.3s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -8px auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 19px; line-height: 1.45; letter-spacing: -0.02em; }
.sheet .opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); margin-bottom: 7px; background: var(--surface); font-size: 15px; }
.sheet .opt .who { margin-left: auto; display: flex; gap: 4px; }
.sheet .opt.hit { border-color: var(--accent); }

/* ───────── 하단 메뉴 + 라운드 탭(참여자) ───────── */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; display: flex; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(250,246,241,0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.bnav .in { display: flex; width: 100%; max-width: 480px; }
.bnav button { flex: 1; background: none; border: 0; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.bnav button svg { width: 24px; height: 24px; }
.bnav button.on { color: var(--accent-deep); }
.bnav button .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: -2px; }
.rtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.rtabs button { flex-shrink: 0; font: inherit; font-size: 13.5px; font-weight: 600; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.rtabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.rtabs button:disabled { color: #b8aea5; cursor: default; }
.rtabs svg { width: 13px; height: 13px; }
.roster-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.roster-row .ava { width: 30px; height: 30px; }
.roster-row .nm { font-weight: 600; flex: 1; }
.roster-row .tm { font-size: 13px; color: var(--ink-2); }
.roster-row.me { background: var(--accent-tint); border-radius: 12px; padding-left: 10px; padding-right: 10px; border-bottom-color: transparent; }

/* ───────── 순위 ───────── */
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .rank-num { width: 28px; font-weight: 600; font-size: 16px; color: var(--ink-2); text-align: center; }
.rank-row.top .rank-num { color: var(--accent-deep); }
.rank-row .who { flex: 1; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; min-width: 0; }
.rank-row .who .team { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.rank-row .score { font-weight: 600; color: var(--ink); white-space: nowrap; }
.rank-row.top .score { color: var(--accent-deep); }
.rank-row.me { background: var(--accent-tint); border-radius: 12px; padding-left: 10px; padding-right: 10px; border-bottom-color: transparent; }

/* ───────── 진행용 대시보드 ───────── */
.host-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .host-grid { grid-template-columns: 1fr; } }
.participant-list { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; margin: 0 -6px; }
.participant-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.participant-row:last-child { border-bottom: 0; }
.participant-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.participant-row .name { flex: 1; font-weight: 500; }
.participant-row .team-tag { font-size: 13px; color: var(--ink-2); }
.share-box { display: flex; gap: 8px; }
.share-box input { flex: 1; font-size: 14px; }
.share-box .btn { width: auto; min-height: 52px; padding: 0 20px; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.top-bar .brand, .top-bar .eyebrow { margin-bottom: 0; }
.code-chip { font-size: 13px; font-weight: 600; color: var(--ink); background: var(--tint); border-radius: 8px; padding: 6px 10px; letter-spacing: 0.06em; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--accent-deep); }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.pin-display { font-size: 52px; font-weight: 700; letter-spacing: 0.22em; color: var(--ink); text-align: center; padding: 18px 0 6px; font-variant-numeric: tabular-nums; }
.error-msg { color: var(--danger); font-size: 14px; font-weight: 500; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #fbeae7; }
.qbank { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.qbank button { text-align: left; font: inherit; font-size: 14px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.qbank button:hover { border-color: var(--accent); }
.qbank button .ans { display: block; font-size: 12px; color: var(--accent-deep); margin-top: 3px; font-weight: 600; }
.qbank button:disabled { opacity: 0.35; cursor: default; }

/* ───────── 스페셜 라운드(퀴즈 서바이벌) ───────── */
.sp-timer { height: 10px; border-radius: 999px; background: var(--tint); overflow: hidden; margin: 6px 0 18px; }
.sp-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--rose)); border-radius: 999px; transform-origin: left; }
.sp-sec { font-size: 30px; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.sp-players { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 14px; font-weight: 600; transition: opacity 0.4s ease; }
.sp-chip .ava { width: 24px; height: 24px; }
.sp-chip.out { opacity: 0.35; text-decoration: line-through; }
.sp-chip.just-out { border-color: var(--danger); animation: shake 0.5s ease 2; }
.sp-chip.win { border-color: var(--accent); background: var(--accent-tint); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.choice-btn.correct { border-color: var(--good); background: var(--good-tint); }
.choice-btn.wrong { border-color: var(--danger); background: #fbeae7; }
.sp-verdict { text-align: center; padding: 14px 0 4px; }
.sp-verdict .big { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }

/* ───────── 화면 전환 효과: 그라데이션 + 도형 + 보글보글 ───────── */
.fx-layer { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; }
.fx-wash {
  position: absolute; left: 50%; top: 58%; width: 190vmax; height: 190vmax; margin: -95vmax 0 0 -95vmax; border-radius: 50%;
  /* 보색(주황↔파랑)이 맞닿으면 회갈색으로 탁해지므로 파랑은 보라·분홍 사이에만 둔다(거울 배치) */
  background: conic-gradient(from 200deg, var(--accent), var(--sun), #ffb38a, var(--rose), var(--lilac), var(--sky), var(--lilac), var(--rose), var(--accent));
  filter: blur(60px) saturate(1.1);
  animation: wash var(--fx-dur, 1.6s) cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes wash { 0% { transform: scale(0) rotate(0deg); opacity: 1; } 45% { transform: scale(1) rotate(60deg); opacity: 1; } 72% { opacity: 1; } 100% { transform: scale(1.05) rotate(90deg); opacity: 0; } }
.fx-bubble { position: absolute; bottom: -12vmax; border-radius: 50%; animation: rise var(--d, 1.4s) cubic-bezier(.3,.6,.4,1) var(--delay, 0s) forwards; opacity: 0; }
.fx-bubble::after { content: ''; position: absolute; left: 22%; top: 18%; width: 28%; height: 22%; border-radius: 50%; background: rgba(255,255,255,0.55); transform: rotate(-30deg); }
@keyframes rise { 0% { transform: translate(0, 0) scale(0.4); opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx, 0), -125vh) scale(1.08); opacity: 0; } }
.fx-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; animation: label-in var(--fx-dur, 1.6s) cubic-bezier(.2,.8,.2,1) forwards; }
.fx-stack { display: flex; flex-direction: column; align-items: center; gap: 0.3em; text-shadow: 0 2px 30px rgba(120, 50, 10, 0.25); }
.fx-kicker { font-size: clamp(13px, min(1.5vw, 2.6vh), 28px); font-weight: 700; letter-spacing: 0.32em; padding-left: 0.32em; opacity: 0.95; }
.fx-main { font-size: clamp(40px, min(8vw, 14vh), 160px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
@keyframes label-in { 0% { opacity: 0; transform: scale(0.85) translateY(20px); } 30% { opacity: 1; transform: none; } 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(1.04) translateY(-12px); } }

.burst { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 3; }
.burst .bit { position: absolute; left: 50%; top: 45%; animation: burst-out 1.5s cubic-bezier(.15,.8,.3,1) var(--delay, 0s) forwards; opacity: 0; }
.burst .bit svg { width: 100%; height: 100%; display: block; }
@keyframes burst-out { 0% { transform: translate(-50%, -50%) scale(0.2) rotate(0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; } }

/* ═════════════════ 발표용(빔프로젝터) ═════════════════
   모든 크기를 --u = min(1vw, 1.78vh) 단위로 — 16:9 기준 1u ≈ 화면 폭의 1%.
   노트북처럼 화면이 작거나(1366×768) 배율 125·150%라서 세로가 짧으면 세로 쪽이 기준이 되어 전체가 비례로 줄고,
   스크롤 없이 한 화면에 들어간다(리뷰 1·5번). */
.screen.present { --u: min(1vw, 1.78vh); max-width: none; height: 100vh; min-height: 0; overflow: hidden; padding: calc(var(--u) * 2.2) calc(var(--u) * 5) 0; background: var(--bg); }
.present-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: calc(var(--u) * 2); flex-shrink: 0; }
.present-brand { font-size: max(13px, calc(var(--u) * 1.1)); font-weight: 700; color: var(--ink-2); }
.present-brand b { color: var(--accent-deep); }
.present-meta { font-size: max(13px, calc(var(--u) * 1.05)); font-weight: 500; color: var(--ink-2); display: flex; gap: 1.2em; align-items: center; }
.present-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.present-center { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: calc(var(--u) * 0.8); }

.present-eyebrow { font-size: max(14px, calc(var(--u) * 1.25)); font-weight: 700; letter-spacing: 0.06em; color: var(--accent-deep); margin-bottom: calc(var(--u) * 0.8); }
.present-steps { display: flex; gap: calc(var(--u) * 0.5); width: calc(var(--u) * 16); margin-bottom: calc(var(--u) * 1.4); }
.present-steps .seg { flex: 1; height: max(5px, calc(var(--u) * 0.45)); border-radius: 999px; background: var(--tint); }
.present-steps .seg.done { background: var(--accent); }
.present-steps .seg.now { background: var(--accent); opacity: 0.5; }

.present-question { font-size: calc(var(--u) * 3.2); line-height: 1.3; margin: 0 0 calc(var(--u) * 2.6); font-weight: 700; letter-spacing: -0.035em; color: var(--ink); max-width: 24ch; }
.present-question .qn { color: var(--accent); margin-right: 0.25em; }

.present-choices { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 1.1) calc(var(--u) * 1.6); max-width: calc(var(--u) * 82); }
.present-choice { display: flex; align-items: center; gap: 0.7em; background: var(--surface); border: 2px solid var(--line); border-left: 0.32em solid var(--c, var(--line)); border-radius: calc(var(--u) * 1.1); padding: 0.75em 1em; font-size: calc(var(--u) * 1.7); font-weight: 500; color: var(--ink); line-height: 1.32; letter-spacing: -0.015em; }
.present-choice .idx { color: var(--ink-2); font-weight: 600; flex-shrink: 0; }
.present-choice .cdot { width: 0.6em; height: 0.6em; }

.present-bottom { margin-top: auto; padding: calc(var(--u) * 2) 0 calc(var(--u) * 2.6); flex-shrink: 0; }
.present-progress-label { display: flex; justify-content: space-between; align-items: baseline; font-size: calc(var(--u) * 1.5); font-weight: 500; color: var(--ink-2); margin-bottom: calc(var(--u) * 0.8); }
.present-progress-label b { color: var(--ink); font-weight: 700; font-size: 1.25em; }
.present-progress-track { height: max(10px, calc(var(--u) * 0.9)); border-radius: 999px; background: var(--tint); overflow: hidden; }
.present-progress-track .progress-fill { height: 100%; }

.present-results { gap: calc(var(--u) * 1.3); max-width: calc(var(--u) * 82); }
.present-results .result-row .rtext { font-size: calc(var(--u) * 1.65); margin-bottom: calc(var(--u) * 0.5); }
.present-results .result-row .track { height: calc(var(--u) * 1); }
.present-results .result-row .rmeta { margin-top: calc(var(--u) * 0.35); }
.present-results .result-row .n { font-size: calc(var(--u) * 1.3); }
.present-results .tag { font-size: calc(var(--u) * 1.05); padding: 0.15em 0.6em; border-radius: 0.4em; }

.present-hill {
  margin: auto calc(var(--u) * -5) 0;
  min-height: 0; padding: calc(var(--u) * 4) calc(var(--u) * 5) calc(var(--u) * 2.6);
  background: var(--hill); border-radius: 50% 50% 0 0 / calc(var(--u) * 7) calc(var(--u) * 7) 0 0;
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; gap: calc(var(--u) * 0.5);
  animation: hill-rise 1s cubic-bezier(.2,.8,.2,1) both; flex-shrink: 0;
}
.present-hill .big { font-size: calc(var(--u) * 2.6); font-weight: 700; letter-spacing: -0.03em; }
.present-hill .sub { font-size: calc(var(--u) * 1.45); font-weight: 500; color: rgba(255,255,255,0.92); }

.present-join-label { font-size: calc(var(--u) * 1.45); font-weight: 600; color: var(--ink-2); }
.present-join-label b { color: var(--ink); }
.present-join-code { font-size: calc(var(--u) * 7.6); font-weight: 700; letter-spacing: 0.14em; color: var(--ink); line-height: 1; margin: calc(var(--u) * 0.4) 0 calc(var(--u) * 0.6); padding-left: 0.14em; }
.present-sub { font-size: calc(var(--u) * 1.45); font-weight: 500; color: var(--ink-2); margin: 0; }
.present-big-msg { font-size: calc(var(--u) * 3.8); font-weight: 700; letter-spacing: -0.035em; color: var(--ink); }
.present-intro { font-size: calc(var(--u) * 1.35); color: var(--ink-2); line-height: 1.6; max-width: 60ch; }
.screen.present .shapes.lg { width: calc(var(--u) * 22); height: calc(var(--u) * 17.5); }
.screen.present .shapes-wrap { margin: 0 0 calc(var(--u) * -1.4); }

.screen.present .race { position: absolute; inset: 0; height: auto; border-radius: calc(var(--u) * 2); }
.screen.present .race-holder { flex: 1; min-height: 0; margin-bottom: calc(var(--u) * 2); }
.screen.present .spot { margin-bottom: calc(var(--u) * 2.4); border-radius: calc(var(--u) * 2.4); min-height: 0; }
.screen.present .spot .kicker { font-size: calc(var(--u) * 1.2); }
.screen.present .spot .halo { width: calc(var(--u) * 15); height: calc(var(--u) * 15); }
.screen.present .spot .crown { width: calc(var(--u) * 5.5); height: calc(var(--u) * 3.4); margin-bottom: calc(var(--u) * -1.6); }
.screen.present .spot .name { font-size: calc(var(--u) * 7); }
.screen.present .spot .team { font-size: calc(var(--u) * 1.7); }

/* 순위판 — 50명도 스크롤 없이 한 화면 */
.present-list { display: flex; flex-direction: column; max-width: calc(var(--u) * 78); }
.present-list .rank-row { padding: calc(var(--u) * 0.9) 0.4vw; }
.present-list .rank-row .rank-num { font-size: calc(var(--u) * 1.5); width: 2.2em; }
.present-list .rank-row .who { font-size: calc(var(--u) * 1.65); }
.present-list .rank-row .who .team { font-size: calc(var(--u) * 1.05); }
.present-list .rank-row .score { font-size: calc(var(--u) * 1.65); }
.present-list.two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--u) * 4); max-width: none; }
.present-list.two-col .rank-row { padding: calc(var(--u) * 0.55) 0.4vw; }
.present-list.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-auto-flow: column; column-gap: calc(var(--u) * 3); max-width: none; }
.present-list.three-col .rank-row { padding: calc(var(--u) * 0.32) 0.2vw; gap: calc(var(--u) * 0.8); }
.present-list.three-col .rank-row .rank-num { font-size: calc(var(--u) * 1.05); width: 2em; }
.present-list.three-col .rank-row .who { font-size: calc(var(--u) * 1.15); }
.present-list.three-col .rank-row .who .team { font-size: calc(var(--u) * 0.85); }
.present-list.three-col .rank-row .score { font-size: calc(var(--u) * 1.15); }
.present-list.two-col .rank-row:last-child, .present-list.three-col .rank-row:last-child { border-bottom: 1px solid var(--line); }

/* 라운드 결과: 일치 개수별 5구역(리뷰 8번) */
.zones { flex: 1; min-height: 0; display: grid; gap: calc(var(--u) * 1); margin-bottom: calc(var(--u) * 1.4); }
.zone { min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: calc(var(--u) * 1.3); background: var(--surface); border: 2px solid var(--line); padding: calc(var(--u) * 1) calc(var(--u) * 1.1); }
.zone.c5 { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-tint), var(--surface) 60%); }
.zone .zh { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6em; margin-bottom: calc(var(--u) * 0.7); flex-shrink: 0; }
.zone .zt { white-space: nowrap; font-size: calc(var(--u) * 1.55); font-weight: 700; letter-spacing: -0.02em; }
.zone .zt small { display: block; font-size: 0.5em; letter-spacing: 0.16em; color: var(--accent-deep); font-weight: 700; }
.zone .zc { font-size: calc(var(--u) * 1.2); font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.zone .zl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 0.35); overflow: hidden; }
.zone .zp { display: flex; align-items: center; gap: 0.45em; font-size: var(--zf, calc(var(--u) * 1.15)); line-height: 1.25; }
.zone .zp .ava { width: 1.2em; height: 1.2em; }
.zone .zp .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone .zp .tm { font-size: 0.78em; color: var(--ink-2); white-space: nowrap; }
.zone .zp .qs { margin-left: auto; font-size: 0.78em; font-weight: 700; color: var(--accent-deep); white-space: nowrap; }
.zone .zempty { color: #b8aea5; font-size: calc(var(--u) * 1.1); }
.zone-zero { font-size: calc(var(--u) * 1.15); color: var(--ink-2); margin-bottom: calc(var(--u) * 1.6); flex-shrink: 0; }
.zone-zero b { color: var(--ink); }

/* 스페셜 라운드 발표 화면 */
.screen.present .sp-players { gap: calc(var(--u) * 0.7); }
.screen.present .sp-chip { font-size: calc(var(--u) * 1.35); padding: 0.3em 0.9em 0.3em 0.35em; }
.screen.present .sp-chip .ava { width: 1.5em; height: 1.5em; }
.screen.present .sp-timer { height: calc(var(--u) * 0.9); margin: calc(var(--u) * 0.6) 0 calc(var(--u) * 1.6); }
.screen.present .sp-sec { font-size: calc(var(--u) * 3); }
.present-choice.correct { border-color: var(--good); background: var(--good-tint); }
.present-choice.dim { opacity: 0.4; }
.present-choice .cnt { margin-left: auto; font-weight: 700; color: var(--ink-2); font-size: 0.85em; }

@media (max-width: 760px) {
  .present-choices { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-layer, .burst { display: none; }
  .shapes .sh, .ring, .spot .rays, .spot .floaters i, .face { animation: none !important; }
}
