/* 킹스맨 · 신사의 품격 (A안 하우스 스타일)
   네이비 원단 바탕 위 휴대폰 폭 앱 한 장. 첫 화면은 원단, 남편 화면은 셔츠 코튼, 아내 화면은 안감 실크, 결과는 원단.
   줄자 = 진행, 소매 단추 = 라운드 완료, 밀랍 봉인 = 제출. */
:root {
  --cloth: #0d1626;
  --cloth-2: #141f33;
  --seam: #2b3a54;
  --ivory: #efe9dc;
  --ivory-2: #f7f3ea;
  --ink: #14203a;
  --ink-muted: #5b6475;
  --stitch: #cfc5b0;
  --muted: #97a3b6;
  --gold: #c8a25a;
  --gold-deep: #8a6a2a;
  --gold-light: #e4c88a;
  --lining: #6a1e2b;
  --lining-muted: #dcc4c0;
  --wife-bar: #d6788a;
  --tape: #e6c34a;
  --danger: #c2413a;
  --goldleaf: linear-gradient(100deg, #8a6a2f 0%, #e9d39a 28%, #b8913f 46%, #f3e2b0 62%, #9c7633 100%);
  --display: "Song Myung", "Bodoni Moda", "AppleMyungjo", serif;
  --latin: "Bodoni Moda", Georgia, serif;
  --body: "IBM Plex Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

/* 화면별 색. 아래 컴포넌트는 이 변수만 씁니다. */
.t-cloth {
  --bg: var(--cloth); --fg: var(--ivory); --sub: var(--muted); --card: var(--cloth-2); --line: var(--seam);
  --accent: var(--gold); --btn-bg: var(--gold); --btn-fg: var(--cloth);
  --opt-bg: rgba(239,233,220,.06); --opt-line: rgba(239,233,220,.22); --opt-on-bg: var(--ivory); --opt-on-fg: var(--cloth);
  --star-off: rgba(239,233,220,.22); --star-on: var(--gold);
}
.t-paper {
  --bg: var(--ivory); --fg: var(--ink); --sub: var(--ink-muted); --card: var(--ivory-2); --line: var(--stitch);
  --accent: var(--gold-deep); --btn-bg: var(--cloth); --btn-fg: var(--ivory);
  --opt-bg: var(--ivory-2); --opt-line: var(--stitch); --opt-on-bg: var(--cloth); --opt-on-fg: var(--ivory);
  --star-off: var(--stitch); --star-on: var(--gold-deep);
  color-scheme: light;
}
.t-lining {
  --bg: var(--lining); --fg: var(--ivory); --sub: var(--lining-muted); --card: rgba(239,233,220,.06); --line: rgba(239,233,220,.26);
  --accent: var(--gold-light); --btn-bg: var(--ivory); --btn-fg: var(--lining);
  --opt-bg: rgba(239,233,220,.07); --opt-line: rgba(239,233,220,.28); --opt-on-bg: var(--ivory); --opt-on-fg: var(--lining);
  --star-off: rgba(239,233,220,.25); --star-on: var(--gold-light);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--cloth);
  background-image: repeating-linear-gradient(90deg, rgba(239,233,220,.028) 0 1px, transparent 1px 14px);
  color: var(--ivory);
  font: 400 16px/1.65 var(--body);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p, dl, dd, figure { margin: 0; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }
.focus-target:focus { outline: none; }
[hidden] { display: none !important; }
.noscript { padding: 24px; text-align: center; }

/* 앱 틀 */
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); }
@media (min-width: 560px) {
  .shell { margin: 24px auto; min-height: calc(100vh - 48px); border: 1px solid var(--seam); border-radius: 28px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.45); }
}
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 20px 6px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; }
.wordmark .km { font-family: var(--latin); font-style: italic; font-weight: 500; font-size: 1.125rem; color: var(--accent); }
.wordmark .sg { font-family: var(--display); font-size: .9375rem; }
.badge { font: 500 .6875rem/1 var(--mono); letter-spacing: .08em; padding: 6px 8px; border-radius: 999px; border: 1px dashed var(--accent); color: var(--accent); white-space: nowrap; }
.main { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }

