:root {
  --bg: #0d0b1a;
  --panel: #1b1631;
  --panel-2: #251e42;
  --line: rgba(216, 180, 106, 0.28);
  --gold: #d8b46a;
  --gold-soft: #f0d9a4;
  --text: #f3ead8;
  --muted: #b8aed0;
  --accent: #8a6fd1;
  --danger: #e2876f;
  --radius: 16px;
  --serif: "Nanum Myeongjo", "Noto Serif KR", serif;
  --sans: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(circle at 50% 0%, #241b45 0%, var(--bg) 60%);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
.hidden { display: none !important; }

#app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}
.screen { position: absolute; inset: 0; display: none; overflow-y: auto; }
.screen.active { display: block; }

/* 버튼 */
.primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #2a1f12;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 20px;
}
.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
}
.big { width: 100%; padding: 16px; font-size: 17px; }
.small { font-size: 13px; padding: 8px 12px; }
.icon { background: none; font-size: 22px; padding: 4px 8px; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: middle;
}
.fineprint { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 1. 인트로 */
.intro-bg {
  position: absolute;
  inset: 0;
  background: url("assets/dalha_base.jpg") center top / cover;
  filter: brightness(0.45) saturate(1.1);
}
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.intro-content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 32px 24px 40px;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(13, 11, 26, 0.95) 35%);
}
.eyebrow { color: var(--gold); font-size: 13px; letter-spacing: 0.2em; margin: 0; }
h1 { font-family: var(--serif); font-size: 40px; margin: 8px 0; color: var(--gold-soft); }
.slogan { color: var(--muted); margin: 0 0 28px; }

/* AI 모드 표시 */
.mode-info {
  margin-top: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  display: grid;
  gap: 4px;
}
.mode-info b { color: var(--gold-soft); }
.mode-info span { color: var(--muted); }
.mode-row { display: flex; gap: 8px; margin-top: 4px; }
.mode-row select { flex: 1; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px; font: inherit; }
.tag { font-size: 11px; color: #2a1f12; background: var(--gold); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.subtitle.thinking::after { content: "· · ·"; letter-spacing: 4px; animation: dots 1.2s infinite; }
@keyframes dots { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* 2. 로비 */
#lobby { padding: 20px 16px 32px; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; }
.lobby-head h2 { font-family: var(--serif); color: var(--gold-soft); margin: 0; }
.balance { font-size: 13px; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
#lobby h3 { font-size: 15px; color: var(--muted); margin: 24px 0 10px; }
.daily-banner {
  margin-top: 16px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.daily-banner img { width: 56px; height: 56px; object-fit: cover; object-position: center 40%; border-radius: 12px; }
.daily-banner b { display: block; }
.daily-banner span { font-size: 13px; color: var(--muted); }
.reader-list { display: grid; gap: 12px; }
.reader-card {
  display: flex;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px;
}
.reader-card img { width: 92px; height: 132px; object-fit: cover; object-position: center 20%; border-radius: 12px; }
.reader-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.reader-name { font-family: var(--serif); font-size: 20px; font-weight: 800; }
.reader-role { color: var(--accent); font-size: 13px; font-weight: 700; }
.reader-tag { color: var(--muted); font-size: 13px; line-height: 1.4; word-break: keep-all; }
.reader-actions { margin-top: auto; display: flex; gap: 8px; }
.reader-actions button { padding: 8px 12px; font-size: 14px; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.history .empty { background: var(--panel); border-radius: 12px; padding: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* 3. 동의 */
#consent { padding: 28px 20px; }
.consent h2 { font-family: var(--serif); color: var(--gold-soft); }
.notice { padding-left: 18px; line-height: 1.6; color: var(--muted); }
.notice b { color: var(--text); }
.field { display: grid; gap: 8px; margin: 20px 0 12px; }
.field input, .controls input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }

/* 화면 전환 */
.screen.active { animation: fadein 0.6s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* 떠다니는 금빛 먼지 */
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* 인트로 연출 */
.intro-bg { animation: introZoom 24s ease-in-out infinite alternate; }
@keyframes introZoom { from { transform: scale(1.02); } to { transform: scale(1.12) translateY(2%); } }
.intro-content h1 { animation: rise 1.4s ease-out both 0.2s; }
.intro-content .slogan { animation: rise 1.4s ease-out both 0.6s; }
.intro-content .primary { animation: rise 1.2s ease-out both 1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* 4. 상담실 */
#room { overflow: hidden; }
.stage { position: absolute; inset: 0; }

/* 리더 움직임: 층마다 하나씩 맡아요(같은 요소에 애니메이션과 전환을 섞으면 서로 덮어써요) */
.cam, .drift, .pose, .nod, .bob, .sway { position: absolute; inset: 0; }
/* 카메라: 질문할 때·들을 때는 얼굴 쪽으로 가까이 */
.cam { transform-origin: 50% 32%; transition: transform 1.6s cubic-bezier(0.45, 0, 0.25, 1); }
#room[data-shot="close"] .cam { transform: scale(1.075); }
/* 아주 천천히 흐르는 화면. 기울여도 가장자리가 안 보이게 조금 확대해 둬요 */
.drift { animation: drift 34s ease-in-out infinite alternate; transform-origin: 50% 35%; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1.11) translate(-0.6%, 0.5%); } }
/* 자세: 듣기(앞으로 기울기), 생각(고개 기울여 카드 내려다보기), 카드 보기(그 카드 쪽으로), 질문(나를 보며 다가오기) */
.pose { transform-origin: 50% 78%; transition: transform 0.9s cubic-bezier(0.45, 0, 0.25, 1); }
#room[data-pose="listen"] .pose { transform: translateY(1.2%) scale(1.035); }
#room[data-pose="think"] .pose { transform: rotate(-1.3deg) translate(-0.8%, 1.8%) scale(1.02); }
#room[data-pose="talk"] .pose { transform: scale(1.01); }
#room[data-pose="ask"] .pose { transform: translateY(0.6%) scale(1.045); }
#room[data-pose="read0"] .pose { transform: rotate(-0.9deg) translate(-1.2%, 2%) scale(1.02); }
#room[data-pose="read1"] .pose { transform: translateY(2.2%) scale(1.02); }
#room[data-pose="read2"] .pose { transform: rotate(0.9deg) translate(1.2%, 2%) scale(1.02); }
/* 끄덕임·표정 몸짓(한 번씩) */
.nod { transform-origin: 50% 80%; }
.nod.nodding { animation: nod 0.75s ease-in-out; }
.nod.lift { animation: lift 1.1s ease-in-out; }
.nod.pop { animation: pop-back 0.6s ease-out; }
.nod.small { animation: nod-small 0.5s ease-in-out; }
@keyframes nod { 0%, 100% { transform: none; } 35% { transform: translateY(1.1%) rotate(0.25deg); } 70% { transform: translateY(-0.2%); } }
@keyframes nod-small { 0%, 100% { transform: none; } 45% { transform: translateY(0.6%); } }
@keyframes lift { 0%, 100% { transform: none; } 40% { transform: translateY(-0.7%) scale(1.008); } }
@keyframes pop-back { 0% { transform: none; } 30% { transform: translateY(-0.6%) scale(0.985); } 100% { transform: none; } }
/* 말할 때 목소리 크기에 맞춰 살짝 움직여요(JS가 값을 넣어요) */
.bob { transform: translate3d(0, var(--by, 0%), 0) rotate(var(--br, 0deg)); transform-origin: 50% 80%; will-change: transform; }
/* 숨쉬기(3.6초)와 어긋난 주기(7.3초)의 흔들림을 겹쳐서 반복하는 티를 없애요 */
.sway { animation: sway 7.3s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes sway {
  0%, 100% { transform: none; }
  30% { transform: rotate(0.35deg) translateX(0.3%); }
  55% { transform: rotate(-0.15deg) translateX(-0.1%); }
  80% { transform: rotate(-0.4deg) translateX(-0.3%); }
}
.char { position: absolute; inset: 0; animation: breathe 3.6s ease-in-out infinite; transform-origin: 50% 70%; transition: filter 0.8s; }
/* 표정: 그림이 한 장이라 빛과 몸짓으로 표현해요 */
#room[data-face="smile"] .char { filter: brightness(1.06) saturate(1.12) sepia(0.06); }
#room[data-face="serious"] .char { filter: brightness(0.95) saturate(0.9); }
#room[data-face="think"] .char { filter: brightness(0.97); }
/* 카드를 크게 보여주는 짧은 순간에만 살짝 어둡게(흐리게 가리지 않아요) */
.stage.revealing .char { filter: brightness(0.72); }
/* 생각하는 동안 촛불이 조금 더 일렁여요 */
#room[data-pose="think"] .candle-glow { animation-duration: 1.4s; }
/* 코드 리깅(rig.js)이 켜지면 그림 대신 캔버스가 그려요. 몸짓은 캔버스 안에서 부위별로 하니까(배경은 가만히)
   그림을 통째로 움직이던 CSS는 꺼요. 카메라(.cam)와 천천히 흐르는 화면(.drift)만 남겨요 */
.rig { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* 가만히 있을 때 틀어주는 미리 만든 영상. 리깅과 0.35초 동안 겹쳐서 바뀌어요 */
.rig-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0; transition: opacity 0.35s; pointer-events: none; }
.rig-video.on { opacity: 1; }
.rig-video.entrance, .rig-video.closing, .rig-video.ritual { pointer-events: auto; cursor: pointer; transition: none; }
.rig-video.ritual { z-index: 6; } /* 카드 섞기·펼치기는 테이블 위 카드까지 덮어요. 연출 영상은 누르면 건너뛰어요 */
#room.rigged .char img { visibility: hidden; }
#room.rigged .pose, #room.rigged .nod, #room.rigged .bob, #room.rigged .sway, #room.rigged .char { transform: none !important; animation: none !important; }
#room.rigged .drift { animation-name: drift-rig; }
@keyframes drift-rig { from { transform: scale(1); } to { transform: scale(1.035) translate(-0.4%, 0.3%); } }
@media (prefers-reduced-motion: reduce) {
  .drift, .sway, .char, .nod { animation: none !important; }
  .cam, .pose { transition: none; }
  .bob { transform: none; }
}

/* 촛불 빛 일렁임 */
.candle-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 6% 50%, rgba(255, 168, 82, 0.34), transparent 24%),
    radial-gradient(circle at 95% 48%, rgba(255, 168, 82, 0.3), transparent 22%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 150, 70, 0.18), transparent 45%);
  animation: flicker 2.8s infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 0.85; }
  12% { opacity: 1; }
  25% { opacity: 0.72; }
  38% { opacity: 0.95; }
  52% { opacity: 0.8; }
  67% { opacity: 1; }
  81% { opacity: 0.76; }
}
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 38%, transparent 52%, rgba(5, 3, 14, 0.62) 100%); }

