/* 사주캐치 — 모바일 세로 기준 디자인
   색은 config/site.json theme 값이 --bg, --primary 등으로 들어오고, 사주 종류 색은 --tc */
:root {
  --bg: #17122b; --bg2: #241b42; --panel: #2d2352; --text: #f3eefe;
  --muted: #b3a8d6; --primary: #f5c451; --accent: #ff7aa8; --tc: #9b7bff;
  --line: #ffffff17; --glass: linear-gradient(180deg, #ffffff12, #ffffff07);
  --r: 20px; --gap: 14px;
  --shadow: 0 10px 30px #0006;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Noto Sans KR", system-ui, sans-serif; overflow-x: hidden;
  overscroll-behavior: none; -webkit-text-size-adjust: 100%; word-break: keep-all;
}

/* ---------- 앱 프레임 ---------- */
#app {
  --vh: 100dvh;
  position: relative; width: 100%; max-width: 430px; margin: 0 auto; min-height: var(--vh);
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #ffffffaa, transparent 60%),
    radial-gradient(1px 1px at 78% 9%, #ffffff99, transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 34%, #ffffff77, transparent 60%),
    radial-gradient(1px 1px at 30% 52%, #ffffff66, transparent 60%),
    radial-gradient(1px 1px at 64% 71%, #ffffff66, transparent 60%),
    radial-gradient(1.5px 1.5px at 18% 86%, #ffffff55, transparent 60%),
    radial-gradient(1px 1px at 92% 92%, #ffffff55, transparent 60%),
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--tc) 28%, var(--bg2)), transparent 70%),
    var(--bg);
  transition: background .6s;
}
@media (min-width: 600px) {
  body { background: radial-gradient(circle at 50% 30%, #1a1430, #07050f 70%); display: flex; align-items: center; justify-content: center; }
  #app { --vh: min(100dvh, 900px); height: var(--vh); overflow-y: auto; border-radius: 34px;
    box-shadow: 0 0 0 10px #1d1733, 0 0 0 11px #ffffff14, 0 40px 100px #000d; scrollbar-width: none; }
  #app::-webkit-scrollbar { display: none; }
}

/* PC 마우스: 휴대폰처럼 끌어서 스크롤 (dragscroll.js) */
@media (hover: hover) and (pointer: fine) {
  #app { cursor: grab; -webkit-user-select: none; user-select: none; }
  #app input, #app textarea { -webkit-user-select: text; user-select: text; }
  #app button, #app label, #app a, #app .theme-card { cursor: pointer; }
  html.dragging, html.dragging * { cursor: grabbing !important; }
}

/* ---------- 화면 ---------- */
.screen { display: none; flex-direction: column; gap: var(--gap); justify-content: flex-start;
  min-height: calc(var(--vh) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); animation: fadein .45s ease; }
.screen.active { display: flex; }
#s-free, #s-game { justify-content: flex-start; }
/* 화면 전환: 아래로 밀며 나타나면(translateY) 그 순간 내용이 넘쳐 스크롤바가 잠깐 생긴다 → 살짝 작게 시작해 넘침 없이 */
@keyframes fadein { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.screen { transform-origin: 50% 0; }

.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--primary);
  padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.screen-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.screen-head h2 { margin: 4px 0 0; font-family: "Gowun Batang", serif; font-size: 26px; }
.screen-head .sub { color: var(--muted); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- 인트로 ---------- */
.logo { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.logo-name { font-family: "Gowun Batang", serif; font-size: 46px; font-weight: 700; line-height: 1.1; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff3c4, var(--primary) 60%, #d99a1e); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px color-mix(in srgb, var(--primary) 45%, transparent)); }
.logo-tag { color: var(--muted); font-size: 15px; }
/* 인트로: 사주별 캐릭터 카드 4장 부채꼴 (--i = -1.5 … 1.5) */
.hero-cards { position: relative; height: 252px; margin: 2px 0 6px; }
.hc { position: absolute; left: 50%; top: 8px; width: 116px; height: 166px; margin-left: -58px; border-radius: 14px; overflow: hidden;
  translate: calc(var(--i) * 64px) calc(var(--i) * var(--i) * 7px); rotate: calc(var(--i) * 9deg);
  border: 2px solid color-mix(in srgb, var(--primary) 70%, #fff);
  box-shadow: 0 14px 30px #000a, 0 0 22px color-mix(in srgb, var(--tc) 55%, transparent);
  animation: hcfloat 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); }
.hc img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.hc::after { content: ""; position: absolute; inset: 5px; border-radius: 10px; border: 1px solid #ffffff55; pointer-events: none; }
.hero-tags { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.hero-tags span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff;
  background: color-mix(in srgb, var(--tc) 28%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent); }
@keyframes hcfloat { 50% { transform: translateY(-7px); } }

/* ---------- 말풍선 (웹툰 컷) ---------- */
.talk { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.speaker { font-size: 12px; font-weight: 700; color: #1a1330; background: var(--primary); padding: 3px 10px; border-radius: 999px; }
.scene { display: flex; align-items: flex-end; gap: 10px; }
.guide { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; line-height: 1;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), #ffffff0a 70%);
  box-shadow: inset 0 0 0 2px #ffffff1c; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
/* 캐릭터 얼굴 원형 (사주 고른 뒤 말풍선 옆) */
.guide.face { overflow: hidden; background: none; box-shadow: 0 0 0 2px var(--tc), 0 6px 16px #0008; animation: none; }
.guide.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble {
  position: relative; flex: 1; width: 100%; background: #fff; color: #231a3d; border-radius: 18px; padding: 14px 16px;
  font-size: 15.5px; line-height: 1.65; box-shadow: 0 8px 24px #0005;
}
.bubble::before { content: ""; position: absolute; left: -8px; bottom: 16px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble.center { text-align: center; }
.bubble.center::before { left: 50%; top: -8px; bottom: auto; transform: translateX(-50%); border: 9px solid transparent; border-bottom-color: #fff; border-top: 0; }
.bubble small { color: #7a6f99; }
.bubble b { color: #c2386b; }

/* ---------- 버튼 ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: 17px; border-radius: 16px; padding: 16px 18px; width: 100%; cursor: pointer;
  color: var(--text); background: var(--glass); border: 1px solid var(--line); transition: transform .1s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.primary { border: 0; color: #2a1d05;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 55%, #fff), var(--primary) 55%, color-mix(in srgb, var(--primary) 85%, #b06a00));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--primary) 45%, #000), 0 12px 24px color-mix(in srgb, var(--primary) 25%, transparent); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 45%, #000); }
/* 결제 버튼: 금색 테두리 + 금색 글씨 (주 버튼과 구분되는 보조 강조) */
.btn.buy { color: var(--primary); border: 1.5px solid color-mix(in srgb, var(--primary) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 16%, transparent), color-mix(in srgb, var(--primary) 6%, transparent));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 25%, #000); }
.btn.buy:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--primary) 25%, #000); }
.btn.ghost { background: transparent; border: 0; color: var(--muted); font-weight: 400; font-size: 15px; padding: 10px; }
.screen > .btn { margin-top: 4px; }
.row { display: flex; gap: 10px; }

/* ---------- 카드 / 폼 ---------- */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.form input[type=text], .form input:not([type]), .form input[type=password], .form input[type=date], .form input[type=time] {
  font: inherit; font-size: 16px; font-weight: 400; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #0000003a; color: var(--text); color-scheme: dark; width: 100%; outline: none; transition: border-color .2s;
}
.form input:focus { border-color: var(--primary); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.seg { display: flex; gap: 8px; padding: 4px; border-radius: 14px; background: #0000003a; border: 1px solid var(--line); }
.seg label { flex: 1; }
.seg input { display: none; }
.seg span { display: block; text-align: center; padding: 10px; border-radius: 10px; color: var(--muted); cursor: pointer; font-weight: 700; transition: all .2s; }
.seg input:checked + span { background: var(--primary); color: #2a1d05; }
.err { color: var(--accent); margin: 0; min-height: 1em; font-size: 14px; }

/* ---------- 사주 종류 ---------- */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-card {
  font: inherit; color: var(--text); text-align: left; cursor: pointer; position: relative; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 32%, transparent), #ffffff06 75%);
  border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); border-radius: var(--r);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 172px;
  box-shadow: var(--shadow); transition: transform .12s; animation: fadein .4s ease both;
}
.theme-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: color-mix(in srgb, var(--tc) 30%, transparent); filter: blur(20px); }
.theme-card:active { transform: scale(.96); }
.theme-card .ti { font-size: 34px; }
.theme-card .tt { font-family: "Gowun Batang", serif; font-weight: 700; font-size: 21px; color: color-mix(in srgb, var(--tc) 75%, #fff); }
.theme-card .td { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.theme-card .tb { margin-top: auto; font-size: 12px; font-weight: 700; color: var(--primary); }
/* 캐릭터 그림이 있는 사주 카드: 타로 카드처럼 */
.theme-card.has-img { padding: 0; min-height: 0; aspect-ratio: 3 / 4.3; justify-content: flex-end;
  border: 1.5px solid color-mix(in srgb, var(--primary) 60%, transparent);
  box-shadow: 0 12px 28px #0009, 0 0 18px color-mix(in srgb, var(--tc) 35%, transparent); }
.theme-card.has-img::after { display: none; }
.theme-card.has-img::before { content: ""; position: absolute; inset: 5px; z-index: 2; border-radius: calc(var(--r) - 5px);
  border: 1px solid #ffffff40; pointer-events: none; }
.tc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; transition: transform .4s; }
.tc-who { position: absolute; top: 0; left: 0; right: 0; z-index: 1; padding: 11px 12px 22px; font-size: 10.5px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 4px #000; background: linear-gradient(#000000b0, transparent); }
.tc-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; padding: 46px 12px 13px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--tc) 30%, #0d0918e6) 38%, #0d0918f2); }
.theme-card.has-img .tt { font-size: 19px; color: #fff; text-shadow: 0 0 14px var(--tc); }
.theme-card.has-img .td { color: #e3dbf7; font-size: 12px; }
.theme-card.has-img .tb { margin-top: 3px; font-size: 11.5px; }
.theme-badge { display: inline-block; font-size: 13px; padding: 5px 12px; border-radius: 999px; font-weight: 700; align-self: center;
  background: color-mix(in srgb, var(--tc) 22%, transparent); color: color-mix(in srgb, var(--tc) 70%, #fff);
  border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); }

/* ---------- 사주팔자 ---------- */
.saju-card { padding: 16px 14px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pillar { text-align: center; perspective: 600px; }
.pillar .cap { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.pillar .ch {
  font-family: "Gowun Batang", serif; font-size: 30px; font-weight: 700; border-radius: 14px; padding: 10px 0 6px;
  margin-bottom: 6px; color: #1a1330; opacity: 0; transform: rotateY(90deg); animation: flip .5s ease forwards;
  box-shadow: inset 0 -3px 0 #0000002a, inset 0 2px 0 #ffffff55;
}
.pillar .ch small { display: block; font-family: "Noto Sans KR"; font-size: 11px; font-weight: 700; opacity: .7; margin-top: 2px; }
.pillar .ch.unknown { background: #ffffff12 !important; color: var(--muted); box-shadow: none; }
@keyframes flip { to { opacity: 1; transform: none; } }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 96px 1fr 18px; align-items: center; gap: 10px; font-size: 14px; min-height: 22px; }
.bar .bl { display: flex; align-items: center; white-space: nowrap; font-weight: 700; }
.bar > span:last-child { text-align: right; color: var(--muted); font-weight: 700; }
.bar .track { height: 10px; background: #ffffff12; border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; width: 0; border-radius: 6px; transition: width 1s ease .6s; }
.bar .tag { font-size: 10.5px; padding: 1px 6px; border-radius: 8px; margin-left: 6px; font-weight: 700; }

/* ---------- 풀이 ---------- */
.chapters { display: flex; flex-direction: column; gap: 12px; }
.chapter { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.chapter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc); }
.chapter h3 { margin: 0 0 10px; font-family: "Gowun Batang", serif; font-size: 19px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chapter p { margin: 0; line-height: 1.75; white-space: pre-line; font-size: 15px; color: #e6def9; }
.chapter .body p { white-space: normal; margin: 0 0 10px; line-height: 1.85; font-size: 15.5px; }
.chapter .body p:last-child { margin-bottom: 0; }
.chapter .body > p:first-child { font-weight: 700; color: #fff; }
.chapter .body h4 { margin: 18px 0 6px; font-size: 15px; color: color-mix(in srgb, var(--tc) 70%, #fff); display: flex; align-items: center; gap: 6px; }
.chapter .body h4::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: currentColor; }
.chapter .body h4:first-child { margin-top: 2px; }
/* 달마다의 흐름(2026-11-18): 왼쪽 달 · 오른쪽 설명, 줄마다 옅은 구분선 */
.chapter .mflow { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #ffffff10; font-size: 14.5px; line-height: 1.6; }
.chapter .mflow:last-child { border-bottom: 0; }
.chapter .mflow b { color: #f2d9a6; font-weight: 700; white-space: nowrap; }
.chapter .mflow span { color: #e6def9; }
/* 잠긴 장 카드: 소제목 목록 + 2줄 블러 + 분량 + [1,500원 열기] */
.lk-divider { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-size: 13px; font-weight: 700;
  color: color-mix(in srgb, var(--tc) 60%, #fff); }
.lk-divider::before, .lk-divider::after { content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tc) 50%, transparent), transparent); }
.chapter.locked { padding: 16px 16px 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 12%, transparent), #ffffff05 70%);
  border: 1px dashed color-mix(in srgb, var(--tc) 35%, transparent); }
.chapter.locked::before { background: color-mix(in srgb, var(--tc) 40%, #ffffff22); }
.chapter.locked h3 { color: #e6def9; margin-bottom: 10px; }
.pill.lockpill { margin-left: auto; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.lk-heads { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lk-heads li { display: flex; gap: 8px; align-items: baseline; font-size: 14.5px; font-weight: 700; color: #ddd3f5; line-height: 1.45; }
.lk-heads li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-2px);
  background: var(--tc); box-shadow: 0 0 6px var(--tc); }
.chapter .lk-blur { margin: 4px 0 12px; font-size: 14px; line-height: 1.7; color: #cfc6ea; filter: blur(4.5px); opacity: .6;
  user-select: none; pointer-events: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  -webkit-mask: linear-gradient(90deg, #000 60%, transparent); mask: linear-gradient(90deg, #000 60%, transparent); }
.lk-foot { display: flex; align-items: stretch; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.lk-foot .btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  line-height: 1.25; padding: 9px 8px; font-size: 14.5px; word-break: keep-all; }
.lk-foot .btn small { font-size: 11px; font-weight: 700; opacity: .85; }
.btn.lk-game { flex: 1.4; color: #1a1330; border: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 50%, #fff), var(--tc));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 45%, #000), 0 8px 18px color-mix(in srgb, var(--tc) 25%, transparent); }
.btn.lk-game:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--tc) 45%, #000); }
.btn.lk-buy { flex: 1; }
.btn.sm { font-size: 15px; padding: 11px 8px; border-radius: 12px; }
.btn.primary.sm { box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 45%, #000); }
.chapter, #paywall { scroll-margin-top: 70px; }

/* 풀이 상단 헤더: 사주 이름 + 목차 + 읽은 정도. 스크롤해도 통째로 고정 */
.reading-head { position: sticky; top: 0; z-index: 5; margin: calc(-16px - env(safe-area-inset-top)) -18px 0;
  padding: calc(12px + env(safe-area-inset-top)) 0 0;
  background:
    radial-gradient(90% 140% at 50% -40%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--tc) 30%, transparent);
  box-shadow: 0 10px 24px -12px #000c; }
/* PC 프레임(#app 이 스크롤 주체)에서는 sticky 가 #app 의 위쪽 여백(16px) 안쪽에 붙으므로 그만큼 올려 프레임 맨 위에 딱 붙인다 */
@media (min-width: 600px) { .reading-head { top: -16px; margin-top: -16px; padding-top: 14px; } }
.rh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px 10px; }
.rh-title { font-family: "Gowun Batang", serif; font-weight: 700; font-size: 20px; letter-spacing: .5px;
  color: color-mix(in srgb, var(--tc) 55%, #fff); text-shadow: 0 0 18px color-mix(in srgb, var(--tc) 60%, transparent);
  white-space: nowrap; min-width: 0; }
.rh-count { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px;
  background: #ffffff0f; border: 1px solid var(--line); }
.rh-count b { color: var(--primary); }
.toc { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 18px 10px; scroll-padding: 0 18px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.toc::-webkit-scrollbar { display: none; }
.toc button { flex: none; display: flex; align-items: center; gap: 5px; max-width: 160px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: #d9d0f3; padding: 7px 12px 7px 9px; border-radius: 999px;
  background: #ffffff0d; border: 1px solid #ffffff1c; transition: background .25s, color .25s, border-color .25s, transform .15s; }
.toc button:active { transform: scale(.95); }
.toc button span { font-size: 15px; line-height: 1; }
.toc button em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc button i { font-style: normal; font-size: 10px; opacity: .8; }
.toc button.lk { color: var(--muted); background: #ffffff06; border-style: dashed; }
.toc button.on { color: #1a1330; border-color: transparent; opacity: 1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 55%, #fff), var(--tc));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--tc) 45%, transparent); }
.toc button.pay { color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 60%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, transparent); }
.toc button.pay.on { color: #2a1d05; background: var(--primary); }
.rh-progress { height: 3px; background: #ffffff0d; }
.rh-progress i { display: block; height: 100%; width: 0; transition: width .15s linear;
  background: linear-gradient(90deg, var(--tc), var(--primary)); box-shadow: 0 0 8px var(--tc); }
.rh-title { display: flex; align-items: center; gap: 8px; }
.rh-face { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--tc), 0 0 12px var(--tc); }

/* 풀이 첫머리: 캐릭터 배너(화면 폭 가득) + 첫인사 */
.rd-hero { display: flex; flex-direction: column; gap: 12px; }
.rd-hero:empty { display: none; }
.rd-banner { position: relative; height: 330px; margin: -14px -18px 0; overflow: hidden; }
.rd-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 8%; }
.rd-banner::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 85%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, transparent 45%, var(--bg) 98%); }
.rd-copy { position: absolute; left: 18px; bottom: 22px; z-index: 1; display: flex; flex-direction: column; gap: 6px; max-width: 62%; }
.rd-eyebrow { align-self: flex-start; font-size: 11.5px; font-weight: 900; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px;
  color: #fff; background: color-mix(in srgb, var(--tc) 60%, transparent); border: 1px solid #ffffff40; }
.rd-copy h2 { margin: 0; font-family: "Gowun Batang", serif; font-size: 28px; line-height: 1.25; color: #fff;
  text-shadow: 0 2px 14px #000, 0 0 24px color-mix(in srgb, var(--tc) 60%, transparent); }
.rd-copy p { margin: 0; font-size: 12.5px; color: #e6def9; text-shadow: 0 1px 6px #000; }
.rd-copy p b { color: color-mix(in srgb, var(--tc) 50%, #fff); }
.rd-talk .bubble { font-size: 14.5px; }

/* 게임 안내·결과의 캐릭터 얼굴 */
/* 스크롤 영역 맨 위의 얼굴 테두리·빛이 잘리지 않게 안쪽 여백 */
.gi-card { scrollbar-width: none; padding: 16px 6px 8px; }
.gi-card::-webkit-scrollbar { display: none; }
.gi-face { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; align-self: center;
  box-shadow: 0 0 0 3px var(--tc), 0 0 24px color-mix(in srgb, var(--tc) 60%, transparent); }
.grade-face { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 6px;
  box-shadow: 0 0 0 3px var(--tc), 0 0 30px color-mix(in srgb, var(--tc) 60%, transparent); }
.gi-face[hidden], .grade-face[hidden] { display: none; }
.chapter.new { animation: glow 1.4s ease 2; }
@keyframes glow { 50% { box-shadow: 0 0 28px color-mix(in srgb, var(--primary) 70%, transparent); } }
.pill { font-family: "Noto Sans KR", sans-serif; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--primary); margin-left: auto; }
.pill.free { background: #5fd38d26; color: #7fe3a5; }

.paywall { text-align: center; display: flex; flex-direction: column; gap: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 12%, transparent), #ffffff06); }
.paywall h3 { margin: 0; font-family: "Gowun Batang", serif; font-size: 22px; color: var(--primary); }
.paywall .desc { color: #ddd3f5; font-size: 14px; line-height: 1.6; }
.tiers { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tiers span { font-size: 12px; font-weight: 700; background: #ffffff10; border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; }
.tiers span.done { background: #5fd38d22; border-color: #5fd38d55; color: #9cf5b8; }
.tiers b { color: var(--primary); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ---------- 게임 ---------- */
#s-game { gap: 8px; height: calc(var(--vh) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0;
  user-select: none; -webkit-user-select: none; }
.hud { display: flex; justify-content: space-between; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px; }
.hud > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud { align-items: center; gap: 10px; padding-left: 10px; }
.hud > div[hidden] { display: none; }
.hud-exit { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: #ffffff12; color: var(--muted); font: 700 16px "Noto Sans KR", sans-serif; display: grid; place-items: center; }
.hud-exit:active { transform: scale(.92); background: #ffffff24; }
.hud-l { font-size: 11px; color: var(--muted); font-weight: 700; }
.hud b { font-size: 20px; }
.scroll-track { display: flex; gap: 6px; }
.scroll-track .sc { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 6px 0; border-radius: 10px;
  background: #ffffff0d; border: 1px solid var(--line); color: var(--muted); transition: all .3s; }
.scroll-track .sc.on { background: color-mix(in srgb, var(--primary) 25%, transparent); border-color: color-mix(in srgb, var(--primary) 60%, transparent); color: var(--primary); }
.stage { position: relative; flex: 1; min-height: 0; border-radius: var(--r); overflow: hidden; touch-action: none;
  background: radial-gradient(100% 70% at 50% 0%, color-mix(in srgb, var(--tc) 14%, #0e0a1d), #0b0817); border: 1px solid var(--line); }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.legend { position: absolute; top: 10px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 12px; pointer-events: none; }
.legend span { background: #000b; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); }
.countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 84px;
  font-weight: 900; color: var(--primary); pointer-events: none; text-shadow: 0 0 30px #000; }
.toast { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  background: var(--primary); color: #2a1d05; font-weight: 900; padding: 10px 16px; border-radius: 14px; white-space: nowrap;
  transition: all .25s; box-shadow: 0 8px 24px #0008; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.game-intro { position: absolute; inset: 0; background: #0b0817f2; display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 2; }
.game-intro.hide { display: none; }
.gi-card { display: flex; flex-direction: column; gap: 12px; text-align: center; width: 100%; max-height: 100%; overflow-y: auto; }
.gi-name { font-family: "Gowun Batang", serif; font-size: 28px; font-weight: 700; color: color-mix(in srgb, var(--tc) 75%, #fff); }
.gi-how { margin: 0; line-height: 1.7; font-size: 14.5px; color: #e6def9; }
.shop { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.shop-title { font-weight: 700; font-size: 14px; }
.shop-title small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.shop-item { display: flex; align-items: center; gap: 10px; background: #ffffff0b; border-radius: 14px; padding: 9px 10px; border: 1px solid var(--line); }
.shop-item.on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, transparent); }
.si-icon { font-size: 24px; width: 32px; text-align: center; }
.si-text { flex: 1; display: flex; flex-direction: column; font-size: 14px; gap: 1px; }
.si-text small { color: var(--muted); font-size: 11.5px; }
.si-use, .si-buy { font: 700 12px "Noto Sans KR", sans-serif; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.si-buy { background: var(--primary); color: #2a1d05; }
.shop-item.locked .si-icon { filter: grayscale(.7) opacity(.7); }
/* 장착/해제 스위치 */
.si-toggle { position: relative; display: flex; align-items: center; width: 74px; height: 32px; padding: 0 10px 0 36px; border: 0; border-radius: 999px;
  background: #ffffff1a; cursor: pointer; transition: background .2s; font: 700 12px "Noto Sans KR", sans-serif; color: var(--muted); }
.si-toggle em { font-style: normal; }
.si-toggle .knob { position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px #0006; transition: left .2s; }
.si-toggle.on { background: var(--tc); color: #1a1330; padding: 0 36px 0 12px; }
.si-toggle.on .knob { left: calc(100% - 28px); }

/* ---------- 게임 결과 ---------- */
.grade-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.grade { font-family: "Gowun Batang", serif; font-size: 68px; font-weight: 700; line-height: 1.05; margin-top: 6px;
  background: linear-gradient(180deg, #fff3c4, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grade-label { font-weight: 700; }
.grade-score { color: var(--muted); font-size: 13px; }
.unlock-list { display: flex; flex-direction: column; gap: 10px; }
.ul-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.ul-row.open { color: var(--text); font-weight: 700; }
.ul-row small { font-size: 12px; font-weight: 700; }

/* ---------- 결제 시트 ---------- */
.sheet-bg { position: fixed; inset: 0; background: #000b; display: none; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-bg.open { display: flex; }
.sheet { width: 100%; max-width: 430px; background: #241b42; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; gap: 10px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: up .25s ease; }
@keyframes up { from { transform: translateY(100%); } }
.sheet h3 { margin: 0 0 4px; }
.sheet .line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sheet .total { font-size: 20px; font-weight: 900; color: var(--primary); border: 0; }
.sheet .mock { font-size: 12px; color: var(--accent); background: #ff7aa81a; padding: 8px 10px; border-radius: 10px; }

.footer { text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.6; margin: 4px 0 0; }

/* ---------- 개발자용 초기화 ---------- */
/* 휴대폰: 앱 화면 아래(스크롤해야 보이는 바깥) / PC: 휴대폰 프레임 바깥 오른쪽 위 */
.dev-reset { display: block; margin: 12px auto calc(16px + env(safe-area-inset-bottom));
  font: 700 12px "Noto Sans KR", sans-serif; color: #fff; background: #ff3b5ccc;
  border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.dev-reset[hidden] { display: none; }
.dev-reset:active { transform: scale(.95); }
@media (min-width: 600px) {
  .dev-reset { position: fixed; margin: 0; left: calc(50% + 215px + 24px); top: calc(50% - min(50dvh, 450px)); box-shadow: 0 2px 8px #0008; }
}

/* ---------- Destiny Atelier: editorial service design ---------- */
:root { --line: #d5c39c26; --glass: linear-gradient(145deg, #ffffff07, #ffffff02); --r: 12px; --shadow: 0 16px 48px #0002; }
body { background: #111714; color: var(--text); }
#app { max-width: 1240px; padding: 0 44px; background: radial-gradient(ellipse at 90% 12%, #8f815414, transparent 42%), var(--bg); }
.site-header { height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border-bottom: 1px solid var(--line); }
.brand-lockup { border: 0; background: none; padding: 0; display: flex; align-items: center; gap: 11px; color: #e8ddc3; font: 700 24px 'Gowun Batang', serif; white-space: nowrap; cursor: pointer; }
.brand-seal { display: grid; place-items: center; width: 34px; height: 39px; border: 1px solid #bda476; border-radius: 40% 40% 4px 4px; font-size: 24px; font-weight: 400; }
.brand-lockup small { font: 9px 'Noto Sans KR', sans-serif; letter-spacing: 2px; max-width: 55px; white-space: normal; line-height: 1.6; color: #998f7c; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: #c4c7bd; text-decoration: none; font-size: 13px; transition: color .2s; }
.header-cta { background: transparent; color: #d7c59e; font: 500 12px 'Noto Sans KR', sans-serif; border: 1px solid #a58d5b70; border-radius: 4px; padding: 11px 17px; cursor: pointer; }
.header-cta span { margin-left: 16px; }
.screen { min-height: calc(var(--vh) - 130px); }
#s-intro { gap: 0; justify-content: flex-start; overflow: clip; }
.landing-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 30px; align-items: center; min-height: 640px; padding: 54px 0 48px; }
.hero-copy { position: relative; z-index: 1; padding-bottom: 8px; }
.editorial-kicker { color: #beaa80; font-size: 10px; letter-spacing: 2.4px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.editorial-kicker > span { width: 22px; height: 1px; background: #b29c70; }
h1 { font: 400 clamp(36px, 4.4vw, 58px)/1.5 'Gowun Batang', serif; letter-spacing: -2.6px; margin: 25px 0 22px; color: #f0ebdf; }
h1 em { color: #d0b880; font-style: normal; }
.hero-description { font-size: 14px; line-height: 2; color: #9ca79e; margin: 0; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin: 33px 0 24px; }
.btn { border-radius: 5px; box-shadow: none; font-size: 14px; font-weight: 500; padding: 16px 20px; transition: background .2s, transform .2s; }
.btn.primary { background: linear-gradient(110deg, #ddc89d, #bea16c); color: #25271e; box-shadow: none; border: 1px solid #e6d5b2; }
.btn.primary:active { transform: translateY(0); box-shadow: none; }
.hero-actions .btn { width: 268px; display: flex; justify-content: space-between; font-size: 14px; }
.text-link { display: inline-flex; align-items: center; gap: 20px; color: #c5b895; font: 400 12px 'Noto Sans KR', sans-serif; text-decoration: none; border: 0; border-bottom: 1px solid #b19c6e60; padding: 0 0 6px; background: transparent; cursor: pointer; }
.hero-note { font-size: 10px; color: #7d8b80; display: flex; align-items: center; gap: 8px; }
.tiny-star { color: #c5ae80; font-size: 17px; }
.hero-art { position: relative; min-width: 0; padding: 8px 18px 26px; }
.hero-cards { height: 478px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: relative; z-index: 1; }
.hc { position: relative; left: auto; top: auto; margin: 0; width: 100%; height: 100%; translate: none; rotate: none; animation: none; border: 1px solid #d6b88670; border-radius: 80px 80px 7px 7px; box-shadow: 0 15px 30px #0005; padding: 0; text-align: left; cursor: pointer; background: #28312b; overflow: hidden; transition: transform .4s, border-color .3s; }
.hc:nth-child(2n) { top: 27px; }
.hc img { object-position: 50% 22%; transition: transform .6s; }
.hc::after { inset: 5px; border-radius: 76px 76px 3px 3px; border-color: #fff4; }
.hc-label { position: absolute; bottom: 0; inset-inline: 0; padding: 30px 16px 14px; background: linear-gradient(transparent, #0d1617dc); color: #fff5df; display: flex; flex-direction: column; gap: 2px; }
.hc-label small { font: 10px 'Noto Sans KR', sans-serif; letter-spacing: 2px; color: #e3d4bb; }
.hc-label b { font: 400 23px 'Gowun Batang', serif; }
.hc-label i { position: absolute; right: 16px; bottom: 20px; font-style: normal; color: #e0ceaa; }
.art-caption { position: relative; z-index: 2; margin-top: 48px; text-align: center; color: #897f69; font-size: 8px; letter-spacing: 2px; }
.art-caption span { margin-right: 14px; color: #c3ad82; font-size: 12px; letter-spacing: 5px; }
.orbit { position: absolute; border: 1px solid #b8a06c25; border-radius: 50%; pointer-events: none; }
.orbit-one { inset: -17px -20px 16px; transform: rotate(-22deg); }
.orbit-two { inset: 15px -44px 50px; transform: rotate(18deg); }
.art-star { position: absolute; top: -28px; right: -4px; color: #d6bc86; font-size: 29px; }
.philosophy-strip { border-block: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 27px 0; }
.philosophy-strip > span:first-child { font: 400 18px/1.7 'Gowun Batang', serif; color: #b0b7a8; }
.philosophy-strip b { color: #ded6c3; font-weight: 400; }
.philosophy-strip p { font-size: 12px; line-height: 1.9; color: #8e9c90; margin: 0; }
.strip-symbol { font: 16px 'Gowun Batang', serif; color: #b9a67c; letter-spacing: 5px; }
.landing-section { padding: 72px 0; scroll-margin-top: 25px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.landing-section h2 { font: 400 29px/1.6 'Gowun Batang', serif; color: #ece5d5; letter-spacing: -.8px; margin: 12px 0 0; }
.section-heading > p { color: #8d9a8f; font-size: 11px; margin-bottom: 8px; }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.collection-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #ffffff02; color: var(--text); text-align: left; font: inherit; padding: 0; cursor: pointer; transition: transform .3s, border-color .3s; min-width: 0; }
.collection-image { height: 265px; position: relative; overflow: hidden; }
.collection-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, #101915dc); }
.collection-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; transition: transform .5s; }
.collection-hanja { position: absolute; top: 14px; right: 14px; z-index: 1; color: #fff8dd; font: 24px 'Gowun Batang', serif; text-shadow: 0 1px 8px #0008; }
.collection-guide { position: absolute; bottom: 14px; left: 16px; z-index: 1; font: 18px 'Gowun Batang', serif; color: #fff5df; }
.collection-guide small { display: block; font: 9px 'Noto Sans KR', sans-serif; margin-top: 4px; color: #e0d9c7; }
.collection-copy { padding: 20px 16px 15px; }
.collection-category { color: #baa37b; font-size: 9px; letter-spacing: 1.5px; }
.collection-copy h3 { font: 400 18px 'Gowun Batang', serif; margin: 12px 0 9px; letter-spacing: -.7px; }
.collection-copy p { font-size: 10px; color: #8d9a91; line-height: 1.7; margin: 0; min-height: 34px; }
.collection-bottom { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 17px; color: #b5bea9; font-size: 10px; }
.collection-bottom > span { font-size: 17px; color: #c4ad7f; }
.journey-section { border-block: 1px solid var(--line); }
.section-flower { color: #c7af7d; font-size: 38px; font-weight: 300; }
.journey-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 35px; }
.journey-grid article + article { border-left: 1px solid var(--line); padding-left: 35px; }
.step-number { font: 400 36px 'Gowun Batang', serif; color: #9f8b61; }
.journey-grid h3 { font-weight: 500; font-size: 15px; margin: 20px 0 12px; }
.journey-grid p { color: #8e9b90; font-size: 12px; line-height: 1.9; margin: 0; }
.journey-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 35px; padding: 20px 24px; background: #c8ad7510; border: 1px solid #c8ad7520; border-radius: 4px; font-size: 11px; color: #b6bcac; }
.journey-bottom i { margin: 0 15px; color: #80775e; font-style: normal; }
.journey-bottom b { color: #d2bc94; font-weight: 500; }
.faq-section { display: grid; grid-template-columns: 1fr 1.7fr; gap: 70px; }
.faq-section > div > p { font-size: 12px; color: #8c998d; margin-top: 16px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; display: flex; justify-content: space-between; gap: 18px; font-size: 13px; color: #d1d5c9; padding: 22px 0; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font-size: 18px; color: #b8a27a; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p { font-size: 12px; line-height: 1.9; color: #97a296; margin: 0 20px 23px 0; }
.site-footer { border-top: 1px solid var(--line); padding: 34px 0 26px; color: #6f7d71; font-size: 10px; line-height: 1.8; }
.footer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.footer-brand { font: 22px 'Gowun Batang', serif; color: #c2b99f; }
.footer-top p { margin: 8px 0 0; color: #8b978b; }
.footer-top > span { font: 13px 'Gowun Batang', serif; letter-spacing: 3px; color: #9e9277; }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid #ffffff08; font-size: 9px; letter-spacing: 1px; }
/* Continuing the same visual language through the actual service. */
.screen:not(#s-intro) { max-width: 640px; margin: 0 auto; padding: 44px 0; gap: 22px; }
.flow-heading { margin-bottom: 10px; text-align: center; }
.flow-heading .editorial-kicker { justify-content: center; }
.flow-heading h2 { font: 400 30px/1.65 'Gowun Batang', serif; margin: 17px 0 12px; color: #e8e0cd; }
.flow-heading p { font-size: 12px; color: var(--muted); }
.card { border-color: var(--line); box-shadow: none; border-radius: 8px; background: #ffffff04; padding: 25px; }
.form { gap: 21px; }
.form label { font-size: 12px; color: #a6b1a2; font-weight: 400; gap: 9px; }
.form input[type=text], .form input:not([type]), .form input[type=password], .form input[type=date], .form input[type=time] { border-radius: 4px; background: #0c120f80; padding: 15px; }
.seg { border-radius: 5px; background: #0c120f80; }
.seg span { border-radius: 3px; font-size: 13px; font-weight: 500; }
.seg input:checked + span { background: #c7b187; }
.form-note { color: #788779; font-size: 10px; line-height: 1.8; margin: 0; text-align: center; }
.guide { animation: none; }
.bubble { background: #d9d1ba0c; border: 1px solid #d9d1ba28; color: #c4ccbe; border-radius: 6px; font-size: 13px; box-shadow: none; line-height: 1.9; }
.bubble::before { display: none; }
.guide.face { box-shadow: 0 0 0 1px #c0a97c70; }
.scene { align-items: center; }
.eyebrow { background: transparent; border: 0; color: #c8b181; padding: 4px 0; font-size: 11px; font-weight: 400; }
.theme-card.has-img { aspect-ratio: 3/4; border: 1px solid #c4ac7640; border-radius: 8px; box-shadow: none; }
.theme-card.has-img::before { border-color: #ffffff30; border-radius: 4px; }
.theme-card.has-img .tt { font: 22px 'Gowun Batang', serif; text-shadow: none; }
.tc-body { padding: 55px 20px 20px; }
.tc-who { padding: 15px 17px; font-weight: 400; }
.theme-card.has-img .tb { font-weight: 400; color: #ddc9a5; margin-top: 9px; }
.reading-head { margin: -44px 0 0; top: 0; padding-top: 16px; background: #111714f2; border-color: var(--line); box-shadow: none; }
.rh-title { color: #e4dac4; font-size: 19px; text-shadow: none; }
.rh-face { box-shadow: 0 0 0 1px #c8b182; }
.toc button { border-radius: 4px; font-weight: 400; color: #bbc5b7; font-size: 11px; }
.toc button.on { background: #ccb58b; color: #20291f; box-shadow: none; }
.rd-banner { margin: -22px 0 0; height: 390px; border-radius: 0 0 8px 8px; }
.rd-banner img { object-position: 50% 20%; }
.rd-copy { left: 24px; bottom: 28px; }
.rd-copy h2 { font-size: 35px; text-shadow: 0 2px 12px #0008; }
.rd-eyebrow { background: #0b151bab; border-radius: 3px; font-size: 10px; font-weight: 400; letter-spacing: 1.5px; }
.chapter { border-radius: 8px; box-shadow: none; background: #ffffff03; border-color: var(--line); padding: 26px; }
.chapter h3 { color: #ded6c1; font-weight: 400; }
.chapter .body { color: #b8c1b3; font-size: 14px; line-height: 2.1; }
.chapter .body h4 { color: #d1ba8e; }
.pill { font-weight: 400; border-radius: 3px; font-size: 10px; }
.pill.free { background: #9db58d19; color: #b0c4a1; }
.btn.lk-game, .btn.buy, .btn.primary.sm { box-shadow: none; border-radius: 5px; }
.lk-title { color: #d8ceba; }
.paywall { background: #c6b17b09; border-color: #c6b17b40; }
.paywall .desc { color: #aebaa8; }
.paywall h3 { font-weight: 400; }
.tiers span { border-radius: 4px; font-weight: 400; }
.sheet { background: #1c251e; border-radius: 12px 12px 0 0; max-width: 520px; }
.sheet h3 { font-family: 'Gowun Batang', serif; font-weight: 400; }
.sheet-bg { backdrop-filter: blur(6px); }
.hud, .stage, .shop-item { border-radius: 7px; }
.gi-face, .grade-face { box-shadow: 0 0 0 2px #c8af7e; }
.gi-name { color: #d7c49d; font-weight: 400; }
.gi-how { color: #c8cdbd; }
.game-intro { background: #111914f5; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #dfc89b; outline-offset: 5px; }
.seg input:focus-visible + span { outline: 2px solid #dfc89b; outline-offset: 3px; }
.dev-reset { left: auto; right: 10px; top: auto; bottom: 10px; background: #445045; color: #c5cfbe; box-shadow: none; font-weight: 400; font-size: 10px; opacity: .8; }
body[data-screen='s-game'] .site-header { display: none; }
#s-game { max-width: 430px; padding: 16px 0; height: calc(var(--vh) - 8px); }
@media (min-width: 600px) {
  body { display: block; background: #111714; }
  #app { --vh: 100dvh; height: 100dvh; border-radius: 0; box-shadow: none; scrollbar-width: thin; scrollbar-color: #5f604c #111714; }
  #app::-webkit-scrollbar { display: block; width: 5px; }
  #app::-webkit-scrollbar-thumb { background: #5f604c; }
  #app { cursor: auto; user-select: auto; -webkit-user-select: auto; }
  .reading-head { top: 0; padding-top: 16px; }
}
@media (max-width: 1000px) and (min-width: 600px) {
  #app { padding-inline: 30px; }
  .brand-lockup small { display: none; }
  .site-nav { gap: 18px; }
  .landing-hero { gap: 20px; min-height: 570px; }
  h1 { font-size: 43px; }
  .hero-cards { height: 405px; gap: 10px; }
  .hero-art { padding-inline: 5px; }
  .collection-grid { gap: 12px; }
  .collection-image { height: 210px; }
  .collection-copy { padding-inline: 12px; }
  .collection-copy h3 { font-size: 16px; }
  .strip-symbol { font-size: 12px; letter-spacing: 2px; }
  .journey-grid { gap: 22px; }
  .journey-grid article + article { padding-left: 22px; }
}
@media (max-width: 749px) {
  .site-nav { display: none; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
  .collection-image { height: 260px; }
  .strip-symbol { display: none; }
}
/* A single portrait layout on phones, tablets and desktop. */
@media all {
  body { background: #090e0b; }
  #app { padding: env(safe-area-inset-top) 22px env(safe-area-inset-bottom); max-width: 480px; container-type: inline-size; }
  .site-nav { display: none; }
  .section-heading { display: block; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-symbol { display: none; }
  .site-header { height: 79px; gap: 10px; }
  .brand-lockup { font-size: 21px; gap: 8px; }
  .brand-seal { width: 28px; height: 32px; font-size: 20px; }
  .brand-lockup small { display: none; }
  .header-cta { font-size: 10px; padding: 9px 12px; }
  .header-cta span { margin-left: 12px; }
  .landing-hero { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 35px; min-height: auto; }
  .hero-copy { padding-bottom: 0; }
  .editorial-kicker { font-size: 9px; letter-spacing: 1.7px; }
  h1 { font-size: clamp(32px, 9.3cqi, 43px); line-height: 1.5; letter-spacing: -1.8px; margin-top: 20px; }
  .hero-description { font-size: 12px; line-height: 1.9; }
  .hero-description br:last-child { display: none; }
  .hero-actions { margin: 24px 0 15px; gap: 16px; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .text-link { display: none; }
  .hero-note { font-size: 9px; }
  .hero-art { padding: 8px 12px 0; margin-top: 8px; }
  .hero-cards { height: 370px; gap: 12px; }
  .hc { border-radius: 65px 65px 5px 5px; }
  .hc::after { border-radius: 60px 60px 2px 2px; }
  .hc-label { padding: 25px 13px 12px; }
  .hc-label b { font-size: 20px; }
  .hc-label small { font-size: 9px; }
  .hc:nth-child(2n) { top: 18px; }
  .art-caption { margin-top: 36px; letter-spacing: 1.2px; font-size: 6px; }
  .art-caption span { font-size: 10px; letter-spacing: 3px; margin-right: 8px; }
  .orbit-one { inset: -10px -8px 15px; }
  .orbit-two { inset: 15px -20px 30px; }
  .art-star { font-size: 22px; top: -18px; right: 0; }
  .philosophy-strip { padding: 22px 0; gap: 14px; }
  .philosophy-strip > span:first-child { font-size: 15px; }
  .philosophy-strip p { font-size: 9px; max-width: 150px; }
  .landing-section { padding: 46px 0; }
  .landing-section h2 { font-size: 24px; letter-spacing: -1px; }
  .section-heading { margin-bottom: 22px; }
  .section-heading > p { font-size: 10px; }
  .collection-grid { gap: 18px 12px; }
  .collection-image { height: 214px; }
  .collection-guide { left: 12px; bottom: 12px; font-size: 17px; }
  .collection-guide small { font-size: 8px; letter-spacing: -.3px; }
  .collection-copy { padding: 16px 12px 12px; }
  .collection-copy h3 { font-size: 16px; line-height: 1.5; margin-block: 10px 7px; }
  .collection-copy p { font-size: 9px; min-height: 33px; }
  .collection-category { font-size: 8px; letter-spacing: 1px; }
  .collection-bottom { margin-top: 12px; font-size: 9px; }
  .journey-section .section-heading { display: flex; }
  .section-flower { font-size: 26px; }
  .journey-grid { grid-template-columns: 1fr; gap: 24px; margin-top: 26px; }
  .journey-grid article { display: grid; grid-template-columns: 46px 1fr; gap: 8px 12px; }
  .journey-grid article + article { border-left: 0; padding-left: 0; }
  .step-number { grid-row: span 2; font-size: 30px; }
  .journey-grid h3 { font-size: 14px; margin: 3px 0 0; }
  .journey-grid p { font-size: 11px; line-height: 1.9; }
  .journey-bottom { flex-direction: column; align-items: flex-start; padding: 18px; gap: 16px; font-size: 10px; }
  .journey-bottom i { margin-inline: 6px; }
  .faq-section { grid-template-columns: 1fr; gap: 20px; }
  .faq-section h2 br { display: none; }
  .faq-section > div > p { font-size: 11px; margin-top: 10px; }
  .faq-list summary { font-size: 12px; padding-block: 19px; }
  .faq-list details p { font-size: 11px; }
  .site-footer { padding-block: 28px 22px; font-size: 9px; }
  .footer-top > span { font-size: 10px; letter-spacing: 1px; }
  .footer-bottom { font-size: 7px; letter-spacing: .5px; }
  .screen:not(#s-intro) { padding-block: 32px; gap: 19px; min-height: calc(100dvh - 79px); }
  .flow-heading h2 { font-size: 25px; }
  .flow-heading p { font-size: 11px; }
  .card, .chapter { padding: 20px; }
  .reading-head { margin: -32px -22px 0; padding-top: 14px; }
  .rd-banner { margin: -19px -22px 0; height: 335px; border-radius: 0; }
  .rd-copy h2 { font-size: 30px; }
  .chapter .body { font-size: 13px; line-height: 2; }
  .theme-card.has-img { aspect-ratio: 3/4.5; }
  .tc-body { padding: 50px 13px 16px; }
  .theme-card.has-img .tt { font-size: 19px; }
  .tc-who { padding: 12px; font-size: 9px; }
  .theme-card.has-img .td { font-size: 10px; }
  .theme-card.has-img .tb { font-size: 9px; }
  #s-game { min-height: 0; height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding-block: 12px; }
}
/* Compact home: one introduction, four guides and one primary action. */
.header-caption { color: #8e9b90; font-size: 10px; letter-spacing: 1px; }
.intro-simple { display: flex; flex-direction: column; gap: 25px; padding: 32px 0 24px; min-height: 0; }
.intro-simple .hero-copy { width: 100%; text-align: center; }
.intro-simple h1 { margin: 0 0 15px; font-size: clamp(29px, 8cqi, 35px); line-height: 1.55; letter-spacing: -1px; }
.intro-simple .hero-description { font-size: 12px; line-height: 1.9; }
.intro-simple .hero-description br:last-child { display: initial; }
.intro-simple .hero-art { width: 100%; margin: 0; padding: 0; }
.intro-simple .hero-cards { height: auto; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: none; }
.intro-simple .hc { top: 0; height: auto; aspect-ratio: 1 / 3; min-height: 0; border-radius: 10px; border-color: #d6b88640; cursor: default; }
.intro-simple .hc::after { display: none; }
.intro-simple .hc img { object-position: 50% 20%; }
.brand-lockup:disabled { cursor: default; }
.intro-start { width: 100%; }
.intro-start .btn { display: flex; justify-content: space-between; }
.intro-start .hero-note { display: block; text-align: center; margin: 12px 0 0; font-size: 10px; }
.intro-footer { padding: 16px 4px 24px; border-top: 1px solid var(--line); }
.intro-footer p { margin: 0; text-align: center; color: #7d8b80; font-size: 9px; line-height: 1.8; }
/* Reserve the full stage for setup; show play metrics only during a game. */
body[data-screen="s-game"]:not([data-game-playing="true"]) .hud,
body[data-screen="s-game"]:not([data-game-playing="true"]) .scroll-track,
body[data-screen="s-game"]:not([data-game-playing="true"]) #gi-tiers { display: none; }
/* Gallery triggers remain separate from the whole-card saju selection buttons. */
.intro-simple .hc { cursor: pointer; }
.gallery-hint { margin: 14px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.portrait-button { display: inline-flex; align-items: center; justify-content: center; align-self: center; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
button.guide { padding: 0; border: 0; cursor: pointer; }
.theme-card { cursor: pointer; }
.tc-portrait, .rd-portrait { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.tc-who { pointer-events: none; }
button.tc-body { font: inherit; color: inherit; text-align: left; border: 0; width: 100%; cursor: pointer; }
.rd-banner::after, .rd-copy { pointer-events: none; }
.rd-portrait { border-radius: inherit; }
body.gallery-open { overflow: hidden; }
body.gallery-open #app { overflow: hidden; }
.character-gallery { width: min(480px, calc(100% - 20px)); max-width: calc(100% - 20px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: auto; padding: 18px; border: 1px solid #cbb58460; border-radius: 12px; background: #172019; color: #e7e5d8; box-shadow: 0 24px 100px #0009; overflow: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #7b735b #172019; }
.character-gallery::backdrop { background: #050a08d9; backdrop-filter: blur(9px); }
.gallery-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; position: sticky; top: -18px; z-index: 3; margin: -18px -18px 0; padding: 18px; background: #172019f5; backdrop-filter: blur(8px); }
.gallery-header h2 { margin: 9px 0 5px; font: 400 26px 'Gowun Batang', serif; color: #eadcc0; }
.gallery-header p { margin: 0; font-size: 11px; color: #9caa98; line-height: 1.7; }
.gallery-close { width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: #ffffff05; color: #e1d2b5; font-size: 16px; cursor: pointer; }
.gallery-characters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 21px 0; }
.gallery-character { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-width: 0; padding: 8px 4px; border: 1px solid #c7b18425; border-radius: 7px; background: #ffffff03; color: #aebb9e; font: 11px 'Noto Sans KR', sans-serif; cursor: pointer; }
.gallery-character img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.gallery-character[aria-pressed="true"] { border-color: #cfb582; color: #e3ceaa; background: #c8ad7514; }
.gallery-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.gallery-viewer { min-width: 0; }
.gallery-media { width: 100%; height: min(480px, 50dvh); position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 10px; border: 1px solid #cbb58430; background: radial-gradient(ellipse at 50% 30%, #4a493027, transparent 75%), #0c140f; }
.gallery-media img { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.gallery-media.loading::after { content: '이미지 불러오는 중…'; position: absolute; bottom: 12px; padding: 5px 10px; border-radius: 4px; background: #101811d9; color: #c6cbb7; font-size: 10px; pointer-events: none; }
.gallery-media [hidden] { display: none !important; }
.gallery-empty { padding: 24px; text-align: center; }
.gallery-empty > span { display: block; color: #9e885e; font: 54px 'Gowun Batang', serif; margin-bottom: 20px; }
.gallery-empty h3 { font: 400 22px 'Gowun Batang', serif; color: #d6c39b; margin: 0 0 10px; }
.gallery-empty p { font-size: 12px; line-height: 1.8; color: #91a18d; margin: 0; }
.gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.gallery-controls button { width: 36px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: #ffffff05; color: #ddc69a; font-size: 18px; cursor: pointer; }
.gallery-controls button:disabled { opacity: .3; cursor: default; }
.gallery-controls span { color: #aebba4; font-size: 11px; }
.gallery-sidebar h3 { margin: 0 0 6px; font: 400 20px 'Gowun Batang', serif; color: #e1d1ae; }
.gallery-sidebar > p { color: #94a18a; font-size: 11px; margin: 0 0 18px; line-height: 1.8; }
.gallery-stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gallery-stage { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 7px; padding: 13px 12px; background: #ffffff03; color: #c9cfba; font: 12px 'Noto Sans KR', sans-serif; cursor: pointer; }
.gallery-stage-number { color: #9d8b64; width: 23px; font: 21px 'Gowun Batang', serif; }
.gallery-stage > span:nth-child(2) { flex: 1; }
.gallery-stage small { display: block; color: #84947f; font-size: 9px; margin-top: 4px; }
.gallery-stage > span:last-child { color: #ac9667; font-size: 10px; }
.gallery-stage[aria-pressed="true"] { border-color: #cbb484; background: #c8ad7510; color: #eedaba; }
.gallery-stage.is-locked { color: #a0ac98; background: #ffffff02; }
.gallery-sidebar .gallery-scroll-progress { padding: 10px 12px; border: 1px solid #c7b18430; border-radius: 5px; color: #decaa4; font-size: 11px; }
.gallery-sidebar .gallery-coming-note { margin: 16px 0 0; font-size: 10px; color: #81917b; }
.gallery-default { border-top: 1px solid var(--line); padding-top: 18px; }
.gallery-default .btn { white-space: normal; font-size: 12px; }
.gallery-default .btn:disabled { cursor: default; opacity: .55; }
#gallery-default-status { color: #d6c49c; font-size: 11px; line-height: 1.8; margin: 12px 0 0; }
.gallery-preference-note { color: #91a18b; font-size: 10px; line-height: 1.9; margin: 8px 0 0; }
.gallery-layout > *, .gallery-header > div { min-width: 0; }
.gallery-stage { min-width: 0; }
.sheet { max-width: 480px; }
@media (max-width: 599px) {
  .character-gallery { width: min(480px, calc(100% - 20px)); padding: 18px; border-radius: 12px; }
  .gallery-header h2 { font-size: 23px; }
  .gallery-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .gallery-characters { gap: 6px; margin-block: 18px; }
  .gallery-character { flex-direction: column; gap: 5px; padding: 8px 4px; font-size: 10px; }
  .gallery-character img { width: 30px; height: 30px; }
  .gallery-media { height: 46dvh; max-height: 440px; }
  .gallery-stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-stage { gap: 8px; padding: 12px 9px; }
  .gallery-stage-number { width: 19px; font-size: 18px; }
}
/* Fixed portrait shell, including games, with one stable scrollbar gutter. */
:root { --app-width: 480px; --site-header-height: calc(79px + env(safe-area-inset-top)); }
html, body { height: 100%; overflow: hidden; }
#app { --vh: 100dvh; width: 100%; max-width: var(--app-width); height: var(--vh); min-height: 0; padding: 0 22px env(safe-area-inset-bottom); overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #5f604c #111714; }
#app::-webkit-scrollbar { display: block; width: 5px; }
#app::-webkit-scrollbar-thumb { background: #5f604c; }
.site-header, body[data-screen='s-game'] .site-header { display: flex; position: sticky; top: 0; z-index: 8; height: var(--site-header-height); min-height: var(--site-header-height); margin: 0 -22px; padding: env(safe-area-inset-top) 22px 0; background: var(--bg); }
.screen:not(#s-intro) { width: 100%; max-width: none; min-height: calc(var(--vh) - var(--site-header-height) - env(safe-area-inset-bottom)); }
.reading-head { top: var(--site-header-height); }
#s-game { width: 100%; max-width: none; height: calc(var(--vh) - var(--site-header-height) - env(safe-area-inset-bottom)); min-height: 0; padding-block: 12px; }
.sheet { max-width: var(--app-width); }
/* 가로로 든 휴대폰(터치 + 낮은 화면)의 게임: 게임판이 너무 낮아 못 하므로 세로로 돌리라는 안내를 덮는다 */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  body[data-screen='s-game']::after { content: "📱 휴대폰을 세로로 돌려 주세요\A게임은 세로 화면에서 할 수 있어요"; white-space: pre-line; position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.9; padding: 24px;
    background: #111714f2; color: #e7dcc0; font: 700 16px 'Noto Sans KR', sans-serif; }
}
/* 낮은 화면(노트북 브라우저·가로로 든 휴대폰): 상단 헤더를 줄여 본문·게임 자리를 확보 */
@media (max-height: 720px) {
  :root { --site-header-height: calc(58px + env(safe-area-inset-top)); }
  .site-header { height: var(--site-header-height); }
}
/* The clicked character is the only portrait in a compact, scrollable dialog. */
.character-gallery { width: min(440px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(92dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 16px; scrollbar-gutter: stable; }
.gallery-header { top: -16px; margin: -16px -16px 0; padding: 16px; }
.gallery-header h2 { font-size: 22px; margin: 6px 0 3px; }
.gallery-header .editorial-kicker { font-size: 8px; }
.gallery-header p { font-size: 10px; }
.gallery-layout { gap: 14px; }
.gallery-media { height: min(340px, 40dvh); max-height: none; }
.gallery-controls { margin-top: 8px; }
.gallery-controls button { min-width: 36px; height: 32px; }
.gallery-sidebar h3 { font-size: 17px; margin-bottom: 8px; }
.gallery-sidebar .gallery-scroll-progress { padding: 8px 10px; margin-bottom: 10px; font-size: 10px; }
.gallery-stages { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.gallery-stage { position: relative; min-height: 78px; flex-direction: column; justify-content: center; text-align: center; padding: 15px 4px 8px; gap: 0; font-size: 10px; line-height: 1.6; }
.gallery-stage-number { display: none; }
.gallery-stage > span:nth-child(2) { flex: none; }
.gallery-stage small { font-size: 8px; line-height: 1.6; margin-top: 4px; }
.gallery-stage > span:last-child { position: absolute; top: 3px; right: 4px; font-size: 8px; }
.gallery-sidebar .gallery-coming-note { margin-top: 10px; font-size: 9px; }
.gallery-default { padding-top: 12px; }
#gallery-default-status { margin-top: 8px; font-size: 10px; white-space: pre-line; }
.gallery-preference-note { font-size: 9px; margin-top: 5px; }
/* Edge-to-edge portrait gallery: the photo fills a phone-shaped viewport. */
.character-gallery.gallery-fullscreen { width: min(100%, var(--app-width)); max-width: 100%; height: 100dvh; max-height: 100dvh; padding: 0; margin: auto; border: 0; border-radius: 0; overflow: hidden; scrollbar-gutter: auto; background: #111714; }
.gallery-fullscreen .gallery-shell { position: relative; width: 100%; height: 100%; overflow: hidden; }
.gallery-fullscreen .gallery-media { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; aspect-ratio: auto; touch-action: pan-y pinch-zoom; }
.gallery-fullscreen .gallery-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.gallery-fullscreen .gallery-media.loading::after { bottom: calc(175px + env(safe-area-inset-bottom)); }
.gallery-fullscreen .gallery-header { position: absolute; inset: 0 0 auto; z-index: 3; margin: 0; padding: calc(16px + env(safe-area-inset-top)) 18px 40px; background: linear-gradient(#0008, transparent); backdrop-filter: none; pointer-events: none; }
.gallery-fullscreen .gallery-header h2 { color: #fff; text-shadow: 0 1px 8px #0008; font-size: 20px; margin: 0 0 4px; }
.gallery-fullscreen .gallery-header p { color: #ffffffe0; font-size: 11px; text-shadow: 0 1px 6px #000; }
.gallery-fullscreen .gallery-close { width: 44px; height: 44px; border: 1px solid #ffffff45; background: #0004; color: #fff; pointer-events: auto; backdrop-filter: blur(10px); }
.gallery-bottom { position: absolute; inset: auto 0 0; z-index: 2; padding: 42px 18px calc(12px + env(safe-area-inset-bottom)); text-align: center; color: #fff; background: linear-gradient(transparent, #0009 35%, #000b); }
.gallery-fullscreen #gallery-count { margin: 0 0 4px; font-size: 14px; color: #fff; text-shadow: 0 1px 6px #000; }
.gallery-fullscreen #gallery-scroll-progress { color: #ffffffba; font-size: 10px; line-height: 1.6; margin: 0 0 4px; }
.gallery-dots { display: flex; align-items: center; justify-content: center; gap: 2px; margin: 0 0 4px; }
.gallery-dot { width: 36px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.gallery-dot > span { width: 9px; height: 9px; border: 1.5px solid #ffffffbd; border-radius: 50%; background: transparent; transition: background .2s, transform .2s; }
.gallery-dot[aria-pressed="true"] > span { background: #f0d5a3; border-color: #f0d5a3; transform: scale(1.15); }
.gallery-dot.is-locked:not([aria-pressed="true"]) > span { opacity: .4; }
.gallery-fullscreen .gallery-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 0; }
.gallery-fullscreen .gallery-controls button { width: 42px; height: 38px; border: 1px solid #ffffff40; border-radius: 20px; background: #ffffff10; color: #fff; font-size: 24px; backdrop-filter: blur(8px); }
.gallery-fullscreen .gallery-controls .gallery-act { width: auto; min-width: 0; padding: 0 16px; font: 500 12.5px 'Noto Sans KR', sans-serif; white-space: nowrap; }
#gallery-menu-toggle span { margin-left: 5px; }
#gallery-feedback { min-height: 0; margin: 0; font-size: 10px; line-height: 1.7; color: #f2d9ae; }
#gallery-feedback:not(:empty) { margin-top: 8px; }
.gallery-fullscreen .gallery-empty { width: 100%; max-width: 360px; padding: 130px 30px 210px; }
.gallery-fullscreen .gallery-empty > span { font-size: 56px; }
.gallery-fullscreen .gallery-empty h3 { font-size: 25px; }
.gallery-action-menu { position: absolute; bottom: calc(125px + env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 5; max-height: calc(100% - 220px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 16px; border: 1px solid #d9c49a60; border-radius: 14px; text-align: left; background: #172019f5; box-shadow: 0 12px 48px #0008; backdrop-filter: blur(18px); }
.gallery-action-menu[hidden] { display: none; }
.gallery-menu-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gallery-menu-heading h3 { font: 400 19px 'Gowun Batang', serif; margin: 0; color: #ebd9b8; }
#gallery-menu-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #d8c9ad; cursor: pointer; }
.gallery-action-menu > button { width: 100%; min-height: 46px; display: block; margin-top: 8px; padding: 12px; border: 1px solid #cbb58440; border-radius: 7px; text-align: left; background: #ffffff06; color: #e8ddc6; font: 12px/1.7 'Noto Sans KR', sans-serif; cursor: pointer; }
.gallery-action-menu > button:disabled { cursor: default; opacity: .45; }
.gallery-action-menu .gallery-preference-note { margin-top: 12px; font-size: 10px; }
/* Shared feedback also covers dynamically rendered shop and reading buttons. */
button {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
    box-shadow .2s ease, filter .2s ease, transform .2s ease, translate .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):not([aria-disabled="true"]):hover {
    filter: brightness(1.12);
    box-shadow: inset 0 0 0 1px #dbc49a80, 0 6px 18px #0003;
    translate: 0 -2px;
  }
  button:not(:disabled):not([aria-disabled="true"]):hover:active { translate: 0 0; }
  :is(.theme-card, .collection-card):not(:disabled):not([aria-disabled="true"]):hover {
    border-color: #d9c298;
    box-shadow: 0 8px 24px #0005;
  }
  :is(.theme-card, .collection-card):not(:disabled):not([aria-disabled="true"]):hover img { transform: scale(1.04); }
  .brand-lockup:not(:disabled):not([aria-disabled="true"]):hover {
    color: #f2dfb8; box-shadow: none; text-shadow: 0 0 16px #d0b88740;
  }
  :is(.si-toggle, .toc button):not(:disabled):not([aria-disabled="true"]):hover { translate: none; }
  .site-nav a:hover { color: var(--primary); }
  .seg label:hover span { color: #e8d5b2; box-shadow: inset 0 0 0 1px #dbc49a70; }
  .seg label:hover input:checked + span { color: #25271e; filter: brightness(1.12); }
  .character-gallery button.gallery-dot:not(:disabled):hover { box-shadow: none; translate: none; filter: none; }
  .gallery-dot:hover > span { border-color: #f0d5a3; }
}
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):not([aria-disabled="true"]):hover { translate: none; }
  :is(.hc, .theme-card, .collection-card):hover img { transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 점검 수정: 점수판 칸을 고르게(큐피드처럼 기운 칸이 없어도 기울지 않게) */
.hud > div { flex: 1; }
/* 게임 준비 화면 뒤로 게임 안내 문구가 비치지 않게 — 실제 시작 후에만 표시 */
body[data-screen="s-game"]:not([data-game-playing="true"]) #legend { display: none; }
/* 사주 선택 카드 맨 위 캐릭터 이름이 그림(머리장식)과 겹쳐도 잘 읽히게 */
.theme-card .tc-who { background: linear-gradient(#000000e0 0, #000000b8 55%, transparent); text-shadow: 0 1px 3px #000, 0 0 8px #000; }

/* 메인 캐릭터 슬라이드(carousel.js): 가운데 한 명을 크게(9:16), 양옆에 이전·다음 캐릭터가 흐리게 붙어 보인다. 자동으로 넘어가며 반복. */
.intro-simple .hero-cards { display: block; position: relative; height: auto; gap: 0; margin: 0 -22px; width: auto; overflow: hidden; touch-action: pan-y;
  --slide-w: min(62%, calc(min(50vh, 540px) * 9 / 16)); }
.hc-track { display: flex; align-items: flex-start; will-change: transform; transition: transform .7s cubic-bezier(.65,0,.35,1); }
.hc-track.hc-instant, .hc-track.hc-instant .hc img, .hc-track.hc-instant .hc-name { transition: none !important; }
.intro-simple .hc { position: relative; top: auto; flex: 0 0 var(--slide-w); width: var(--slide-w); height: auto; aspect-ratio: auto; margin: 0; padding: 0 5px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; cursor: pointer; }
.intro-simple .hc img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; object-position: 50% 0; border-radius: 14px;
  user-select: none; -webkit-user-drag: none; -webkit-mask-image: none; mask-image: none;
  filter: blur(2.5px) brightness(.5) saturate(.85); transform: scale(.9);
  transition: filter .7s ease, transform .7s cubic-bezier(.65,0,.35,1); }
.intro-simple .hc.is-active img { filter: none; transform: none; box-shadow: 0 18px 40px #000a; }
/* 옆 그림은 누르면 그쪽으로 넘어감(손가락 모양), 가운데 그림은 눌러도 동작 없음 */
.intro-simple .hc.is-active { cursor: default; }
.hc-name { position: absolute; left: 5px; right: 5px; bottom: 0; padding: 80px 8px 20px; border-radius: 0 0 14px 14px;
  background: linear-gradient(transparent, #000000b8 62%); display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; pointer-events: none; opacity: 0; transition: opacity .5s; }
.hc.is-active .hc-name { opacity: 1; }
.hc-name b { font: 400 30px 'Gowun Batang', serif; color: #f3e6c8; letter-spacing: 8px; text-indent: 8px; text-shadow: 0 2px 14px #000, 0 0 4px #000; }
.hc-name small { font-size: 11px; color: #d8c69c; letter-spacing: .5px; text-shadow: 0 1px 6px #000; }
.hc-dots { position: static; display: flex; justify-content: center; gap: 2px; margin-top: 10px; }
.hc-dots button { width: 18px; height: 18px; padding: 6px; border: 0; border-radius: 99px; background: #ffffff44; background-clip: content-box;
  cursor: pointer; transition: width .3s, background-color .3s; }
.hc-dots button[aria-current="true"] { width: 32px; background-color: #d6b886; }
.intro-simple .hc:focus-visible { outline-offset: -3px; }
/* 메인 슬라이드는 호버 효과 없음: 사이트 공통 버튼 호버(위로 뜸·네모 테두리·그림자·밝아짐)도 끈다 */
@media (hover: hover) and (pointer: fine) {
  #hero-cards .hc:hover { translate: none; box-shadow: none; filter: none; }
  #hero-cards .hc-dots button:hover { translate: none; box-shadow: none; filter: none; background-color: #ffffff99; }
  #hero-cards .hc-dots button[aria-current="true"]:hover { background-color: #e8cc96; }
  /* 슬라이드 끌기: 마우스 커서로 끌 수 있음을 표시 */
  #app #hero-cards .hc { cursor: grab; }
  #app #hero-cards.dragging, #app #hero-cards.dragging .hc { cursor: grabbing; }
}

/* 사주 안(풀이·게임·결과)에서는 그 사주 색(--tc)으로 배경을 은은하게 물들인다: 연애=분홍, 금전=금빛, 직업=푸른빛, 건강=초록 */
body:is([data-screen="s-free"], [data-screen="s-game"], [data-screen="s-result"]) {
  --theme-bg: color-mix(in srgb, var(--tc) 12%, #111714);
  background: color-mix(in srgb, var(--tc) 9%, #0c110e);
}
body:is([data-screen="s-free"], [data-screen="s-game"], [data-screen="s-result"]) #app {
  background:
    radial-gradient(ellipse 140% 60% at 50% 0%, color-mix(in srgb, var(--tc) 28%, transparent), transparent 75%),
    radial-gradient(ellipse 130% 50% at 50% 100%, color-mix(in srgb, var(--tc) 17%, transparent), transparent 72%),
    var(--theme-bg);
}
body:is([data-screen="s-free"], [data-screen="s-game"], [data-screen="s-result"]) .site-header { background: color-mix(in srgb, var(--tc) 17%, #111714); }
body[data-screen="s-free"] .reading-head { background: color-mix(in srgb, var(--tc) 15%, #111714f2); }

/* 풀이 장 카드 왼쪽의 사주 색 세로선 제거(배경이 이미 사주 색으로 물들어 있어 중복) */
.chapter::before, .chapter.locked::before { display: none; }

/* 새 캐릭터 그림(9:16 전신): 가로로 넓은 풀이 배너에서는 머리부터 보이게 맨 위 기준으로 자른다 */
.rd-banner img { object-position: 50% 2%; }

/* 메인: 시작 버튼 글자 가운데 + 갤러리 보기 버튼 */
.intro-start .btn { justify-content: center; gap: 10px; }
.intro-start .intro-gallery-btn { width: 100%; margin-top: 14px; }
/* 메인 아래 캐릭터 갤러리 모아 보기 */
.intro-gallery { scroll-margin-top: calc(var(--site-header-height) + 12px); padding: 34px 0 10px; border-top: 1px solid var(--line); margin-top: 26px; }
.ig-head { text-align: center; margin-bottom: 20px; }
.ig-head h2 { font: 400 24px 'Gowun Batang', serif; margin: 8px 0 8px; color: #efe3c8; }
.ig-head p { margin: 0; font-size: 11px; color: var(--muted); }
.ig-list { display: flex; flex-direction: column; gap: 18px; }
.ig-row { padding: 14px 12px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 12%, transparent), #ffffff03 70%); }
.ig-who { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.ig-who img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px color-mix(in srgb, var(--tc) 60%, #fff3); }
.ig-who b { font: 400 17px 'Gowun Batang', serif; color: #f3e6c8; }
.ig-who small { margin-left: auto; font-size: 10px; color: #b8c0ad; }
.ig-cells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ig-cell { position: relative; padding: 0; border: 1px solid #ffffff1a; border-radius: 8px; overflow: hidden; aspect-ratio: 9 / 16; background: #0b100d; cursor: pointer; }
.ig-cell img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.ig-cell.locked { background: linear-gradient(170deg, color-mix(in srgb, var(--tc) 22%, #0e1410), #0b100d); }
.ig-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 15px; }
.ig-lock small { font-size: 8.5px; color: #cdbf9f; line-height: 1.3; text-align: center; padding: 0 2px; }
.ig-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 0 4px; font-size: 9.5px; color: #f3e6c8; text-align: center;
  background: linear-gradient(transparent, #000000c0); }
@media (hover: hover) and (pointer: fine) {
  #app .ig-cell:hover { translate: none; box-shadow: none; filter: none; border-color: color-mix(in srgb, var(--tc) 70%, #fff4); }
}
/* 대표로 선택된 칸: 캐릭터 대표색(--tc) 테두리 + 은은한 빛, 왼쪽 위 '대표' 표시 */
#app .ig-cell.is-rep, #app .ig-cell.is-rep:hover { border: 1.5px solid color-mix(in srgb, var(--tc) 85%, #fff3);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tc) 35%, transparent), 0 0 12px color-mix(in srgb, var(--tc) 40%, transparent); }
.ig-rep { position: absolute; top: 4px; left: 4px; padding: 1px 5px; border-radius: 6px; font-size: 8.5px; font-weight: 700; color: #fff;
  background: color-mix(in srgb, var(--tc) 70%, #0008); text-shadow: 0 1px 2px #0008; }
.ig-head .editorial-kicker { display: block; text-align: center; }

/* PC 에서도 휴대폰 화면 그대로: 틀 폭은 휴대폰 비율(9:19.5)을 따르되 390~480px 로 제한.
   (예전엔 창 높이만 따라서 노트북(보이는 높이 600px 안팎)에서 폭이 260~290px 로 좁아져 글자·카드가 삐져나왔음)
   휴대폰엔 자리를 차지하는 스크롤바가 없으므로 PC 틀에서도 숨긴다(휠·끌기 스크롤은 그대로). */
@media (min-width: 600px) {
  :root { --app-width: min(100vw, clamp(390px, calc(100dvh * 9 / 19.5), 480px)); }
  /* PC 여백: 화면 뒤로 은은하게 번지는 사주 산수화. 모바일에서는 로드하지 않는다. */
  body { isolation: isolate; }
  body::before {
    content: ""; position: fixed; inset: -10px; z-index: -1; pointer-events: none;
    background:
      linear-gradient(180deg, #11131c30, #0c101438),
      radial-gradient(ellipse at center, #0b10133b, transparent 75%),
      url("img/backgrounds/desktop-saju.webp") center / cover no-repeat;
    filter: blur(4px);
  }
  #app { scrollbar-width: none; scrollbar-gutter: auto; }
  #app::-webkit-scrollbar { display: none; }
  /* 가운데 앱 = 반투명 유리(2026-11-11 사용자 선택): 뒤 산수화가 은은하게 비치고, 경계는 얇은 금색 선 + 그림자로 '틀'처럼.
     --glass = 바탕 진하기(낮을수록 배경이 더 보임). 글씨가 읽히도록 흐림(backdrop-filter)을 함께 준다. */
  :root { --glass: 35%; --glass-blur: 6px; }
  html body #app {
    background: radial-gradient(ellipse at 90% 12%, #8f815414, transparent 42%), color-mix(in srgb, var(--bg) var(--glass), transparent);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.15); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
    box-shadow: 0 0 0 1px #d6b88633, 0 0 80px 20px #0009;
  }
  html body:is([data-screen="s-free"], [data-screen="s-game"], [data-screen="s-result"]) #app {
    background:
      radial-gradient(ellipse 140% 60% at 50% 0%, color-mix(in srgb, var(--tc) 16%, transparent), transparent 75%),
      radial-gradient(ellipse 130% 50% at 50% 100%, color-mix(in srgb, var(--tc) 8%, transparent), transparent 72%),
      color-mix(in srgb, var(--theme-bg) var(--glass), transparent);
  }
  /* 위에 붙는 헤더·목차는 불투명 그대로 → 스크롤한 밝은 글씨는 조금만 비쳐도 눈에 띄어서(97% 도 보였음) */
  html body .site-header { background: var(--bg); }
  html body:is([data-screen="s-free"], [data-screen="s-game"], [data-screen="s-result"]) .site-header {
    background: color-mix(in srgb, var(--tc) 17%, #111714); }
  html body[data-screen="s-free"] .reading-head {
    background: color-mix(in srgb, var(--tc) 15%, #111714); }
}

/* 갤러리(전체 화면): 그림을 꽉 채우느라(cover) 양옆이 잘리지 않게 — 그림 전체가 보이도록(contain) */
.gallery-fullscreen .gallery-media img { object-fit: contain; object-position: 50% 50%; }
/* 그림은 세로 가운데. 위(이름·닫기)·아래(단계·점·버튼) UI 를 화면 끝이 아니라 그림의 위·아래 끝에 붙여, 휴대폰처럼 그림 위에 겹쳐 보이게.
   그림(9:16)과 화면 사이 남는 띠 = (화면 높이 - 폭×16/9) / 2  (컨테이너 단위 cqw/cqh). 화면이 그림보다 짧으면 0. */
.gallery-fullscreen .gallery-shell { container-type: size; }
/* 낮은 화면(노트북 등): 창 폭을 그림 비율(9:16)에 맞춰, 그림 양옆 빈 띠에 이름·✕·화살표가 떠 보이지 않게 */
.character-gallery.gallery-fullscreen { width: min(100%, var(--app-width), max(360px, calc(100dvh * 9 / 16))); } /* 가로로 든 휴대폰(높이 390)에서 220px 로 좁아져 버튼이 잘리던 것: 최소 360px, 남는 양옆은 흐린 그림 */
.gallery-fullscreen .gallery-header { top: max(0px, (100cqh - 100cqw * 16 / 9) / 2); }
.gallery-fullscreen .gallery-bottom { bottom: max(0px, (100cqh - 100cqw * 16 / 9) / 2); }

/* 갤러리 메뉴 창도 화면 끝이 아니라 그림 아래 끝 기준으로(휴대폰과 같은 자리) */
.gallery-fullscreen .gallery-action-menu {
  --gap: max(0px, (100cqh - 100cqw * 16 / 9) / 2);
  bottom: calc(125px + env(safe-area-inset-bottom) + var(--gap));
  max-height: calc(100% - 220px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 2 * var(--gap));
}
.ig-head .ig-owner { margin-top: 6px; color: #cbb991; font-size: 10.5px; }

/* 갤러리 그림을 원본 그대로: 위·아래에 깔던 검은 그라데이션 제거. 글자는 그림자로만 읽히게 */
.gallery-fullscreen .gallery-header, .gallery-fullscreen .gallery-bottom { background: none; }
.gallery-fullscreen .gallery-bottom #gallery-count, .gallery-fullscreen .gallery-bottom #gallery-scroll-progress,
.gallery-fullscreen .gallery-bottom #gallery-feedback { text-shadow: 0 1px 3px #000, 0 0 10px #000c; }
.gallery-fullscreen .gallery-header h2, .gallery-fullscreen .gallery-header p { text-shadow: 0 1px 3px #000, 0 0 10px #000c; }
.gallery-fullscreen .gallery-controls button { background: #0006; }
.gallery-fullscreen .gallery-dots { filter: drop-shadow(0 0 2px #000) drop-shadow(0 1px 3px #000a); }

/* 갤러리 메뉴: 싸인 새기기(유료)·켜기/끄기 */
.gallery-action-menu > button.gallery-sign-btn { border-color: #e2c27e90; color: #f3dca4; background: linear-gradient(110deg, #e2c27e1f, #ffffff06); }
.gallery-sign-note { margin: 6px 2px 0; font-size: 10px; line-height: 1.6; color: #c9bc9c; }
.character-gallery .sheet-bg { z-index: 20; }

/* 사주 선택 화면의 '캐릭터 갤러리 보기' 버튼 · 갤러리 페이지 */
#s-theme .gallery-entry { margin-top: 6px; }
#s-gallery .ig-head { margin-top: 8px; }
#s-gallery #btn-gallery-back { margin-top: 8px; }

/* 게임 배경·시작 전 안내: 사주 색(--tc) 은은하게 */
/* (2026-11-10) 그림 배경은 글씨가 잘 안 보여서 다시 사주 색을 은은하게 */
.stage { background: radial-gradient(140% 100% at 50% 0%, color-mix(in srgb, var(--tc) 28%, #141a17), color-mix(in srgb, var(--tc) 16%, #0f1411) 85%); }
.game-intro, body .game-intro { background: color-mix(in srgb, var(--tc) 12%, #0f1411f2); }
.game-intro .gi-name, .game-intro .gi-how, .game-intro .shop-title { text-shadow: 0 1px 3px #000, 0 0 12px #000c; }
.game-intro .gi-how { color: #fff; }
.legend span { background: #000a; }

/* 전체 싸인: 큰 그림 화면 ✕ 옆 ON/OFF 스위치 */
.gallery-header-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.gallery-sign-toggle { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid #e2c27e99; background: #0006; color: #f3dca4;
  font: 700 12px 'Noto Sans KR', sans-serif; cursor: pointer; backdrop-filter: blur(8px); text-shadow: 0 1px 3px #000; }
.gallery-sign-toggle[aria-pressed="false"] { color: #cfcfcf; border-color: #ffffff55; }
.gallery-sign-toggle[hidden] { display: none; }
/* 갤러리 페이지: 전체 싸인 구매 / 켜고 끄기 */
.ig-sign:empty { display: none; }
.ig-sign-buy { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e2c27e90; border-radius: 12px; text-align: left;
  background: linear-gradient(110deg, #e2c27e26, #ffffff06); color: #f3e6c8; cursor: pointer; font: inherit; }
.ig-sign-buy span, .ig-sign-row span { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ig-sign-buy b, .ig-sign-row b { font-size: 14px; color: #f3dca4; }
.ig-sign-buy small, .ig-sign-row small { font-size: 10.5px; color: #c9bc9c; line-height: 1.5; }
.ig-sign-buy em { font-style: normal; font-weight: 900; color: #25271e; background: #d9bd84; padding: 7px 11px; border-radius: 16px; white-space: nowrap; }
.ig-sign-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff05; }
.ig-sign-switch { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 18px; border: 1px solid #e2c27e90; background: #e2c27e33;
  color: #f3dca4; font: 900 12px 'Noto Sans KR', sans-serif; cursor: pointer; }
.ig-sign-switch i { width: 22px; height: 22px; border-radius: 50%; background: #e2c27e; }
.ig-sign-switch[aria-pressed="false"] { background: #ffffff0a; color: #aaa; border-color: #ffffff33; }
.ig-sign-switch[aria-pressed="false"] i { background: #777; }
#s-gallery .ig-sign { margin: -4px 0 4px; }
/* 싸인 산 뒤: 스위치 대신 '해제 완료' 표시(켜고 끄기는 큰 그림 화면 안에서) */
.ig-sign-done { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 12px; font-weight: 700; color: #f3dca4; white-space: nowrap;
  padding: 6px 11px; border-radius: 16px; border: 1px solid #e2c27e70; background: #e2c27e1f; }
.ig-sign-done img.ci { height: 1.3em; }

/* 갤러리 잠긴 단계: 바로 그 사주 풀이로 열러 가기 */
.gallery-go-unlock { margin-top: 22px; width: auto; padding: 14px 22px; pointer-events: auto; }
.gallery-go-unlock[hidden] { display: none; }

/* 게임 시작 전(설명·아이템 화면): 가운데 진한 판 없이 페이지 배경 위에 바로 */
body[data-screen="s-game"]:not([data-game-playing="true"]) .stage { background: transparent; border-color: transparent; }
.game-intro, body .game-intro { background: transparent; }

/* 싸인 스위치: 동그라미가 좌우로 미끄러지는 토글(켜짐 = 오른쪽·금색) */
.sw-track { position: relative; display: inline-block; width: 42px; height: 24px; border-radius: 12px; background: #ffffff33; transition: background .25s; flex: none; }
.sw-track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0006; transition: transform .25s cubic-bezier(.4,0,.2,1); }
[aria-pressed="true"] > .sw-track { background: #d9b46a; }
[aria-pressed="true"] > .sw-track i { transform: translateX(18px); }
.gallery-sign-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; }
.gallery-sign-toggle[aria-pressed="false"] { color: #f3dca4; border-color: #e2c27e99; }
.gallery-sign-toggle[hidden] { display: none; }
.ig-sign-switch, .ig-sign-switch[aria-pressed="false"] { padding: 0; border: 0; background: none; }
.ig-sign-switch > i { display: none; }

/* 마우스 호버: 버튼이 위로 뜨지 않게(공통 translate·떠 보이는 그림자 제거). 살짝 밝아지고 테두리만 은은하게 */
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):not([aria-disabled="true"]):hover,
  button:not(:disabled):not([aria-disabled="true"]):hover:active { translate: none; box-shadow: inset 0 0 0 1px #dbc49a80; }
  :is(.theme-card, .collection-card):not(:disabled):not([aria-disabled="true"]):hover { translate: none; box-shadow: none; }
}
/* 어디서나 호버로 움직이지 않게: 카드 그림 확대도 끔 */
@media (hover: hover) and (pointer: fine) {
  :is(.hc, .theme-card, .collection-card):hover img, :is(.hc, .theme-card, .collection-card):not(:disabled):not([aria-disabled="true"]):hover img { transform: none; }
}

/* 목차: 상단 '목차 ▾' 버튼 → 화면 가운데 세로 목록(번호 · 제목 · 상태). 가로 줄 목차는 쓰지 않음(화면 밖 항목을 PC에서 못 누르던 문제) */
.rh-count { cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: #e9dcc0; }
.rh-count span { margin-left: 2px; font-size: 10px; opacity: .8; }
.reading-head .toc { display: none; }
.reading-head.toc-open .toc { display: flex; flex-direction: column; gap: 2px; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: min(340px, calc(100% - 32px)); max-height: min(62vh, 460px); overflow-y: auto; padding: 8px; z-index: 6;
  background: color-mix(in srgb, var(--tc) 10%, #151b17f7); border: 1px solid color-mix(in srgb, var(--tc) 35%, #ffffff22); border-radius: 14px;
  box-shadow: 0 18px 48px #000b; -webkit-mask: none; mask: none; scrollbar-width: thin; }
.reading-head .toc .toc-head { padding: 8px 12px 6px; font: 400 15px 'Gowun Batang', serif; color: #e9dcc0; }
.reading-head .toc button { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; width: 100%; max-width: none;
  padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; font-weight: 700; color: #e6e1d4; box-shadow: none; }
.reading-head .toc button b { font: 400 13px 'Gowun Batang', serif; color: color-mix(in srgb, var(--tc) 60%, #fff); }
.reading-head .toc button em { font-style: normal; white-space: normal; overflow: visible; }
.reading-head .toc button small { font-size: 11px; font-weight: 400; color: #a9b2a5; white-space: nowrap; }
.reading-head .toc button.lk { color: #b9b4a6; background: transparent; border-style: none; }
.reading-head .toc button.on { background: color-mix(in srgb, var(--tc) 22%, transparent); color: #fff; box-shadow: none; }
.reading-head .toc button.pay { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); border: 0; margin-top: 4px; }

/* 이모티콘 대신 그림(연애사주 love-art) */
img.ticon { height: 1.35em; width: auto; vertical-align: -.32em; }
img.emo { height: 1.3em; width: auto; vertical-align: -.32em; }
.legend span img.emo { height: 1.5em; vertical-align: -.42em; }
.gi-how img.emo { height: 1.45em; }
.chapter h3 img.ch-icon { width: 34px; height: 34px; margin-right: 8px; vertical-align: middle; flex: none; }
.chapter h3 .lockpill img.emo { height: 1.5em; margin-right: 3px; vertical-align: -.45em; }
.si-icon img { width: 40px; height: 40px; display: block; }
.ig-lock img { width: 30px; height: 30px; }

/* 게임 하는 법(튜토리얼) 단계 카드 */
.gi-howto { width: auto; align-self: center; padding: 10px 22px; }
.gi-tut { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: transparent; } /* 2026-11-12: 뒤의 진한 박스 없이 카드(모달)만 — 대신 뒤 준비 카드는 숨김 */
.gi-tut[hidden] { display: none; }
.tut-card { position: relative; width: min(330px, 100%); height: 404px; box-sizing: border-box; padding: 24px 20px 18px; border-radius: 18px; text-align: center;
  background: color-mix(in srgb, var(--tc) 12%, #18201b); border: 1px solid color-mix(in srgb, var(--tc) 40%, #ffffff22); box-shadow: 0 20px 60px #000a;
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tut-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ffffff33; background: #0003; color: #ddd; cursor: pointer; }
.tut-count { font-size: 11px; letter-spacing: 1px; color: #b9b29d; }
.tut-visual { min-height: 118px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tut-visual img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 6px 14px #0008); }
.tut-visual img:only-child { width: 120px; height: 120px; }
.tut-emo { font-size: 64px; line-height: 1; }
.tut-title { margin: 4px 0 0; font: 400 22px 'Gowun Batang', serif; color: #f3e6c8; }
.tut-text { margin: 0; font-size: 14px; color: #d5d0c2; }
.tut-text img.emo { height: 1.4em; }
.tut-dots { display: flex; gap: 6px; margin-top: 4px; }
.tut-dots i { width: 7px; height: 7px; border-radius: 50%; background: #ffffff33; }
.tut-dots i.on { width: 18px; border-radius: 4px; background: var(--tc); }
.tut-nav { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.tut-nav .btn { flex: 1; }
.tut-nav .btn:disabled { opacity: .35; }
.gi-name { text-align: center; }
.gi-howto { border: 1px solid color-mix(in srgb, var(--tc) 50%, #ffffff33); border-radius: 20px; color: #f3e6c8; }

/* 게임 도중 나가기 확인 모달 */
.leave-bg { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px; background: #000a; backdrop-filter: blur(5px); }
.leave-bg[hidden] { display: none; }
.leave-card { width: min(320px, 100%); padding: 26px 20px 18px; border-radius: 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--tc) 12%, #18201b); border: 1px solid color-mix(in srgb, var(--tc) 40%, #ffffff22); box-shadow: 0 24px 70px #000c; }
.leave-face { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 70%, #fff4); margin-bottom: 4px; }
.leave-face[hidden] { display: none; }
.leave-card h3 { margin: 0; font: 400 21px 'Gowun Batang', serif; color: #f3e6c8; }
.leave-card p { margin: 0 0 8px; font-size: 13px; color: #c9c3b3; }
.leave-nav { display: flex; gap: 8px; width: 100%; }
.leave-nav .btn { flex: 1; }

/* 공용 UI 아이콘(assets/common-art) */
img.ci { height: 1.4em; width: auto; vertical-align: -.36em; margin-right: .1em; }
#hud-lives img.ci { height: 22px; vertical-align: middle; margin: 0 1px; }
.scroll-track .sc img.ci { height: 1.5em; vertical-align: -.42em; }
.lk-game small img.ci, .lk-buy img.ci { height: 1.5em; }
.si-buy img.ci { height: 1.5em; vertical-align: -.42em; }
.gallery-sign-toggle span img.ci, .ig-sign-row b img.ci, .ig-sign-buy b img.ci { height: 1.5em; vertical-align: -.42em; }
.lk-buy .lk-price { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lk-buy .lk-price img.ci { margin: 0; }

/* 잠긴 장 버튼: 왼쪽에 큰 그림(게임 패드·열린 자물쇠) + 오른쪽 글자 두 줄 */
.btn.lk-game, .btn.lk-buy { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; text-align: left; }
.lk-ic { flex: none; display: flex; }
.lk-ic img.ci { height: 38px; width: auto; margin: 0; vertical-align: middle; }
.lk-ic:empty { display: none; }
.lk-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lk-txt small { display: block; }
.lk-txt { white-space: nowrap; }

/* 잠긴 장 버튼 글자 가운데 정렬 */
.lk-txt { align-items: center; text-align: center; }
/* 하단 게임 버튼: 글자 가운데 + 양옆에 큰 게임 패드 */
.btn.pw-pads { display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn.pw-pads img.ci { height: 34px; width: auto; margin: 0; flex: none; }
.btn.pw-pads span { text-align: center; }

/* 점검 수정 1: 갤러리 그림 칸의 '화면 가득' 규칙이 버튼 속 작은 아이콘(두루마리)까지 키우지 않게 */
.gallery-media .gallery-empty img.ci, .gallery-fullscreen .gallery-media .gallery-empty img.ci {
  position: static; inset: auto; width: auto; height: 1.5em; object-fit: contain; vertical-align: -.42em; margin-right: 4px; }
/* 점검 수정 2: 하단 게임 버튼 — 게임 이름이 길어도 한 줄(패드 조금 작게) */
.btn.pw-pads { gap: 8px; padding-left: 10px; padding-right: 10px; }
.btn.pw-pads img.ci { height: 30px; }
.btn.pw-pads span { white-space: nowrap; }

/* 메인 슬라이드: 양 끝 그림이 화면 끝까지 보이게(#s-intro 의 overflow:clip 이 화면 여백 안쪽에서 잘랐음) */
#s-intro { overflow: visible; }
/* 메인 슬라이드 호버: 옆 그림이 커지지 않게(크기 0.9배 유지), 대신 흐림이 살짝 걷히고 밝아짐 */
#hero-cards .hc:not(.is-active) img, #hero-cards .hc:not(.is-active):hover img { transform: scale(.9); }
#hero-cards .hc.is-active img, #hero-cards .hc.is-active:hover img { transform: none; }
@media (hover: hover) and (pointer: fine) {
  #hero-cards .hc:not(.is-active):hover img { filter: blur(1px) brightness(.75) saturate(.95); }
}
/* 갤러리 잠긴 단계 '두루마리 열러 가기': 아이콘과 글자 한 줄 */
.gallery-go-unlock { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }

/* 메인 슬라이드 그림은 누를 수 없음(끌어서 넘기기만): 손가락 모양 커서 대신 끌기 커서 */
#app #hero-cards .hc { cursor: grab; }


/* 큰 그림 보기: 좌우 넘기기 화살표를 그림 세로 가운데(9시·3시)에, 버튼 모양 없이 화살표만 */
.gallery-fullscreen .gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 52px; height: 96px; padding: 0;
  border: 0; background: none; color: #fff; font: 300 64px/1 'Noto Sans KR', sans-serif; cursor: pointer;
  text-shadow: 0 2px 10px #000, 0 0 3px #000; opacity: .9; }
.gallery-fullscreen .gallery-arrow.prev { left: 2px; }
.gallery-fullscreen .gallery-arrow.next { right: 2px; }
.gallery-fullscreen .gallery-arrow:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .gallery-fullscreen button.gallery-arrow:not(:disabled):hover { opacity: 1; box-shadow: none; translate: none; filter: none; }
}

/* 큰 그림 보기 왼쪽 아래: UI 숨기기 + 싸인 스위치 (그림 아래 끝 기준) */
.gallery-fullscreen .gallery-corner { position: absolute; left: 12px; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  bottom: calc(max(0px, (100cqh - 100cqw * 16 / 9) / 2) + 128px); }
.gallery-ui-toggle { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid #ffffff55; background: #0006; color: #fff;
  font: 700 12px 'Noto Sans KR', sans-serif; cursor: pointer; backdrop-filter: blur(8px); text-shadow: 0 1px 3px #000; }
.gallery-ui-toggle[aria-pressed="true"] { border-color: #e2c27e99; color: #f3dca4; }
/* UI 숨김: 싸인 스위치·UI 숨기기 버튼만 남김 */
.character-gallery .gallery-header, .character-gallery .gallery-bottom, .character-gallery .gallery-arrow { transition: opacity .25s; }
.character-gallery.ui-hidden .gallery-header, .character-gallery.ui-hidden .gallery-bottom,
.character-gallery.ui-hidden .gallery-arrow, .character-gallery.ui-hidden #gallery-menu { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .gallery-fullscreen button.gallery-ui-toggle:not(:disabled):hover { box-shadow: none; translate: none; }
}

/* 열람할 수 없는 단계: 왼쪽 아래 버튼들·메뉴 버튼 숨김 */
.gallery-fullscreen .gallery-corner[hidden], .gallery-fullscreen #gallery-actions[hidden] { display: none; }
/* UI 숨기기: 싸인 스위치도 함께 숨김('UI 보기' 버튼만 남음) */
.character-gallery #gallery-sign-toggle { transition: opacity .25s; }
.character-gallery.ui-hidden #gallery-sign-toggle { opacity: 0; pointer-events: none; }
/* UI 숨기기 버튼 자신도 숨김 → 화면을 누르면 다시 보임 */
.character-gallery #gallery-ui-toggle { transition: opacity .25s; }
.character-gallery.ui-hidden #gallery-ui-toggle { opacity: 0; pointer-events: none; }

/* 하단 프리미엄 풀이의 게임 버튼도 잠긴 장 게임 버튼과 같은 사주 색(연애=분홍, 금전=금빛 …) */
.btn.primary.pw-pads { color: #1a1330; border: 0; box-shadow: none; border-radius: 5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 50%, #fff), var(--tc)); }

/* 게임 준비 화면 아이템 제목: 가방 그림 없이 가운데 정렬 */
.shop .shop-title { text-align: center; }


/* 게임 준비 화면 '시작!' 버튼도 사주 색(잠긴 장·하단 게임 버튼과 같은 색) */
#gi-start.btn.primary { color: #1a1330; border: 0; box-shadow: none; border-radius: 5px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 50%, #fff), var(--tc)); }


/* '풀이로 돌아가기'·모달 '그만두기' = 바로 보기 버튼 디자인(.btn.buy), 모달 '계속하기' = 사주 색. 두 버튼 높이 같게 */
.leave-nav .btn { height: 50px; min-height: 50px; padding: 0 10px; margin: 0; display: flex; align-items: center; justify-content: center; }
.btn.leave-continue { color: #1a1330; border: 0; box-shadow: none; border-radius: 5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 50%, #fff), var(--tc)); }
.leave-nav .btn.buy { border-radius: 5px; box-shadow: none; }

/* 게임판 위 안내 알약: 그림이 들어가도 한 줄에 맞게 */
.legend { gap: 5px; }
.legend span { padding: 4px 8px; }
.legend span img.emo { height: 1.3em; vertical-align: -.3em; }


/* 사주 선택 카드: 위쪽 글씨가 얼굴을 가리지 않게 아래 글 묶음으로 내리고, 그림은 위쪽 기준으로 확대해 얼굴·상반신이 보이게 */
#themes .theme-card.has-img .tc-img, #themes .theme-card.has-img:hover .tc-img { object-position: 50% 0; transform: scale(1.22); transform-origin: 50% 4%; }
.theme-card .tc-who2 { display: block; font-size: 10.5px; font-weight: 700; color: #f6ecd6; letter-spacing: .2px; margin-bottom: 4px;
  text-shadow: 0 1px 3px #000, 0 0 8px #000a; }
/* 태어난 시각(12시진) 선택 상자: 다른 입력칸과 같은 모양 */
.form select { width: 100%; padding: 15px; border-radius: 4px; border: 1px solid var(--line); background: #0c120f80; color: var(--text);
  font: inherit; font-size: 16px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #c8b182 50%), linear-gradient(135deg, #c8b182 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.form select option { background: #18201b; color: #e9e3d2; }
/* 펼친 목록(년·월·일·시각)의 스크롤바: 하얀 기본 대신 어두운 바탕 + 금빛 손잡이(2026-11-13 사용자 요청) */
.form select { color-scheme: dark; scrollbar-width: thin; scrollbar-color: #8a7a52 #141b17; }
.form select::-webkit-scrollbar { width: 8px; background: #141b17; }
.form select::-webkit-scrollbar-thumb { background: #8a7a52; border-radius: 8px; border: 2px solid #141b17; }
/* 생년월일: 제목 + 양력|음력|윤달 작은 토글(한 줄 — 고를 때 높이가 바뀌지 않게), 년·월·일 선택 3칸 */
.birth-field { display: flex; flex-direction: column; gap: 9px; }
.birth-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: #a6b1a2; }
.seg.seg-sm { padding: 3px; gap: 4px; }
.seg.seg-sm label { flex: none; }
.seg.seg-sm span { padding: 5px 14px; font-size: 12px; }
.birth-selects { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 8px; }
.form .birth-selects select { padding: 14px 26px 14px 12px; background-position: calc(100% - 16px) 52%, calc(100% - 10px) 52%; min-width: 0; }

/* 목차 목록: 잠긴 장은 확실히 — 제목 흐리게 + 잠김 배지(사주 잠김 그림) */
.reading-head .toc button.lk em { color: #8d877a; }
.reading-head .toc button.lk b { opacity: .5; }
.reading-head .toc button small.toc-lock { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px 3px 6px; border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--tc) 45%, #ffffff22); background: #00000040; color: #e8d6bd; font-weight: 700; }
.reading-head .toc button small.toc-lock img { width: 18px; height: 18px; object-fit: contain; }

/* 튜토리얼 카드: 단계마다 크기 고정(그림 칸·제목 2줄·설명 2줄 자리를 항상 확보) */
.tut-visual { height: 128px; min-height: 0; flex: none; overflow: hidden; flex-wrap: nowrap; }
.tut-visual img { width: 80px; height: 80px; }
.tut-visual img:only-child { width: 120px; height: 120px; }
.tut-visual .tut-emo { font-size: 56px; }
.tut-visual .tut-emo:only-child { font-size: 72px; }
.tut-title { height: 2.7em; line-height: 1.35; display: flex; align-items: center; justify-content: center; flex: none; }
.tut-text { height: 3em; line-height: 1.5; display: flex; align-items: flex-start; justify-content: center; flex: none; }
.tut-dots { margin-top: auto; }

/* 사주 선택 화면 아래 버튼: 갤러리 = 바로 보기(.btn.buy) 디자인, 생년월일 다시 입력 = 차분한 테두리 버튼 */
#s-theme #btn-gallery, #s-theme #btn-edit-birth { width: 100%; height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: center; border-radius: 5px; box-shadow: none; font-size: 15px; }
#s-theme #btn-gallery { margin-top: 10px; font-weight: 700; }
.btn.line-btn { margin-top: 10px; background: #ffffff08; border: 1px solid #ffffff2e; color: #d8d0bf; font-weight: 500; }
.btn.line-btn:hover { background: #ffffff12; border-color: #ffffff45; }

/* 로그인 화면 + 오른쪽 위 로그아웃 버튼 (2026-11-11 로그인 도입) */
#s-login .form { margin-top: 8px; }
#s-login .form-note { text-align: center; }
.site-header .btn-logout { margin-left: 10px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 14px; background: transparent;
  color: var(--muted); font: 500 11px 'Noto Sans KR', sans-serif; cursor: pointer; white-space: nowrap; }
.site-header .btn-logout[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .site-header .btn-logout:hover { color: #e8d5b2; border-color: #d6b88670; } }

/* ===== 메인 = 대표 이미지 한 장 (2026-11-11) =====
   그림 영역(.if-pic) = 헤더 아래 화면 높이 전체. 그림은 원본 비율(9:16) 그대로 맨 위에(늘이지 않음).
   문구·'내 사주 시작하기'는 그림 영역 맨 아래에 겹친다 — PC·휴대폰 같은 배치. 스크롤 없음.
   그림 폭 = 앱(화면) 폭 — 양옆 빈 공간 없음. 화면이 짧으면 그림 아래 끝이 버튼 뒤로 들어간다(휴대폰·PC 같음).
   PC 는 영역 높이를 그림 높이까지로 제한(아주 긴 모니터에서 그림 아래 빈 띠에 버튼이 떨어지지 않게). */
#s-intro { padding: 0; overflow: visible; }
body[data-screen="s-intro"] #app { overflow-y: hidden; }
.intro-full { --intro-h: calc(var(--vh) - var(--site-header-height) - env(safe-area-inset-bottom)); --pic-w: 100%;
  position: relative; margin: 0 -22px; height: var(--intro-h); overflow: hidden; background: #0c100e; }
.intro-full .if-pic { position: absolute; top: 0; bottom: 0; left: 50%; translate: -50% 0; width: var(--pic-w); overflow: hidden; }
.intro-full .if-img { position: absolute; top: 0; left: 0; width: 100%; height: auto; aspect-ratio: 9 / 16;
  display: block; user-select: none; -webkit-user-drag: none;
  -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); } /* 그림 아래 끝은 바탕으로 부드럽게 */
/* 그림 아래 남는 공간(긴 휴대폰)은 검은 바탕 대신 같은 그림을 흐리게 깔아 자연스럽게 이어지게(그림 끝은 mask 로 녹아듦). 어두운 띠는 없음 */
.intro-full .if-pic::before { content: ""; position: absolute; inset: -30px; z-index: 0; pointer-events: none;
  background: var(--intro-bg, none) 50% 100% / cover no-repeat; filter: blur(22px) saturate(1.1) brightness(.9); }
.intro-full .if-img { z-index: 0; }
.intro-full .if-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; /* (z-index 로 그림·흐린 바탕 위) */ padding: 0 20px calc(20px + env(safe-area-inset-bottom)); }
.intro-full .if-copy { position: relative; text-align: center; margin-bottom: 18px; pointer-events: none; }
/* 띠 대신 글자 바로 뒤에만 옅게 번지는 그림자(무늬 많은 그림 위에서도 읽히게) */
.intro-full .if-copy::before { content: ""; position: absolute; inset: -10px 6% -6px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, #0b0f0dbf, #0b0f0d73 55%, transparent); filter: blur(8px); }
.intro-full .if-copy h1 { margin: 0 0 10px; font-size: clamp(23px, 6.6cqi, 30px); line-height: 1.45; letter-spacing: -.5px;
  text-shadow: 0 0 3px #000, 0 2px 10px #000, 0 0 24px #000c; } /* 어두운 띠 없이 글자 그림자로만 읽히게 */
.intro-full .if-copy p { margin: 0; font-size: 12px; line-height: 1.85; color: #eef0e6; text-shadow: 0 0 3px #000, 0 1px 8px #000, 0 0 16px #000c; }
.intro-full .intro-start { padding: 0; }
/* PC(마우스·넓은 화면): 그림 전체가 화면 높이에 들어가는 폭 — 그림 아래 빈 띠가 거의 없고 버튼은 그림 아래쪽 위에 */
@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  /* 그림 폭 = 앱 폭(양옆 빈 띠 없음). 영역 높이 = min(화면, 그림 높이) → 아주 긴 모니터에서도 문구·버튼이 그림 위에, 짧은 노트북은 그림 아래 끝이 버튼 뒤로 */
  .intro-full { height: min(var(--intro-h), calc(var(--app-width) * 16 / 9)); }
  /* 그림 영역 아래 끝이 앱 바탕(뒤 산수화)과 뚝 끊기지 않게: 그림·흐린 바탕 모두 아래쪽을 투명하게 서서히 사라지게 */
  .intro-full { background: transparent; }
  .intro-full .if-img { -webkit-mask-image: linear-gradient(#000 72%, transparent 99%); mask-image: linear-gradient(#000 72%, transparent 99%); }
  .intro-full .if-pic::before { -webkit-mask-image: linear-gradient(#000 55%, transparent 92%); mask-image: linear-gradient(#000 55%, transparent 92%); }
}
/* 아주 낮은 화면(가로로 든 휴대폰 등): 문구가 얼굴·상체를 덮으므로 숨기고 시작 버튼만 */
@media (max-height: 520px) {
  .intro-full .if-copy { display: none; }
  .intro-full .if-bottom { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ===== 아래 탭(홈 · 내 사주 · 갤러리) — 2026-11-11 UX: 어디서든 화면 이동, 갤러리 위치를 늘 보이게 ===== */
:root { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
.tabbar { display: none; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 7; width: min(100%, var(--app-width));
  height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid #ffffff14;
  background: color-mix(in srgb, #0d120f 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body:is([data-screen="s-intro"], [data-screen="s-form"], [data-screen="s-reveal"], [data-screen="s-theme"], [data-screen="s-free"], [data-screen="s-result"], [data-screen="s-gallery"], [data-screen="s-play"], [data-screen="s-me"]) .tabbar { display: flex; }
body:is([data-screen="s-intro"], [data-screen="s-form"], [data-screen="s-reveal"], [data-screen="s-theme"], [data-screen="s-free"], [data-screen="s-result"], [data-screen="s-gallery"], [data-screen="s-play"], [data-screen="s-me"]) #app { padding-bottom: var(--tabbar-h); }
.tabbar button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0;
  border: 0; background: none; color: #8f9a8a; font: 600 10.5px 'Noto Sans KR', sans-serif; cursor: pointer; transition: color .2s; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabbar button[aria-current="page"] { color: #e8cf98; }
.tabbar button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: #d6b886; }
.tabbar .tab-new { position: absolute; top: 6px; left: calc(50% + 8px); padding: 1px 5px; border-radius: 8px; background: #e0566f; color: #fff;
  font: 800 8.5px/1.4 'Noto Sans KR', sans-serif; font-style: normal; letter-spacing: .3px; }
.tabbar .tab-new[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .tabbar button:hover { color: #d9c9a2; } }
/* 메인은 탭 높이만큼 짧게(스크롤 없음 유지) */
.intro-full { --intro-h: calc(var(--vh) - var(--site-header-height) - var(--tabbar-h)); }
.intro-full .if-bottom { padding-bottom: 16px; }

/* 메인: 위쪽 캐릭터 얼굴 4개(메인 캐릭터 고르기) + '모습 바꾸기'(그 캐릭터 갤러리 창) */
.intro-full .if-tools { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.intro-full .if-pick { display: flex; gap: 5px; padding: 4px; border-radius: 26px; background: #0b0f0d73; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.intro-full .if-pick button { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 2px solid #ffffff40; background: #0006; overflow: hidden; cursor: pointer; opacity: .78; transition: opacity .2s, border-color .2s, box-shadow .2s; }
.intro-full .if-pick button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro-full .if-pick button[aria-checked="true"] { opacity: 1; border-color: color-mix(in srgb, var(--tc) 80%, #fff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 45%, transparent), 0 0 12px color-mix(in srgb, var(--tc) 60%, transparent); }
.intro-full .if-skin { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 20px; border: 1px solid #ffffff3a; background: #0b0f0d8c;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #f3ead2; font: 600 12px 'Noto Sans KR', sans-serif; cursor: pointer; white-space: nowrap; }
.intro-full .if-skin svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .intro-full .if-pick button:hover { opacity: 1; translate: none; box-shadow: none; } .intro-full .if-skin:hover { border-color: #d6b886aa; translate: none; box-shadow: none; } }
@media (max-width: 360px) { .intro-full .if-pick button { width: 34px; height: 34px; } .intro-full .if-skin { padding: 7px 10px; font-size: 11.5px; } }

/* 잠긴 풀이·결제 안내: "두루마리를 열면 ○○의 n단계 모습 공개" (누르면 그 캐릭터 갤러리 창) */
.lk-gallery { display: flex; align-items: center; gap: 11px; width: 100%; margin: 4px 0 10px; padding: 9px 12px; text-align: left; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--tc) 55%, #fff3); border-radius: 12px; background: color-mix(in srgb, var(--tc) 10%, transparent); color: inherit; }
.lk-gallery .lkg-face { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 1px solid color-mix(in srgb, var(--tc) 60%, #fff3); }
.lk-gallery .lkg-face > img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.6); }
.lk-gallery .lkg-face i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 15px; }
.lk-gallery .lkg-face i img { width: 20px; height: 20px; }
.lk-gallery .lkg-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lk-gallery b { font-size: 12.5px; color: #f3e2bd; }
.lk-gallery small { font-size: 10.5px; color: #b9bfae; }
@media (hover: hover) and (pointer: fine) { #app .lk-gallery:hover { translate: none; box-shadow: none; border-style: solid; } }

/* 새 모습 공개 알림 창 */
.unlock-pop-bg { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: #000000b8; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.unlock-pop-bg[hidden] { display: none; }
.unlock-pop { width: min(330px, 100%); padding: 22px 20px 16px; border-radius: 16px; text-align: center; border: 1px solid #d6b88655;
  background: linear-gradient(180deg, #232a24, #151b17); box-shadow: 0 20px 60px #000c; animation: upIn .35s ease-out; }
@keyframes upIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.unlock-pop .up-art { position: relative; width: 150px; margin: 0 auto 14px; }
.unlock-pop .up-art img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; display: block; box-shadow: 0 0 0 1px #d6b88680, 0 0 30px #d6b88640; }
.unlock-pop .up-badge { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); padding: 3px 10px; border-radius: 12px; background: #d6b886; color: #23251c; font: 800 11px 'Noto Sans KR', sans-serif; white-space: nowrap; }
.unlock-pop h3 { margin: 18px 0 6px; font: 400 20px 'Gowun Batang', serif; color: #f3e6c8; }
.unlock-pop p { margin: 0 0 14px; font-size: 12px; line-height: 1.7; color: #c9cfbd; }
.unlock-pop .btn { width: 100%; }
.unlock-pop .btn.ghost { margin-top: 6px; }
body:is([data-screen="s-form"], [data-screen="s-reveal"], [data-screen="s-theme"], [data-screen="s-free"], [data-screen="s-result"], [data-screen="s-gallery"], [data-screen="s-play"], [data-screen="s-me"]) .screen:not(#s-intro) {
  min-height: calc(var(--vh) - var(--site-header-height) - var(--tabbar-h)); }
#s-intro { min-height: 0; } /* 예전 .screen 최소 높이가 남아 메인에 7px 스크롤이 생겼음 */
/* 아주 낮은 화면(가로로 든 휴대폰): 탭 바를 얇게(아이콘만) */
@media (max-height: 520px) {
  :root { --tabbar-h: calc(42px + env(safe-area-inset-bottom)); }
  .tabbar button span { display: none; }
  .tabbar .tab-new { top: 3px; }
}

/* 풀이 위 제목 '○○사주 ▾' = 사주 바꾸기 버튼 + 펼침 목록(목차 목록과 같은 모양) */
.rh-switch { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 2px; border: 0; border-radius: 8px; background: none; color: inherit;
  font: inherit; cursor: pointer; }
.rh-switch span { font-size: 11px; opacity: .75; transition: transform .2s; }
.reading-head.ts-open .rh-switch span { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .rh-switch:hover { background: #ffffff10; translate: none; box-shadow: none; } }
.reading-head .ts-menu { display: none; }
.reading-head.ts-open .ts-menu { display: flex; flex-direction: column; gap: 3px; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: min(340px, calc(100% - 32px)); padding: 8px; z-index: 6; background: color-mix(in srgb, var(--tc) 10%, #151b17f7);
  border: 1px solid color-mix(in srgb, var(--tc) 35%, #ffffff22); border-radius: 14px; box-shadow: 0 18px 48px #000b; }
.reading-head .ts-menu .toc-head { padding: 8px 12px 6px; font: 400 15px 'Gowun Batang', serif; color: #e9dcc0; }
.reading-head .ts-menu button { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 10px; background: transparent; color: #e7e2d4; text-align: left; cursor: pointer; }
.reading-head .ts-menu button img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 60%, transparent); }
.reading-head .ts-menu button em { display: flex; flex-direction: column; gap: 2px; font-style: normal; min-width: 0; }
.reading-head .ts-menu button b { font: 400 15px 'Gowun Batang', serif; display: inline-flex; align-items: center; gap: 5px; }
.reading-head .ts-menu button b .ticon { width: 18px; height: 18px; }
.reading-head .ts-menu button small { font-size: 11px; color: #a9b2a5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-head .ts-menu button i { font-style: normal; font-size: 11px; color: color-mix(in srgb, var(--tc) 70%, #fff); white-space: nowrap; }
.reading-head .ts-menu button.on { background: color-mix(in srgb, var(--tc) 22%, transparent); }
@media (hover: hover) and (pointer: fine) { .reading-head .ts-menu button:not(.on):hover { background: #ffffff0d; translate: none; box-shadow: none; } }

/* ===== 처음 3단계 진행 표시(정보 입력 → 명식 확인 → 사주 고르기) ===== */
.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin: 0 auto 4px; padding: 0; list-style: none; width: 100%; max-width: 320px; }
.steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10.5px; color: #7f8a7d; text-align: center; }
.steps li + li::before { content: ""; position: absolute; top: 11px; right: calc(50% + 15px); width: calc(100% - 30px); height: 1px; background: #ffffff22; }
.steps li.done + li::before, .steps li.done + li.on::before { background: #d6b88688; }
.steps b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; border: 1px solid #ffffff2e; font: 700 11px 'Noto Sans KR', sans-serif; color: #8f9a8a; background: #0c120f; }
.steps li.done { color: #b9ac8b; }
.steps li.done b { border-color: #d6b88699; color: #d6b886; }
.steps li.on { color: #f0e2bf; font-weight: 700; }
.steps li.on b { border-color: #d6b886; background: #d6b886; color: #22261d; box-shadow: 0 0 0 4px #d6b88626; }

/* ===== 정보 입력 '이 정보로 시작하기' 버튼 틀(.cta-bar) =====
   2026-11-12 사용자 규칙: 휴대폰에서 스크롤해도 고정되는 건 헤더·아래 탭뿐 → 버튼은 따라다니지 않고 제자리(예전 sticky 띠 방식 폐기).
   틀은 오류 알림(.form-toast)의 기준 위치로만 쓴다 */
.cta-bar { position: relative; z-index: 4; margin: 0; padding: 6px 0 0; pointer-events: none; }
.cta-bar .btn { width: 100%; pointer-events: auto; box-shadow: 0 10px 28px #0009; }
/* ===== 불러오는 중: 위쪽 금색 진행 줄 + 화면 누름 막기 ===== */
body.busy #app { pointer-events: none; }
body.busy::after { content: ""; position: fixed; top: 0; left: 0; z-index: 50; height: 3px; width: 40%; background: linear-gradient(90deg, transparent, #e8cf98, transparent);
  animation: busyBar 1s ease-in-out infinite; }
@keyframes busyBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
body:is([data-screen="s-form"], [data-screen="s-reveal"]) { --page-bg: #111714; }
/* PC(마우스·넓은 화면): 버튼은 그대로 탭 바 위에 붙어 있되 뒤의 어두운 띠는 없앤다(유리 바탕 위에서 그 부분만 진하게 끊겨 보였음).
   버튼 자체가 불투명해 뒤 내용이 비치지 않고, 은은한 그림자로만 떠 보이게. */
@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  .cta-bar { margin: 4px 0 0; padding: 0 0 14px; background: none; }
  .cta-bar .btn { box-shadow: 0 8px 24px #0008, 0 0 0 1px #d6b88640; }
}

/* ===== 2026-11-11 흐름 개편: 로그인 → 누구의 사주(최근 5명)/입력 → 메인(사주 보기·갤러리 보기) → 사주 고르기(명식 카드) → 풀이 ===== */
/* 메인: 지금 사람 + 두 갈래 버튼 */
#btn-intro-next[hidden], .if-actions[hidden], .if-person[hidden] { display: none; }
.intro-full.has-person .if-copy { margin-bottom: 12px; }
.intro-full.has-person .if-copy p { display: none; }
.intro-full .if-person { display: flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; margin: 0 auto 12px; padding: 6px 6px 6px 14px;
  border: 1px solid #e6d5b252; border-radius: 20px; background: #0b0f0d9e; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #f1e7cf; font: 500 13px/1.3 'Noto Sans KR', sans-serif; cursor: pointer; }
.intro-full .if-person b { font-weight: 700; white-space: nowrap; }
.intro-full .if-person small { min-width: 0; color: #cfc7b3; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intro-full .if-person em { flex: none; font-style: normal; font-size: 11px; padding: 3px 10px; border-radius: 12px; background: #e6d5b226; color: #ead9b4; }
.intro-full .if-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.intro-full .if-actions .btn { position: relative; width: 100%; margin: 0; padding: 15px 8px; justify-content: center; font-size: 15.5px; font-weight: 700; border-radius: 5px; }
.intro-full .if-actions .btn.ghost { background: #0b0f0da6; border: 1px solid #e6d5b2a6; color: #f3e8cc; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.intro-full .if-actions .btn.has-new::after { content: "NEW"; position: absolute; top: -7px; right: 8px; padding: 1px 6px; border-radius: 8px; background: #e0566f; color: #fff;
  font: 800 9px/1.5 'Noto Sans KR', sans-serif; letter-spacing: .3px; }
@media (hover: hover) and (pointer: fine) {
  .intro-full .if-person:hover { background: #0b0f0dc4; border-color: #e6d5b280; }
  .intro-full .if-actions .btn.ghost:hover { background: #0b0f0dcc; translate: none; }
}

/* 정보 입력 위: 최근에 본 사람(최신이 위, 최대 5명) */
.people[hidden], #form-heading[hidden], #form-scene[hidden] { display: none; }
.people .flow-heading { margin-bottom: 16px; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pp { display: flex; align-items: stretch; border: 1px solid #ffffff1f; border-radius: 8px; background: #ffffff08; overflow: hidden; }
.pp.is-now { border-color: #d6b88699; background: #d6b88610; }
.pp-pick { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 12px 8px 12px 16px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pp-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 15px; font-weight: 700; color: #efe6cf; }
.pp-name em { flex: none; font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 8px; background: #d6b886; color: #22261d; }
.pp-pick small { grid-column: 1; margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-pick i { grid-column: 2; grid-row: 1 / 3; font-style: normal; font-size: 22px; color: #d6b886; }
.pp-del { flex: none; width: 46px; border: 0; border-left: 1px solid #ffffff14; background: none; color: #8f9a8a; font-size: 13px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .pp-pick:hover { background: #ffffff0a; }
  .pp-del:hover { background: #ffffff0a; color: #e5a1ab; }
}
.people-or { display: flex; align-items: center; gap: 12px; margin: 24px 0 6px; color: #b9ac8b; font-size: 12px; }
.people-or::before, .people-or::after { content: ""; flex: 1; height: 1px; background: #ffffff1f; }

/* 사주 고르기 위: 명식(사주팔자) 요약 카드 — 예전 별도 '명식 확인' 화면을 합침 */
#s-theme .ms-card { margin: 4px 0 4px; padding: 14px 14px 6px; }
.ms-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ms-head > div { min-width: 0; }
.ms-head .eyebrow { font-size: 10px; letter-spacing: 2px; color: #b9ac8b; }
.ms-head h2 { margin: 3px 0 3px; font: 400 19px/1.4 'Gowun Batang', serif; color: #efe6cf; }
.ms-head .sub { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.ms-change { flex: none; padding: 6px 11px; border: 1px solid #ffffff2e; border-radius: 14px; background: #ffffff08; color: #d8d0bf; font: 500 12px 'Noto Sans KR', sans-serif; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ms-change:hover { background: #ffffff14; } }
.ms-card .pillars { gap: 6px; }
.ms-card .pillar .cap { font-size: 11px; margin-bottom: 4px; }
.ms-card .pillar .ch { font-size: 22px; padding: 6px 0 4px; border-radius: 10px; margin-bottom: 5px; }
.ms-card .pillar .ch small { font-size: 10px; }
/* 여덟 글자 아래 '사주 자세히 보기'(2026-11-18): 기본 정보 + 다섯 기운을 접었다 폈다 */
.ms-more { margin-top: 12px; }
.ms-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 auto; width: max-content;
  padding: 8px 16px; border-radius: 999px; border: 1px solid #d6b88655; background: #ffffff06; font-size: 12.5px; font-weight: 700; color: #e6cf9c;
  transition: background-color .2s, border-color .2s; }
.ms-more summary:hover { background: #d6b8861a; border-color: #d6b886aa; }
.ms-more summary::-webkit-details-marker { display: none; }
.ms-more .mm-ic { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .25s; }
.ms-more[open] .mm-ic { transform: translateY(2px) rotate(-135deg); }
.ms-more[open] summary .mm-txt { font-size: 0; }
.ms-more[open] summary .mm-txt::before { content: "접기"; font-size: 12.5px; }
.ms-more[open] > :not(summary) { animation: msOpen .35s ease-out; }
@keyframes msOpen { from { opacity: 0; } to { opacity: 1; } }
.ms-el { margin-top: 12px; padding-top: 10px; border-top: 1px solid #ffffff14; }
.ms-el-t { display: block; font-size: 12px; color: #b9ac8b; font-weight: 400; margin-bottom: 2px; }
.ms-more .bars { padding: 6px 0 4px; }
/* '내 사주' 사주 기본 정보(2026-11-18) */
.ms-info { margin: 12px 0 2px; padding-top: 10px; border-top: 1px solid #ffffff14; display: grid; gap: 6px; }
.ms-info > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: baseline; }
.ms-info dt { font-size: 12px; color: #b9ac8b; }
.ms-info dd { margin: 0; font-size: 13px; line-height: 1.5; color: #efe6cf; }
.ms-note { margin: 4px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
/* 풀이 맨 위 기본 사주 카드(2026-11-18) — 두루마리 앞, 다섯 기운은 펼친 채로 */
.rd-ms { margin: 14px 0 6px; padding: 14px 14px 12px; }
.rd-ms[hidden] { display: none !important; }
.rd-ms-el { margin-top: 10px; padding-top: 10px; border-top: 1px solid #ffffff14; }
.rd-ms-el > b { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: #d6b886; text-align: center; }

/* 메인 인사: 사람을 고른 뒤 제목 위 "○○님, 어서 오세요" */
.intro-full .if-welcome { display: block; margin: 0 0 6px; font: 700 14px/1.4 'Noto Sans KR', sans-serif; letter-spacing: .5px; color: #f1d9a4;
  text-shadow: 0 0 3px #000, 0 1px 8px #000, 0 0 16px #000c; }
.intro-full .if-welcome[hidden] { display: none; }

/* 사람을 고른 뒤: 인사가 크게(주인공), 사주 맞춤 제목은 한 단계 작게 */
.intro-full.has-person .if-welcome { margin-bottom: 8px; font: 700 clamp(23px, 6.8cqi, 30px)/1.35 'Gowun Batang', serif; letter-spacing: -.3px; color: #f4dca6; }
.intro-full.has-person .if-copy h1 { margin-bottom: 4px; font-size: clamp(16px, 4.6cqi, 20px); line-height: 1.55; color: #f3efe4; }

/* 메인 캐릭터 바꿀 때 페이드 아웃 → 인(main.js switchHero) */
.intro-full .if-img, .intro-full .if-pic::before, .intro-full .if-copy { transition: opacity .3s ease; }
.intro-full.is-fading .if-img, .intro-full.is-fading .if-pic::before, .intro-full.is-fading .if-copy { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .intro-full .if-img, .intro-full .if-pic::before, .intro-full .if-copy { transition: none; } }

/* ===== 로그인 전 대표 페이지(s-welcome): 메인과 같은 한 장 그림 배치, 아래 탭 없음 ===== */
#s-welcome { padding: 0; overflow: visible; }
body[data-screen="s-welcome"] #app { overflow-y: hidden; }
#s-welcome .intro-full { --intro-h: calc(var(--vh) - var(--site-header-height) - env(safe-area-inset-bottom)); }
#s-welcome .if-welcome { margin-bottom: 8px; font: 700 clamp(22px, 6.4cqi, 28px)/1.35 'Gowun Batang', serif; letter-spacing: -.3px; color: #f4dca6; }
#s-welcome .if-copy h1 { margin-bottom: 8px; font-size: clamp(16px, 4.6cqi, 20px); line-height: 1.55; color: #f3efe4; }
#s-welcome .if-copy { margin-bottom: 14px; }
.welcome-note { margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; background: #0b0f0dc4; border: 1px solid #e6d5b24d; color: #efe3c4;
  font-size: 12.5px; line-height: 1.5; text-align: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.welcome-note[hidden] { display: none; }
@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  #s-welcome .intro-full { height: min(var(--intro-h), calc(var(--app-width) * 16 / 9)); }
}
/* 로그인 화면 위 '처음으로' */
#s-login .login-back, #s-signup .login-back { display: inline-flex; width: auto; margin: 0 0 4px -8px; padding: 8px; font-size: 13px; }
/* .screen:not(#s-intro) 의 위아래 여백·최소 높이가 대표 페이지에도 걸려 그림 위 빈 띠 + 버튼 잘림이 생겼음 → 메인과 같게 */
section#s-welcome.screen { padding: 0; gap: 0; margin: 0; max-width: none; min-height: 0; justify-content: flex-start; }

/* ===== 로그인·정보 입력 바탕 = 네 캐릭터 대표 그림(login-hero) =====
   #app 바탕을 칠하지 않고(PC 유리 바탕·휴대폰 기본 바탕이 그대로 → 다른 화면과 같은 배경), 헤더 바로 아래에 붙은 그림 층(.hero-bg)을 깐다.
   크기·위치는 첫 화면과 같고(폭 = 앱 폭, 9:16), 아래 끝은 첫 화면처럼 mask 로 투명하게 녹아 뚝 끊기지 않는다.
   .hero-bg 는 높이 0 인 sticky(헤더 아래에 고정) → 스크롤해도 그림은 제자리. #app 안이라 PC 유리의 backdrop-filter 에 흐려지지 않음. */
.hero-bg { display: none; position: sticky; top: var(--site-header-height); height: 0; z-index: 0; pointer-events: none; }
body:is([data-screen="s-login"], [data-screen="s-signup"]) .hero-bg { display: block; }
.hero-bg i { position: absolute; top: 0; left: -22px; width: calc(100% + 44px); aspect-ratio: 9 / 16;
  background: linear-gradient(180deg, #111714b0 0%, #111714d4 35%, #111714eb 70%), url("img/backgrounds/login-hero.webp") 0 0 / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  .hero-bg i { -webkit-mask-image: linear-gradient(#000 72%, transparent 99%); mask-image: linear-gradient(#000 72%, transparent 99%); }
}
/* 내용은 그림 층 위로 */
body:is([data-screen="s-login"], [data-screen="s-signup"]) .screen.active { position: relative; z-index: 1; }

/* 정보 입력 오류: 칸 높이를 늘리지 않고 버튼 바로 위에 떠 있는 안내(버튼 틀이 화면 아래에 붙어 있어 늘 보임). 비어 있으면 안 보임 */
.cta-bar .form-toast { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); margin: 0; min-height: 0; padding: 9px 12px; border-radius: 8px;
  background: #2a1518f0; border: 1px solid #e0566f80; color: #ffd9de; font-size: 13px; line-height: 1.45; text-align: center; box-shadow: 0 6px 18px #0008;
  pointer-events: none; animation: toastIn .2s ease; }
.cta-bar .form-toast:empty { display: none; }
@keyframes toastIn { from { opacity: 0; translate: 0 4px; } }
@media (min-width: 600px) and (hover: hover) and (pointer: fine) { .cta-bar .form-toast { left: 0; right: 0; bottom: calc(100% + 8px); } }
#birth-form input.invalid { border-color: #e0566f; box-shadow: 0 0 0 3px #e0566f26; }

/* 이름 칸 오류: 라벨 옆 빨간 글씨(높이 그대로, 다른 칸을 가리지 않음) */
.form label .lbl { display: flex; align-items: baseline; gap: 8px; }
.field-err { font-style: normal; font-size: 12px; font-weight: 700; color: #ff7d8f; }
.field-err:not(:empty) { animation: toastIn .2s ease; }

/* ===== 정보 입력: '최근 정보 불러오기' 버튼 + 모달 ===== */
#s-form .people-open { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin: 0; border-radius: 5px; font-size: 14.5px; font-weight: 700; }
#s-form .people-open em { font-style: normal; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: #d6b886; color: #22261d; font-size: 11.5px; font-weight: 800; }
#s-form .people-open em[hidden] { display: none; }
.people-modal { width: min(calc(100vw - 32px), 400px); max-height: min(80dvh, 560px); margin: auto; padding: 0; border: 1px solid #e6d5b240; border-radius: 12px;
  background: #151c18; color: var(--text, #e7e5d8); box-shadow: 0 24px 60px #000c; overflow: auto; }
.people-modal::backdrop { background: #050807b3; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.people-modal[open] { animation: pmIn .2s ease; }
@keyframes pmIn { from { opacity: 0; transform: scale(.97); } }
.pm-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 12px 18px; background: #151c18; border-bottom: 1px solid #ffffff12; }
.pm-head h3 { margin: 0; font: 400 18px/1.4 'Gowun Batang', serif; color: #efe6cf; }
.pm-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: #b9b4a6; font-size: 15px; cursor: pointer; }
.people-modal .people-list { padding: 14px; }
.pm-empty { margin: 0; padding: 28px 20px 32px; text-align: center; font-size: 13px; line-height: 1.7; color: var(--muted); }
.pm-empty[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .pm-close:hover { background: #ffffff10; } }

/* 위 헤더 가운데: 지금 사람 — 작은 '命 主'(사주의 주인) 위에 붓글씨 느낌 이름(금색). 누를 수 없음, 테두리·점 없음 */
.site-header { position: sticky; }
.header-who { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 50% - env(safe-area-inset-top) / 2); translate: -50% -50%;
  display: flex; flex-direction: column; align-items: center; gap: 1px; max-width: calc(100% - 290px); pointer-events: none; text-align: center; }
.header-who[hidden] { display: none; }
.header-who small { font: 600 8.5px/1 'Noto Sans KR', sans-serif; letter-spacing: 3px; padding-left: 3px; color: #b99a63; opacity: .9; }
.header-who b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 16px/1.3 'Gowun Batang', serif; letter-spacing: .5px;
  background: linear-gradient(180deg, #f6e4b8, #c9a463); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
/* 아래 탭 '○○님 사주': 긴 이름은 말줄임 */
.tabbar button span { max-width: 100%; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 메인 칩: '다른 분의 사주 보기 ›' 한 줄(생년월일 없이). 테두리 없는 은은한 금색 글자 + 아래 가는 선 */
.intro-full .if-person { gap: 4px; padding: 6px 4px 5px; border: 0; border-bottom: 1px solid #e6d5b266; border-radius: 0; background: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; font: 500 13px/1.3 'Gowun Batang', serif; letter-spacing: .5px; color: #f1e3be;
  text-shadow: 0 0 3px #000, 0 1px 8px #000, 0 0 14px #000c; }
.intro-full .if-person i { font-style: normal; font-size: 15px; line-height: 1; color: #e6c98c; }
@media (hover: hover) and (pointer: fine) { .intro-full .if-person:hover { background: none; border-color: #e6d5b2b3; color: #fff3d6; } }

/* 풀이 제목: 위에 작게 '○○님의', 아래 사주 이름 */
.rh-switch .rh-lines { display: flex; flex-direction: column; align-items: flex-start; font-weight: inherit; line-height: 1.15; text-align: left; }
.rh-switch .rh-lines small { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 10.5px/1.3 'Noto Sans KR', sans-serif; letter-spacing: .3px; color: #d6b886; }
/* 갤러리 맨 위: 지금 보고 있는 분(命主) 카드 */
.who-card { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 2px auto 6px; padding: 12px 18px 11px; width: 100%;
  border-top: 1px solid #d6b8864d; border-bottom: 1px solid #d6b8864d; background: linear-gradient(90deg, transparent, #d6b88614 30%, #d6b88614 70%, transparent); text-align: center; }
.who-card[hidden] { display: none; }
.who-card small { font: 600 9px/1 'Noto Sans KR', sans-serif; letter-spacing: 3px; padding-left: 3px; color: #b99a63; }
.who-card b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 20px/1.35 'Gowun Batang', serif;
  background: linear-gradient(180deg, #f6e4b8, #c9a463); -webkit-background-clip: text; background-clip: text; color: transparent; }
.who-card span { font-size: 11px; color: var(--muted); }

/* 풀이 맨 아래 두 버튼(다른 사주 보기 / 다른 분의 사주 보기): 좁은 휴대폰(360)에서 두 줄로 꺾이지 않게 */
#btn-other, #btn-home { white-space: nowrap; padding-inline: 8px; font-size: min(15px, 3.9vw); }

/* ===== 개발자 메뉴(DEV 버튼 + 창) — dev_reset 이 켜졌을 때만. 아래 탭 바 윗변 오른쪽에 걸쳐(내용·버튼을 가리지 않게) ===== */
.dev-reset { position: fixed; z-index: 9; left: auto; top: auto; right: max(8px, calc(50vw - var(--app-width) / 2 + 8px)); bottom: calc(var(--tabbar-h) - 9px); margin: 0; padding: 2px 8px;
  border: 1px solid #e0566f66; border-radius: 10px; background: #2a1518d9; color: #ffb4bf; font: 800 10px/1.4 'Noto Sans KR', sans-serif; letter-spacing: 1px;
  box-shadow: 0 2px 8px #0008; opacity: .85; cursor: pointer; }
body:is([data-screen="s-welcome"], [data-screen="s-login"]) .dev-reset { bottom: 10px; }
.dev-body { padding: 16px 18px 20px; }
.dev-body p { margin: 0 0 14px; font-size: 13px; line-height: 1.65; color: #cfc8b6; }
.dev-danger { width: 100%; height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: center; line-height: 1.2;border: 1px solid #e0566f99; border-radius: 6px; background: #3a1a1f; color: #ffd0d6; font-weight: 700; font-size: 14.5px; }
.dev-danger.armed { background: #c4344f; border-color: #ff8a9c; color: #fff; }
.dev-danger:disabled { opacity: .6; }
.dev-body .dev-msg { margin: 10px 0 0; min-height: 1.4em; text-align: center; font-size: 12px; color: #ffb4bf; }

/* ===== 회원가입(2026-11-12): 계정 칸과 사주 정보 칸 사이 구분선, 로그인 ↔ 회원가입 바꾸기 링크 ===== */
.form-sep { display: flex; align-items: center; gap: 12px; margin: 6px 0 -2px; color: #b9ac8b; font-size: 12px; }
.form-sep::before, .form-sep::after { content: ""; flex: 1; height: 1px; background: #ffffff1f; }
.form-switch { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.form-switch button { padding: 4px 2px; border: 0; background: none; color: #e6c98c; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .form-switch button:hover { color: #f6e2b0; } }

/* ===== 잠긴 두루마리 '프리미엄' 제목 아래 네모 칸: "두루마리를 열면 ○○의 새로운 모습 공개!" (main.js galleryReward) ===== */
.lk-reward { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 2px 0 12px; padding: 9px 12px 9px 9px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--tc) 55%, #e6d5b2 25%); text-align: left; color: inherit; font: inherit; cursor: default; overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tc) 26%, #111714), color-mix(in srgb, var(--tc) 10%, #111714) 75%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--tc) 18%, transparent); }
.lk-reward::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, #ffffff12 50%, transparent 65%); background-size: 250% 100%; animation: grShine 3.6s ease-in-out infinite; }
@keyframes grShine { 0%, 40% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .lk-reward::after { animation: none; } }
.lr-thumb { position: relative; flex: none; width: 46px; height: 60px; border-radius: 7px; overflow: hidden;
  border: 1px solid color-mix(in srgb, #e6c98c 55%, var(--tc)); background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tc) 38%, #0b0f0d), #07090800 70%), #0b0f0d;
  box-shadow: inset 0 0 12px #000c; }
.lr-thumb i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 18px; }
.lr-thumb i img { width: 24px; height: 24px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tc) 60%, #f0cf8a)); }
.lr-thumb b { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 10px; font-weight: 800; color: #f0cf8a; letter-spacing: .2px; }
.lr-txt { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lr-txt small { font-size: 11px; color: #e8dcc0; opacity: .85; }
.lr-txt b { font: 700 15px/1.35 'Gowun Batang', serif; color: #fff1cf; }
.lr-prog { display: flex; align-items: center; gap: 7px; margin-top: 1px; font-size: 11px; color: #d9cba6; }
.lr-dots { display: inline-flex; gap: 4px; }
.lr-dots i { width: 14px; height: 4px; border-radius: 2px; background: #ffffff2b; }
.lr-dots i.on { background: #f0cf8a; box-shadow: 0 0 6px #f0cf8a99; }
.lk-reward { pointer-events: none; } /* 누를 수 없는 안내 칸 */

/* 큰 그림 보기(갤러리 창) 바깥: 검게 덮지 않고 원래 배경 그대로(2026-11-12 사용자 요청 — 예전 85% 검정 + 흐림이라 PC 양옆이 새까맸음) */
.character-gallery::backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.character-gallery.gallery-fullscreen { box-shadow: 0 0 0 1px #cbb58433, 0 24px 80px #0008; }

/* ===== 내 정보(s-me): 命主 카드 · 내 사주 모아 보기 · 정보 수정 · 비밀번호 · 로그아웃 ===== */
#s-me .me-card { margin: 0 0 6px; }
#s-me .me-card .me-id { font-size: 10.5px; color: #8f9a8a; letter-spacing: .3px; }
.me-sec { padding: 18px 0 4px; border-top: 1px solid #ffffff14; }
.me-sec h3 { margin: 0 0 12px; font: 700 16px/1.4 'Gowun Batang', serif; color: #efe6cf; }
.me-note { margin: -4px 0 12px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.me-list { display: flex; flex-direction: column; gap: 8px; }
.me-saju { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; border-radius: 10px; text-align: left; color: inherit; font: inherit; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--tc) 45%, #ffffff10); background: linear-gradient(110deg, color-mix(in srgb, var(--tc) 18%, #111714), #ffffff06); }
.me-saju img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1.5px solid color-mix(in srgb, var(--tc) 70%, #fff3); }
.me-saju span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.me-saju b { font-size: 15px; color: #efe6cf; display: inline-flex; align-items: center; gap: 4px; }
.me-saju b .ticon { width: 18px; height: 18px; }
.me-saju small { font-size: 11.5px; color: var(--muted); }
.me-saju em { flex: none; font-style: normal; font-size: 12px; font-weight: 700; color: #e6c98c; }
.me-msg { margin: 0; min-height: 1.3em; text-align: center; font-size: 12.5px; color: #e6c98c; }
#s-me .form { gap: 14px; }
#s-me .me-logout { margin: 18px auto 0; color: #b9b4a6; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .me-saju:hover { filter: brightness(1.08); } }
/* 아래 탭 4칸(홈·내 사주·갤러리·내 정보) */
.tabbar button span { font-size: 10.5px; }

/* 큰 그림 보기 열릴 때: 홈의 그림 위치(헤더 아래)에서 전체 화면(가운데)으로 '뚝' 바뀌는 느낌을 줄이려고 살짝 확대되며 서서히 나타남 */
.character-gallery[open] { animation: galIn .26s ease-out; }
@keyframes galIn { from { opacity: 0; transform: scale(.965); } }
@media (prefers-reduced-motion: reduce) { .character-gallery[open] { animation: none; } }

/* ===== 갤러리 '캐릭터들의 손편지' 결제 카드(2026-11-12): 단조로운 가격 알약 대신 결제 카드처럼 고급스럽게 ===== */
.ig-sign-buy.letter-buy { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px 14px; border-radius: 14px; overflow: hidden;
  border: 1px solid #e2c27eb0; text-align: left; color: inherit; font: inherit; cursor: pointer;
  background: radial-gradient(120% 90% at 100% 0%, #e2c27e2e, transparent 55%), linear-gradient(160deg, #2a2216, #17140f 60%, #1d1710);
  box-shadow: 0 0 0 1px #00000060 inset, 0 14px 34px #0008, 0 0 26px #e2c27e1f; }
.letter-buy::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 38%, #ffffff10 50%, transparent 62%); background-size: 260% 100%; animation: grShine 4.2s ease-in-out infinite; }
.letter-buy .lb-head { display: flex; flex-direction: column; gap: 5px; }
.letter-buy .lb-kicker { font-size: 9.5px; letter-spacing: 3px; font-weight: 700; color: #c9a463; }
.letter-buy .lb-head b { font: 700 20px/1.3 'Gowun Batang', serif; color: #f6e2b0; }
.letter-buy .lb-head small { font-size: 12px; line-height: 1.6; color: #cdbf9d; }
/* 미리 보기 = 큰 그림에 새겨지는 것과 같은 손글씨(바탕 없이 글씨만, 나눔 펜 손글씨) */
.letter-buy .lb-note { display: block; margin: 2px 6px 0; text-align: center; color: #fffaf2; font: 400 24px/1.18 'Nanum Pen Script', 'Gowun Batang', cursive;
  text-shadow: 0 1px 2px #22101699, 0 0 14px #ff9fb840; }
.letter-buy .lb-note i { display: block; margin-top: 3px; padding-right: 18px; text-align: right; font-style: normal; color: inherit; font-size: 21px; }
.letter-buy .lb-pay { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px dashed #e2c27e55; }
.letter-buy .lb-price { display: flex; flex-direction: column; gap: 2px; }
.letter-buy .lb-price small { font-size: 10.5px; color: #b9ac8b; }
.letter-buy .lb-price b { font: 900 22px/1.1 'Noto Sans KR', sans-serif; color: #f6e2b0; letter-spacing: -.3px; }
.letter-buy .lb-cta { flex: none; padding: 11px 16px; border-radius: 22px; background: linear-gradient(110deg, #f0d9a2, #c9a463 55%, #e8cc8c); color: #2a2216;
  font: 900 14px/1 'Noto Sans KR', sans-serif; box-shadow: 0 4px 14px #c9a46355, inset 0 1px 0 #fff8; }
@media (hover: hover) and (pointer: fine) { .letter-buy:hover { filter: brightness(1.06); } }
/* 예전 .ig-sign-buy span 규칙(세로 묶음)이 결제 줄까지 세로로 쌓던 것 덮어쓰기 */
.letter-buy span { flex: none; }
.letter-buy .lb-pay { flex-direction: row; }
.letter-buy .lb-price { flex: 1; align-items: flex-start; }
.letter-buy .lb-note span { display: inline; }

/* 큰 그림 보기: 그림 전체를 보이게(contain) 하면서 남는 띠(긴 휴대폰의 위아래, 넓은 창의 양옆)는 검은색 대신 같은 그림을 흐리게(홈 화면과 같은 방식) */
.gallery-fullscreen .gallery-media { background: #111714; }
.gallery-fullscreen .gallery-media::before { content: ""; position: absolute; inset: -40px; pointer-events: none;
  background: var(--gal-bg, none) 50% 50% / cover no-repeat; filter: blur(26px) brightness(.62) saturate(1.15); }

/* 큰 그림 아래 버튼 두 개(2026-11-12, 예전 '메뉴' 대신): 대표 스킨으로 설정 · 이미지 저장 */
.gallery-fullscreen .gallery-controls { gap: 10px; }
.gallery-fullscreen .gallery-controls .gallery-act:disabled { opacity: .5; cursor: default; }
.gallery-fullscreen .gallery-controls .gallery-act.is-on { opacity: 1; border-color: #f0d5a3a0; color: #f6e2b0; background: #e2c27e26; }
.letter-buy .lb-note .lb-heart { background: none; padding: 0; border-radius: 0; font-weight: 400; font-style: normal; color: inherit; font-family: 'Segoe UI Symbol', 'Apple SD Gothic Neo', sans-serif; font-size: .8em; margin-left: 1px; }


/* 아주 낮은 화면(가로로 든 휴대폰): 큰 그림 아래 UI 를 줄여 그림·손글씨·잠긴 안내와 겹치지 않게 */
@media (max-height: 520px) {
  .gallery-fullscreen #gallery-count, .gallery-fullscreen #gallery-scroll-progress { display: none; }
  .gallery-fullscreen .gallery-bottom { padding-top: 18px; padding-bottom: 8px; }
  .gallery-fullscreen .gallery-dots { margin: 0; }
  .gallery-fullscreen .gallery-dot { height: 24px; }
  .gallery-fullscreen .gallery-controls button { height: 32px; }
  .gallery-fullscreen .gallery-empty { padding: 56px 24px 96px; }
  .gallery-fullscreen .gallery-empty > span { font-size: 34px; }
  .gallery-fullscreen .gallery-empty h3 { font-size: 20px; margin: 4px 0; }
  .gallery-fullscreen .gallery-corner { bottom: 86px; }
}
/* 하는 법 카드가 떠 있는 동안 뒤의 게임 준비 카드(이름·버튼)는 숨겨 카드만 보이게 */
.game-intro:has(.gi-tut:not([hidden])) .gi-card { visibility: hidden; }
/* 설명은 줄(.tl)마다 한 줄씩 세로로(예전 flex 가로 배치에 그림이 섞이면 흩어졌음) */
.tut-text { flex-direction: column; align-items: center; justify-content: flex-start; }
.tut-text .tl { display: block; white-space: nowrap; } .tut-text, .tut-title { align-self: stretch; width: 100%; min-width: 0; box-sizing: border-box; } /* (2026-11-17) 글자 칸이 카드 폭을 넘지 않게 — 넘치는 줄은 main.js fitTut 이 글자를 줄임 */
.tut-text .tl img.emo { height: 1.3em; vertical-align: -0.3em; }
.tut-dots { margin-top: 10px; }

/* 풀이 열림 알림(2026-11-12): 그림 없이 두루마리 아이콘 + 몇 장 열렸는지 + 진행 수 */
.unlock-pop { position: relative; }
.unlock-pop .up-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #ffffff2e; background: #0003; color: #d8d2c2; cursor: pointer; }
.unlock-pop .up-icon { display: flex; justify-content: center; margin: 4px 0 2px; }
.unlock-pop .up-icon img { width: 58px; height: 58px; filter: drop-shadow(0 4px 14px #d6b88655); }
.unlock-pop h3 { margin: 8px 0 10px; font-size: 22px; }
.unlock-pop .up-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.unlock-pop .up-list li { padding: 9px 12px; border-radius: 9px; border: 1px solid #d6b88644; background: #d6b8860f; color: #f3e6c8; font: 400 14px 'Gowun Batang', serif; }
.unlock-pop .up-stats { display: flex; gap: 8px; margin: 0 0 12px; }
.unlock-pop .up-stats span { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; border-radius: 9px; background: #ffffff08; }
.unlock-pop .up-stats small { font-size: 10.5px; color: #a9b09f; }
.unlock-pop .up-stats b { font-size: 15px; color: #e8cf98; }
.unlock-pop p[hidden], .unlock-pop .btn[hidden] { display: none; }
/* 큰 그림 왼쪽 버튼 묶음(2026-11-12): UI 숨기기 · 손편지 · 이미지 저장 · 대표 스킨으로 설정을 세로로. 아래 가운데엔 모습 이름·문구·점만 */
.gallery-fullscreen .gallery-corner { bottom: calc(max(0px, (100cqh - 100cqw * 16 / 9) / 2) + 96px); }
.gallery-corner-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.gallery-corner .gallery-act { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid #ffffff55; background: #0006; color: #fff;
  font: 700 12px 'Noto Sans KR', sans-serif; white-space: nowrap; cursor: pointer; backdrop-filter: blur(8px); text-shadow: 0 1px 3px #000; }
.gallery-corner .gallery-act:disabled { cursor: default; opacity: 1; }
.gallery-corner .gallery-act.is-on { border-color: #e2c27e99; color: #f3dca4; }
.character-gallery #gallery-actions { transition: opacity .25s; }
.character-gallery.ui-hidden #gallery-actions { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .gallery-corner .gallery-act:not(:disabled):hover { filter: brightness(1.15); translate: none; box-shadow: none; } }
@media (max-height: 520px) {
  .gallery-fullscreen .gallery-corner { bottom: 52px; gap: 6px; }
  .gallery-corner-actions { gap: 6px; }
  .gallery-corner .gallery-act, .gallery-fullscreen .gallery-ui-toggle, .gallery-fullscreen .gallery-sign-toggle { height: 30px; }
}
/* 갤러리 목록: 열렸지만 아직 크게 안 본 모습에 NEW(2026-11-12) — 아래 탭 NEW 와 같은 색 */
.ig-new { position: absolute; top: 4px; right: 4px; padding: 1px 5px; border-radius: 6px; background: #e0566f; color: #fff;
  font: 800 8.5px/1.4 'Noto Sans KR', sans-serif; letter-spacing: .3px; box-shadow: 0 1px 4px #0008; }
/* 손편지 산 뒤: 사기 전과 같은 카드, 누르는 곳 아님 */
.letter-buy.is-owned { cursor: default; }
.letter-buy.is-owned .lb-done { display: inline-flex; align-items: center; gap: 5px; background: #e2c27e1f; color: #f3dca4; border: 1px solid #e2c27e88; box-shadow: none; }
.letter-buy.is-owned .lb-done img.ci { height: 1.25em; }
@media (hover: hover) and (pointer: fine) { .letter-buy.is-owned:hover { filter: none; } }.letter-buy.is-owned .lb-done { flex-direction: row; white-space: nowrap; padding: 10px 14px; }
.letter-buy.is-owned .lb-done img.ci { display: inline-block; margin: 0; }

/* 갤러리 대표 모습 표시 강화(2026-11-12): 금빛 두꺼운 테두리 + 빛 + '★ 대표' 금색 딱지, 줄 머리에 "★ 대표 · ○○ 모습" */
#app .ig-cell.is-rep, #app .ig-cell.is-rep:hover { border: 2px solid #f0d5a3;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 55%, transparent), 0 0 16px #f0d5a399; }
.ig-cell.is-rep .ig-label { color: #f6e2b0; font-weight: 700; }
.ig-rep { top: 3px; left: 3px; padding: 2px 6px; border-radius: 7px; font-size: 9px; font-weight: 800; color: #2a2216;
  background: linear-gradient(110deg, #f6e2b0, #d9b66e); text-shadow: none; box-shadow: 0 1px 5px #0009; }
.ig-rep-name { flex: none; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; color: #f6e2b0; white-space: nowrap;
  border: 1px solid #e2c27e77; background: #e2c27e1a; }
.ig-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 380px) { .ig-who { gap: 7px; } .ig-who b { font-size: 15px; } .ig-rep-name { font-size: 9.5px; padding: 2px 6px; } }
/* 숨겨진 모습 열기(2026-11-12): 시작 전 '이번 도전' 카드, 상단 두루마리 줄의 지금 단계 */
.gi-challenge { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 2px auto 4px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--tc) 55%, #ffe08a55); background: color-mix(in srgb, var(--tc) 14%, #0006); text-align: center; }
.gi-challenge small { font-size: 10.5px; letter-spacing: 1px; color: #cdbf9d; }
.gi-challenge b { font: 400 18px 'Gowun Batang', serif; color: #f6e2b0; }
.gi-challenge span { font-size: 12.5px; color: #ece6d6; }
.scroll-track .sc.now { border-color: #ffe08acc; color: #ffe08a; box-shadow: 0 0 10px #ffe08a44; }
/* 준비 화면의 단계 점수 줄은 숨기지만, 숨겨진 모습 열기의 '이번 도전' 카드는 보여 준다 */
body[data-screen="s-game"]:not([data-game-playing="true"]) #gi-tiers:has(.gi-challenge), body[data-screen="s-game"]:not([data-game-playing="true"]) #gi-tiers:has(.gi-pick) { display: block; }

/* ✦ 특별한 모습(2026-11-12): 첫 번째~네 번째 모습을 모두 열면 공개 — 갤러리 목록의 다섯 칸 아래 넓은 금빛 칸 */
.ig-special { position: relative; width: 100%; display: flex; align-items: stretch; gap: 12px; margin-top: 8px; padding: 8px; border-radius: 10px; overflow: hidden;
  border: 1.5px solid #e2c27eaa; color: inherit; font: inherit; text-align: left; cursor: pointer;
  background: radial-gradient(120% 140% at 100% 0%, #e2c27e30, transparent 55%), linear-gradient(120deg, color-mix(in srgb, var(--tc) 22%, #17140f), #120f0c 70%);
  box-shadow: 0 0 0 1px #00000060 inset, 0 0 18px #e2c27e22; }
.ig-special::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 38%, #ffffff12 50%, transparent 62%); background-size: 260% 100%; animation: grShine 4.2s ease-in-out infinite; }
.igs-art { flex: none; width: 64px; aspect-ratio: 9 / 16; border-radius: 7px; overflow: hidden; display: grid; place-items: center;
  border: 1px solid #e2c27e88; background: radial-gradient(circle at 50% 40%, #e2c27e33, #0b0a08 70%); }
.igs-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.igs-lock { font-size: 26px; color: #f0d5a3; text-shadow: 0 0 12px #e2c27ecc; animation: igsTwinkle 2.4s ease-in-out infinite; }
@keyframes igsTwinkle { 0%, 100% { opacity: .65; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
.igs-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.igs-txt small { font-size: 9.5px; letter-spacing: 2.5px; font-weight: 800; color: #c9a463; }
.igs-txt b { font: 400 17px 'Gowun Batang', serif; color: #f6e2b0; }
.igs-txt em { font-style: normal; font-size: 11px; line-height: 1.5; color: #cdbf9d; }
.igs-prog { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; color: #f0d5a3; }
.igs-prog .lr-dots { display: inline-flex; gap: 3px; }
.igs-prog .lr-dots i { width: 14px; height: 4px; border-radius: 2px; background: #ffffff26; }
.igs-prog .lr-dots i.on { background: #f0d5a3; }
.ig-special.locked .igs-art { filter: saturate(.8); }
#app .ig-special.is-rep { border: 2px solid #f0d5a3; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 55%, transparent), 0 0 18px #f0d5a399; }
@media (hover: hover) and (pointer: fine) { #app .ig-special:hover { filter: brightness(1.08); translate: none; } }
/* 큰 그림 아래 점: 특별한 모습은 별 모양 */
.gallery-dot.is-special > span { width: 11px; height: 11px; border-radius: 0; border: 0; background: #f0d5a3;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); opacity: .9; }
.gallery-dot.is-special.is-locked:not([aria-pressed="true"]) > span { opacity: .4; background: #fff; }
.gallery-dot.is-special[aria-pressed="true"] > span { transform: scale(1.35); }
/* 풀이 잠김 안내·알림 창의 '✦ 특별한 모습' 글씨 */
.lr-special, .up-special { font-style: normal; color: #f6e2b0; text-shadow: 0 0 10px #e2c27e88; }
/* 풀이 첫머리(2026-11-12): 캐릭터 그림 전체(9:16)를 보여 주고 그 아래에서 풀이 시작. 맨 아래 '아래로 내려 풀이 보기' 안내(통통) */
#s-free .rd-banner { height: auto !important; aspect-ratio: 9 / 16; }
#s-free .rd-banner img { object-fit: cover; object-position: 50% 0 !important; }
#s-free .rd-copy { bottom: 74px; }
.rd-scroll-hint { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px;
  pointer-events: none; color: #fff; font: 700 12px 'Noto Sans KR', sans-serif; text-shadow: 0 1px 6px #000, 0 0 12px #000a; transition: opacity .35s; }
.rd-scroll-hint i { width: 14px; height: 14px; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(45deg);
  filter: drop-shadow(0 1px 3px #000); animation: rdHint 1.3s ease-in-out infinite; }
@keyframes rdHint { 0%, 100% { translate: 0 -2px; opacity: .55; } 50% { translate: 0 6px; opacity: 1; } }
body.rd-scrolled .rd-scroll-hint { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .rd-scroll-hint i { animation: none; } }/* 안내는 첫 화면에서 보여야 함: 그림이 화면보다 길어 그림 맨 아래에 두면 안 보였음 → 그림 안에서 화면 바닥(탭 바 위)에 붙게(sticky). 조금 내리면 사라짐 */
#s-free .rd-banner { overflow: clip; display: flex; flex-direction: column; justify-content: flex-end; }
#s-free .rd-scroll-hint { position: sticky; left: auto; right: auto; bottom: calc(var(--tabbar-h, 58px) + 12px + env(safe-area-inset-bottom)); margin: 0 auto 14px;
  padding: 6px 14px 4px; border-radius: 16px; background: #0007; backdrop-filter: blur(4px); }/* 왼쪽 아래 제목과 겹치지 않게 오른쪽 아래로 */
#s-free .rd-scroll-hint { margin: 0 14px 14px auto; }

/* (2026-11-12) 풀이 첫머리: 말풍선 + 제목을 그림 위에 한 묶음으로(아래로 내려 풀이 보기 바로 위, main.js layoutHero), 안내는 가운데 */
#s-free .rd-scroll-hint { margin: 0 auto 14px; }
.rd-over { position: absolute; left: 16px; right: 16px; bottom: 74px; z-index: 1; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.rd-over .rd-copy { position: static; max-width: 72%; }
#s-free .rd-copy { bottom: auto; }
.gallery-format { display: flex; gap: 2px; padding: 3px; border: 1px solid #ffffff55; border-radius: 18px; background: #151018b8; }
.gallery-format[hidden] { display: none; }
.gallery-format button { border: 0; border-radius: 14px; padding: 6px 12px; background: transparent; color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.gallery-format button.is-active { background: #e0c68d; color: #271f15; }
.gallery-format button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.character-gallery.ui-hidden .gallery-format { opacity: 0; pointer-events: none; }
.bubble.rd-say { align-self: stretch; margin: 0; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.65; color: #fff;
  background: #120d14b8; border: 1px solid #ffffff2e; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 18px #0006; }
.bubble.rd-say::before { display: block; content: ""; position: absolute; left: 50%; top: -9px; bottom: auto; border: 0; width: 16px; height: 16px;
  background: inherit; border-left: 1px solid #ffffff2e; border-top: 1px solid #ffffff2e; transform: translateX(-50%) rotate(45deg); backdrop-filter: none; }
/* 말풍선 옆 동그란 초상화는 쓰지 않음(사용자 요청) — 결과 화면 등 */
.scene > .guide { display: none; }@media (max-height: 520px) { #s-free .rd-scroll-hint { display: none; } }

/* 두루마리는 차례대로(2026-11-12): 아직 차례가 아닌 잠긴 장 — 버튼 대신 안내 한 줄, 카드 살짝 어둡게 */
.lk-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 12px 10px; border-radius: 8px;
  border: 1px dashed #ffffff2e; background: #0000002e; color: #cfc7b4; font-size: 13px; }
.lk-wait img { width: 22px; height: 22px; opacity: .85; }
.chapter.locked.waiting { opacity: .82; }
/* (2026-11-12) 풀이 첫머리 안내 = 글자·바탕 없이 화살표만(통통), 제목 묶음은 그 바로 위까지 내림. 첫인사 말풍선은 없앰 */
#s-free .rd-scroll-hint { padding: 0 0 6px; background: none; backdrop-filter: none; border-radius: 0; margin: 0 auto 10px; }
#s-free .rd-scroll-hint i { width: 18px; height: 18px; border-right-width: 3px; border-bottom-width: 3px; }
.rd-over { bottom: 48px; }

/* (2026-11-12) 풀이 첫머리: 그림은 누를 수 없음, 화살표(버튼)를 누르면 풀이 시작으로 */
#s-free .rd-portrait { cursor: default; }
#s-free button.rd-scroll-hint { pointer-events: auto; cursor: pointer; border: 0; background: none; padding: 10px 26px 12px; margin: 0 auto 4px; font: inherit; color: #fff; }
#s-free button.rd-scroll-hint:focus-visible { outline: 2px solid #ffe08a; outline-offset: 2px; border-radius: 12px; }
body.rd-scrolled #s-free button.rd-scroll-hint { pointer-events: none; }
@media (hover: hover) and (pointer: fine) { #s-free button.rd-scroll-hint:hover { translate: none; box-shadow: none; filter: brightness(1.2); } }/* 화살표·제목을 화면 바닥 가까이로: #app 스크롤 영역은 이미 탭 바 위에서 끝나므로 탭 바 높이를 또 빼지 않는다(예전엔 70px 떠 있었음) */
#s-free .rd-scroll-hint { bottom: calc(6px + env(safe-area-inset-bottom)); }

/* 풀이 첫머리: 대표 모습이 ✦ 특별한 모습이면 그림 오른쪽 위에 [사진 | GIF] 전환(갤러리 큰 그림의 전환과 같은 모양·같은 기억) */
.rd-format { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 2px; padding: 3px; border: 1px solid #ffffff55; border-radius: 18px; background: #151018b8; backdrop-filter: blur(6px); }
.rd-format button { border: 0; border-radius: 14px; padding: 6px 12px; background: transparent; color: #fff; font: 700 12px 'Noto Sans KR', sans-serif; cursor: pointer; }
.rd-format button[aria-pressed="true"] { background: #e0c68d; color: #271f15; }
.rd-format button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .rd-format button:hover { translate: none; box-shadow: none; filter: brightness(1.12); } }
/* 개발자 메뉴: 예전 미니게임 4종 연습 */
.dev-classic { margin-top: 16px; padding-top: 14px; border-top: 1px solid #ffffff1c; }
.dev-classic[hidden] { display: none; }
.dev-classic h4 { margin: 0 0 10px; font: 700 13.5px 'Noto Sans KR', sans-serif; color: #e8ddc6; }
.dev-classic h4 small { margin-left: 6px; font-weight: 400; font-size: 11px; color: #9aa594; }
.dev-classic-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dev-game { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 8px; text-align: left; border: 1px solid color-mix(in srgb, var(--tc) 55%, #ffffff22);
  background: color-mix(in srgb, var(--tc) 14%, #151a17); color: #f3e6c8; min-width: 0; }
.dev-game img { width: 26px; height: 26px; flex: none; }
.dev-game span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dev-game b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-game small { font-size: 10.5px; color: #b9c0ae; }
.dev-menu { max-height: calc(100dvh - 40px); overflow-y: auto; }
/* ✦ 특별한 모습의 움직이는 버전이 영상(mp4)일 때: 소리 없음·자동 반복 <video> — 그림과 같은 자리·같은 맞춤 */
.gallery-media video { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; background: transparent; }
.gallery-media video[hidden] { display: none; }
.gallery-fullscreen .gallery-media video { object-fit: contain; object-position: 50% 50%; }
#s-free .rd-portrait video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; display: block; pointer-events: none; }
/* 영상 위 손편지(갤러리 큰 그림에서만): 글씨만 있는 투명 그림을 영상과 같은 자리·같은 맞춤으로 겹침 */
.gallery-media .gallery-letter { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; object-position: 50% 50%; pointer-events: none; z-index: 1; }
.gallery-media .gallery-letter[hidden] { display: none; }
/* 메인 그림 자리의 영상(특별한 모습 · 영상 보기) */
.intro-full video.if-video { object-fit: cover; object-position: 50% 0; z-index: 0; pointer-events: none; }
.intro-full video.if-video[hidden] { display: none; }
/* 당겨서 새로고침 표시(휴대폰·태블릿, frontend/pullrefresh.js): 맨 위에서 아래로 당기면 헤더 아래로 내려오는 동그란 표시 */
.ptr { position: fixed; left: 50%; top: calc(var(--site-header-height, 79px) - 46px); z-index: 60; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none; opacity: 0; transform: translate(-50%, 0);
  background: #18201bf2; border: 1px solid #e2c27e88; box-shadow: 0 6px 16px #0009; transition: transform .22s ease, opacity .22s ease; }
.ptr.pulling { transition: none; }
.ptr i { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #e2c27e; border-top-color: transparent; }
.ptr.ready { border-color: #f6e2b0; box-shadow: 0 6px 16px #0009, 0 0 14px #e2c27e66; }
.ptr.ready i { border-color: #f6e2b0; border-top-color: transparent; }
.ptr.spin i { animation: ptrSpin .7s linear infinite; }
@keyframes ptrSpin { to { rotate: 360deg; } }
/* 큰 그림 왼쪽 버튼 묶음을 그림 맨 아래에 붙임(2026-11-12 사용자 요청: 아래 정보 위에 어정쩡하게 떠 있었음).
   왼쪽 아래 = 버튼(UI 숨기기 · 손편지 숨기기 · 저장 · 대표 스킨), 오른쪽 아래 = 모습 이름·공개 수·점(오른쪽 정렬, 손편지 글씨와 같은 쪽) */
.gallery-fullscreen .gallery-corner { bottom: calc(max(0px, (100cqh - 100cqw * 16 / 9) / 2) + 14px + env(safe-area-inset-bottom)); }
.gallery-fullscreen .gallery-bottom { padding: 0 14px calc(12px + env(safe-area-inset-bottom)) 150px; text-align: right; pointer-events: none; }
.gallery-fullscreen .gallery-bottom .gallery-dots { justify-content: flex-end; margin: 0 -8px 0 0; pointer-events: auto; }
.gallery-corner #gallery-sign-toggle[hidden] { display: none; }
@media (max-height: 520px) {
  .gallery-fullscreen .gallery-corner { bottom: 8px; }
  .gallery-fullscreen .gallery-bottom { padding-bottom: 8px; }
}

/* 숨겨진 모습 열기 · 모습 고르기(2026-11-13): 이미 깬 모습 = 그림(다시 하기), 새 도전·아직 차례 아닌 모습 = ? */
.gi-pick { display: flex; flex-direction: column; gap: 10px; }
.gp-row { display: flex; justify-content: center; gap: 8px; }
.gp-cell { flex: 0 1 70px; min-width: 0; padding: 0; border: 0; background: none; color: #d9d2c0; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; -webkit-tap-highlight-color: transparent; }
.gp-pic { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden;
  border: 2px solid #ffffff2e; background: color-mix(in srgb, var(--tc) 16%, #0b0a10d9); box-sizing: border-box; }
.gp-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.gp-pic b { font: 400 30px 'Gowun Batang', serif; color: #f1d898; text-shadow: 0 0 12px #f1d89866; }
.gp-cell em { font-style: normal; font-size: 11.5px; white-space: nowrap; }
.gp-cell.is-new .gp-pic { border-style: dashed; border-color: #f1d89899; }
.gp-cell.is-on .gp-pic { border-style: solid; border-color: #ffe08a; box-shadow: 0 0 0 2px #ffe08a40, 0 0 14px #ffe08a55; }
.gp-cell.is-on em { color: #ffe08a; font-weight: 700; }
.gp-cell.is-locked { cursor: default; opacity: .42; }
.gp-cell.is-locked .gp-pic b { color: #bdb7a8; text-shadow: none; }
.gp-cell:focus-visible .gp-pic { outline: 2px solid #fff; outline-offset: 2px; }
.gi-pick .gi-challenge { margin: 0 auto; align-self: stretch; }
@media (max-height: 620px) { .gp-cell { flex-basis: 58px; } .gp-pic b { font-size: 24px; } .gi-pick { gap: 7px; } }
/* 낮은 화면: 모습 고르기 칸이 들어가면 '풀이로 돌아가기'가 화면 밖으로 밀려서, 위의 동그란 얼굴을 숨긴다(고르기 칸에 이미 그림이 있음) */
@media (max-height: 720px) { .gi-card:has(.gi-pick) #gi-face { display: none; } }

/* 스페셜 오픈 가능(2026-11-13): 네 번째까지 다 열면 갤러리 목록의 스페셜 칸이 밝게 빛나고 '지금 열기' — 눌러야 열린다 */
.ig-special.can-open { border-color: #ffe08a; animation: igsCall 1.8s ease-in-out infinite;
  background: radial-gradient(120% 140% at 100% 0%, #ffe08a4d, transparent 60%), linear-gradient(120deg, color-mix(in srgb, var(--tc) 34%, #1d170d), #17120b 70%); }
@keyframes igsCall { 0%, 100% { box-shadow: 0 0 0 1px #00000060 inset, 0 0 10px #ffe08a44; } 50% { box-shadow: 0 0 0 1px #00000060 inset, 0 0 26px #ffe08acc; } }
.ig-special.can-open .igs-txt b { color: #ffe9a8; text-shadow: 0 0 12px #ffe08a88; }
.ig-special.can-open .igs-txt em { color: #efe4c6; }
.igs-open { align-self: flex-start; margin-top: 3px; padding: 5px 12px; border-radius: 14px; font-size: 11.5px; font-weight: 800; color: #2a1f0c;
  background: linear-gradient(180deg, #ffe9a8, #e2c27e); box-shadow: 0 2px 8px #0006; }
@media (prefers-reduced-motion: reduce) { .ig-special.can-open { animation: none; } }

/* 스페셜을 처음 열 때의 연출 3판(2026-11-13 사용자 요청: 컷신 느낌 말고 샤방샤방하게, 약 11초, 누르면 건너뜀)
   ① 흰 바탕에 손편지 문구만(한 번에) → ② 그림의 세 부분이 뽀얀 빛 속에서 천천히 번갈아(배경 → 포인트 → 얼굴) → ③ 뽀얗게 걷히며 전체(영상). 단계는 main.js playSpecialReveal 이 data-stage(letter·cut·out)로 넘긴다 */
.special-reveal { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(130% 95% at 50% 38%, #fff 0%, #fff7fb 42%, #ffe9f2 74%, #ffe6cf 100%); }
.special-reveal[hidden] { display: none; }
.special-reveal > * { grid-area: 1 / 1; pointer-events: none; }
.special-reveal[data-stage="out"] { animation: srOut .95s ease forwards; }
@keyframes srOut { to { opacity: 0; visibility: hidden; } }
/* 손편지 문구: 한 줄씩이 아니라 한 번에, 손글씨 */
.sr-msg { position: relative; z-index: 2; margin: 0; padding: 0 6%; text-align: center; white-space: nowrap; color: #8a4f63;
  font: 400 min(42px, calc(84cqw / (var(--n, 16) * .58))) / 1.4 'Nanum Pen Script', 'Nanum Brush Script', cursive;
  text-shadow: 0 0 14px #fff, 0 0 26px #fff, 0 1px 0 #fff; opacity: 0; transition: opacity .6s ease; }
.sr-msg span { display: block; }
.special-reveal[data-stage="letter"] .sr-msg { opacity: 1; animation: srMsg 1.1s ease both; }
@keyframes srMsg { from { opacity: 0; filter: blur(8px); transform: scale(.96); } to { opacity: 1; filter: none; transform: none; } }
/* 반짝이(자리·크기·박자는 main.js 가 흩뿌림) */
.sr-sparks { position: absolute; inset: 0; z-index: 3; }
.sr-sparks b { position: absolute; font: 400 var(--s, 16px) / 1 serif; color: #ffd98a; opacity: 0; text-shadow: 0 0 8px #fff, 0 0 14px #ffc7dc;
  animation: srTwinkle var(--t, 2s) ease-in-out var(--d, 0s) infinite; }
.sr-sparks b:nth-child(3n) { color: #ffb9d2; } .sr-sparks b:nth-child(4n) { color: #fff; text-shadow: 0 0 8px #ffd98a, 0 0 16px #ffb9d2; }
@keyframes srTwinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
/* 부분 장면: 화면 가득, 서서히 나타나며 아주 천천히 다가옴. 가장자리는 뽀얀 흰빛 */
.sr-cut { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .8s ease; }
.special-reveal[data-stage="cut"] .sr-cut, .special-reveal[data-stage="out"] .sr-cut { opacity: 1; }
.sr-cut i { position: absolute; inset: 0; background: var(--sr-img) no-repeat var(--x) var(--y) / var(--z, 240%) auto; filter: brightness(1.06) saturate(1.06);
  animation: srSoftIn .7s ease both, srDrift 3.4s linear both; }
@keyframes srSoftIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes srDrift { from { transform: scale(1); } to { transform: scale(1.09); } }
.sr-cut::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at 50% 50%, transparent 46%, #fff8 78%, #fff 100%), linear-gradient(180deg, #ffeef5aa 0%, transparent 22%, transparent 78%, #fff3e2aa 100%); }
.sr-flash { position: absolute; inset: 0; z-index: 4; opacity: 0; background: radial-gradient(circle, #fff, #fff7fb 60%, #ffeef5); }
.sr-flash.go { animation: srFl .9s ease-out forwards; }
@keyframes srFl { from { opacity: .75; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sr-cut i, .sr-flash.go, .sr-sparks b, .special-reveal[data-stage="letter"] .sr-msg { animation: none; } .sr-sparks b { opacity: .7; } }

/* 열린 스페셜 칸 오른쪽의 [연출 보기](2026-11-13): 카드(버튼) 위에 얹은 작은 금색 알약 버튼 */
.igs-wrap { position: relative; }
/* 연출 보기(2026-11-13 다시): 가운데 뜬 작은 알약 대신 카드 오른쪽 끝 칸 전체 — 금빛 가는 선으로 나누고 둥근 금색 재생 단추 + 작은 글씨(별 표시 없음) */
.ig-special.has-replay .igs-txt { padding-right: 82px; }
.igs-replay { position: absolute; right: 0; top: 0; bottom: 0; width: 84px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 0; border: 0; border-radius: 0 10px 10px 0;
  cursor: pointer; white-space: nowrap; background: linear-gradient(90deg, transparent, #e2c27e1c); color: #f0dcae; font: 400 11.5px 'Gowun Batang', serif; letter-spacing: 1.5px; }
.igs-replay::before { content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 1px; background: linear-gradient(transparent, #e2c27eaa, transparent); }
.igs-replay i { position: relative; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff3cf, #e2c27e 55%, #a8813a); box-shadow: 0 0 0 3px #e2c27e26, 0 2px 8px #0008; }
.igs-replay i::after { content: ""; position: absolute; left: 54%; top: 50%; translate: -50% -50%; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #3a2a0c; }
@media (hover: hover) and (pointer: fine) { #app .igs-replay:hover { filter: brightness(1.15); translate: none; } }
/* NEW 는 카드 오른쪽 위(연출 보기 칸)가 아니라 사진 위에만(2026-11-13 사용자 요청) */
.igs-art { position: relative; } .igs-art .ig-new { top: 3px; right: 3px; z-index: 1; }
.sr-sparks b { color: #ffc24d; text-shadow: 0 0 6px #fff, 0 0 12px #ffb3cf; } .sr-sparks b:nth-child(3n) { color: #ff9fc2; } .sr-sparks b:nth-child(4n) { color: #ffd98a; }
.igs-wrap { margin-top: 8px; } .igs-wrap > .ig-special { margin-top: 0; }

/* 연출 3판 손보기(2026-11-13): 반짝이는 손편지 단계에서만 · 부분 장면 뒤 컷신 영상(한 번) · 컷신 동안 큰 그림 UI 숨김 → 끝나면 서서히 */
.sr-sparks { transition: opacity .6s ease; }
.special-reveal:not([data-stage="letter"]) .sr-sparks { opacity: 0; }
.sr-video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; background: transparent; opacity: 0; transition: opacity .6s ease; }
.special-reveal[data-stage="scene"], .special-reveal[data-stage="return"] { background: transparent; cursor: default; }
.special-reveal[data-stage="scene"] .sr-video { opacity: 1; }
.special-reveal[data-stage="scene"] .sr-cut, .special-reveal[data-stage="return"] .sr-cut { opacity: 0; }
.special-reveal[data-stage="return"] > * { opacity: 0; }
.character-gallery.cutscene .gallery-header, .character-gallery.cutscene .gallery-bottom, .character-gallery.cutscene .gallery-arrow,
.character-gallery.cutscene #gallery-corner, .character-gallery.cutscene .gallery-letter { opacity: 0; pointer-events: none; }
.character-gallery.ui-returning .gallery-header, .character-gallery.ui-returning .gallery-bottom, .character-gallery.ui-returning .gallery-arrow,
.character-gallery.ui-returning #gallery-corner, .character-gallery.ui-returning .gallery-letter { transition: opacity 1.2s ease; }
#gallery-corner, .gallery-letter { transition: opacity .25s; }

/* 큰 그림 창이 9:16 보다 아주 조금만 길거나 넓을 때(예: PC 390×700): 그림·영상 위아래에 3~4px 어두운 띠가 남아, UI 가 사라지는 컷신에서 검은 선처럼 보였다(2026-11-13).
   비율 차이가 6% 안쪽이면 여백 없이 꽉 채운다(가장자리 3% 이내만 잘림). 차이가 크면 지금처럼 전체를 보이고 남는 곳은 흐린 그림. */
@container (min-aspect-ratio: 529 / 1000) and (max-aspect-ratio: 596 / 1000) {
  .gallery-fullscreen .gallery-media #gallery-image, .gallery-fullscreen .gallery-media #gallery-video,
  .gallery-fullscreen .gallery-media #gallery-letter, .sr-video, .sr-eye video { object-fit: cover; }
}

/* 컷신 → 반복 영상: 밑의 영상이 돌기 시작한 뒤에 컷신 마지막 장면이 걷히게(휴대폰 깜빡임 방지, 2026-11-13) */
.special-reveal[data-stage="return"] .sr-video { transition: opacity .7s ease .25s; }

/* 가입 창(2단계 가입, 2026-11-13) — 가입 없이 보던 사람이 게임·갤러리·결제를 누르면 뜬다 */
.join-body { padding: 16px 18px 18px; gap: 12px; }
.join-why { margin: 0 0 2px; padding: 11px 13px; border-radius: 9px; border: 1px solid #e2c27e55; background: #e2c27e14; color: #f0dcae; font-size: 13.5px; line-height: 1.55; }
.join-note { margin: 0; text-align: center; font-size: 12px; color: #a9a593; }
.join-body .err:empty { display: none; }
.site-header .btn-logout.is-join { color: #1d1608; background: linear-gradient(180deg, #f2dca3, #d9b76a); border-color: #e2c27e; font-weight: 700; }

/* 연출: 눈에서 시작해 전체로(2026-11-13) — 짧은 반복 영상을 크게 확대해 눈만 보이다가(위아래는 뽀얀 흰빛으로 가림) 서서히 넓어져 전체, 끝에 화사하게 번짐 */
.sr-eye { position: absolute; inset: 0; z-index: 1; overflow: hidden; opacity: 0; transition: opacity .6s ease; }
.special-reveal[data-stage="eye"] .sr-eye { opacity: 1; }
.sr-eye video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: brightness(1.05) saturate(1.05);
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--ez, 3.6)); }
.sr-eye.zoom video { transform: none; transition: transform 3s cubic-bezier(.5, 0, .15, 1); }
.sr-eye::before { content: ""; position: absolute; inset: 0; z-index: 1; transition: opacity 1.5s ease;
  background: linear-gradient(180deg, #fff 0%, #fff8fb 33%, #fff0 43%, #fff0 57%, #fff8fb 67%, #fff 100%); }
.sr-eye::after { content: ""; position: absolute; inset: 0; z-index: 1; transition: opacity 2.4s ease .5s;
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, #fff8 80%, #fff 100%); }
.sr-eye.zoom::before, .sr-eye.zoom::after { opacity: 0; }
.sr-flash.bloom { animation: srBloom 1.7s ease-out forwards; }
@keyframes srBloom { 0% { opacity: 0; } 16% { opacity: 1; } 34% { opacity: .92; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sr-eye.zoom video { transition: none; } .sr-flash.bloom { animation: none; } }
/* 즐겨찾기 별(큰 그림 ✕ 왼쪽, 2026-11-13 — 예전 '대표 스킨으로 설정' 버튼) */
.gallery-fav { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid #ffffff45; border-radius: 50%; background: #0004; color: #fff; font-size: 21px; line-height: 1;
  cursor: pointer; pointer-events: auto; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.gallery-fav[hidden] { display: none; }
/* 큰 그림을 열 때 ✕ 에 초점이 가서 생기던 노란 테두리 원 없앰(2026-11-14 사용자 요청) */
.gallery-close:focus-visible, .gallery-fav:focus-visible { outline: none; }
.gallery-fav.is-on { color: #ffd76a; border-color: #ffd76acc; background: #2a1f08b3; text-shadow: 0 0 10px #ffd76a99; }
.gallery-fav span { translate: 0 -1px; }
@media (hover: hover) and (pointer: fine) { .gallery-fav:hover { filter: brightness(1.2); } }
/* 메인: 즐겨찾기가 여럿이면 그림만 서서히 바뀐다(문구·버튼은 그대로) */
.intro-full .if-img, .intro-full .if-pic::before { transition: opacity .45s ease; }
.intro-full.is-swapping .if-img, .intro-full.is-swapping .if-pic::before { opacity: 0; }

/* 가입 창: 옆 스크롤바 없애기(2026-11-13 사용자 요청 — 이질적). 화면 높이까지 늘려 웬만하면 한 번에 다 보이고, 아주 낮은 화면(가로 휴대폰)만 막대 없이 끌어서 스크롤 */
.join-modal { max-height: calc(100dvh - 24px); scrollbar-width: none; -ms-overflow-style: none; }
.join-modal::-webkit-scrollbar { display: none; }
.join-modal .join-body { gap: 10px; padding-top: 14px; padding-bottom: 16px; }

/* 가입 전 '처음으로'(내 정보 맨 아래) */
.me-restart { width: 100%; margin-top: 8px; color: #b9b4a6; border-color: #ffffff22; }
.me-restart.is-armed { color: #ffb4a8; border-color: #ff8a7a88; }
.me-restart-msg { text-align: center; color: #e2b8b0; }

/* 첫 화면(2026-11-13): 큰 버튼 하나 + 아래 작은 '로그인'. 로그인·정보 입력은 그림 위에 뜨는 창 */
#s-welcome .welcome-go { width: 100%; }
#s-welcome .welcome-login { margin: 10px 0 0; color: #e9e1cf; text-shadow: 0 1px 6px #000c; }
.entry-modal { width: min(calc(100vw - 24px), 420px); max-height: calc(100dvh - 24px); scrollbar-width: none; -ms-overflow-style: none; }
.entry-modal::-webkit-scrollbar { display: none; }
.entry-body { padding: 14px 18px 18px; }
.entry-sub { margin: 0; font-size: 12.5px; line-height: 1.6; color: #b9b4a6; }
.entry-footer { margin: 0; font-size: 10.5px; line-height: 1.6; color: #7f8a7f; text-align: center; }
.entry-modal .cta-bar { padding-top: 2px; }
.entry-modal .cta-bar .btn { box-shadow: none; }
.entry-modal .err:empty { display: none; }
/* 계정 메뉴(2026-11-13): 오른쪽 위 버튼 대신 가운데 이름 ▾ → 바로 아래로 펼쳐지는 작은 메뉴 */
.site-header .btn-logout { display: none !important; }
/* 이름은 헤더 오른쪽 끝(예전 로그아웃 자리), 메뉴도 오른쪽에 맞춰 펼침 */
.site-header .header-who.is-menu { left: auto; right: 14px; translate: 0 -50%; align-items: center; max-width: calc(100% - 190px); }
.site-header .who-menu { left: auto; right: 14px; translate: none; }
.site-header .who-menu::before { left: auto; right: 26px; translate: none; }
.site-header .header-who.is-menu { cursor: pointer; pointer-events: auto; padding: 4px 10px; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
.site-header .header-who.is-menu { flex-direction: column; }
.site-header .header-who.is-menu b { display: inline-flex; align-items: center; gap: 5px; }
.site-header .header-who.is-menu b::after { content: ""; flex: none; width: 6px; height: 6px; margin-top: -3px; border-right: 1.6px solid #d6b886; border-bottom: 1.6px solid #d6b886; rotate: 45deg; transition: rotate .2s; }
.site-header .header-who.is-menu[aria-expanded="true"] b::after { rotate: 225deg; margin-top: 3px; }
.site-header .header-who.is-menu[aria-expanded="true"] { background: #ffffff0d; }
@media (hover: hover) and (pointer: fine) { .site-header .header-who.is-menu:hover { background: #ffffff0a; } }
.who-menu { position: absolute; left: 50%; top: calc(100% - 6px); translate: -50% 0; z-index: 30; width: 220px; padding: 8px;
  border: 1px solid #cbb58455; border-radius: 12px; background: #161d19f5; box-shadow: 0 16px 40px #000b;
  display: flex; flex-direction: column; animation: wm-in .16s ease; }
.who-menu[hidden] { display: none; }
@keyframes wm-in { from { opacity: 0; } to { opacity: 1; } }
.who-menu::before { content: ""; position: absolute; top: -6px; left: 50%; width: 10px; height: 10px; translate: -50% 0; rotate: 45deg;
  background: #161d19; border-left: 1px solid #cbb58455; border-top: 1px solid #cbb58455; }
.who-menu .wm-guest, .who-menu .wm-member { display: flex; flex-direction: column; gap: 2px; }
.who-menu[data-guest="true"] .wm-member, .who-menu:not([data-guest="true"]) .wm-guest { display: none; }
.wm-item { width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; background: none; color: #e7e1cf; font: 400 14px 'Noto Sans KR', sans-serif; text-align: left; cursor: pointer; }
.wm-item.wm-primary { color: #f0d79c; font-weight: 700; }
.wm-item:disabled { opacity: .5; }
@media (hover: hover) and (pointer: fine) { .wm-item:hover { background: #ffffff10; } }
.wm-note { margin: 4px 0 2px; padding: 8px 12px 2px; border-top: 1px solid #ffffff14; font-size: 11.5px; line-height: 1.5; color: #a9a593; }
.wm-id { margin: 0; padding: 6px 12px 8px; border-bottom: 1px solid #ffffff14; font-size: 12px; color: #a9a593; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-menu { width: min(calc(100vw - 32px), 340px); }
.gm-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.gm-body .btn { width: 100%; }
.gm-body .btn.is-armed { color: #ffb4a8; border-color: #ff8a7a88; }
.gm-msg { margin: 0; min-height: 1em; text-align: center; font-size: 12.5px; line-height: 1.5; color: #e2b8b0; }
.gm-msg:empty { display: none; }
/* 가입 전 잠금 표시: 갤러리·게임·결제·다른 사주 — 누르면 가입 창 */
/* (2026-11-16 사용자 요청 "확실히 잠겨서 못 쓰는 느낌") 오른쪽 위 작은 배지 대신 — 버튼 전체를 어두운 막이 덮고 가운데 큰 자물쇠, 글자는 막 아래로 흐리게 */
body[data-guest="true"] :is(#btn-main-gallery, #intro-skin, .lk-game, .lk-buy, #pw-game, #pw-buy) { position: relative; overflow: hidden; filter: saturate(.35); }
body[data-guest="true"] :is(#btn-main-gallery, #intro-skin, .lk-game, .lk-buy, #pw-game, #pw-buy)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: url("img/common/actions/locked-padlock.webp") center / 26px no-repeat, repeating-linear-gradient(135deg, rgba(0,0,0,.2) 0 6px, transparent 6px 12px), rgba(8,10,14,.74);
  box-shadow: inset 0 0 0 1px #d6b88655; animation: none; }
body[data-guest="true"] :is(.lk-game, .lk-buy) .lk-ic { opacity: 0; } /* 버튼 안 원래 그림(자물쇠·게임패드)은 숨김 — 가운데 큰 자물쇠와 겹치지 않게 */
body[data-guest="true"] #tabbar :is([data-tab="gallery"], [data-tab="play"]) { position: relative; } /* 게임·갤러리 탭: 아이콘·글자를 흐리게 + 아이콘 자리에 큰 자물쇠 */
body[data-guest="true"] #tabbar :is([data-tab="gallery"], [data-tab="play"]) > * { opacity: .28; }
body[data-guest="true"] #tabbar :is([data-tab="gallery"], [data-tab="play"])::after { content: ""; position: absolute; top: 6px; left: 50%; width: 26px; height: 26px; transform: translateX(-50%);
  border-radius: 50%; background: #11151a url("img/common/actions/locked-padlock.webp") center / 17px no-repeat; box-shadow: 0 0 0 1.5px #d6b886aa, 0 2px 6px rgba(0,0,0,.5); pointer-events: none; }
.theme-card.is-locked { filter: saturate(.45) brightness(.7); }
.theme-card.is-locked .tb img { width: 14px; height: 14px; vertical-align: -2px; }
#theme-switch .is-locked, .me-saju.is-locked { opacity: .6; }
#theme-switch .is-locked i img { width: 12px; height: 12px; vertical-align: -1px; }
.me-saju.is-locked em img { width: 12px; height: 12px; vertical-align: -1px; }
.gm-msg { color: #a9a593; font-size: 12px; }

/* 가입 전 안내(2026-11-13): 사주 고르기 위 · 풀이 아래 결제 칸 */
.theme-guest { margin: 0 0 12px; padding: 11px 13px; border-radius: 9px; border: 1px solid #e2c27e44; background: #e2c27e10; color: #e8dcc0; font-size: 13px; line-height: 1.6; }
.theme-guest[hidden] { display: none; }
.theme-guest img { width: 14px; height: 14px; vertical-align: -2px; }
.theme-guest .tg-join { padding: 0; border: 0; background: none; color: #f2d48a; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pw-guest { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 6px; padding: 12px; border-radius: 9px; border: 1px solid #e2c27e44; background: #e2c27e10; color: #e8dcc0; font-size: 13px; line-height: 1.6; text-align: center; }
.pw-guest > img { width: 18px; height: 18px; }
.pw-guest .btn { width: 100%; }
body[data-guest="true"] .pw-guest .btn { filter: none; }

/* 첫 화면·로그인 창의 '로그인 · 회원가입' 글씨 링크 사이 점, 회원가입 모드에서만 보이는 아이디·비밀번호 칸(2026-11-14) */
.form-switch .fs-dot { margin: 0 6px; font-style: normal; color: #8f8a78; }
#guest-modal:not([data-mode="signup"]) .signup-only { display: none; }
#s-welcome .welcome-login.welcome-signup { margin-top: 4px; }
/* 계정 메뉴 맨 위 내 정보 · 가입 창의 '이 정보로 가입돼요' (2026-11-14) */
.wm-info { display: flex; flex-direction: column; gap: 3px; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid #ffffff14; }
.wm-info:empty { display: none; }
.wm-info b, .js-info b { font: 700 15px/1.3 'Gowun Batang', serif; color: #f0d79c; }
.wm-info span, .js-info span { font-size: 12.5px; color: #d9d3c2; }
.wm-info small, .js-info small { font-size: 11.5px; color: #a9a593; }
.who-menu { width: 240px; }
.join-save { margin: 2px 0 4px; padding: 12px 14px; border: 1px solid #d6b88655; border-radius: 10px; background: #d6b8860d; }
.join-save .js-head { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: #e2c27e; }
.js-info { display: flex; flex-direction: column; gap: 3px; }
.js-info small { display: none; }
.join-save .js-warn { margin: 8px 0 0; font-size: 12px; line-height: 1.55; color: #e2b8b0; }
.join-save .js-warn button { padding: 0; border: 0; background: none; color: #f0d79c; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* 눈 장면 → 컷신(2026-11-14, 반짝임 없이 이어지게): 컷신 영상이 위에서 서서히 덮는 동안 눈 장면(마지막 전체 화면)은 그대로 아래에 둔다 — 사이에 바탕색이 비치지 않게 */
.special-reveal[data-stage="scene"] .sr-eye { opacity: 1; }
.special-reveal[data-stage="scene"] .sr-video { z-index: 2; }
.special-reveal[data-stage="return"] .sr-eye { opacity: 0; transition: none; }
/* 위아래 빈 띠도 이어지게(2026-11-14): 연분홍 바탕을 겹(::before)으로 옮겨, 눈 장면이 넓어지는 동안 서서히 걷어 내고
   컷신 때 보이는 갤러리의 흐린 바탕이 미리 드러나게 한다(예전엔 컷신 시작 순간 한 번에 바뀌던 것을 반짝임이 가려 줬음) */
.special-reveal { background: none; }
.special-reveal::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity 2s ease .6s;
  background: radial-gradient(130% 95% at 50% 38%, #fff 0%, #fff7fb 42%, #ffe9f2 74%, #ffe6cf 100%); }
.special-reveal[data-stage="eye"]:has(.sr-eye.zoom)::before, .special-reveal[data-stage="scene"]::before, .special-reveal[data-stage="return"]::before { opacity: 0; }

/* 눈 깜빡임 한 장면 → 컷신(2026-11-14 최종): 겹쳐 비치면 확대된 눈이 몸 위에 남아 어색해서, 눈이 하얀 여백 속으로 스며 사라진 뒤(0.45초)
   컷신과 갤러리 흐린 바탕이 함께 떠오른다(0.3초 뒤부터 0.7초). 반짝임(bloom) 없음 */
.special-reveal[data-stage="scene"] .sr-eye { opacity: 0; transition: opacity .45s ease; }
.special-reveal[data-stage="scene"] .sr-video { transition: opacity .7s ease .3s; }
.special-reveal[data-stage="scene"]::before { opacity: 0; transition: opacity .7s ease .3s; }

/* 연출 = 손편지 문구 → 바로 컷신(2026-11-14 사용자 요청: 부분 장면·눈 장면 없앰, 끊김 없이).
   문구는 나타날 때처럼 사라질 때도 서서히(예전엔 fade 단계에서 애니메이션이 빠지며 뚝 사라졌음) — 0.9초에 걸쳐 흐려지며 사라지고 반짝이도 같이. */
.special-reveal[data-stage="fade"] .sr-msg { opacity: 0; animation: srMsgOut .9s ease both; }
@keyframes srMsgOut { from { opacity: 1; filter: none; transform: none; } to { opacity: 0; filter: blur(6px); transform: scale(1.02); } }
.special-reveal[data-stage="fade"] .sr-sparks { opacity: 0; transition: opacity .9s ease; }
@media (prefers-reduced-motion: reduce) { .special-reveal[data-stage="fade"] .sr-msg { animation: none; transition: opacity .6s ease; } }

/* 문구가 다 사라진 뒤: 연분홍 바탕에서 컷신 영상과 갤러리 흐린 바탕이 함께 0.8초에 걸쳐 떠오름(지연 없음 — 눈 장면이 없어졌으므로) */
.special-reveal[data-stage="scene"] .sr-video { transition: opacity .8s ease; }
.special-reveal[data-stage="scene"]::before { transition: opacity .8s ease; }

/* 갤러리 목록 칸의 별(2026-11-14): 열린 칸 왼쪽 위 동그란 별 — ☆ 누르면 즐겨찾기(★ 금색), 다시 누르면 해제. 큰 그림에 안 들어가도 됨 */
.ig-fav { position: absolute; top: 4px; left: 4px; z-index: 2; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: #0d0f0cb3; box-shadow: 0 0 0 1px #ffffff40; color: #f1e7cf; font: 400 13px/1 'Noto Sans KR', sans-serif; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.ig-fav.on { background: linear-gradient(180deg, #f6dc9a, #d6b05e); color: #2a2216; box-shadow: 0 0 0 1px #fff6, 0 2px 8px #0008; }
.ig-fav::after { content: ""; position: absolute; inset: -7px; } /* 손가락으로 누르기 쉽게 누르는 범위만 넓힘 */
@media (hover: hover) and (pointer: fine) { .ig-fav:not(.on):hover { background: #1d211bd9; color: #f6dc9a; } }
.igs-art .ig-fav { top: 3px; left: 3px; }


/* 즐겨찾기 표시가 칸 크기를 바꾸지 않게(2026-11-14 사용자 지적: 스페셜 칸 높이가 달라짐) — 테두리 굵기는 그대로, 굵어 보이는 건 안쪽 그림자로 */
#app .ig-special.is-rep { border-width: 1.5px; box-shadow: inset 0 0 0 1px #f0d5a3, 0 0 0 2px color-mix(in srgb, var(--tc) 55%, transparent), 0 0 18px #f0d5a399; }
#app .ig-cell.is-rep, #app .ig-cell.is-rep:hover { border-width: 1px; box-shadow: inset 0 0 0 1px #f0d5a3; }
/* 풀이 첫 그림도 즐겨찾기를 차례로(2026-11-14): 바뀔 때 그림만 0.45초 서서히 */
.rd-portrait { transition: opacity .45s ease; }
.rd-portrait.is-swapping { opacity: 0; }
/* 회원가입 창 경고(2026-11-14): 생년월일·성별·태어난 시간은 가입 뒤 못 바꿈 */
.entry-warn { margin: 0; padding: 10px 12px; border: 1px solid #e2a89a66; border-radius: 8px; background: #e2a89a14; color: #f1c4b8; font-size: 12.5px; line-height: 1.55; }

/* 사주 PDF 소장 카드(2026-11-14): 풀이 맨 아래 결제 칸 다음 — 금빛 테두리 카드 한 줄 */
.pdf-keep { display: flex; align-items: center; gap: 12px; width: 100%; margin: 14px 0 4px; padding: 14px 14px; border: 1px solid #d6b88680; border-radius: 12px;
  background: linear-gradient(120deg, #2a2418, #16130f 75%); color: #f1e7cf; font: inherit; text-align: left; cursor: pointer; position: relative; }
.pdf-keep:disabled { opacity: .7; cursor: progress; }
.pdf-keep .pk-ic { flex: none; width: 40px; height: 48px; display: grid; place-items: center; border-radius: 5px; background: #f7efdf; color: #a3302e;
  font: 900 11px/1 'Noto Sans KR', sans-serif; letter-spacing: .5px; box-shadow: inset 0 -10px 0 #ead9b8; }
.pdf-keep .pk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pdf-keep .pk-txt b { font: 700 15px/1.3 'Gowun Batang', serif; color: #f6e2b0; }
.pdf-keep .pk-txt small { font-size: 12px; color: #b9b09a; }
.pdf-keep .pk-go { flex: none; font-size: 22px; color: #d6b886; }
@media (hover: hover) and (pointer: fine) { .pdf-keep:not(:disabled):hover { border-color: #e2c27e; } }
body[data-guest="true"] #btn-pdf { overflow: hidden; }
body[data-guest="true"] #btn-pdf::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: url("img/common/actions/locked-padlock.webp") center / 34px no-repeat, repeating-linear-gradient(135deg, rgba(0,0,0,.18) 0 6px, transparent 6px 12px), rgba(8,10,14,.62); box-shadow: inset 0 0 0 1px #d6b88655; } /* 카드 전체를 덮는 잠금 막 + 큰 자물쇠 */


/* 게임 중 표시(2026-11-14 사용자 요청: % · 시간 · 목숨이 더 잘 보이게) — 진한 바탕 + 큰 숫자, 열림 %는 금색, 하트 크게 */
#s-game .hud { background: #0b0a0ee6; border: 1px solid #d6b88666; padding: 8px 14px 8px 10px; box-shadow: 0 6px 18px #0007; }
#s-game .hud-l { font-size: 12.5px; color: #d9c9a4; letter-spacing: .5px; }
#s-game .hud b { font-size: 30px; line-height: 1.15; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #000; }
#s-game #hud-score { color: #f6d98f; }
#s-game #hud-lives img.ci { height: 28px; margin: 0 1.5px; }
#s-game .hud-exit { width: 40px; height: 40px; }
@media (max-height: 720px) { #s-game .hud b { font-size: 24px; } #s-game #hud-lives img.ci { height: 23px; } }
#s-game #hud-lives { display: flex; justify-content: center; white-space: nowrap; }
#s-game #hud-lives img.ci { height: 25px; margin: 0 1px; }
#s-game #hud-lives-box { flex: 1.3; }

/* 게임 안 광고판(2026-11-14): 게임 화면 맨 아래 띠(판 아래). 칸들은 겹쳐 두고 'on' 만 서서히 보임 — 뚝 바뀌지 않게 */
.ad-slot { position: relative; flex: none; height: 56px; border-radius: 12px; overflow: hidden; border: 1px solid #d6b88655;
  background: linear-gradient(110deg, #231d14, #120f0c 70%); box-shadow: 0 4px 14px #0006; }
.ad-slot[hidden] { display: none; }
.ad-label { position: absolute; top: 4px; right: 8px; z-index: 2; font-size: 9px; font-weight: 700; letter-spacing: .5px; color: #a8987a; pointer-events: none; }
.ad-label:empty { display: none; }
.ad-track { position: absolute; inset: 0; }
.ad-item { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 14px; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.ad-item.on { opacity: 1; pointer-events: auto; }
.ad-item.has-link { cursor: pointer; }
.ad-item.is-media { padding: 0; }
.ad-item.is-media img, .ad-item.is-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d6b88622; font-size: 18px; color: #f0d79c; }
.ad-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-txt b { font: 700 14px/1.25 'Gowun Batang', serif; color: #f6e2b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-txt small { font-size: 11.5px; color: #b9b09a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 720px) { .ad-slot { height: 46px; } .ad-ic { width: 28px; height: 28px; font-size: 15px; } .ad-txt b { font-size: 13px; } .ad-txt small { font-size: 10.5px; } }
/* 마지막 즐겨찾기(기본 모습)를 끄려 하면 살짝 흔들림 */
.ig-fav.is-shake { animation: favShake .45s ease; }
@keyframes favShake { 20%, 60% { translate: -2px 0; } 40%, 80% { translate: 2px 0; } }

/* 내 사주 PDF 모아 보기(2026-11-14): 사주 고르기 화면 맨 아래 카드 — 사주 칩(기본 모두 켬) + 보기 / 내려받기 */
.pdf-book { margin-top: 16px; padding: 16px; border: 1px solid #d6b88680; border-radius: 14px; background: linear-gradient(120deg, #2a2418, #16130f 75%); position: relative; }
.pdf-book .pb-head { display: flex; align-items: center; gap: 12px; }
.pdf-book .pk-ic { flex: none; width: 40px; height: 48px; display: grid; place-items: center; border-radius: 5px; background: #f7efdf; color: #a3302e;
  font: 900 11px/1 'Noto Sans KR', sans-serif; letter-spacing: .5px; box-shadow: inset 0 -10px 0 #ead9b8; }
.pdf-book .pb-head > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pdf-book .pb-head b { font: 700 15.5px/1.3 'Gowun Batang', serif; color: #f6e2b0; }
.pdf-book .pb-head small { font-size: 12px; color: #b9b09a; }
/* (2026-11-18 사용자 요청) 고른 사주가 한눈에 — 고름: 사주 색 테두리·바탕 + ✓ 동그라미 / 안 고름: 흐린 점선 + 빈 동그라미 */
.pb-count { margin: 14px 0 8px; font-size: 12px; text-align: center; color: #b9b09a; letter-spacing: .2px; }
.pb-count b { color: #f6e2b0; font-size: 14px; margin-right: 1px; }
.pb-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.pb-chip { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; border-radius: 12px; border: 1px dashed #ffffff26;
  background: #ffffff05; color: #8d8977; font: 700 13px/1.2 'Noto Sans KR', sans-serif; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
.pb-chip .ticon { width: 18px; height: 18px; opacity: .35; filter: grayscale(.8); transition: opacity .2s, filter .2s; }
.pb-chip .pb-ck { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #ffffff3a; display: grid; place-items: center;
  font: 900 10px/1 'Noto Sans KR', sans-serif; color: transparent; transition: background-color .2s, border-color .2s, color .2s, transform .25s; }
.pb-chip.on { border: 1px solid color-mix(in srgb, var(--tc) 80%, #fff3); background: color-mix(in srgb, var(--tc) 22%, transparent); color: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tc) 30%, transparent), 0 6px 18px -8px var(--tc); }
.pb-chip.on .ticon { opacity: 1; filter: none; }
.pb-chip.on .pb-ck { background: var(--tc); border-color: var(--tc); color: #fff; animation: pbCk .3s ease-out; }
.pb-chip.on .pb-ck::before { content: "✓"; }
@keyframes pbCk { from { transform: scale(.4); } 60% { transform: scale(1.2); } to { transform: scale(1); } }
/* 버튼 두 줄: 위 = 금박 주 버튼(모아 보기), 아래 = 금테 보조 버튼(내려받기) */
.pb-btns { display: grid; grid-template-columns: 1fr; gap: 9px; }
.pb-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px;
  cursor: pointer; font: 700 15px/1 'Gowun Batang', serif; letter-spacing: .3px; transition: filter .2s, box-shadow .2s, background-color .2s, border-color .2s; overflow: hidden; }
.pb-btn .pb-bi { font-size: 13px; opacity: .85; }
.pb-main { border: 1px solid #fff1c8; color: #3a2a10;
  background: linear-gradient(180deg, #fff3cf 0%, #f2d38c 45%, #d9a94e 100%);
  box-shadow: inset 0 1px 0 #ffffffb0, inset 0 -2px 0 #b9862f66, 0 8px 22px -10px #f2c25c, 0 0 0 1px #8a6a2a55; text-shadow: 0 1px 0 #fff6dc90; }
.pb-main:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 #ffffffb0, inset 0 -2px 0 #b9862f66, 0 10px 26px -10px #f2c25c, 0 0 0 1px #8a6a2a77; }
.pb-sub { border: 1px solid #d6b88699; color: #f3dfb1; background: linear-gradient(180deg, #2e271b, #1b1710); box-shadow: inset 0 1px 0 #ffffff14, inset 0 0 0 1px #00000040; }
.pb-sub .pb-bi { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #d6b88699; font-size: 11px; }
.pb-sub:hover { border-color: #f2d38c; color: #fff1cf; }
.pb-btn:disabled { cursor: default; filter: grayscale(.7) brightness(.7); box-shadow: none; }
.pb-msg { margin: 8px 0 0; min-height: 0; font-size: 12px; text-align: center; color: #b9b09a; }
.pb-msg:empty { display: none; }
body[data-guest="true"] #pdf-book { overflow: hidden; }
body[data-guest="true"] #pdf-book::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: url("img/common/actions/locked-padlock.webp") center / 34px no-repeat, repeating-linear-gradient(135deg, rgba(0,0,0,.18) 0 6px, transparent 6px 12px), rgba(8,10,14,.62); box-shadow: inset 0 0 0 1px #d6b88655; } /* 카드 전체를 덮는 잠금 막 + 큰 자물쇠 */
/* PDF 보기 창: 전체 화면(앱 폭), 위 머리글 + 쪽들을 세로로 */
.pdf-viewer { width: min(100vw, var(--app-width, 480px)); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: auto; padding: 0; border: 0;
  background: #1a1714; color: #e7e1cf; overflow: hidden; }
.pdf-viewer[open] { display: flex; flex-direction: column; }
.pdf-viewer::backdrop { background: #000c; }
.pv-head { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 10px 8px 16px; border-bottom: 1px solid #ffffff14; background: #110f0d; }
.pv-head b { flex: 1; min-width: 0; font: 700 15px/1.3 'Gowun Batang', serif; color: #f6e2b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-save { flex: none; padding: 7px 12px; border-radius: 16px; border: 1px solid #d6b88699; background: #d6b8861a; color: #f0d79c; font: 700 12.5px/1 'Noto Sans KR', sans-serif; cursor: pointer; }
.pv-save:disabled { opacity: .4; cursor: default; }
.pv-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 10px calc(env(safe-area-inset-bottom) + 16px); -webkit-overflow-scrolling: touch; }
.pv-wait { margin: 40px 0; text-align: center; font-size: 13px; color: #b9b09a; }
.pv-wait[hidden] { display: none; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pv-page { display: block; max-width: 100%; height: auto; border-radius: 3px; box-shadow: 0 4px 16px #0008; background: #fbf7f0; }
.pv-zoom { margin-right: 2px; }
.pv-body { overflow-x: auto; }
/* PDF 보기 창 스크롤바 숨김(2026-11-14 사용자 요청) — 스크롤은 그대로(손가락·휠·PC 끌기) */
.pv-body { scrollbar-width: none; -ms-overflow-style: none; }
.pv-body::-webkit-scrollbar { display: none; width: 0; height: 0; }
.pv-pages.is-zoom { align-items: flex-start; width: max-content; }

/* 하는 법 움짤(2026-11-14): 움직이는 작은 판(260×150)이 들어가게 카드를 조금 키움 — 카드 크기는 단계와 상관없이 고정 */
.tut-card { height: auto; min-height: 436px; } /* (2026-11-17) 긴 설명이 두 줄로 넘어가면 카드가 그만큼만 늘어남(버튼이 카드 밖으로 안 나가게) */
.tut-visual { height: 156px; }
.tut-visual.is-demo canvas.tut-demo { display: block; width: 260px; height: 150px; max-width: 100%; border-radius: 10px; box-shadow: 0 8px 22px #0009; }
@media (max-height: 560px) { .tut-card { height: auto; } .tut-visual { height: 118px; } .tut-visual.is-demo canvas.tut-demo { width: 204px; height: 118px; } }

/* 게임 단계 고르기(2026-11-15 다시): 칸 아래 상태 글씨(다시 하기 · 도전 · 잠김) + 잠긴 칸의 자물쇠 */
.gp-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.gp-tag { font-style: normal; font-size: 10.5px; line-height: 1.2; color: #b9b29d; white-space: nowrap; }
.gp-cell.is-new .gp-tag { color: #f1d898; font-weight: 700; }
.gp-cell.is-on .gp-tag { color: #ffe08a; }
.gp-cell.is-locked .gp-pic img { width: 26px; height: 26px; object-fit: contain; }

/* ===== 사이트 전체 인터랙티브 효과(2026-11-15, fx.js) — 호버로는 아무것도 안 움직임, 나타날 때는 서서히, '동작 줄이기'면 꺼짐 ===== */
/* 스크롤하면 떠오르기(화면 밖에 있던 것만) · 화면이 바뀔 때 차례로 나타나기 — 위치 이동 대신 투명도 + 아주 살짝 커지기(스크롤바가 생기지 않게) */
.fx-rv { opacity: 0; transform: scale(.975); }
.fx-rv.fx-in { opacity: 1; transform: none; transition: opacity .5s ease var(--fx-d, 0ms), transform .5s cubic-bezier(.2,.7,.3,1) var(--fx-d, 0ms); }
.fx-enter { animation: fxEnter .45s cubic-bezier(.2,.7,.3,1) var(--fx-d, 0ms) both; }
@keyframes fxEnter { from { opacity: 0; transform: scale(.975); } to { opacity: 1; transform: none; } }
/* 누르면 물결 */
.fx-rp { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.fx-rp i { position: absolute; border-radius: 50%; background: radial-gradient(circle, #ffffff55 0%, #ffffff22 40%, transparent 70%); transform: scale(0); animation: fxRipple .6s ease-out forwards; }
@keyframes fxRipple { to { transform: scale(1); opacity: 0; } }
/* 아래 탭: 지금 탭이 바뀌면 아이콘이 톡 */
#tabbar button[aria-current="page"] svg { animation: fxPop .38s cubic-bezier(.3,1.6,.5,1); }
@keyframes fxPop { 0% { transform: scale(.8); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
/* 결과 점수: 다 센 뒤 한 번 톡 */
.fx-bump { animation: fxPop .4s cubic-bezier(.3,1.6,.5,1); }
/* 꽃가루 */
.fx-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
/* 주요 버튼에 4.5초마다 빛이 한 번 스쳐 지나감 */
.fx-shine { position: relative; overflow: hidden; isolation: isolate; }
.fx-shine::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%; pointer-events: none; z-index: 1;
  background: linear-gradient(100deg, transparent 0%, #ffffff00 20%, #ffffff66 50%, #ffffff00 80%, transparent 100%); transform: skewX(-18deg); animation: fxShine 4.5s ease-in-out 1.2s infinite; }
@keyframes fxShine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.fx-shine:disabled::after { animation: none; }
/* 열린 창(나가기 확인·풀이 열림 알림·하는 법)이 살짝 커지며 나타남 */
.leave-bg:not([hidden]) > *, .unlock-pop-bg:not([hidden]) .unlock-pop, .gi-tut:not([hidden]) .tut-card { animation: fxPopIn .32s cubic-bezier(.2,.9,.3,1.15); }
@keyframes fxPopIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fx-rv { opacity: 1; transform: none; } .fx-shine::after { display: none; } }

/* 게임 광고판 = 모바일 게임 배너처럼(2026-11-15 사용자 요청): 좌우 여백 없이 꽉 차고 맨 아래에 붙음(main.js fitAdSlot), 둥근 모서리·옆 테두리 없음, 위에 얇은 금빛 줄,
   왼쪽 위 작은 표시 띠(광고 / 사주캐치), 아이폰 아래 안전 영역만큼 안쪽 여백 */
.ad-slot { border-radius: 0; border: 0; border-top: 1px solid #d6b88666; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(180deg, #1d1524, #120d18); box-shadow: 0 -6px 18px #0006; }
.ad-slot .ad-track { inset: 0 0 env(safe-area-inset-bottom) 0; }
.ad-label { top: 0; left: 0; right: auto; padding: 2px 6px; border-radius: 0 0 6px 0; background: #d6b886; color: #2a1d05; font-size: 9px; letter-spacing: .3px; }
.ad-item { padding: 0 16px 0 20px; }
@media (max-height: 720px) { .ad-slot { height: calc(50px + env(safe-area-inset-bottom)); } }

/* 휴대폰 게임 화면 깔끔하게(2026-11-15 사용자 요청): 실제 게임 중엔 위 사이트 머리글을 숨기고 그만큼 판을 키움(✕ 는 위 표시 줄에 있음),
   위 표시 줄·판·광고판 사이 간격을 촘촘하게. PC(마우스)는 그대로 */
@media (pointer: coarse), (max-width: 599px) {
  body[data-screen="s-game"][data-game-playing="true"] .site-header { display: none; }
  body[data-screen="s-game"][data-game-playing="true"] #s-game { height: calc(var(--vh) - env(safe-area-inset-bottom)); padding-top: calc(8px + env(safe-area-inset-top)); gap: 6px; }
  body[data-screen="s-game"][data-game-playing="true"] #s-game .hud { padding: 6px 12px 6px 8px; border-radius: 12px; }
  body[data-screen="s-game"][data-game-playing="true"] #s-game .stage { border-radius: 0; background: transparent; border-color: transparent; box-shadow: none; } /* 판 둘레의 빈 상자 테두리 없이 판만 */
}

/* 휴대폰 브라우저 기본 '당겨서 새로고침'·화면 튕김 막기(2026-11-15 실기기 제보: 게임 중 아래로 끌다가 새로고침 동그라미가 돌고 게임이 끝남)
   — 바깥(html)까지 막고, 게임 화면에선 어떤 끌기도 브라우저가 가져가지 못하게 */
html, body { overscroll-behavior: none; }
body[data-screen="s-game"], body[data-screen="s-game"] #app, body[data-screen="s-game"] #s-game { touch-action: none; overscroll-behavior: none; }

/* 게임 끝 문구(2026-11-15 사용자 요청: 뚝 나타나지 않게) — 흐릿하고 크게 벌어진 글자가 모이며 서서히, 끝나기 전 서서히 사라짐. 게임 오버는 붉게, 조금 더 천천히 */
.cd-end { display: inline-block; animation: cdEndIn .7s cubic-bezier(.2, .8, .2, 1) both; }
.cd-end.is-over { color: #ff6b7a; text-shadow: 0 0 22px rgba(255, 40, 70, .65), 0 0 30px #000; animation-duration: 1.1s; }
.cd-end.out { animation: cdEndOut .38s ease-in forwards; }
@keyframes cdEndIn { from { opacity: 0; transform: scale(1.4); filter: blur(10px); letter-spacing: .35em; } to { opacity: 1; transform: none; filter: none; letter-spacing: 0; } }
@keyframes cdEndOut { to { opacity: 0; transform: scale(.94); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) { .cd-end, .cd-end.out { animation: none; } }
/* 목숨을 잃으면 위 목숨 칸에서(2026-11-15 사용자 요청 — 판 안 💔 대신): 그 하트가 크게 튀어 깨진 하트로 흔들리다 흐려지고 '-1' 이 떨어짐, 잃은 자리는 흐린 깨진 하트 */
#hud-lives .hb { position: relative; display: inline-flex; }
#hud-lives .hb img.ci { opacity: .28; filter: grayscale(1); }
#hud-lives .hb.is-new img.ci { animation: hbBreak 1.1s ease-out both; }
#hud-lives .hb i { position: absolute; left: 50%; top: 2px; font-style: normal; font-weight: 900; font-size: 15px; color: #ff6b7a; text-shadow: 0 0 6px #000, 0 0 2px #000; pointer-events: none; animation: hbNum 1.1s ease-out both; }
@keyframes hbBreak {
  0% { opacity: 1; filter: drop-shadow(0 0 10px #ff3b5c); transform: scale(1.75); }
  18% { transform: scale(1.3) rotate(-14deg); }
  32% { transform: scale(1.32) rotate(11deg); }
  46% { opacity: 1; filter: drop-shadow(0 0 6px #ff3b5c); transform: scale(1.18) rotate(-5deg); }
  100% { opacity: .28; filter: grayscale(1); transform: none; }
}
@keyframes hbNum { 0% { opacity: 0; transform: translate(-50%, 4px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 10px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, 30px); } }
@media (prefers-reduced-motion: reduce) { #hud-lives .hb.is-new img.ci, #hud-lives .hb i { animation: none; } #hud-lives .hb i { display: none; } }

/* 게임 모음(아래 탭 '게임', 2026-11-15): 캐릭터 카드 — 왼쪽 그림 · 가운데 이름·진행 · 오른쪽 [도전] */
#s-play .ig-head { margin-top: 8px; }
.play-list { display: grid; gap: 12px; }
.play-card { position: relative; display: flex; align-items: stretch; gap: 12px; width: 100%; min-height: 112px; padding: 0; text-align: left; overflow: hidden; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--tc) 45%, #6a5838); border-radius: 16px; color: #efe3c8;
  background: linear-gradient(100deg, color-mix(in srgb, var(--tc) 22%, #1a1420), #15111b 70%); box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.play-card .pc-art { flex: 0 0 84px; position: relative; overflow: hidden; }
.play-card .pc-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transform: scale(1.35); transform-origin: 50% 10%;
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.play-card .pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 0; }
.play-card .pc-body small { font-size: 11px; color: color-mix(in srgb, var(--tc) 70%, #e8d9b8); letter-spacing: .02em; }
.play-card .pc-body b { font: 400 19px 'Gowun Batang', serif; color: #f3e6c8; }
.play-card .pc-prog { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #cdbd9a; }
.play-card .pc-dots { display: inline-flex; gap: 4px; }
.play-card .pc-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--tc) 60%, #b89a62); background: transparent; }
.play-card .pc-dots i.on { background: var(--tc); box-shadow: 0 0 6px var(--tc); }
.play-card .pc-body em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-card .pc-go { align-self: center; flex: 0 0 auto; margin-right: 12px; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #2a1d05;
  background: linear-gradient(180deg, #f0d9a0, #c9a463); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.play-card.is-done .pc-go { color: #efe3c8; background: transparent; border: 1px solid color-mix(in srgb, var(--tc) 55%, #8a7448); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .play-card:hover { filter: brightness(1.08); } }

/* (2026-11-15) 풀이를 모두 열면 맨 아래 상자 숨김 — .card 의 display 가 [hidden] 을 덮어써 빈 상자가 남았음 */
#paywall[hidden] { display: none !important; }

/* (2026-11-16 사용자 요청) 스페셜 연출 중엔 그림 칸 바깥 = 흐린 캐릭터 그림 대신 사이트 배경이 비치는 반투명 바탕 — 끝나면 서서히 원래대로 */
.character-gallery.gallery-fullscreen { transition: background-color .9s ease; }
.gallery-fullscreen .gallery-media::before { transition: opacity .9s ease; }
.character-gallery.gallery-fullscreen.cutscene { background: rgba(8, 12, 10, .55); }
.character-gallery.gallery-fullscreen.cutscene .gallery-media::before { opacity: 0; }
.gallery-fullscreen .gallery-media { transition: background-color .9s ease; }
.character-gallery.gallery-fullscreen.cutscene .gallery-media { background-color: transparent; } /* 그림 칸 자체의 어두운 바탕도 연출 중엔 비침 */