/* 공통 글 */
.label { font: 500 .75rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.title { font-family: var(--display); font-size: 2rem; line-height: 1.3; }
.sub { color: var(--sub); }
.note { color: var(--sub); font-size: .875rem; }

/* 버튼 */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 12px 18px; border-radius: 12px; border: 0; background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; font-size: 1.0625rem; text-align: center; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.link { align-self: center; background: none; border: 0; padding: 10px; color: var(--sub); font-size: .9375rem; text-decoration: underline; text-underline-offset: 3px; }
.back { align-self: flex-start; background: none; border: 0; padding: 10px 0; color: var(--sub); font-size: .9375rem; }

/* 첫 화면 */
.hero { display: grid; gap: 6px; padding-top: 10px; }
.eyebrow { font: 500 .8125rem/1.4 var(--mono); letter-spacing: .08em; color: var(--accent); }
.brand { display: grid; gap: 2px; }
.brand-en { font-family: var(--latin); font-style: italic; font-weight: 500; font-size: clamp(3rem, 15vw, 3.8rem); line-height: 1; background: var(--goldleaf); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.brand-ko { font-family: var(--display); font-size: clamp(2rem, 9vw, 2.4rem); line-height: 1.2; }
.tagline { color: var(--sub); }

.video { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid rgba(200,162,90,.45); background: #000; aspect-ratio: 16 / 9; }
.video video, .video img { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.play { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; border: 0; background: linear-gradient(to bottom, rgba(13,22,38,.05), rgba(13,22,38,.55)); color: var(--ivory); }
.play-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--gold); box-shadow: 0 6px 20px rgba(0,0,0,.45); position: relative; }
.play-icon::after { content: ""; position: absolute; left: 27px; top: 21px; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--cloth); }
.play-label { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(13,22,38,.8); font-weight: 600; font-size: .875rem; }
.video-cap { font-size: .8125rem; color: var(--sub); margin-top: -10px; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.facts dt { font: 500 .75rem/1.9 var(--mono); letter-spacing: .06em; color: var(--accent); }
.facts dd { font-weight: 500; }

.status { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--accent); font-size: .9375rem; }
.status b { color: var(--accent); font-weight: 600; margin-right: 6px; }

.cta { position: sticky; bottom: 0; margin: auto -20px calc(-20px - env(safe-area-inset-bottom)); padding: 18px 20px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 4px; background: linear-gradient(to top, var(--bg) 72%, rgba(0,0,0,0)); }

/* 참석 응답 */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > .flabel { font-weight: 600; }
.field .err { display: none; color: var(--danger); font-size: .875rem; }
.field.invalid .err { display: block; }
.field.invalid .input, .field.invalid .chips { outline: 2px solid var(--danger); outline-offset: 3px; border-radius: 10px; }
.input { width: 100%; min-height: 52px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--opt-line); background: var(--opt-bg); color: var(--fg); font-weight: 500; }
.chip.on { background: var(--opt-on-bg); border-color: var(--opt-on-bg); color: var(--opt-on-fg); }
.form-error { color: var(--danger); font-weight: 500; }

/* 설문 진행: 줄자와 소매 단추 */
.progress { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.tape { position: relative; height: 12px; border-radius: 2px; background: rgba(200,162,90,.2); background: color-mix(in srgb, var(--accent) 18%, transparent); overflow: hidden; }
.tape-fill { position: absolute; inset: 0 auto 0 0; width: 0; background-color: var(--tape);
  background-image: repeating-linear-gradient(90deg, rgba(20,32,58,.7) 0 1px, transparent 1px 30px), repeating-linear-gradient(90deg, rgba(20,32,58,.45) 0 1px, transparent 1px 6px);
  background-size: auto 100%, auto 45%; background-repeat: repeat-x; transition: width .3s ease; }
.cuffs { display: flex; gap: 6px; }
.cuff { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--accent); }
.cuff.on { background: radial-gradient(circle at 35% 35%, #f3e2b0 0 18%, var(--gold) 45%, #8a6a2f 100%); border-color: var(--gold); }
.cuffs.big { gap: 10px; }
.cuffs.big .cuff { width: 24px; height: 24px; border-width: 2px; }
.counter { font: 500 .8125rem/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--sub); text-align: right; }

.q-screen { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.q-title { font-family: var(--display); font-size: 1.9rem; line-height: 1.32; }
.q-sub { color: var(--sub); margin-top: -6px; }
.q-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }

.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: baseline; gap: 8px; width: 100%; min-height: 54px; padding: 14px 16px; text-align: left; border-radius: 12px; border: 1px solid var(--opt-line); background: var(--opt-bg); color: var(--fg); font-weight: 500; }
.opt.on { background: var(--opt-on-bg); border-color: var(--opt-on-bg); color: var(--opt-on-fg); }
.opt .opt-sub { font-size: .875rem; opacity: .75; }
.opt .opt-name { font-family: var(--display); font-size: 1.1875rem; }