/* 해석 중인 카드: 뒤집는 순간 크게 보여주고, 잠시 뒤 옆으로 비켜서 리더 얼굴을 가리지 않아요 */
.focus {
  position: absolute;
  left: 27%;
  top: 9%;
  width: 46%;
  transform: scale(0.7);
  transform-origin: 50% 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2), left 0.8s ease-in-out, top 0.8s ease-in-out, width 0.8s ease-in-out;
  text-align: center;
}
.focus.show { opacity: 1; transform: scale(1); pointer-events: auto; cursor: pointer; }
.focus.docked { left: 72%; top: 11%; width: 25%; }
/* 카드 공개 연출: 화면 전체를 덮고, 빛이 터지는 순간 실제 카드가 빛 속에서 떠올라요 */
.reveal-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s; pointer-events: none; z-index: 6; }
.reveal-video.on { opacity: 1; }
.focus.show { z-index: 7; }
.focus.from-light.show:not(.docked) img { animation: from-light 1.1s ease-out; }
@keyframes from-light {
  from { opacity: 0; transform: scale(0.82); filter: brightness(2.4) blur(6px); }
  60% { opacity: 1; filter: brightness(1.4) blur(0); }
  to { transform: none; filter: none; }
}
.focus img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(240, 217, 164, 0.6), 0 0 40px rgba(255, 200, 120, 0.55), 0 18px 40px rgba(0, 0, 0, 0.6);
}
.focus.docked img { box-shadow: 0 0 0 1px rgba(240, 217, 164, 0.6), 0 0 18px rgba(255, 200, 120, 0.45), 0 8px 18px rgba(0, 0, 0, 0.6); }
.focus-name { margin-top: 8px; font-family: var(--serif); font-weight: 800; color: var(--gold-soft); text-shadow: 0 2px 6px #000; transition: font-size 0.8s; word-break: keep-all; }
.focus.docked .focus-name { font-size: 11px; margin-top: 4px; }
.stage.revealing .subtitle { top: 51%; }
.stage.revealing .quick { bottom: auto; top: 59%; }

/* 카드 뒤집을 때 빛 */
.slot.flash::after {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 160, 0.9), rgba(255, 200, 120, 0.35) 35%, transparent 65%);
  animation: burst 1.1s ease-out forwards;
  pointer-events: none;
}
@keyframes burst { from { opacity: 0; transform: scale(0.4); } 25% { opacity: 1; } to { opacity: 0; transform: scale(1.4); } }
.char img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0; }
.char img.on { opacity: 1; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012) translateY(-0.4%); } }

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(13, 11, 26, 0.8), transparent);
  font-family: var(--serif);
  font-weight: 800;
  font-size: 18px;
}
.spacer { flex: 1; }

