/* 냥술사 타로방
   Layout: 한 화면 게임(위) + 스크롤하면 나오는 설명 글(아래). 운빨오락실과 같은 밝은 앱 톤에 보라·금빛 포인트. */
:root {
  --bg: #f4f2fb;
  --surface: #ffffff;
  --surface-2: #ece8f8;
  --ink: #1f1b33;
  --sub: #69638a;
  --line: #e0dbf0;
  --accent: #7a4dff;
  --accent-ink: #ffffff;
  --gold: #f4a400;
  --night: #241b4d;
  --night-2: #3a2a78;
  --shadow: 0 6px 24px rgba(36, 27, 77, 0.09);
  /* 제목·풀이는 타로방 분위기의 명조(고운바탕), 로고·버튼·게임 글씨는 사이트 공통 주아 */
  --display: "Gowun Batang", "AppleMyungjo", "Batang", serif;
  --game: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121022; --surface: #1d1a33; --surface-2: #29254a; --ink: #f0eefa; --sub: #a49fc4; --line: #2f2b4d;
    --accent: #9a78ff; --gold: #ffc23d; --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121022; --surface: #1d1a33; --surface-2: #29254a; --ink: #f0eefa; --sub: #a49fc4; --line: #2f2b4d;
  --accent: #9a78ff; --gold: #ffc23d; --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.stage { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 6px; }
.logo { font-family: var(--game); font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: 0.04em; }
.logo b { color: #ff4867; font-weight: 400; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); }
.screen.measuring > * { flex-shrink: 0; }
.spacer { flex: 1; min-height: 0; }
.sub { color: var(--sub); }
.small { font-size: 13px; }
.center { text-align: center; }

.btn { min-height: 54px; border-radius: 16px; border: 0; padding: 10px 16px; font-size: 16px; font-weight: 700; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform .08s ease; text-decoration: none; display: grid; place-items: center; text-align: center; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-family: var(--game); font-weight: 400; font-size: 20px; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--sub); font-weight: 400; min-height: 44px; }
.btn small { display: block; font-family: var(--body); font-size: 12px; font-weight: 400; opacity: .8; }
.actions { display: grid; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* 냥술사 말풍선 */
.sul { display: flex; align-items: flex-end; gap: 8px; }
.sul .face { width: 84px; height: 84px; flex: none; object-fit: contain; }
.sul .say { position: relative; flex: 1; background: var(--surface); border-radius: 18px 18px 18px 6px; padding: 11px 14px; box-shadow: var(--shadow); font-size: 16px; line-height: 1.45; word-break: keep-all; margin-bottom: 14px; animation: rise .25s ease-out; }
.sul .say b { color: var(--accent); }
.sul .who { display: block; font-size: 11px; color: var(--sub); margin-bottom: 2px; }
.sul.cameo .face { width: 58px; height: 58px; }
.sul.cameo .say { font-size: 14px; background: var(--surface-2); box-shadow: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---- 시작 */
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 4px; }
.hero h1 { font-size: 44px; line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 16px; color: var(--sub); }
/* 살아 있는 타로방. .room은 배경 그림(3:2)과 같은 비율이라 안쪽 위치를 그림 기준 퍼센트로 잡는다 */
.scene { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 26px; overflow: hidden; background: var(--night); box-shadow: var(--shadow); isolation: isolate; }
.room { position: absolute; top: -3%; left: 50%; height: 124%; aspect-ratio: 3 / 2; transform: translateX(-50%); }
.room-bg, .room-front { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.room-front { z-index: 2; }
.room .twinkle { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .8; animation: twinkle 2.4s ease-in-out infinite; }
.glow { position: absolute; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; translate: -50% -50%; }
.glow.candle { width: 6%; aspect-ratio: 1; background: radial-gradient(circle, rgba(255, 214, 120, .9), rgba(255, 170, 60, 0) 70%); animation: flicker 1.3s ease-in-out infinite alternate; }
.glow.c1 { left: 33.9%; top: 36%; } .glow.c2 { left: 35.9%; top: 33.4%; animation-delay: -.5s; } .glow.c3 { left: 38%; top: 36%; animation-delay: -.9s; }
.glow.lantern { width: 14%; aspect-ratio: 1; top: 9.5%; background: radial-gradient(circle, rgba(255, 210, 120, .55), rgba(255, 190, 80, 0) 70%); animation: breathe 3.4s ease-in-out infinite; }
.glow.l1 { left: 30.3%; } .glow.l2 { left: 69.5%; animation-delay: -1.7s; }
.glow.ball { z-index: 3; left: 63.9%; top: 40.5%; width: 13%; aspect-ratio: 1; background: radial-gradient(circle, rgba(225, 190, 255, .85), rgba(160, 110, 255, 0) 70%); animation: breathe 2.6s ease-in-out infinite; }
.glow.ball.lit { animation: balllit 1.6s ease-out, breathe 2.6s ease-in-out 1.6s infinite; }
.room .cat { position: absolute; z-index: 1; left: 50.5%; bottom: 45%; width: 26%; aspect-ratio: 1; margin-left: -13%; border: 0; padding: 0; background: none; cursor: pointer; transform-origin: 50% 100%; animation: idle 3s ease-in-out infinite; }
.room .cat img { width: 100%; height: 100%; object-fit: contain; display: block; }
.room .cat.act { animation: nod .5s ease-out, idle 3s ease-in-out .5s infinite; }
.room .cat.sip { animation: sip 1.4s ease-in-out, idle 3s ease-in-out 1.4s infinite; }
.room .cat.jump { animation: jump .6s ease-out; }
.floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; perspective: 400px; }
.fly-card { position: absolute; left: 49%; top: 40%; width: 5%; aspect-ratio: 1 / 1.85; border-radius: 3px; overflow: hidden; opacity: 0; animation: flycard 1.7s cubic-bezier(.2,.7,.4,1) forwards; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.fly-card svg { width: 100%; height: 100%; display: block; }
.mote { position: absolute; z-index: 3; bottom: 10%; width: 4px; height: 4px; border-radius: 50%; background: #ffd77a; box-shadow: 0 0 6px #ffd77a; opacity: 0; animation: mote 7s linear infinite; pointer-events: none; }
.dosa { position: absolute; z-index: 4; right: 0; bottom: -3%; width: 30%; aspect-ratio: 1; transform: translateX(105%) rotate(10deg); transition: transform .5s cubic-bezier(.3,1.4,.5,1); pointer-events: none; }
.dosa.in { transform: translateX(22%) rotate(-8deg); }
.dosa img { width: 100%; height: 100%; object-fit: contain; }
.say-bubble { position: absolute; z-index: 5; max-width: 44%; padding: 6px 10px; border-radius: 14px; background: #fff; color: #1f1b33; font-size: 13px; line-height: 1.35; text-align: left; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); word-break: keep-all; pointer-events: none; animation: bubbleIn .22s ease-out; }
.say-bubble::after { content: ''; position: absolute; width: 10px; height: 10px; background: #fff; transform: rotate(45deg); }
.say-bubble.on-sul { left: 63%; top: 8%; }
.say-bubble.on-sul::after { left: -4px; bottom: 9px; }
.say-bubble.on-dosa { right: 25%; bottom: 26%; background: #fff4dc; }
.say-bubble.on-dosa::after { right: -4px; bottom: 9px; background: #fff4dc; }
.say-bubble.out { opacity: 0; transform: scale(.9); transition: opacity .25s, transform .25s; }
@keyframes bubbleIn { from { opacity: 0; transform: scale(.6) translateY(6px); } }
@keyframes twinkle { 50% { opacity: .15; transform: scale(.6); } }
@keyframes flicker { 0% { opacity: .65; scale: .9; } 40% { opacity: 1; scale: 1.05; } 70% { opacity: .8; scale: .95; } 100% { opacity: 1; scale: 1.08; } }
@keyframes breathe { 50% { opacity: .55; scale: .9; } }
@keyframes balllit { 0% { scale: 1; opacity: 1; } 30% { scale: 1.9; opacity: 1; } 100% { scale: 1; opacity: .9; } }
@keyframes idle { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .98); } }
@keyframes nod { 30% { transform: translateY(4%) scale(1.04, .96); } 60% { transform: translateY(-2%); } }
@keyframes sip { 30%, 70% { transform: rotate(-4deg) translateY(-2%); } }
@keyframes jump { 0% { transform: scale(1.12, .85); } 35% { transform: translateY(-16%) scale(.92, 1.1); } 70% { transform: translateY(0) scale(1.08, .92); } 100% { transform: none; } }
@keyframes flycard { 0% { opacity: 0; transform: translate(0, 0) rotateY(0) scale(.6); } 15% { opacity: 1; } 60% { opacity: 1; transform: translate(var(--dx), -260%) rotateY(360deg) rotate(var(--r)) scale(1.2); } 100% { opacity: 0; transform: translate(calc(var(--dx) * 1.3), -330%) rotateY(540deg) rotate(var(--r)) scale(1); } }
@keyframes mote { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(14px, -260px); } }
@keyframes hop { 30% { transform: translateY(-14px); } 60% { transform: translateY(0); } 80% { transform: translateY(-4px); } }
.daily-done { font-size: 12px; color: var(--sub); }
.scroll-hint { text-align: center; font-size: 12px; color: var(--sub); }

/* ---- 속도 */
.seg { display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--surface); border-radius: 99px; padding: 4px; box-shadow: var(--shadow); align-self: center; }
.seg-lbl { font-size: 12px; color: var(--sub); padding: 0 6px 0 8px; }
.seg button { border: 0; background: transparent; border-radius: 99px; min-width: 52px; min-height: 36px; padding: 0 12px; font-weight: 700; font-size: 14px; color: var(--sub); font-variant-numeric: tabular-nums; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }

/* ---- 고민 고르기 */
.topics { display: grid; gap: 10px; }
.topic { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; text-align: left; min-height: 62px; padding: 8px 14px; border-radius: 18px; border: 0; background: var(--surface); box-shadow: var(--shadow); transition: transform .08s ease; }
.topic:active { transform: scale(.97); }
.topic .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; }
.topic b { display: block; font-size: 17px; }
.topic span { font-size: 13px; color: var(--sub); }

/* ---- 별 받기 */
.star-hud { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.timebar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transform-origin: left; }
.tally { display: flex; gap: 6px; font-variant-numeric: tabular-nums; }
.tally span { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; min-width: 30px; }
.tally span img { width: 18px; height: 18px; }
.tally span.bump { animation: bump .25s ease-out; }
@keyframes bump { 50% { transform: scale(1.35); } }
.sky-wrap { position: relative; flex: 1; min-height: 300px; border-radius: 24px; overflow: hidden; background: var(--night); box-shadow: var(--shadow); touch-action: none; }
.sky-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sky-over { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--game); font-size: 44px; text-shadow: 0 3px 12px rgba(0,0,0,.4); pointer-events: none; }
.sky-over.go { animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.sky-over.small { font-size: 32px; color: #ffe28a; }
.sky-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sky-flash.on { animation: skyflash .5s ease-out; }
.sky-flash.zap { background: #ffe14a; }
.timebar.rush i { background: linear-gradient(90deg, #ff5ca8, #ffb02e); animation: rushbar .4s ease-in-out infinite alternate; }
@keyframes skyflash { from { opacity: .7; } to { opacity: 0; } }
@keyframes rushbar { to { filter: brightness(1.35); } }
.legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 8px 10px; font-size: 14px; box-shadow: var(--shadow); }
.legend img { width: 30px; height: 30px; flex: none; }
.legend .bad { grid-column: 1 / -1; color: var(--sub); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* 기운 결과 */
.aura { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 16px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); text-align: center; overflow: hidden; }
.aura .orb { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; animation: glow 2.4s ease-in-out infinite; }
.aura .orb img { width: 74px; height: 74px; animation: idle 2.4s ease-in-out infinite; }
.aura .rays { position: absolute; left: 50%; top: 75px; width: 340px; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c) 28%, transparent) 0 9deg, transparent 9deg 24deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 64%); mask: radial-gradient(circle, #000 20%, transparent 64%); animation: spin 20s linear infinite; pointer-events: none; }
.aura > :not(.rays) { position: relative; }
.aura h2 { font-size: 28px; }
.aura .grade { font-family: var(--game); font-size: 18px; padding: 3px 14px; border-radius: 99px; color: #fff; }
.aura .bars { display: grid; gap: 6px; width: 100%; max-width: 280px; }
.aura .bars div { display: grid; grid-template-columns: 44px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.aura .bars i { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.aura .bars i b { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow .7s ease-out both; }
@keyframes glow { 50% { transform: scale(1.06); filter: brightness(1.08); } }
@keyframes grow { from { transform: scaleX(0); } }

/* ---- 카드 공통 */
.tc { position: relative; aspect-ratio: 1 / 1.85; border-radius: 9% / 4.9%; perspective: 800px; border: 0; padding: 0; background: none; }
.tc .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,1.2,.5,1); }
.tc.open .in { transform: rotateY(180deg); }
.tc .back, .tc .front { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.tc .front { transform: rotateY(180deg); background: var(--night); }
.tc .front img { width: 100%; height: 100%; display: block; }
.tc.rev .front img { transform: rotate(180deg); }
.back { background: var(--night); box-shadow: 0 4px 12px rgba(36, 27, 77, .25); }
.back svg { width: 100%; height: 100%; display: block; }
.tc.next .back { box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--gold); animation: hint 1.2s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(-4px); } }

/* 섞기 */
.deck-area { position: relative; flex: 1; min-height: 260px; display: grid; place-items: center; touch-action: none; }
.deck { position: relative; width: 140px; aspect-ratio: 1 / 1.85; }
.deck .back { position: absolute; inset: 0; border-radius: 12px; transition: transform .18s ease-out; }
.deck.cut .back:nth-child(odd) { transform: translateX(-80px) rotate(-8deg) !important; }
.deck.cut .back:nth-child(even) { transform: translateX(80px) rotate(8deg) !important; }
.ring { width: 100%; max-width: 280px; align-self: center; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.ring i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width .15s; }

/* 3장 고르기 */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 12px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot .hole { width: 100%; max-width: 92px; aspect-ratio: 1 / 1.85; border-radius: 10px; border: 2px dashed var(--line); display: grid; place-items: center; }
.slot .hole .back { width: 100%; height: 100%; border-radius: 9px; animation: drop .35s cubic-bezier(.3,1.5,.5,1); }
.slot span { font-size: 13px; color: var(--sub); font-weight: 700; }
@keyframes drop { from { transform: translateY(-40px) scale(1.2); opacity: 0; } }
.fan-area { position: relative; flex: 1; min-height: 200px; overflow: hidden; }
.fan-card { position: absolute; left: 50%; top: 14px; width: 64px; height: 118px; margin-left: -32px; border: 0; padding: 0; background: none; transform-origin: 50% 280%; transition: transform .2s ease, opacity .25s; }
.fan-card .back { width: 100%; height: 100%; border-radius: 6px; }
.fan-card:hover .back, .fan-card:focus-visible .back { box-shadow: 0 0 0 2px var(--gold); }
.fan-card.gone { opacity: 0; pointer-events: none; }

/* 뒤집기와 풀이 */
.spread { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 6px; }
.spread .pos { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spread .tc { width: 100%; max-width: 112px; }
.spread .pos span { font-size: 12px; color: var(--sub); font-weight: 700; }
.spread .pos .nm { font-family: var(--display); font-size: 16px; color: var(--ink); font-weight: 700; min-height: 22px; text-align: center; line-height: 1.2; }
.reading { background: var(--surface); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-height: 118px; }
.reading .hd { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.reading .hd b { font-family: var(--display); font-weight: 700; font-size: 20px; }
.reading .hd .tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--sub); }
.reading .hd .tag.rv { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.reading .kw { font-size: 12px; color: var(--sub); }
.reading p { font-size: 16px; line-height: 1.5; word-break: keep-all; }
.reading.empty { place-content: center; text-align: center; color: var(--sub); }

/* 종합 */
.sum { position: relative; flex-shrink: 0; overflow: hidden; isolation: isolate; background: var(--surface); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.sum > * { position: relative; }
.sum .intro { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; padding-right: 52px; }
.sum .intro .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 5px; }
/* 기운 색 오라: 카드 뒤에서 숨 쉬듯 퍼진다 */
.sum-aura { position: absolute !important; z-index: -1; left: 50%; top: 34%; width: 130%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--aura) 30%, transparent), transparent 62%); animation: aura 3.2s ease-in-out infinite; pointer-events: none; }
.sum-sul { position: absolute !important; right: 6px; top: 4px; width: 62px; height: 62px; object-fit: contain; pointer-events: none; }
.sum.anim .sum-sul { animation: sulpop .6s cubic-bezier(.3,1.6,.5,1) 1.4s both, idle 3s ease-in-out 2s infinite; }
.minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.mini .tc { width: 64px; border-radius: 6px; }
.mini .tc .back, .mini .tc .front { border-radius: 6px; }
.sum.anim .mini { animation: flyin .55s cubic-bezier(.2,1.3,.5,1) both; }
.sum.anim .mini b, .sum.anim .mini > span { animation: rise .3s ease-out 1.5s both; }
.mini b { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.2; }
.mini > span { font-size: 11px; color: var(--sub); }
.minis.linked:not(.still) .mini .tc { animation: floaty 3.6s ease-in-out infinite; }
.minis.linked .mini:nth-child(3) .tc { animation-delay: -1.2s; } .minis.linked .mini:nth-child(4) .tc { animation-delay: -2.4s; }
.constel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.constel path { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .85; }
.constel circle { fill: #fff; stroke: var(--gold); stroke-width: 1.5; opacity: 0; }
.minis.linked .constel path { animation: draw 1.1s ease-out forwards; }
.minis.linked .constel circle { animation: node .4s ease-out forwards; }
.minis.still .constel path { animation: none; stroke-dashoffset: 0; }
.minis.still .constel circle { animation: none; opacity: 1; }
.minis .constel + .mini, .mini { z-index: 2; }
.sum .final { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.35; text-align: center; word-break: keep-all; }
.sum.anim .final span { opacity: 0; animation: type .01s linear forwards; }
.sum.anim .todo { animation: rise .4s ease-out 3.4s both; }
.sum .todo { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.sum .todo b { color: var(--accent); }
.sum .mote { position: absolute; z-index: 0; bottom: 4%; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); opacity: 0; animation: mote 7s linear infinite; pointer-events: none; }
.sul.cameo.slide { animation: slidein .6s cubic-bezier(.3,1.4,.5,1) 3.8s both; }
@keyframes aura { 50% { scale: 1.12; opacity: .7; } }
@keyframes sulpop { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }
@keyframes flyin { from { transform: translateY(140px) rotate(-14deg) scale(.6); opacity: 0; } }
@keyframes floaty { 50% { transform: translateY(-4px) rotate(1deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes node { 0% { opacity: 0; r: 0; } 60% { opacity: 1; r: 6px; } 100% { opacity: 1; r: 3.5px; } }
@keyframes type { to { opacity: 1; } }
@keyframes slidein { from { transform: translateX(-110%); opacity: 0; } }
.note { font-size: 12px; color: var(--sub); text-align: center; }

/* 오늘의 한 장 */
.daily { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.daily .stagecard { position: relative; width: 46%; max-width: 190px; display: grid; }
.daily .stagecard .tc { width: 100%; }
.daily .rays { position: absolute; left: 50%; top: 50%; width: 260%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(244, 192, 74, .22) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%); mask: radial-gradient(circle, #000 18%, transparent 62%); opacity: 0; transition: opacity .8s; pointer-events: none; animation: spin 24s linear infinite; }
.daily .stagecard.shown .rays { opacity: 1; }
.daily .stagecard.shown .tc { animation: floaty3d 4.5s ease-in-out infinite; }
.tc .front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.daily .stagecard.shown .front::after { animation: shimmer 3.6s ease-in-out .4s infinite; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes floaty3d { 0%, 100% { transform: translateY(0) rotateX(0) rotateZ(-1deg); } 50% { transform: translateY(-8px) rotateX(6deg) rotateZ(1deg); } }
@keyframes shimmer { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
.daily h2 { font-size: 28px; }
.daily .en { font-size: 12px; letter-spacing: .12em; color: var(--sub); }
.daily .line { font-size: 16px; word-break: keep-all; }
.daily .todo { background: var(--surface); border-radius: 14px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow); }
.daily .todo b { color: var(--accent); }
.daily .left { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }

.fine { font-size: 12px; color: var(--sub); text-align: center; }
.cardimg { width: 100%; border-radius: 18px; box-shadow: var(--shadow); -webkit-touch-callout: default; user-select: auto; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 9; }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; animation: spark .8s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* ---- 설명 글 */
.guide { max-width: 480px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 28px; }
.guide section { display: flex; flex-direction: column; gap: 10px; }
.guide h2 { font-size: 24px; }
.guide p, .guide li { font-size: 15px; color: var(--ink); max-width: 65ch; }
.guide ul, .guide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.arcana { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; list-style: none; padding: 0 !important; }
.arcana li { background: var(--surface); border-radius: 14px; padding: 8px 12px; font-size: 13px; }
.arcana b { display: block; font-family: var(--display); font-weight: 700; font-size: 16px; }
.log { font-size: 14px; }
.site-foot { border-top: 1px solid var(--line); padding-top: 16px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.site-foot a { color: var(--sub); }

/* 화면이 낮으면 단계적으로 줄인다 */
.stage.fit1 .scene { width: 80%; align-self: center; }
.stage.fit1 .hero h1 { font-size: 36px; }
.stage.fit1 .sul .face { width: 64px; height: 64px; }
.stage.fit1 .btn { min-height: 48px; }
.stage.fit1 .topic { min-height: 54px; }
.stage.fit2 .scene { width: 58%; }
.stage.fit2 .say-bubble { font-size: 11px; padding: 4px 8px; }
.stage.fit2 .hero .lede { display: none; }
.stage.fit2 .sul .face { width: 52px; height: 52px; }
.stage.fit2 .sul .say { font-size: 14px; padding: 8px 12px; }
.stage.fit2 .reading { min-height: 96px; }
.stage.fit2 .spread .tc { max-width: 90px; }

@media (prefers-reduced-motion: reduce) {
  .room .twinkle, .glow, .mote, .room .cat, .aura .orb, .aura .rays, .tc.next .back, .sum-aura, .minis .tc, .daily .rays, .daily .stagecard .tc, .tc .front::after { animation: none !important; }
}