.stars { display: flex; justify-content: center; gap: 2px; padding: 10px 0 0; }
.star { min-width: 56px; min-height: 56px; background: none; border: 0; padding: 0; font-size: 2.9rem; line-height: 1; color: var(--star-off); }
.star.on { color: var(--star-on); }
.star-val { text-align: center; font: 500 .875rem/1 var(--mono); color: var(--sub); }

.tiles { display: grid; gap: 10px; }
.tile { width: 100%; min-height: 88px; padding: 18px 16px; border-radius: 14px; border: 1px solid var(--opt-line); background: var(--opt-bg); color: var(--fg); font-family: var(--display); font-size: 1.4rem; line-height: 1.3; }
.tile.on { background: var(--opt-on-bg); border-color: var(--opt-on-bg); color: var(--opt-on-fg); }
.vs { text-align: center; font-family: var(--latin); font-style: italic; font-size: 1.125rem; color: var(--sub); }

.intro-no { font-family: var(--latin); font-style: italic; font-size: 3.4rem; line-height: 1; color: var(--accent); }
.intro-name { font-family: var(--display); font-size: 2.2rem; line-height: 1.25; }
.intro-meta { font: 500 .8125rem/1 var(--mono); color: var(--sub); }

.line-input { width: 100%; min-height: 7rem; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--fg); resize: vertical; font-size: 1rem; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--gold); }