.subtitle {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 47%;
  padding: 12px 16px;
  background: rgba(13, 11, 26, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.55;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, top 0.45s;
  backdrop-filter: blur(4px);
}
.subtitle.show { opacity: 1; }

.bubble {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  max-width: 80%;
  background: #fff8ea;
  color: #1d1a2b;
  font-weight: 600;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  border: 10px solid transparent;
  border-top-color: #fff8ea;
  border-bottom: 0;
  transform: translateX(-50%);
}
.bubble.show { animation: pop 0.25s ease-out forwards; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
#room:not(.bubble-mode) .bubble { display: none; }
#room.bubble-mode .subtitle { display: none; }

.quick {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 84px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.quick button { backdrop-filter: blur(6px); background-color: rgba(13, 11, 26, 0.6); }

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(13, 11, 26, 0.95), rgba(13, 11, 26, 0.6) 70%, transparent);
}
.controls input { flex: 1; min-width: 0; }
.send { background: rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 0 14px; }
.mic {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #2a1f12;
  display: grid;
  place-items: center;
}
.mic.listening { animation: pulse 1s infinite; background: var(--danger); color: #fff; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 135, 111, 0.6); } 50% { box-shadow: 0 0 0 12px rgba(226, 135, 111, 0); } }

/* 카드 의식 */
.table-layer { position: absolute; left: 0; right: 0; top: 64%; bottom: 0; }
.deck { position: absolute; left: 50%; top: 18%; width: 22%; aspect-ratio: 2 / 3.2; transform: translateX(-50%); }
.deck img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  animation: shuffle 0.8s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * 0.08s);
}
@keyframes shuffle {
  from { transform: translateX(calc((var(--i) - 2.5) * -6px)) rotate(calc((var(--i) - 2.5) * -3deg)); }
  to { transform: translateX(calc((var(--i) - 2.5) * 10px)) rotate(calc((var(--i) - 2.5) * 4deg)); }
}

.slots { position: absolute; inset: 0 0 auto 0; height: 62%; display: flex; justify-content: center; gap: 4%; padding-top: 2%; }
.slot { width: 21%; aspect-ratio: 2 / 3.2; border: 1px dashed var(--line); border-radius: 8px; position: relative; transition: transform 0.3s; }
.slot.active { transform: translateY(-6%) scale(1.06); }
.slot-label { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--gold-soft); text-shadow: 0 1px 3px #000; }
.slot-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; animation: drop 0.35s ease-out; }
@keyframes drop { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

.fan { position: absolute; left: 0; right: 0; bottom: 14%; height: 40%; transition: opacity 0.4s; }
.fan.gone { opacity: 0; pointer-events: none; }
.fan-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 13%;
  aspect-ratio: 2 / 3.2;
  padding: 0;
  background: none;
  transform-origin: 50% 260%;
  transform: translateX(-50%) rotate(calc(var(--k) * 4.2deg));
  transition: transform 0.25s, opacity 0.25s;
}
.fan-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55); }
.fan-card:hover:not(:disabled) { transform: translateX(-50%) rotate(calc(var(--k) * 4.2deg)) translateY(-10%); }
.fan-card.picked { opacity: 0; transform: translateX(-50%) rotate(calc(var(--k) * 4.2deg)) translateY(-60%); }

