:root {
  --bg: #fbf7ef; --bg2: #f3ecdf; --card: #ffffff; --ink: #1f2430; --ink2: #545b6b; --line: #e4dccd;
  --brand: #2f4a7a; --brand2: #23395f; --gold: #b8862b; --ok: #1f7a45; --okbg: #e3f4e9; --bad: #b23636; --badbg: #fbe7e7;
  --a0: #c23a3a; --a1: #2563c9; --a2: #f2b705; --a3: #23824a; --a2ink: #1d1d1d;
  --t0: #c8456a; --t1: #2f6fc4; --t2: #2b8a55; --t3: #7d55c0;
  --shadow: 0 2px 10px rgba(40, 30, 10, .08); --r: 16px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --verse: "Nanum Myeongjo", "AppleMyungjo", "Batang", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111827; --bg2: #172033; --card: #1c2638; --ink: #f3f4f6; --ink2: #c2c8d4; --line: #2d3a52;
  --brand: #8fb0ea; --brand2: #b7cdf3; --gold: #e2b45a; --ok: #6fd69b; --okbg: #163826; --bad: #f08a8a; --badbg: #3d1d1d;
  --shadow: 0 2px 10px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }

/* 머리·발 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 19px; }
.logo svg { width: 34px; height: 34px; flex: none; }
.top nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { text-decoration: none; color: var(--ink2); padding: 6px 10px; border-radius: 10px; font-size: 15px; }
.top nav a:hover { background: var(--bg2); }
.langbtn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 5px 10px; font-size: 14px; }
footer { margin: 48px 0 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink2); font-size: 14px; }
footer a { color: var(--ink2); margin-right: 14px; }

/* 공용 조각 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 22px; font-weight: 700; font-size: 18px; text-decoration: none; background: var(--brand); color: #fff; min-height: 52px; }
.btn:hover { filter: brightness(1.07); }
.btn { white-space: nowrap; }
.joinbox .btn { flex: none; }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn.soft { background: var(--bg2); color: var(--ink); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.small { padding: 8px 14px; min-height: 40px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink2); }
.center { text-align: center; }
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.25; margin: 18px 0 10px; }
h2 { font-size: clamp(21px, 3vw, 27px); margin: 28px 0 10px; }
h3 { font-size: 19px; margin: 18px 0 6px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--bg2); color: var(--ink2); font-size: 14px; }
label.field { display: block; margin: 12px 0; }
label.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px 14px; font-size: 16px; min-height: 44px; }
.seg button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 700; }
input[type=text], input[type=tel] { width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; font-size: 20px; }
input:focus { border-color: var(--brand); outline: none; }

/* 첫 화면 */
.hero { padding: 18px 0 8px; }
.hero p.lead { font-size: 19px; color: var(--ink2); max-width: 640px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.mode { display: flex; flex-direction: column; gap: 10px; }
.mode h2 { margin: 0; }
.mode .btn { margin-top: auto; }
.joinbox { display: flex; gap: 8px; }
.joinbox input { font-size: 24px; letter-spacing: 4px; text-align: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.fact b { display: block; font-size: 26px; color: var(--brand); }

/* 보기 단추(혼자·휴대폰·큰 화면 공용) — 색 + 모양 + 숫자 셋 다(색약 배려) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: 14px; padding: 14px 16px; min-height: 72px; font-size: 19px; font-weight: 700; color: #fff; box-shadow: var(--shadow); }
.choice .sh { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); border-radius: 10px; font-size: 18px; }
.choice.c0 { background: var(--a0); } .choice.c1 { background: var(--a1); } .choice.c2 { background: var(--a2); color: var(--a2ink); } .choice.c3 { background: var(--a3); }
.choice.c2 .sh { background: rgba(0, 0, 0, .12); }
.choice.dim { opacity: .35; }
.choice.right { outline: 5px solid var(--ok); outline-offset: 3px; opacity: 1; }
.choice.wrong { outline: 5px dashed var(--bad); outline-offset: 3px; }
.choice .mark { margin-left: auto; font-size: 26px; }
.choice .cnt { margin-left: auto; font-size: 22px; background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 2px 10px; }
.solo .choice { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.solo .choice .sh { color: #fff; }
.solo .choice.c0 .sh { background: var(--a0); } .solo .choice.c1 .sh { background: var(--a1); } .solo .choice.c2 .sh { background: var(--a2); color: var(--a2ink); } .solo .choice.c3 .sh { background: var(--a3); }
.solo .choice:not(:disabled):hover { border-color: var(--brand); }
.solo .choice.right { background: var(--okbg); border-color: var(--ok); outline: none; }
.solo .choice.wrong { background: var(--badbg); border-color: var(--bad); outline: none; }

.verse { margin-top: 14px; border-left: 5px solid var(--gold); background: var(--bg2); border-radius: 0 12px 12px 0; padding: 12px 16px; font-family: var(--verse); font-size: 18px; line-height: 1.75; }
.verse .ref { display: block; font-family: var(--font); font-weight: 800; color: var(--gold); font-size: 15px; margin-bottom: 2px; }
.passage { font-family: var(--verse); font-size: 21px; line-height: 1.7; background: var(--bg2); border-radius: 12px; padding: 12px 16px; margin: 10px 0 14px; }
.passage .blank { display: inline-block; min-width: 3.2em; border-bottom: 3px solid var(--gold); text-align: center; color: var(--gold); font-weight: 800; }
.qtext { font-size: clamp(21px, 3.2vw, 28px); font-weight: 800; line-height: 1.45; margin: 8px 0 14px; }
.progress { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.feedback { font-weight: 800; font-size: 20px; margin-top: 10px; }
.feedback.ok { color: var(--ok); } .feedback.bad { color: var(--bad); }
.ad-slot { margin: 24px 0; min-height: 0; }
.ad-slot[hidden] { display: none !important; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; }
.ic.ok { background: var(--ok); } .ic.bad { background: var(--bad); }
.score-big { font-size: clamp(48px, 10vw, 76px); font-weight: 900; color: var(--brand); line-height: 1.1; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--bg2); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 24px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; z-index: 50; font-weight: 700; }

/* 진행자 큰 화면 — 교회 화면에서 뒷자리에서도 보이게. 글씨는 화면 크기를 따라 커지고 A+ 로 더 키운다 */
body.stage { --z: 1; overflow-x: hidden; }
.stage .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; }
.stage .bar .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.stage .screen { padding: 0 2.2vw 2vw; }
.stage .code-big { font-size: calc(11vw * var(--z)); font-weight: 900; letter-spacing: .06em; line-height: 1; color: var(--brand); }
.stage .joinurl { font-size: calc(2.3vw * var(--z)); font-weight: 700; }
.stage .lobby { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2.5vw; align-items: start; }
.stage .qr { background: #fff; padding: 14px; border-radius: 18px; display: inline-block; }
.stage .qr svg, .stage .qr img { display: block; width: min(26vw, 340px); height: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: calc(1.5vw * var(--z) + 6px); font-weight: 700; }
.chip .dot { width: .7em; height: .7em; border-radius: 50%; }
.chip.off { opacity: .45; }
.chip button { border: 0; background: none; color: var(--ink2); padding: 0 2px; font-size: .8em; }
.stage .sq { font-size: calc(3.4vw * var(--z)); font-weight: 800; line-height: 1.35; margin: 1vw 0; }
.stage .passage { font-size: calc(2.7vw * var(--z)); }
.stage .choices { gap: 1.4vw; }
.stage .choice { font-size: calc(2.6vw * var(--z)); min-height: 12vh; padding: 1.4vw 1.8vw; }
.stage .choice .sh { width: 1.6em; height: 1.6em; font-size: .9em; }
.stage .verse { font-size: calc(2.2vw * var(--z)); }
.stage .verse .ref { font-size: calc(1.5vw * var(--z) + 4px); }
.stage .meta { display: flex; justify-content: space-between; align-items: center; font-size: calc(1.6vw * var(--z) + 4px); font-weight: 700; color: var(--ink2); }
.timer { position: relative; width: calc(7vw * var(--z) + 30px); height: calc(7vw * var(--z) + 30px); }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(2.6vw * var(--z) + 6px); font-weight: 900; }
.board { display: grid; gap: .8vw; }
.brow { display: grid; grid-template-columns: 3em 1fr auto auto; align-items: center; gap: 1vw; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8vw 1.4vw; font-size: calc(2.1vw * var(--z) + 4px); font-weight: 800; }
.brow .gain { color: var(--ok); font-size: .75em; }
.brow .n { color: var(--gold); }
.tbars { display: grid; gap: .8vw; margin-top: 1.4vw; }
.tbar { display: grid; grid-template-columns: 7em 1fr 4em; gap: 1vw; align-items: center; font-size: calc(1.8vw * var(--z) + 4px); font-weight: 800; }
.tbar .track { background: var(--bg2); border-radius: 10px; height: 1.3em; overflow: hidden; }
.tbar .track i { display: block; height: 100%; border-radius: 10px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 2vw; margin: 2vw 0; }
.podium div { text-align: center; font-weight: 900; font-size: calc(2.2vw * var(--z) + 6px); }
.podium .blk { border-radius: 14px 14px 0 0; background: var(--brand); color: #fff; width: 16vw; display: grid; place-items: center; font-size: 1.6em; }
.podium .p1 .blk { height: 22vh; background: var(--gold); } .podium .p2 .blk { height: 15vh; } .podium .p3 .blk { height: 10vh; opacity: .8; }
.settings-side { font-size: 16px; }
.hint { font-size: 14px; color: var(--ink2); }
.fsline { margin-top: 1vw; }

/* 휴대폰 참여 화면 */
body.player { min-height: 100svh; display: flex; flex-direction: column; }
.player main { flex: 1; display: flex; flex-direction: column; padding: 12px 16px 20px; max-width: 560px; width: 100%; margin: 0 auto; }
.player .pbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; padding: 8px 0; }
.player .choices { grid-template-columns: 1fr 1fr; flex: 1; align-content: stretch; }
.player .choice { flex-direction: column; justify-content: center; text-align: center; min-height: 26svh; font-size: 18px; }
.player .choice .sh { width: 44px; height: 44px; font-size: 22px; }
.player .big { font-size: 30px; font-weight: 900; text-align: center; margin: 18px 0 6px; }
.player .tbadge { display: inline-block; color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 800; }
.tc0 { background: var(--t0); } .tc1 { background: var(--t1); } .tc2 { background: var(--t2); } .tc3 { background: var(--t3); }
.td0 { background: var(--t0); } .td1 { background: var(--t1); } .td2 { background: var(--t2); } .td3 { background: var(--t3); }
.tbarclr0 { background: var(--t0); } .tbarclr1 { background: var(--t1); } .tbarclr2 { background: var(--t2); } .tbarclr3 { background: var(--t3); }
.ring { width: 100%; height: 6px; background: var(--bg2); border-radius: 9px; overflow: hidden; }
.ring i { display: block; height: 100%; background: var(--gold); }
.bigok { font-size: 64px; text-align: center; line-height: 1; margin-top: 10vh; }

/* 글 쪽(소개·하는 법·개인정보·약관) */
.doc { max-width: 760px; }
.doc li { margin: 6px 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc td, .doc th { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; margin: 14px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
[data-lang-show]:not(.on) { display: none !important; }

@media (max-width: 560px) {
  .top { flex-wrap: wrap; row-gap: 4px; }
  .logo { white-space: nowrap; font-size: 17px; }
  .top nav { width: 100%; justify-content: flex-start; }
  .top nav .langbtn { margin-left: auto; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .choices { grid-template-columns: 1fr; }
  .player .choices { grid-template-columns: 1fr 1fr; }
  .stage .lobby { grid-template-columns: 1fr; }
  .stage .code-big { font-size: calc(16vw * var(--z)); }
  .stage .sq { font-size: calc(5.4vw * var(--z)); }
  .stage .choice { font-size: calc(4.4vw * var(--z)); }
  .stage .verse { font-size: calc(4vw * var(--z)); }
  .stage .passage { font-size: calc(4.6vw * var(--z)); }
  .brow, .tbar { font-size: 17px; }
  .chip { font-size: 15px; }
  .stage .joinurl { font-size: 18px; }
  .stage .qr svg, .stage .qr img { width: 56vw; }
  .podium .blk { width: 26vw; }
  .top nav a { padding: 6px 7px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
