/* ============================================================
   비전스튜디오 프리미엄 · 유족 앱 디자인
   - 테마: classic(전통) · buddhist(불교) · catholic(천주교) · christian(기독교)
   - 어두운 바탕 + 금빛 포인트 + 한지 결 질감. 글자는 크고 대비 높게(고객 친화).
   ============================================================ */
:root {
  --font-serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", "BatangChe", serif;
  --font-sans: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --radius: 18px; --tap: 58px;
  /* 금빛 팔레트(공통) */
  --gold: #d6b86e; --gold-2: #f6e6b4; --gold-3: #8c6c2b; --gold-4: #5c4418;
  /* ---- classic(전통 · 먹색과 금) ---- */
  --bg: #0f1216; --bg-2: #1b2029; --bg-3: #262c38;
  --glow: 214, 184, 110;              /* rgb 튜플: rgba(var(--glow), .3) 처럼 씀 */
  --glow-2: 120, 140, 180;
  --surface: rgba(255,255,255,.055); --surface-2: rgba(255,255,255,.10); --surface-solid: #1c2129;
  --line: rgba(214,184,110,.22); --line-strong: rgba(214,184,110,.45);
  --ink: #f4eee1; --muted: #b7ae9c; --accent: #d6b86e; --accent-ink: #1b1409;
  --btn-a: #efd48c; --btn-b: #c9a95c;
  --danger: #e07a68; --ok: #86c9a0; --warn-bg: rgba(214,184,110,.10);
  --ai-bg: rgba(160,140,220,.14); --ai-ink: #d9cdf5;
  --symbol: "✦";
  --backdrop: none;
}
[data-theme="buddhist"] {
  --bg: #15090d; --bg-2: #2a1418; --bg-3: #3a1d22;
  --glow: 238, 170, 96; --glow-2: 200, 90, 110;
  --line: rgba(232,190,120,.24); --line-strong: rgba(232,190,120,.5);
  --accent: #e2bd74; --btn-a: #f2d692; --btn-b: #cfa85a;
  --symbol: "❁";
  --backdrop: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><g fill='none' stroke='%23e8be78' stroke-opacity='.24' stroke-width='2' transform='translate(200 260)'><path d='M0-110C34-70 34-14 0 30C-34-14-34-70 0-110Z'/><path d='M0-110C34-70 34-14 0 30C-34-14-34-70 0-110Z' transform='rotate(28)'/><path d='M0-110C34-70 34-14 0 30C-34-14-34-70 0-110Z' transform='rotate(-28)'/><path d='M0-100C30-64 30-16 0 20C-30-16-30-64 0-100Z' transform='rotate(56)'/><path d='M0-100C30-64 30-16 0 20C-30-16-30-64 0-100Z' transform='rotate(-56)'/><path d='M-120 30C-70 90 70 90 120 30' /></g></svg>");
}
[data-theme="catholic"] {
  --bg: #0b0e1e; --bg-2: #171b3a; --bg-3: #23284f;
  --glow: 150, 170, 255; --glow-2: 220, 120, 150;
  --line: rgba(220,196,130,.24); --line-strong: rgba(220,196,130,.5);
  --accent: #dcc47f; --btn-a: #efdb98; --btn-b: #c6ab5e;
  --symbol: "✝";
  --backdrop: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><g fill='none' stroke='%23dcc47f' stroke-opacity='.22' stroke-width='2'><path d='M200 40v300M120 130h160'/><path d='M200 20a180 180 0 0 1 180 180H20A180 180 0 0 1 200 20Z'/><path d='M200 70a130 130 0 0 1 130 130H70A130 130 0 0 1 200 70Z'/></g></svg>");
}
[data-theme="christian"] {
  --bg: #0a171c; --bg-2: #123039; --bg-3: #1b4350;
  --glow: 200, 226, 255; --glow-2: 120, 200, 210;
  --line: rgba(230,208,140,.24); --line-strong: rgba(230,208,140,.5);
  --accent: #e6d08c; --btn-a: #f4e3a6; --btn-b: #cdb266;
  --symbol: "✝";
  --backdrop: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><g fill='none' stroke='%23e6d08c' stroke-opacity='.22' stroke-width='2'><path d='M200 60v260M130 150h140'/><g stroke-opacity='.08'><path d='M200 200L20 0M200 200L380 0M200 200L0 120M200 200L400 120M200 200L60 400M200 200L340 400'/></g></g></svg>");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans);
  font-size: 18px; line-height: 1.55; -webkit-text-size-adjust: 100%; }