.seal-wrap { display: grid; justify-items: center; gap: 8px; padding-top: 4px; }
.seal { width: 96px; height: 96px; border-radius: 50%; border: 0; display: grid; place-items: center; background: radial-gradient(circle at 38% 32%, #9a3344 0 12%, #74202f 45%, #4a0f1a 100%); box-shadow: 0 0 0 4px rgba(122,32,47,.3), inset 0 -4px 10px rgba(0,0,0,.35); color: var(--gold-light); font-family: var(--latin); font-style: italic; font-weight: 700; font-size: 1.6rem; }
.t-lining .seal { box-shadow: 0 0 0 4px rgba(228,200,138,.45), inset 0 -4px 10px rgba(0,0,0,.35); }
.seal:disabled { opacity: .6; cursor: progress; }
.seal-caption { font-weight: 600; }

.done { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-top: 24px; }
.stack { margin-top: auto; display: grid; gap: 4px; }

/* 운영 보드 */
.tiles4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile4 { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tile4 .n { font-family: var(--latin); font-size: 2rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile4 .k { font-size: .8125rem; color: var(--sub); }
.dl { display: grid; gap: 8px; }
.dl .btn { min-height: 48px; font-size: .9375rem; }
.people { display: grid; gap: 8px; }
.person { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.person .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.person .nm { font-weight: 600; font-size: 1.0625rem; }
.person .att { padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--cloth); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.person .att.no { background: transparent; color: var(--sub); border: 1px solid var(--line); }
.person .meta { font-size: .875rem; color: var(--sub); }

/* 토스트·복사 시트 */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--ivory); border: 1px solid var(--gold); font-size: .9375rem; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 20; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 30; max-width: 480px; margin: 0 auto; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); background: var(--cloth-2); color: var(--ivory); border-top: 1px solid var(--gold); border-radius: 18px 18px 0 0; display: grid; gap: 10px; }
.sheet textarea { width: 100%; min-height: 6rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--seam); background: var(--cloth); color: var(--ivory); font-size: .9375rem; }

/* 결과 화면 (현장 프로젝터) */
.deck { height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 2vh; padding: max(16px, 2.2vw) max(16px, 3.2vw); color: var(--ivory); }
.deck-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.deck-top .wordmark .km { font-size: clamp(1.1rem, 1.8vw, 1.8rem); color: var(--gold); }
.deck-top .wordmark .sg { font-size: clamp(.95rem, 1.4vw, 1.4rem); }
.deck-meta { display: flex; gap: 10px; align-items: center; font: 500 clamp(.75rem, 1vw, 1rem)/1 var(--mono); color: var(--muted); }
.slide { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; gap: 3vh; cursor: pointer; }
.s-label { font: 500 clamp(.8rem, 1.1vw, 1.15rem)/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.s-title { font-family: var(--display); font-size: clamp(1.8rem, 3.8vw, 4rem); line-height: 1.2; margin-bottom: 1.2vh; }
.s-sub { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.6rem); }
.s-cover .brand-en { font-size: clamp(3.4rem, 9vw, 9rem); }
.s-cover .s-title { font-size: clamp(2.2rem, 5vw, 5.4rem); }
.legend { display: flex; gap: 18px; font-size: clamp(.85rem, 1.2vw, 1.25rem); color: var(--muted); }
.legend i { display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin-right: 8px; vertical-align: -.05em; }
.cmp { display: grid; gap: 2vh; }
.cmp-row { display: grid; gap: .8vh; }
.cmp-row .t { font-size: clamp(1.05rem, 2vw, 2.1rem); }
.cmp.compact { gap: 2.2vh; }
.cmp.compact .cmp-row { grid-template-columns: minmax(4.5em, 26%) 1fr; column-gap: 1.2vw; row-gap: 4px; align-items: center; }
.cmp.compact .cmp-row .t { grid-row: span 2; font-size: clamp(1rem, 1.7vw, 1.8rem); }
.bar { display: grid; grid-template-columns: 1fr minmax(4.5em, auto); gap: 12px; align-items: center; }
.bar .track { height: clamp(8px, 1.3vh, 18px); border-radius: 3px; background: rgba(239,233,220,.08); overflow: hidden; }
.bar .val { height: 100%; }
.bar.h .val { background: var(--gold); }
.bar.w .val { background: var(--wife-bar); }
.bar .num { font: 500 clamp(.85rem, 1.4vw, 1.5rem)/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; }
.duo .card { border: 1px solid var(--seam); border-radius: 16px; padding: clamp(14px, 2vw, 32px); background: rgba(239,233,220,.05); display: grid; gap: 6px; }
.duo .card.w { border-color: rgba(214,120,138,.6); }
.duo .who { font-size: clamp(.85rem, 1.2vw, 1.3rem); color: var(--muted); }
.duo .pick { font-family: var(--display); font-size: clamp(1.6rem, 3.6vw, 3.8rem); line-height: 1.2; }
.duo .pct { font: 500 clamp(.9rem, 1.4vw, 1.5rem)/1 var(--mono); color: var(--gold); }
.duo .card.w .pct { color: var(--wife-bar); }
.split { display: grid; gap: 1.6vh; }
.split-row { display: grid; grid-template-columns: minmax(7em, 22%) 1fr; gap: 1.6vw; align-items: center; }
.split-row .t { font-size: clamp(1rem, 1.7vw, 1.8rem); }
.split-bars { display: grid; gap: 4px; }
.sbar-line { display: grid; grid-template-columns: 2.6em 1fr; gap: 10px; align-items: center; }
.s-two { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3vw; align-items: start; }
.duo.stacked { grid-template-columns: 1fr; gap: 1.6vh; }
.sbar { display: flex; height: clamp(22px, 3vh, 40px); border-radius: 8px; overflow: hidden; font-size: clamp(.75rem, 1.1vw, 1.15rem); }
.sbar span { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; min-width: 0; }
.sbar .a { background: rgba(239,233,220,.85); color: var(--cloth); }
.sbar .b { background: var(--seam); color: var(--ivory); justify-content: flex-end; }
.sbar.w .a { background: var(--wife-bar); color: var(--cloth); }
.sbar-who { font: 500 clamp(.75rem, 1vw, 1.05rem)/1 var(--mono); color: var(--muted); }
.quote { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 4.2rem); line-height: 1.4; padding-left: 2vw; border-left: 4px solid var(--gold); }
.deck-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.deck-nav button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--seam); background: transparent; color: var(--ivory); }
.deck-msg { margin: auto; max-width: 36rem; text-align: center; display: grid; gap: 12px; }
@media (max-width: 900px) {
  .s-two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .duo { grid-template-columns: 1fr; }
  .split-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tape-fill { transition: none; }
}