.card { width: 100%; height: 100%; perspective: 800px; }
.card .inner { position: relative; width: 100%; height: 100%; transition: transform 0.8s; transform-style: preserve-3d; }
.card.flipped .inner { transform: rotateY(180deg); }
.card .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55); }
.card .face img { width: 100%; height: 100%; object-fit: cover; }
.card .front { transform: rotateY(180deg); background: #f5ecd8; }
img.rev { transform: rotate(180deg); }

/* 모달 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 12, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(3px);
}
.sheet, .summary-card, .daily, .crisis {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  animation: up 0.3s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3, .crisis h3 { font-family: var(--serif); color: var(--gold-soft); margin: 0 0 6px; }
.q { color: var(--muted); margin: 0 0 14px; }
.options { display: grid; gap: 10px; margin-bottom: 8px; }
.option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.option b { display: block; font-size: 16px; }
.option span { font-size: 12px; color: var(--muted); }
.option em { font-style: normal; color: var(--gold); font-weight: 700; white-space: nowrap; }
.row { display: flex; gap: 10px; margin-top: 16px; }
.row button { flex: 1; }

.summary-card { border-radius: 22px; margin: auto 12px; align-self: center; }
.sum-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--serif); color: var(--gold-soft); font-weight: 800; }
.sum-cards { display: flex; gap: 8px; justify-content: center; margin: 8px 0 12px; }
.sum-cards figure { margin: 0; width: 30%; text-align: center; }
.sum-cards img { width: 100%; border-radius: 6px; }
.sum-cards figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.sum-cards figcaption b { color: var(--text); }
.sum-line { font-family: var(--serif); font-size: 17px; text-align: center; line-height: 1.5; }
.sum-action { background: var(--panel-2); border-radius: 12px; padding: 12px; font-size: 14px; }
.sum-action b { color: var(--gold); font-size: 12px; }
.sum-action p { margin: 4px 0 0; line-height: 1.5; white-space: pre-line; }

.daily { text-align: center; }
.daily-cat { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: center 40%; border: 2px solid var(--gold); }
.daily-card { width: 40%; aspect-ratio: 2 / 3.2; margin: 12px auto; }
.bubble-static { background: #fff8ea; color: #1d1a2b; font-weight: 600; border-radius: 16px; padding: 12px 14px; line-height: 1.5; }

.crisis { border-color: var(--danger); }
.hotlines { display: grid; gap: 8px; margin: 14px 0; }
.hotlines a {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.hotlines b { color: var(--gold); margin-right: 8px; font-size: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(20px);
  background: #fff8ea;
  color: #1d1a2b;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 20;
  max-width: 90%;
  text-align: center;
  pointer-events: none; /* 사라진 뒤에도 아래 버튼을 가로막지 않게 */
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.fatal { position: fixed; top: 0; left: 0; right: 0; background: var(--danger); color: #fff; padding: 12px; text-align: center; z-index: 30; }

/* ---------- 영화 같은 화면 ---------- */
/* 필름 질감: 아주 옅은 입자가 살짝 떨려요 */
.grain {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background: url("assets/grain.jpg") repeat;
  background-size: 180px 180px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  animation: grain 0.9s steps(5) infinite;
  z-index: 5;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

/* 자막: 상자 대신 영화 자막처럼. 글자 뒤에만 은은한 어둠을 깔아요 */
.subtitle {
  top: 62%;
  left: 18px;
  right: 18px;
  padding: 14px 10px;
  background: radial-gradient(ellipse 70% 100% at 50% 50%, rgba(6, 4, 16, 0.58) 0%, rgba(6, 4, 16, 0.3) 55%, transparent 80%);
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: #fbf4e6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 14px rgba(0, 0, 0, 0.75);
}
/* 줄바꿈은 앱이 문장 끝·쉼표 자리에 넣어요(wrapLines). 그래도 넘치면 낱말 사이에서만 고르게 끊어요 */
.subtitle, .bubble { white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }

/* 창(리딩 고르기·요약·오늘의 카드): 금박 테두리를 두른 밤하늘 카드처럼 */
.sheet, .summary-card, .daily, .crisis {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(138, 111, 209, 0.18), transparent 62%),
    linear-gradient(180deg, #1b1536, #110d24);
  border: 1px solid rgba(216, 180, 106, 0.6);
  box-shadow: inset 0 0 0 5px rgba(13, 11, 26, 0.85), inset 0 0 0 6px rgba(216, 180, 106, 0.28), 0 -12px 40px rgba(0, 0, 0, 0.6);
}
.sheet h3, .crisis h3 { text-align: center; font-size: 20px; letter-spacing: 0.02em; }
.sheet h3::before, .sheet h3::after, .sum-head span:first-child::before {
  content: "✦";
  color: var(--gold);
  font-size: 11px;
  margin: 0 10px;
  vertical-align: 3px;
  opacity: 0.85;
}
.sum-head span:first-child::before { margin: 0 8px 0 0; }
.sheet .q { text-align: center; font-family: var(--serif); }
.option { background: rgba(255, 255, 255, 0.025); border-color: rgba(216, 180, 106, 0.35); transition: border-color 0.2s, background 0.2s; }
.option:hover { border-color: var(--gold); background: rgba(216, 180, 106, 0.08); }
.option b { font-family: var(--serif); font-weight: 800; }
.sum-line { color: var(--gold-soft); }
.sum-action { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(216, 180, 106, 0.2); }
.sum-cards img { border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55); }

/* 아래 입력창: 화면을 덜 가리게 더 투명하게 */
.controls { background: linear-gradient(0deg, rgba(10, 8, 22, 0.9), rgba(10, 8, 22, 0.45) 65%, transparent); }
.quick button { border-color: rgba(216, 180, 106, 0.45); }

/* ---------- 카드 장면 ---------- */
/* 섞고 고르는 동안: 테이블을 내려다보는 장면. 카드 자리와 펼친 카드가 매트 위에 놓여요 */
.table-shot { position: absolute; inset: 0; background: url("assets/dalha_table.jpg") center 30% / cover no-repeat; opacity: 0; transition: opacity 0.6s; pointer-events: none; }
#room[data-table="pick"] .table-shot { opacity: 1; }
#room[data-table="pick"] .table-layer { top: 33%; }
#room[data-table="pick"] .deck { top: 16%; }
#room[data-table="pick"] .slots { height: 42%; transform: perspective(900px) rotateX(20deg); transform-origin: 50% 100%; }
#room[data-table="pick"] .slot { border-color: rgba(120, 80, 40, 0.55); background: rgba(80, 50, 30, 0.08); }
#room[data-table="pick"] .slot-label { color: #4a2f1a; text-shadow: none; font-weight: 700; }
#room[data-table="pick"] .fan { bottom: 17%; height: 44%; }
#room[data-table="pick"] .subtitle { top: 24%; }
/* 해석하는 동안: 리더 얼굴로 돌아오고, 고른 카드는 리더 앞 테이블(매트) 위에 눕혀 둬요 */
#room[data-table="read"] .table-layer { top: 78.5%; bottom: 9%; }
#room[data-table="read"] .slots { height: 100%; gap: 3%; padding-top: 0; transform: perspective(520px) rotateX(46deg); transform-origin: 50% 100%; }
#room[data-table="read"] .slot { width: 12.5%; border: 0; }
#room[data-table="read"] .slot-label { display: none; }
#room[data-table="read"] .slot.active { transform: translateY(-10%) scale(1.08); }
#room[data-table="read"] .slot.active .face { box-shadow: 0 0 0 1px rgba(240, 217, 164, 0.8), 0 0 16px rgba(255, 200, 120, 0.55); }
.icon.sound { font-size: 18px; color: var(--gold-soft); opacity: 0.9; }
.icon.sound.off { opacity: 0.35; text-decoration: line-through; }

/* ---------- 카메라 ---------- */
/* 마음을 털어놓을 때: 아주 천천히 얼굴 가까이 다가가요 */
#room[data-shot="intimate"] .cam { transform: scale(1.15); transition-duration: 5s; }
/* 해석하는 동안에는 테이블 높이를 기준으로 다가가서, 매트 위에 눕힌 카드와 테이블이 어긋나지 않아요 */
#room[data-table="read"] .cam { transform-origin: 50% 82%; }
#room[data-table="read"][data-shot="intimate"] .cam { transform: scale(1.09); }

/* ---------- 카드 알아보기: 고르기 전에 이 리더의 덱과 카드 종류, 자리 뜻을 보여줘요 ---------- */
.guide-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 106, 0.5);
  background: rgba(13, 11, 26, 0.55);
  color: var(--gold-soft);
  white-space: nowrap;
}
.link { background: none; color: var(--gold-soft); font-size: 13px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.sheet { max-height: 92dvh; overflow-y: auto; }
#guide, #cardInfo { z-index: 11; }

/* 리딩 고르기 창의 덱 소개 */
.sheet-deck { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; padding: 12px; border: 1px solid rgba(216, 180, 106, 0.25); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.sheet-deck:empty { display: none; }
.deck-fan { position: relative; flex: none; width: 76px; height: 72px; }
.deck-fan img { position: absolute; top: 6px; width: 38px; border-radius: 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55); }
.deck-fan img:nth-child(1) { left: 0; transform: rotate(-12deg); }
.deck-fan img:nth-child(2) { left: 19px; top: 0; z-index: 1; }
.deck-fan img:nth-child(3) { left: 38px; transform: rotate(12deg); }
.deck-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.deck-text b { font-family: var(--serif); color: var(--gold-soft); font-size: 15px; }
.deck-text span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.deck-text .link { align-self: flex-start; }
.option .pos { display: block; font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.option .pos i, .g-spread li i {
  font-style: normal;
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  line-height: 15px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid rgba(216, 180, 106, 0.55);
  color: var(--gold);
  font-size: 10px;
  margin-right: 6px;
}

/* 카드 알아보기 창 */
.guide h4, .card-info h4 { font-family: var(--serif); color: var(--gold-soft); font-size: 15px; margin: 0 0 6px; }
.guide p, .card-info p { font-size: 13px; line-height: 1.65; margin: 0 0 8px; }
.g-deck { text-align: center; margin: 4px 0 12px; }
.g-deck .deck-fan { margin: 0 auto 8px; width: 122px; height: 106px; }
.g-deck .deck-fan img { width: 60px; }
.g-deck .deck-fan img:nth-child(2) { left: 31px; }
.g-deck .deck-fan img:nth-child(3) { left: 62px; }
.g-deck b { font-family: var(--serif); color: var(--gold-soft); font-size: 17px; }
.g-deck p { color: var(--muted); }
.g-sec { border-top: 1px solid rgba(216, 180, 106, 0.2); padding: 12px 0 4px; }
.g-suits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 10px; }
.g-suit { display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(216, 180, 106, 0.2); border-radius: 10px; padding: 6px; }
.g-suit img { width: 34px; border-radius: 3px; flex: none; }
.g-suit b { font-family: var(--serif); color: var(--gold-soft); margin-right: 5px; }
.g-suit small { color: var(--gold); font-size: 11px; }
.g-suit span { display: block; font-size: 12px; color: var(--muted); }
.g-ranks { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.g-ranks b { color: var(--gold-soft); margin-right: 4px; }
.g-spread { margin-bottom: 8px; }
.g-spread > b { font-family: var(--serif); font-size: 14px; }
.g-spread ul, .card-info ul { list-style: none; padding: 0; margin: 6px 0 0; }
.g-spread li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 13px; padding: 3px 0; }
.g-spread li span { color: var(--muted); font-size: 12px; }

/* 카드 설명 창 */
.ci-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.ci-head img { width: 96px; flex: none; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6); }
.ci-head small { color: var(--gold); font-size: 12px; }
.ci-head h3 { font-family: var(--serif); color: var(--gold-soft); margin: 2px 0 6px; font-size: 22px; }
.ci-head .fineprint { margin: 6px 0 0; }
.ci-pos { display: inline-block; font-size: 12px; border: 1px solid rgba(216, 180, 106, 0.5); border-radius: 999px; padding: 2px 9px; color: var(--gold-soft); }
.card-info .ci-essence { font-family: var(--serif); font-size: 14px; color: var(--gold-soft); }
.ci-sec { border-top: 1px solid rgba(216, 180, 106, 0.2); padding-top: 10px; margin-top: 8px; }
.card-info li { font-size: 13px; line-height: 1.55; padding: 3px 0; }
.card-info li b { color: var(--gold-soft); margin-right: 6px; }
.ci-side { border: 1px solid rgba(216, 180, 106, 0.18); border-radius: 12px; padding: 10px; margin-bottom: 8px; opacity: 0.72; }
.ci-side.now { opacity: 1; border-color: var(--gold); background: rgba(216, 180, 106, 0.07); }
.ci-side b small { margin-left: 8px; font-size: 11px; color: var(--gold); }
.ci-kw { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ci-kw span { font-size: 11px; border-radius: 999px; padding: 2px 8px; background: rgba(216, 180, 106, 0.12); color: var(--gold-soft); }

/* 크게 보는 카드: 어떤 카드인지와 키워드, 설명 버튼 */
.focus-info { margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--text); text-shadow: 0 1px 4px #000; }
.focus-more { margin-top: 6px; font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(216, 180, 106, 0.6); background: rgba(13, 11, 26, 0.65); color: var(--gold-soft); }
.focus.docked .focus-info { display: none; }
.focus.docked .focus-more { font-size: 10px; padding: 2px 8px; margin-top: 3px; }

/* 로비: 리더마다 쓰는 덱 */
/* 로비: 들어가기 전에 리더마다 어떤 카드를 쓰는지(카드 종류, 쉬운 한 줄 설명, 카드 구경하기) */
.reader-card { flex-wrap: wrap; }
.lobby-hint { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.reader-card .reader-deck {
  flex-basis: 100%; display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(216, 180, 106, 0.22); border-radius: 12px; padding: 8px 10px; cursor: pointer;
}
.reader-card .reader-deck:hover { border-color: var(--accent); }
.reader-card .reader-deck .deck-fan { width: 62px; height: 56px; }
.reader-card .reader-deck img { width: 30px; height: auto; object-fit: initial; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); }
.reader-card .reader-deck .deck-fan img:nth-child(2) { left: 16px; }
.reader-card .reader-deck .deck-fan img:nth-child(3) { left: 32px; }
.rd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rd-text b { font-family: var(--serif); color: var(--gold-soft); font-size: 14px; }
.rd-text span { font-size: 12.5px; color: var(--text); line-height: 1.45; word-break: keep-all; }
.rd-text small { font-size: 12px; color: var(--accent); font-weight: 700; }

/* 로비: 어떤 고민이에요? → 그 분야 전문 리더를 맨 위로 올려 추천해요 */
.worry { margin: 0 0 12px; }
.worry > b { display: block; font-size: 14px; color: var(--gold-soft); margin-bottom: 8px; }
.worry-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.worry-chips .chip {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.worry-chips .chip.on { color: #2a1f12; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.worry-pick { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--text); word-break: keep-all; }
.reader-card.reco { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 22px rgba(0, 0, 0, 0.35); }
.badge.reco-badge { color: #2a1f12; background: var(--accent); border-color: var(--accent); }

/* 주역 괘 그림: 양효는 이어진 막대, 음효는 가운데가 끊긴 막대, 움직이는 효는 빛나요 */
.hexa { display: grid; gap: 5px; width: 64px; flex: none; }
.hexa i { display: block; height: 7px; border-radius: 2px; }
.hexa i.yang { background: var(--gold); }
.hexa i.yin { background: linear-gradient(90deg, var(--gold) 0 42%, transparent 42% 58%, var(--gold) 58%); }
.hexa i.moving { box-shadow: 0 0 8px 1px rgba(240, 217, 164, 0.85); }
.ci-hexa { display: flex; gap: 14px; align-items: center; }
.ci-hexa p { margin: 0; }

/* 카드 섞기 전 덱 소개: 이 리더의 덱 그림 세 장을 테이블에 펼쳐 보여요 */
.deck-show { position: absolute; left: 50%; top: 2%; width: 78%; height: 50%; transform: translateX(-50%); pointer-events: none; z-index: 2; animation: deck-show-in 0.7s ease-out; transition: opacity 0.4s; }
.deck-show.gone { opacity: 0; }
.deck-show img {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 34%;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(240, 217, 164, 0.5);
  transform: translateX(calc(-50% + (var(--i) - 1) * 88%)) rotate(calc((var(--i) - 1) * 9deg));
  transform-origin: 50% 120%;
}
.deck-show img:nth-child(2) { z-index: 1; top: 5%; }
@keyframes deck-show-in { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; transform: translateX(-50%); } }

/* 크게 보는 카드 아래 설명 줄과 버튼이 자막과 겹치지 않게 자막을 조금 내려요 */
.stage.revealing .subtitle { top: 60%; }
.stage.revealing .quick { top: 69%; }
/* 작게 접힌 카드: 자리와 방향을 두 줄로 */
.focus.docked .focus-name .sep { display: none; }
.focus.docked .focus-name .ori, .focus.plain-ori .focus-name .ori { display: block; }
.focus.plain-ori .focus-name .sep { display: none; }
/* 해석 중 버튼은 테이블 위 카드를 가리지 않게 조금 위에 */
#room[data-table="read"] .stage:not(.revealing) .quick { bottom: 150px; }
/* 자막이 세 줄이어도 그 버튼에 닿지 않게, 키가 작은 화면에서는 자막을 조금 올려요(150 버튼 자리 + 49 버튼 + 109 세 줄 자막) */
#room[data-table="read"] .stage:not(.revealing) .subtitle { top: min(62%, calc(100% - 308px)); }
/* 카드 이름표: 공개 연출의 밝은 빛 위에서도 읽히게 어두운 받침을 깔아요 */
.focus-cap { display: inline-block; margin-top: 8px; padding: 6px 12px 8px; border-radius: 12px; background: rgba(10, 8, 22, 0.62); }
.focus-cap .focus-name { margin-top: 0; }
.focus.docked .focus-cap { margin-top: 4px; padding: 3px 6px 5px; border-radius: 8px; }
/* 크게 볼 때 이름표는 카드보다 넓어도 돼요: '덜어 내면 오히려 채워져요'처럼 긴 한 줄 뜻이 두 줄로 꺾여 자막과 겹치지 않게 */
.focus:not(.docked) .focus-cap { position: relative; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(88vw, 360px); }
/* 세로가 짧은 화면에서는 크게 보는 카드를 조금 작게 해서 이름표가 자막 위에서 끝나게 해요 */
@media (max-height: 780px) {
  .focus:not(.docked) { left: 30%; width: 40%; }
}
.option > div { min-width: 0; }
.option em { margin-left: 10px; }
/* 윗줄: 카드 알아보기 버튼이 생겨서 좁은 화면에서도 이름과 달빛이 줄바꿈되지 않게 */
.topbar #readerName, .topbar .balance { white-space: nowrap; }
@media (max-width: 380px) {
  .topbar { gap: 6px; font-size: 16px; padding: 10px 8px; }
  .guide-btn { font-size: 11px; padding: 4px 8px; }
  .topbar .balance { padding: 3px 8px; font-size: 12px; }
}

/* 팩폭 카드 알아보기: 네 묶음 */
.g-group { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.g-group + .g-group { border-top: 1px dashed rgba(216, 180, 106, 0.15); }
.g-thumbs { position: relative; flex: none; width: 74px; height: 62px; }
.g-thumbs img { position: absolute; top: 0; width: 36px; border-radius: 3px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.g-thumbs img:nth-child(1) { left: 0; transform: rotate(-8deg); }
.g-thumbs img:nth-child(2) { left: 19px; z-index: 1; }
.g-thumbs img:nth-child(3) { left: 38px; transform: rotate(8deg); }
.g-group b { font-family: var(--serif); color: var(--gold-soft); margin-right: 6px; }
.g-group span { font-size: 12px; color: var(--text); }
.g-group small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
/* 팩폭 카드 설명: 먹물의 한마디 */
.card-info .ci-message { font-family: var(--serif); font-size: 17px; font-weight: 800; color: var(--gold-soft); text-align: center; margin: 4px 0 10px; line-height: 1.5; }
.ci-message small { display: block; font-family: var(--sans); font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
/* 르노르망 알아보기: 36장 그림과 뜻 한눈에(고르기 전에 무슨 카드가 나올 수 있는지) */
.g-cards { list-style: none; padding: 0; margin: 8px 0 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.g-cards li { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.g-cards img { width: 100%; max-width: 92px; border-radius: 5px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); margin-bottom: 4px; }
.g-cards b { font-family: var(--serif); color: var(--gold-soft); font-size: 13px; }
.g-cards span { font-size: 11.5px; color: var(--muted); line-height: 1.35; word-break: keep-all; }
@media (min-width: 440px) { .g-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- 로그인·가입 ---------- */
#auth { background: radial-gradient(130% 55% at 50% 0%, rgba(138, 111, 209, 0.26), transparent 62%), var(--bg); }
.auth { position: relative; min-height: 100%; padding: 64px 20px calc(36px + env(safe-area-inset-bottom)); }
.auth-back { position: absolute; top: 14px; left: 8px; color: var(--muted); }
.auth-brand { text-align: center; margin-bottom: 24px; }
/* 초승달: 안쪽 그림자로 달 모양을 깎아요 */
.auth-moon {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
  box-shadow: inset 15px -7px 0 0 var(--gold-soft);
  transform: rotate(-18deg);
  filter: drop-shadow(0 0 16px rgba(240, 217, 164, 0.55));
  animation: moonGlow 4s ease-in-out infinite alternate;
}
@keyframes moonGlow { from { filter: drop-shadow(0 0 10px rgba(240, 217, 164, 0.35)); } to { filter: drop-shadow(0 0 22px rgba(240, 217, 164, 0.7)); } }
.auth-brand h2 { font-family: var(--serif); color: var(--gold-soft); font-size: 28px; margin: 0; }
.auth-brand p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.seg button { background: none; border-radius: 999px; padding: 10px; font-weight: 700; color: var(--muted); transition: background 0.2s, color 0.2s; }
.seg button.on { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #2a1f12; }
.auth-form { display: grid; gap: 14px; animation: fadein 0.35s ease-out; }
.auth-form .field { margin: 0; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form .field input { width: 100%; font-size: 16px; padding: 14px; } /* 16px보다 작으면 아이폰이 화면을 확대해요 */
.field input:focus, .ask-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.18); }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.hint:empty { display: none; }
.hint.ok { color: #9fd39a; }
.hint.bad { color: var(--danger); }
.pw { position: relative; display: block; }
.pw input { padding-right: 72px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; color: var(--gold); font-size: 13px; padding: 8px 10px; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; line-height: 1.5; text-align: center; }
.form-error:empty { display: none; }
.auth-alt { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.link { background: none; padding: 0 2px; color: var(--gold); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.agree { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 14px; padding: 2px 14px; }
.agree .check { margin: 0; padding: 12px 0; font-size: 14px; line-height: 1.4; }
.agree .check + .check { border-top: 1px solid rgba(216, 180, 106, 0.12); }
.agree .check.all { font-weight: 700; color: var(--gold-soft); }
.agree em { font-style: normal; font-size: 11px; color: var(--gold); }
.agree .link { margin-left: auto; font-size: 13px; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
button:disabled { opacity: 0.55; cursor: default; }
.intro-user { margin: 12px 0 0; font-size: 13px; color: var(--gold-soft); }
.intro-user:empty { display: none; }

/* ---------- 로비 머리: 달빛과 내 정보 ---------- */
.head-right { display: flex; align-items: center; gap: 8px; }
button.balance { background: rgba(255, 255, 255, 0.04); font-size: 13px; color: var(--gold); }
.avatar {
  flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-family: var(--serif); font-size: 15px; font-weight: 800; color: #2a1f12;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line);
}
.avatar.big { width: 56px; height: 56px; font-size: 24px; }
.lobby-hello { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.lobby-hello b { color: var(--text); }
#lobby h3 small { margin-left: 4px; font-size: 12px; font-weight: 700; color: var(--gold); }

/* 지난 리딩: 누르면 그때 요약 카드를 다시 봐요 */
.hist-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--panel); border: 1px solid rgba(216, 180, 106, 0.16); border-left: 3px solid var(--accent);
  border-radius: 14px; padding: 10px 12px; transition: border-color 0.2s, background 0.2s;
}
.hist-item:hover { border-color: rgba(216, 180, 106, 0.4); background: var(--panel-2); }
.hist-item img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
.hi-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hi-main b, .hi-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-main b { font-size: 14px; }
.hi-main span { font-size: 12px; color: var(--muted); }
.hi-date { flex: none; font-size: 12px; color: var(--gold); }
#summary[data-mode="history"] #sumMore { display: none; }
.sum-names { text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 내 정보 ---------- */
.pf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pf-name { display: grid; gap: 2px; min-width: 0; }
.pf-name b { font-family: var(--serif); font-size: 20px; color: var(--gold-soft); }
.pf-name span { font-size: 13px; color: var(--muted); }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pf-stats div { display: grid; gap: 2px; padding: 10px 6px; text-align: center; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(216, 180, 106, 0.18); border-radius: 14px; }
.pf-stats b { font-size: 18px; color: var(--gold-soft); }
.pf-stats span { font-size: 12px; color: var(--muted); }
.pf-list { display: grid; margin-bottom: 16px; border: 1px solid rgba(216, 180, 106, 0.18); border-radius: 14px; overflow: hidden; }
.pf-list button { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; text-align: left; padding: 14px; font-size: 15px; background: rgba(255, 255, 255, 0.025); }
.pf-list button + button { border-top: 1px solid rgba(216, 180, 106, 0.12); }
.pf-list button::after { content: "›"; font-size: 18px; color: var(--muted); }
.pf-list small { font-size: 12px; color: var(--muted); }
.pf-list .danger { color: var(--danger); }

/* ---------- 이용 안내 · 한 줄 묻기 ---------- */
#terms, #ask { z-index: 12; }
.terms section { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(216, 180, 106, 0.15); }
.terms h4 { margin: 0 0 4px; font-family: var(--serif); font-size: 15px; color: var(--gold-soft); }
.terms p { margin: 0; font-size: 13px; line-height: 1.65; }
.terms .fineprint { margin: 12px 0; text-align: center; }
.ask-input { width: 100%; padding: 14px; font: inherit; font-size: 16px; color: var(--text); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 12px; }
.ask .form-error { margin-top: 10px; }
.danger-btn { background: var(--danger); color: #fff; }
.auth-readers { display: flex; justify-content: center; margin-top: 16px; }
.auth-readers img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 18%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line); }
.auth-readers img + img { margin-left: -8px; }
.auth-foot { margin: 28px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
/* 한국어는 낱말 중간에서 줄이 바뀌지 않게 해요 */
.q, .sum-line, .sum-action p, .terms p, .lobby-hello, .auth-brand p, .form-error, .hint, .notice, .ask .q, .pf-list button { word-break: keep-all; overflow-wrap: anywhere; }

/* ===== 앱처럼: 로비를 아래 탭 넷(홈·리더·기록·내 정보)으로 (10월 30일) ===== */
#lobby { padding: 0; }
#lobby.active { display: flex; flex-direction: column; overflow: hidden; }
.app-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
}
.app-top h2 { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--gold-soft); letter-spacing: 0.02em; }
.app-top .balance { background: rgba(255, 255, 255, 0.05); font-weight: 700; padding: 6px 12px; }
.tab-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 24px; -webkit-overflow-scrolling: touch; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadein 0.25s ease-out; }
.tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(13, 11, 26, 0.94);
  border-top: 1px solid rgba(216, 180, 106, 0.18);
  backdrop-filter: blur(12px);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; background: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--gold-soft); }
.tabbar button.on svg { stroke: var(--gold); fill: rgba(216, 180, 106, 0.16); }

/* 홈 */
.tab-panel[data-panel="home"] .lobby-hello { margin: 0 0 12px; }
.tab-panel[data-panel="home"] .daily-banner { margin-top: 0; }
.continue {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.continue img { flex: none; width: 50px; height: 50px; border-radius: 50%; object-fit: cover; object-position: center 20%; border: 2px solid var(--accent); }
.ct-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ct-text span { font-size: 12px; color: var(--muted); }
.ct-text b { font-family: var(--serif); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-text small { font-size: 12px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue .primary { flex: none; }
.tab-panel[data-panel="home"] .worry { margin: 20px 0 12px; }
.face-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.face-strip::-webkit-scrollbar { display: none; }
.face-strip button { flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; font-size: 12px; color: var(--text); }
.face-strip img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: center 18%; border: 2px solid var(--accent); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.more-readers { display: block; margin: 4px auto 0; text-decoration: none; }
.reco-card { display: flex; gap: 12px; padding: 12px; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0, 0, 0, 0.35); animation: fadein 0.25s ease-out; }
.reco-card img { flex: none; width: 96px; height: 132px; border-radius: 12px; object-fit: cover; object-position: center 18%; }
.reco-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reco-tag { font-size: 12px; color: var(--muted); }
.reco-text b { font-family: var(--serif); font-size: 20px; }
.reco-role { color: var(--accent); font-size: 13px; font-weight: 700; }
.reco-text p { margin: 2px 0 8px; font-size: 13px; line-height: 1.45; color: var(--text); word-break: keep-all; }
.reco-actions { margin-top: auto; display: flex; gap: 8px; }

/* 리더 탭 */
.panel-lead { margin: 2px 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; word-break: keep-all; }
.reader-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rg-card { display: flex; flex-direction: column; padding: 0 0 12px; text-align: left; overflow: hidden; background: var(--panel); border: 1px solid rgba(216, 180, 106, 0.18); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.rg-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 18%; }
.rg-name { padding: 9px 10px 0; font-family: var(--serif); font-size: 17px; font-weight: 800; }
.rg-role { padding: 2px 10px 0; color: var(--accent); font-size: 12px; font-weight: 700; }
.rg-deck { padding: 2px 10px 0; color: var(--muted); font-size: 11.5px; }
.reader-sheet .rs-hero { display: flex; gap: 14px; align-items: flex-end; }
.reader-sheet .rs-hero img { flex: none; width: 108px; height: 146px; border-radius: 14px; object-fit: cover; object-position: center 18%; border: 2px solid var(--accent); }
.rs-title { display: grid; gap: 3px; min-width: 0; }
.rs-title b { font-family: var(--serif); font-size: 24px; }
.rs-title > span { color: var(--accent); font-size: 14px; font-weight: 700; }
.rs-title p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; word-break: keep-all; }
.reader-sheet .reader-deck { display: flex; gap: 12px; align-items: center; width: 100%; margin: 16px 0 14px; padding: 10px 12px; text-align: left; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(216, 180, 106, 0.25); border-radius: 14px; }
.reader-sheet .reader-deck .deck-fan { width: 62px; height: 56px; }
.reader-sheet .reader-deck .deck-fan img { width: 30px; }
.reader-sheet .reader-deck .deck-fan img:nth-child(2) { left: 16px; }
.reader-sheet .reader-deck .deck-fan img:nth-child(3) { left: 32px; }
.rs-actions { display: flex; gap: 10px; margin: 14px 0 10px; }
.rs-actions button { flex: 1; padding: 14px; font-size: 15px; }

/* 기록 탭 */
.records-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 2px 0 4px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.records-head:empty { display: none; }
.records-head b { font-family: var(--serif); font-size: 16px; color: var(--gold-soft); }
.records-head span { font-size: 12px; color: var(--muted); text-align: right; }
.rec-month { margin: 18px 2px 8px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; }
.rec-item { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 10px; padding: 12px; text-align: left; background: var(--panel); border: 1px solid rgba(216, 180, 106, 0.16); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.rec-item:active { background: var(--panel-2); }
.rec-fan { position: relative; flex: none; width: 86px; height: 92px; }
.rec-fan img { position: absolute; top: 8px; width: 48px; aspect-ratio: 5 / 8; object-fit: cover; border-radius: 5px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55); }
.rec-fan.n1 img { left: 19px; top: 2px; width: 54px; }
.rec-fan.n2 img:nth-child(1) { left: 6px; transform: rotate(-7deg); }
.rec-fan.n2 img:nth-child(2) { left: 32px; transform: rotate(7deg); }
.rec-fan.n3 img:nth-child(1) { left: 0; transform: rotate(-11deg); }
.rec-fan.n3 img:nth-child(2) { left: 19px; top: 3px; z-index: 1; }
.rec-fan.n3 img:nth-child(3) { left: 38px; transform: rotate(11deg); }
.rec-fan.n1 img.rev, .rec-fan.n3 img.rev:nth-child(2) { transform: rotate(180deg); }
.rec-fan.n2 img.rev:nth-child(1) { transform: rotate(173deg); }
.rec-fan.n2 img.rev:nth-child(2) { transform: rotate(187deg); }
.rec-fan.n3 img.rev:nth-child(1) { transform: rotate(169deg); }
.rec-fan.n3 img.rev:nth-child(3) { transform: rotate(191deg); }
.rec-fan img.face { position: static; width: 64px; height: 64px; aspect-ratio: auto; margin: 14px 11px; border-radius: 50%; object-position: center 20%; border: 2px solid var(--accent); }
.rec-main { display: grid; gap: 3px; min-width: 0; }
.rec-meta { font-size: 12px; color: var(--muted); }
.rec-meta i { margin-right: 6px; font-style: normal; font-weight: 700; color: var(--gold); }
.rec-main b { font-family: var(--serif); font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.rec-sum { font-size: 13px; line-height: 1.45; color: rgba(243, 234, 216, 0.82); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.rec-todo { justify-self: start; margin-top: 3px; padding: 2px 9px; font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(216, 180, 106, 0.14); border-radius: 999px; }
.rec-todo.done { color: #a9d3a2; background: rgba(143, 185, 138, 0.16); }
.records-empty { padding: 36px 16px; text-align: center; }
.records-empty img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.records-empty p { margin: 14px 0 18px; font-size: 14px; line-height: 1.6; color: var(--muted); word-break: keep-all; }

/* 지난 리딩 자세히 */
.record {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  z-index: 11;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 0%, #241b45 0%, var(--bg) 55%);
  animation: slidein 0.28s ease-out;
}
@keyframes slidein { from { opacity: 0; transform: translateX(-46%); } to { opacity: 1; transform: translateX(-50%); } }
.record-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: rgba(13, 11, 26, 0.9); border-bottom: 1px solid rgba(216, 180, 106, 0.15); backdrop-filter: blur(10px); }
#recTitle { flex: 1; font-family: var(--serif); font-size: 17px; color: var(--gold-soft); }
.record-share { padding: 8px 12px; font-size: 13px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 999px; }
.record-body { padding: 18px 18px calc(28px + env(safe-area-inset-bottom)); }
.rec-reader { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.rec-reader img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: center 20%; border: 2px solid var(--accent); }
.rec-reader b { color: var(--accent); }
.rec-reader .badge { margin-left: auto; }
.rec-q { margin: 14px 0 18px; font-family: var(--serif); font-size: 23px; line-height: 1.4; color: var(--text); word-break: keep-all; }
.rec-cards { display: grid; gap: 12px; }
.rec-cards.n1 { grid-template-columns: minmax(0, 200px); justify-content: center; }
.rec-cards.n2 { grid-template-columns: 1fr 1fr; padding: 0 20px; }
.rec-cards.n3 { grid-template-columns: repeat(3, 1fr); }
.rec-cards figure { margin: 0; text-align: center; }
.rec-cards img { width: 100%; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55); }
.rec-cards figcaption { margin-top: 8px; display: grid; gap: 2px; }
.rec-cards figcaption small { font-size: 11px; color: var(--muted); }
.rec-cards figcaption b { font-size: 14px; }
.rec-cards figcaption i { font-style: normal; font-size: 12px; color: var(--muted); }
.rec-lines { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.rec-lines li { padding: 11px 13px; font-size: 14.5px; line-height: 1.6; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(216, 180, 106, 0.14); border-radius: 12px; word-break: keep-all; }
.rec-lines small { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--accent); }
.rec-summary { margin: 20px 0; padding: 16px 8px; text-align: center; border-top: 1px solid rgba(216, 180, 106, 0.25); border-bottom: 1px solid rgba(216, 180, 106, 0.25); }
.rec-summary small { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.rec-summary p { margin: 6px 0 0; font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--gold-soft); word-break: keep-all; }
.rec-todos { margin-bottom: 18px; padding: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(216, 180, 106, 0.2); border-radius: 14px; }
.rec-todos > b { display: block; margin-bottom: 4px; font-size: 12px; color: var(--gold); }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 15px; line-height: 1.45; cursor: pointer; }
.todo input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); }
.todo.done span { color: var(--muted); text-decoration: line-through; }
.rec-todos > small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 달빛 충전 · 단골손님 · 친구 초대 · 앱으로 추가 */
.charge .q, .invite .q, .install .q { text-align: center; }
.test-note { width: fit-content; margin: 0 auto 14px; padding: 6px 12px; font-size: 12px; color: #a9d3a2; background: rgba(143, 185, 138, 0.12); border-radius: 999px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 14px 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; }
.pack b { font-family: var(--serif); font-size: 22px; color: var(--gold-soft); }
.pack b small { margin-left: 2px; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.pack i { font-style: normal; font-size: 11px; font-weight: 700; color: #2a1f12; background: var(--gold); border-radius: 999px; padding: 1px 7px; }
.pack em { font-style: normal; font-size: 13px; }
.member-card { display: grid; gap: 4px; width: 100%; margin-bottom: 12px; padding: 14px; text-align: left; border: 1px solid var(--gold); border-radius: 14px; background: linear-gradient(135deg, rgba(216, 180, 106, 0.18), rgba(138, 111, 209, 0.16)); }
.mc-title { display: flex; justify-content: space-between; align-items: baseline; }
.mc-title b { font-family: var(--serif); font-size: 18px; color: var(--gold-soft); }
.mc-title em { font-style: normal; font-size: 14px; font-weight: 700; color: var(--gold); }
.member-card > span { font-size: 13px; }
.member-card small { font-size: 11.5px; color: var(--muted); }
.member-card.on { opacity: 0.85; cursor: default; }
.invite-code { margin: 6px 0 8px; padding: 16px; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: 0.08em; color: var(--gold-soft); border: 1px dashed var(--gold); border-radius: 14px; }
.install-steps { margin: 6px 0 16px; padding-left: 20px; font-size: 14px; line-height: 1.7; word-break: keep-all; }
.install-steps li { margin-bottom: 6px; }
.install-steps b { color: var(--gold-soft); }
.member-on { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 14px; background: linear-gradient(135deg, rgba(216, 180, 106, 0.16), rgba(138, 111, 209, 0.12)); }
.member-on b { font-family: var(--serif); color: var(--gold-soft); }
.member-on span { font-size: 12px; color: var(--muted); text-align: right; }
.tab-panel[data-panel="me"] .pf-head { margin: 6px 0 16px; }
.sheet .big + .big, .sheet .row + .big { margin-top: 8px; }