body { padding-bottom: 108px; min-height: 100dvh; position: relative; }
/* 배경: 은은한 빛 + 테마 문양 + 한지 결 */
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -5%, rgba(var(--glow), .30), transparent 70%),
    radial-gradient(45% 35% at 90% 90%, rgba(var(--glow-2), .16), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%, var(--bg)); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 1;
  background-image: var(--backdrop), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-repeat: no-repeat, repeat; background-position: center 42%, 0 0; background-size: min(120vw, 720px) auto, 260px 260px; }

h1 { font-family: var(--font-serif); font-size: 24px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
h2 { font-family: var(--font-serif); font-size: 22px; margin: 0 0 8px; font-weight: 700; color: var(--ink); }
h3 { font-family: var(--font-serif); font-size: 17px; margin: 0 0 8px; color: var(--accent); font-weight: 600; letter-spacing: .5px; }
p { margin: 6px 0; }
small, .muted { color: var(--muted); font-size: 15px; }
a { color: var(--accent); }
b, strong { color: var(--ink); }
.serif { font-family: var(--font-serif); }
.orn { display: flex; align-items: center; gap: 10px; color: var(--accent); margin: 8px 0 14px; opacity: .85; }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.orn i { font-style: normal; font-size: 12px; letter-spacing: 6px; }

header.top { position: sticky; top: 0; z-index: 5; padding: 14px 18px 10px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
header.top .brand { font-family: var(--font-serif); font-weight: 700; font-size: 19px; letter-spacing: .2px; color: var(--gold-2); display: flex; align-items: center; gap: 8px; }
header.top .brand::before { content: var(--symbol); color: var(--accent); font-size: 15px; opacity: .9; }
header.top .who { font-size: 15px; color: var(--muted); }

main { padding: 12px 16px; max-width: 580px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card.tight { padding: 14px; }
.card.hero { text-align: center; padding: 22px 18px; background: linear-gradient(180deg, rgba(var(--glow), .12), var(--surface)); }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.stack > * + * { margin-top: 10px; }

button, .btn { appearance: none; border: none; border-radius: 16px; min-height: var(--tap); padding: 0 18px; font-size: 18px; font-weight: 700; font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b)); color: var(--accent-ink); cursor: pointer; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.55), 0 0 0 1px rgba(0,0,0,.25); text-decoration: none; transition: transform .12s, box-shadow .2s, filter .2s; }
button:active, .btn:active { transform: translateY(1px); filter: brightness(.96); }
button.secondary, .btn.secondary { background: rgba(255,255,255,.04); color: var(--accent); border: 1.5px solid var(--line-strong); box-shadow: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 600; box-shadow: none; }
button.danger { background: linear-gradient(180deg, #e08a7a, #b8503f); color: #fff; }
button.small, .btn.small { min-height: 42px; font-size: 15px; padding: 0 14px; width: auto; border-radius: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { width: 100%; font: inherit; font-size: 18px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px;
  background: rgba(0,0,0,.28); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
input::placeholder, textarea::placeholder { color: rgba(183,174,156,.7); }
input:focus, textarea:focus, select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(var(--glow), .18); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
select option { background: var(--surface-solid); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 15px; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 12px; }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; z-index: 10; padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10,12,16,.82); border-top: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
nav.tabs button { flex: 1; max-width: 150px; background: transparent; color: var(--muted); border-radius: 0; min-height: 86px; font-size: 15px; font-weight: 700; flex-direction: column; gap: 5px; box-shadow: none; position: relative; padding: 0 6px; }
nav.tabs button svg { width: 36px; height: 36px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
nav.tabs button.active { color: var(--gold-2); }
nav.tabs button.active svg { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(var(--glow), .85)); }
nav.tabs button.active::after { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
@media (max-width: 420px) { nav.tabs button { font-size: 14px; min-height: 80px; } nav.tabs button svg { width: 32px; height: 32px; } }

/* ---------- 봉안함 보기: 액자 + 막 + 촛불 + 향 ---------- */
.viewer { position: relative; padding: 9px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold) 22%, var(--gold-3) 48%, var(--gold-2) 70%, var(--gold-3) 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 18px 46px rgba(0,0,0,.5), 0 0 40px rgba(var(--glow), .12); }
.viewer::before { content: ""; position: absolute; inset: 3px; border-radius: 13px; border: 1px solid rgba(255,255,255,.45); pointer-events: none; z-index: 3; }
.snapshot { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0b0d10; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.snapshot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.snapshot::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(0,0,0,.55); }
.snapshot .placeholder { color: #cfc8ba; text-align: center; padding: 20px; font-size: 16px; }
.snapshot .badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 20px; z-index: 2; }
.snapshot .badge.live { background: rgba(190,60,50,.9); box-shadow: 0 0 12px rgba(220,80,60,.6); }
.snapshot .tap-hint { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,.55); color: var(--gold-2); font-size: 13px; padding: 4px 10px; border-radius: 20px; z-index: 2; border: 1px solid var(--line); }
.title-card { position: absolute; left: 0; right: 0; top: 42%; text-align: center; z-index: 5; pointer-events: none;
  font-family: var(--font-serif); font-size: 26px; color: var(--gold-2); text-shadow: 0 2px 20px rgba(0,0,0,.8), 0 0 30px rgba(var(--glow), .6); letter-spacing: 1px; }
.status-line { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 15px; color: var(--muted); flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #666; margin-right: 6px; box-shadow: 0 0 0 2px rgba(255,255,255,.06); }
.dot.on { background: var(--ok); box-shadow: 0 0 10px rgba(134,201,160,.7); } .dot.busy { background: #e2b04a; box-shadow: 0 0 10px rgba(226,176,74,.7); }
.chime-toggle { background: transparent; border: 1px solid var(--line); color: var(--muted); min-height: 36px; font-size: 14px; padding: 0 10px; border-radius: 10px; width: auto; box-shadow: none; font-weight: 600; }
.chime-toggle.on { color: var(--accent); border-color: var(--line-strong); }

.notice { background: var(--warn-bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 15px; color: var(--ink); }
.notice.ai { background: var(--ai-bg); border-color: rgba(190,170,240,.3); color: var(--ai-ink); font-weight: 600; }
.notice.danger { background: rgba(224,122,104,.14); border-color: rgba(224,122,104,.45); color: #f3b3a7; }

.portrait { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); background: var(--bg-3); box-shadow: 0 0 0 4px rgba(var(--glow), .15), 0 10px 30px rgba(0,0,0,.5); }
.portrait.big { width: 148px; height: 148px; }
.dates { color: var(--muted); font-size: 15px; font-family: var(--font-serif); letter-spacing: .5px; }
.guest { border-top: 1px solid var(--line); padding: 10px 0; }
.guest .who { font-weight: 700; font-size: 15px; color: var(--gold-2); } .guest .when { color: var(--muted); font-size: 13px; margin-left: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); }
.media-grid .cap { font-size: 12px; color: var(--muted); }
.ai-tag { display: inline-block; background: var(--ai-bg); color: var(--ai-ink); font-size: 11px; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

.ritual { border-top: 1px solid var(--line); padding: 12px 0; }
.ritual:first-child { border-top: none; }
.ritual .when { font-weight: 700; color: var(--accent); font-family: var(--font-serif); }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 10px; background: var(--surface-2); color: var(--muted); margin-left: 6px; border: 1px solid var(--line); }
.pill.live { background: rgba(190,60,50,.85); color: #fff; border-color: transparent; }
.pill.ok { background: rgba(134,201,160,.15); color: var(--ok); }
.stream { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); }
.stream img, .stream iframe { width: 100%; height: 100%; border: 0; object-fit: contain; }

/* ---------- 대화 ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 212px); min-height: 360px; }
.chat-wrap > .shrine, .chat-wrap > .chat-head, .chat-wrap > .chat-input, .chat-wrap > .notice, .chat-wrap > p { flex: none; }
.chat-head { display: flex; align-items: center; gap: 12px; }
.chat-log { flex: 1 1 auto; min-height: 64px; overflow-y: auto; padding: 8px 2px; scrollbar-width: thin; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 18px; margin: 7px 0; font-size: 18px; line-height: 1.6; }
.bubble.them { background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06)); border: 1px solid var(--line); border-bottom-left-radius: 5px; font-family: var(--font-serif); font-size: 19px; color: var(--ink); }
.bubble.me { background: linear-gradient(180deg, rgba(var(--glow), .32), rgba(var(--glow), .20)); color: var(--ink); margin-left: auto; border-bottom-right-radius: 5px; border: 1px solid var(--line); }
.bubble.sys { background: var(--warn-bg); border: 1px solid var(--line); font-size: 15px; max-width: 100%; color: var(--muted); }
.bubble.danger { background: rgba(224,122,104,.14); border: 1px solid rgba(224,122,104,.45); color: #f3b3a7; max-width: 100%; }
.chat-input { display: flex; gap: 8px; align-items: center; padding-top: 8px; }
.chat-input input { flex: 1; }
.mic { width: 64px; min-width: 64px; height: 64px; border-radius: 50%; padding: 0; font-size: 26px; }
.mic.listening { background: linear-gradient(180deg, #e08a7a, #b8503f); color: #fff; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.modal { background: var(--surface-solid); color: var(--ink); width: 100%; max-width: 580px; border-radius: 22px 22px 0 0; padding: 20px 18px 30px; max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--line-strong); border-bottom: none; box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; margin: 10px 0; }
.check input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 116px; transform: translateX(-50%); background: rgba(20,22,28,.95); color: var(--gold-2); padding: 11px 18px; border-radius: 14px; font-size: 15px; z-index: 60; max-width: 90%; text-align: center; border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: none; }
.link-box { font-size: 13px; word-break: break-all; background: rgba(0,0,0,.3); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); }
.center { text-align: center; }
.big-num { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.hidden { display: none !important; }

/* ---------- 아바타 성소(액자 창) ---------- */
.shrine { position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.shrine-frame { position: relative; z-index: 1; height: min(340px, 30dvh); width: auto; max-width: 76vw; aspect-ratio: 4 / 5; padding: 10px;
  border-radius: 50% 50% 18px 18px / 36% 36% 18px 18px;
  background: linear-gradient(160deg, var(--gold-2) 0%, var(--gold) 18%, var(--gold-3) 42%, var(--gold-2) 58%, var(--gold-3) 82%, var(--gold-2) 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 24px 60px rgba(0,0,0,.6), 0 0 50px rgba(var(--glow), .18); transition: box-shadow .6s; }
.shrine-frame::before { content: ""; position: absolute; inset: 4px; border-radius: 50% 50% 15px 15px / 36% 36% 15px 15px; border: 1px solid rgba(255,255,255,.55); pointer-events: none; z-index: 5; }
.shrine-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; z-index: 5; }
.shrine-inner { position: absolute; inset: 10px; overflow: hidden; border-radius: 50% 50% 10px 10px / 36% 36% 10px 10px; background: radial-gradient(70% 60% at 50% 40%, var(--bg-3), var(--bg) 100%); }
.shrine-inner img, .shrine-inner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shrine-inner img { -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%); mask-image: linear-gradient(180deg, #000 82%, transparent 100%); }
.shrine-inner video { opacity: 0; transition: opacity 2s ease; background: transparent; }
.shrine.live .shrine-inner video { opacity: 1; }
.shrine.live .shrine-inner img { opacity: 0 !important; transition: opacity 1.6s .4s; }
.shrine-inner .no-photo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; color: var(--gold); }
.shrine.listening .shrine-frame { box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 24px 60px rgba(0,0,0,.6), 0 0 60px rgba(120,200,255,.35); }
.shrine-caption { z-index: 2; margin-top: 12px; text-align: center; }
.live-badge { display: inline-block; font-size: 11px; color: var(--ai-ink); background: var(--ai-bg); border: 1px solid rgba(190,170,240,.35); padding: 2px 9px; border-radius: 10px; letter-spacing: .3px; }
.voice-tag { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 목소리 등록(녹음) ---------- */
.rec-btn { width: 96px; height: 96px; border-radius: 50%; padding: 0; font-size: 34px; margin: 6px auto; display: flex; }
.rec-btn.on { background: linear-gradient(180deg, #e08a7a, #b8503f); color: #fff; }
.rec-time { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; color: var(--accent); }
.rec-time.short { color: var(--danger); }
.script { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.7; }
.script b { color: var(--gold-2); }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border-radius: 0; background: transparent; color: var(--muted); font-size: 15px; min-height: 48px; font-weight: 600; box-shadow: none; }
.seg button.active { background: rgba(var(--glow), .22); color: var(--gold-2); }

/* ---------- 테마 고르기 ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; background: rgba(0,0,0,.2); text-align: left; display: flex; gap: 10px; align-items: center; min-height: 64px; box-shadow: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.tile .sw { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold); flex: none; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--gold-2); }
.tile[data-theme="classic"] .sw { background: linear-gradient(135deg, #1b2029, #0f1216); }
.tile[data-theme="buddhist"] .sw { background: linear-gradient(135deg, #3a1d22, #15090d); }
.tile[data-theme="catholic"] .sw { background: linear-gradient(135deg, #23284f, #0b0e1e); }
.tile[data-theme="christian"] .sw { background: linear-gradient(135deg, #1b4350, #0a171c); }
.tile.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--glow), .2); }
.tile small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- 로컬 시작 화면 ---------- */
.launch .who-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.launch .who-row:first-child { border-top: none; }
.launch .who-row .btn { width: auto; min-height: 44px; font-size: 15px; padding: 0 16px; border-radius: 12px; flex: none; }

/* ---------- 제사 생중계(틱톡 라이브식 전체 화면) ---------- */
.noscroll { overflow: hidden; }
.live-view { position: fixed; inset: 0; z-index: 80; background: radial-gradient(80% 60% at 50% 40%, #1b2029, #07080a); overflow: hidden; color: #fff; font-family: var(--font-sans); }
.live-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.live-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.6), transparent 22%, transparent 52%, rgba(0,0,0,.78)); }
.live-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 14px 8px; }
.live-badge-red { background: #d93a2f; color: #fff; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px; letter-spacing: .5px; box-shadow: 0 0 12px rgba(217,58,47,.7); }
.live-title { font-family: var(--font-serif); font-weight: 700; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.live-viewers { font-size: 13px; background: rgba(0,0,0,.45); padding: 3px 9px; border-radius: 12px; white-space: nowrap; }
.live-close { width: 36px; min-width: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; box-shadow: none; font-size: 16px; border: 1px solid rgba(255,255,255,.2); }
.live-now { position: absolute; top: 58px; left: 14px; right: 14px; }
.live-now-in { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; background: rgba(0,0,0,.5); border: 1px solid rgba(214,184,110,.5); border-radius: 12px; padding: 8px 12px; font-size: 14px; backdrop-filter: blur(6px); }
.live-now-in b { font-family: var(--font-serif); font-size: 18px; color: var(--gold-2); }
.live-now-k { color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: .5px; }
.live-mine { background: var(--gold); color: #1b1409; font-weight: 800; font-size: 12px; padding: 1px 8px; border-radius: 8px; }
.live-msgs { position: absolute; left: 12px; right: 84px; bottom: 134px; display: flex; flex-direction: column; gap: 6px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 28%); mask-image: linear-gradient(180deg, transparent, #000 28%); }
.live-msg { align-self: flex-start; background: rgba(0,0,0,.45); border-radius: 14px; padding: 6px 12px; font-size: 15px; line-height: 1.4; max-width: 100%; backdrop-filter: blur(4px); word-break: break-word; }
.live-msg b { color: var(--gold-2); margin-right: 6px; font-weight: 700; }
.live-msg.site { background: rgba(214,184,110,.22); border: 1px solid rgba(214,184,110,.5); }
.live-msg.notice { background: rgba(214,184,110,.92); color: #1b1409; font-weight: 700; } .live-msg.notice b { color: #1b1409; }
.live-bar { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 72px); display: flex; gap: 8px; }
.live-bar input { flex: 1; background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.25); color: #fff; font-size: 16px; padding: 10px 14px; border-radius: 22px; }
.live-send { width: auto; min-height: 44px; padding: 0 16px; border-radius: 22px; font-size: 15px; }
.live-react { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px); display: flex; gap: 8px; justify-content: flex-end; }
.live-react button { width: 46px; min-width: 46px; min-height: 46px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.5); box-shadow: none; font-size: 22px; border: 1px solid rgba(255,255,255,.2); color: #fff; }
.live-react .live-orderbtn { width: auto; padding: 0 14px; border-radius: 23px; font-size: 14px; color: var(--gold-2); font-weight: 700; margin-right: auto; }
.live-fx { position: absolute; right: 0; bottom: 130px; width: 55%; height: 60%; pointer-events: none; overflow: hidden; }
.live-fx i, .fx i { position: absolute; bottom: 0; font-style: normal; font-size: 30px; opacity: 0; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.live-drawer { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; z-index: 2; }
.live-drawer-in { background: var(--surface-solid); color: var(--ink); width: 100%; border-radius: 22px 22px 0 0; padding: 18px 16px 24px; max-height: 70%; overflow-y: auto; border-top: 1px solid var(--line-strong); }
.live-order-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.live-order-row:first-child { border-top: none; }
.live-order-row .no { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--gold); flex: none; }
.live-order-row.now { background: rgba(var(--glow), .14); margin: 0 -8px; padding: 10px 8px; border-radius: 10px; border-top: none; }
.live-order-row.now .no { background: var(--gold); color: #1b1409; border-color: var(--gold); }
.live-order-row.mine b { color: var(--gold-2); }
.live-ended { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); font-family: var(--font-serif); font-size: 22px; color: var(--gold-2); z-index: 1; }

/* 짧은 화면(노트북 125% 배율 등): 액자를 더 줄이고 장식을 접어 마이크·입력칸이 항상 보이게 */
@media (max-height: 700px) {
  .shrine-frame { height: min(300px, 24dvh); }
  .shrine { padding: 4px 0 0; }
  .shrine-caption .voice-scene { display: none; }
  .shrine-caption { margin-top: 6px; }
  .chat-head h2 { font-size: 18px; }
  .chat-wrap { height: calc(100dvh - 200px); min-height: 300px; }
}
