/* 전서낭도 — 참가자 화면 (사극 톤: 한지 · 먹 · 금 · 주사) */
@import url('https://fonts.googleapis.com/css2?family=Nanum+Myeongjo:wght@400;700;800&family=Song+Myung&display=swap');
:root {
  --hanji: #f3ead8; --hanji-2: #e9dfc8; --ink: #1f1a12; --ink-2: #3b3326; --gold: #b08d3c; --gold-2: #d9b85e;
  --red: #a4382f; --teal: #2f5d62; --green: #3f7d3a; --gray: #7d7566; --line: #c9bc9b; --team: #2e5ba0;
  --radius: 18px; --shadow: 0 6px 18px rgba(31, 26, 18, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }
body { margin: 0; font-family: 'Nanum Myeongjo', 'Apple SD Gothic Neo', serif; background: var(--hanji); color: var(--ink); line-height: 1.5; word-break: keep-all;
  background-image: radial-gradient(rgba(176, 141, 60, .08) 1px, transparent 1px); background-size: 7px 7px; min-height: 100vh; }
h1, h2, h3 { font-family: 'Song Myung', 'Nanum Myeongjo', serif; font-weight: 400; margin: 0; letter-spacing: .02em; }
button { font-family: inherit; font-size: 1rem; border: 0; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
.hidden { display: none !important; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.view { padding: 0 16px 100px; }

/* 상단 */
.top { background: var(--ink); color: var(--hanji); padding: 18px 20px 16px; border-radius: 0 0 26px 26px; box-shadow: var(--shadow); position: relative; }
.top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--team); border-radius: 0 0 0 0; }
.top .title { font-size: 1.65rem; font-family: 'Song Myung', serif; }
.top .sub { color: var(--gold-2); font-size: .9rem; margin-top: 4px; }
.top .meta { display: flex; gap: 14px; margin-top: 10px; font-size: .85rem; color: #d8cfb8; }
.top .meta b { color: #fff; font-weight: 700; }
.sos { position: absolute; right: 18px; top: 18px; width: 54px; height: 54px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: .85rem; letter-spacing: .05em; box-shadow: 0 3px 10px rgba(164, 56, 47, .5); }

/* 카드 */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; box-shadow: 0 2px 8px rgba(31, 26, 18, .05); }
.card h3 { font-size: 1.15rem; color: var(--ink-2); margin-bottom: 8px; }
.card.ink { background: var(--ink); color: var(--hanji); border-color: var(--ink); position: relative; overflow: hidden; }
.card.ink::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(217, 184, 94, .35); border-radius: 12px; pointer-events: none; }
.card.ink .label { color: var(--gold-2); font-size: .85rem; letter-spacing: .1em; }
.card.ink .clue-title { font-family: 'Song Myung', serif; font-size: 1.9rem; margin: 6px 0 10px; color: #fff; }
.card.ink .clue-body { font-size: 1.12rem; line-height: 1.75; white-space: pre-wrap; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .82rem; background: var(--gold); color: #fff; margin: 10px 8px 0 0; }
.chip.dim { background: #4a4235; color: var(--gold-2); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.btn { display: block; width: 100%; padding: 15px; border-radius: 14px; font-weight: 700; font-size: 1.05rem; text-align: center; color: #fff; background: var(--ink-2); }
.btn.gold { background: var(--gold); } .btn.teal { background: var(--teal); } .btn.red { background: var(--red); } .btn.line { background: transparent; color: var(--ink); border: 1.5px solid var(--ink-2); }
.btn:disabled { opacity: .45; }
.btn.small { padding: 10px; font-size: .92rem; width: auto; display: inline-block; }
.muted { color: var(--gray); font-size: .88rem; }
.field { margin-top: 10px; }
.field label { display: block; font-size: .85rem; color: var(--gray); margin-bottom: 4px; }
.field input, .field textarea { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf8; }
.field input:focus { outline: none; border-color: var(--gold); }
.role-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.role-row .role { width: 92px; font-weight: 700; font-size: .95rem; }
.role-row input { flex: 1; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fffdf8; }
.team-btn { display: flex; align-items: center; gap: 12px; width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; text-align: left; }
.team-btn .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.team-btn .nm { font-weight: 800; font-size: 1.05rem; }
.team-btn .st { margin-left: auto; font-size: .8rem; color: var(--gray); }

/* 보이스 */
.voice { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 12px; }
.voice .play { width: 54px; height: 54px; border-radius: 50%; background: var(--red); color: #fff; font-size: 1.3rem; flex: none; }
.voice .bars { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; }
.voice .bars i { display: block; width: 4px; background: var(--line); border-radius: 2px; height: 30%; }
.voice.playing .bars i { background: var(--red); animation: bar .8s infinite ease-in-out alternate; }
@keyframes bar { from { height: 20%; } to { height: 100%; } }
.voice .bars i:nth-child(2n) { animation-delay: .15s; } .voice .bars i:nth-child(3n) { animation-delay: .3s; }

/* 인증 */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.shots .shot { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--hanji-2); }
.shots .shot img, .shots .shot video { width: 100%; height: 100%; object-fit: cover; }
.shots .shot .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; }
.shots .add { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gray); font-size: .85rem; background: #fffdf8; }
.shots .add span { font-size: 1.6rem; }
.progress { height: 10px; background: var(--hanji-2); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .3s; }
.status { border-radius: 14px; padding: 14px 16px; margin-top: 12px; font-weight: 700; }
.status.pending { background: #fff7e0; color: #8a6a1e; border: 1px solid #e6cf84; }
.status.approved { background: #e8f3e6; color: var(--green); border: 1px solid #a9cfa4; }
.status.rejected { background: #f9e5e2; color: var(--red); border: 1px solid #e3a9a3; }
.status small { display: block; font-weight: 400; margin-top: 4px; }

/* 목록 */
.done-list .item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.done-list .item .n { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex: none; }
.done-list .item .n.p { background: var(--gold); } .done-list .item .n.r { background: var(--red); }
.lb .r { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.lb .r.me { background: #fff8e4; margin: 0 -8px; padding: 7px 8px; border-radius: 8px; }
.lb .r .dot { width: 14px; height: 14px; border-radius: 50%; }
.lb .r .sc { margin-left: auto; font-weight: 700; }
.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.gal img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.notice { background: #fff3d6; border: 1px solid #e3c87a; border-radius: 12px; padding: 10px 14px; margin-top: 12px; font-size: .95rem; }
.notice b { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: .95rem; box-shadow: var(--shadow); z-index: 50; max-width: 90%; text-align: center; }

/* 퀴즈 모달 */
.modal { position: fixed; inset: 0; background: rgba(20, 16, 10, .78); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 40; }
.modal .box { background: var(--ink); color: var(--hanji); border-radius: 22px; padding: 22px; width: 100%; max-width: 440px; border: 1px solid rgba(217, 184, 94, .4); }
.modal .q { font-size: 1.25rem; line-height: 1.6; margin: 10px 0 18px; }
.modal .timer { font-family: 'Song Myung', serif; font-size: 2rem; color: var(--gold-2); text-align: right; }
.ox { display: flex; gap: 12px; }
.ox button { flex: 1; padding: 22px; border-radius: 16px; font-family: 'Song Myung', serif; font-size: 2.4rem; color: #fff; }
.ox .o { background: var(--teal); } .ox .x { background: #b5582f; }
.choice button { display: block; width: 100%; text-align: left; background: #3b3326; color: #fff; padding: 14px; border-radius: 12px; margin-top: 8px; }
.pledge-list .p { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.pledge-list input { width: 22px; height: 22px; accent-color: var(--red); }
.prelude { font-size: .95rem; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; }
.final { text-align: center; padding: 40px 10px; }
.final .big { font-family: 'Song Myung', serif; font-size: 2rem; line-height: 1.4; color: var(--ink); margin: 20px 0; }
.foot { text-align: center; color: var(--gray); font-size: .78rem; padding: 20px 0 0; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .8s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
