/* 등대섬 이야기 — 디자인 시스템 */
:root {
  --night: #0B1D33;
  --night-2: #12294A;
  --sea: #123B5C;
  --sea-deep: #0A2740;
  --lamp: #F5C451;
  --lamp-soft: #FFE59A;
  --cream: #F7EEDC;
  --cream-dim: #CBBFA6;
  --fog: #9FB3C8;
  --fog-dark: #5E7390;
  --coral: #F08A6B;
  --leaf: #8CD17D;
  --ink: #0A1626;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.10);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --font: 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  --display: 'Gowun Batang', 'Noto Serif KR', serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--cream);
  background: var(--night);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 6px; }

/* ── 앱 프레임 ── */
#app {
  position: relative; width: 100%; height: 100%;
  max-width: 480px; margin: 0 auto; overflow: hidden;
  background: radial-gradient(120% 60% at 50% -10%, #1B4B6E 0%, var(--night) 55%, #06101F 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 0 80px rgba(0,0,0,.6);
}
@media (min-width: 520px) { body { background: #04091A; } #app { height: min(100%, 960px); margin-top: max(0px, calc((100vh - 960px)/2)); border-radius: 28px; } }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  padding-top: var(--sat); padding-bottom: var(--sab);
}
.screen.active { opacity: 1; pointer-events: auto; transform: none; }

/* 별 배경 */
#stars { position: absolute; inset: 0; pointer-events: none; opacity: .9; }
.wave-bg { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none; opacity: .5;
  background: linear-gradient(to top, rgba(18,59,92,.8), transparent); }

/* ── 공통 컴포넌트 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 16px;
  background: var(--card-strong); border: 1px solid var(--line); color: var(--cream);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn > svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: linear-gradient(180deg, #FFD976, var(--lamp)); color: #3A2A05; border-color: transparent;
  box-shadow: 0 8px 24px rgba(245,196,81,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.icon-btn svg { width: 22px; height: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip .coin { width: 16px; height: 16px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--lamp); font-weight: 700; }
.muted { color: var(--cream-dim); }
h1, h2, h3 { margin: 0; font-weight: 700; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }

/* ── 타이틀 ── */
#screen-title { align-items: center; justify-content: flex-end; text-align: center; padding-bottom: calc(48px + var(--sab)); }
#title-art { position: absolute; inset: 0; width: 100%; height: 100%; }
#screen-title .title-block { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 24px; width: 100%; }
#screen-title h1 { font-size: 46px; line-height: 1.05; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
#screen-title .sub { font-size: 15px; color: var(--cream-dim); }
#screen-title .actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 10px; }
.title-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(to top, var(--night) 25%, transparent); pointer-events: none; }

/* ── 상단 바 ── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 6px; position: relative; z-index: 3; }
.topbar .title { font-size: 18px; font-weight: 700; }
.topbar .right { display: flex; gap: 8px; align-items: center; }

/* ── 섬 지도 ── */
#map-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 16px 40px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
#map-scroll::-webkit-scrollbar { width: 0; }
.progress-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.progress-strip .bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-strip .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lamp), #FFE59A); border-radius: 4px; transition: width .6s var(--ease); }
.progress-strip span { font-size: 12px; font-weight: 700; white-space: nowrap; }

.area { position: relative; margin-bottom: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(180deg, var(--card-strong), var(--card)); box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .25s var(--ease), box-shadow .25s; }
.area.locked { opacity: .55; filter: saturate(.4); }
.area.current { border-color: rgba(245,196,81,.5); box-shadow: 0 0 0 1px rgba(245,196,81,.25), 0 18px 40px rgba(0,0,0,.35); }
.area .diorama { position: relative; height: 150px; overflow: hidden; }
.area .diorama svg { width: 100%; height: 100%; display: block; }
.area .diorama .layer { opacity: 0; transition: opacity .8s var(--ease), transform .8s var(--ease); transform: translateY(6px); }
.area .diorama .layer.on { opacity: 1; transform: none; }
.area .head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; }
.area .head .ch { font-size: 12px; color: var(--lamp); font-weight: 700; letter-spacing: .12em; }
.area .head h2 { font-size: 20px; margin-top: 2px; }
.area .head .tag { font-size: 12px; color: var(--cream-dim); }
.area .lock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cream-dim); }
.area .lock-badge svg { width: 14px; height: 14px; }
.area .body { padding: 6px 16px 16px; }

.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0 12px; }
.level {
  position: relative; aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); font-weight: 800; font-size: 17px;
  transition: transform .15s var(--ease), background .2s;
}
.level:active { transform: scale(.94); }
.level.done { background: rgba(245,196,81,.12); border-color: rgba(245,196,81,.4); }
.level.next { background: linear-gradient(180deg, #FFD976, var(--lamp)); color: #3A2A05; border-color: transparent; box-shadow: 0 6px 18px rgba(245,196,81,.35); animation: pulse 1.8s ease-in-out infinite; }
.level.locked { opacity: .4; }
.level.boss::after { content: ''; position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); border: 2px solid var(--night); }
.level .stars { display: flex; gap: 1px; margin-top: 2px; }
.level .stars i { width: 9px; height: 9px; background: currentColor; opacity: .25; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.level .stars i.on { opacity: 1; color: var(--lamp); }
.level.next .stars i.on { color: #3A2A05; }
@keyframes pulse { 0%,100% { box-shadow: 0 6px 18px rgba(245,196,81,.35); } 50% { box-shadow: 0 6px 28px rgba(245,196,81,.6); } }

.tasks { display: flex; flex-direction: column; gap: 6px; }
.task { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid transparent; }
.task .name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.task .name .check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--fog-dark); display: grid; place-items: center; flex: none; }
.task.done .name .check { background: var(--lamp); border-color: var(--lamp); color: #3A2A05; }
.task.done .name { color: var(--cream-dim); }
.task .cost { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 9px; background: var(--card-strong); }
.task .cost.can { background: var(--lamp); color: #3A2A05; }
.task .cost svg { width: 14px; height: 14px; }

/* ── 스토리 ── */
#screen-story { justify-content: flex-end; }
#story-bg { position: absolute; inset: 0; transition: background 1s; }
#story-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,29,51,.15) 0%, rgba(11,29,51,.55) 45%, rgba(11,29,51,.95) 62%, rgba(11,29,51,.2) 100%); }
#story-bg .story-scene { position: absolute; left: 0; top: 0; width: 100%; height: 62%; opacity: .75; }
#story-bg .story-scene .layer { opacity: 0; } #story-bg .story-scene .layer.on { opacity: 1; }
#story-skip { position: absolute; top: calc(14px + var(--sat)); right: 16px; z-index: 5; }
.story-stage { position: relative; z-index: 2; height: 46%; display: flex; align-items: flex-end; justify-content: center; }
.portrait { width: 200px; height: 220px; transition: transform .35s var(--ease), opacity .35s, filter .35s; }
.portrait.bounce { animation: pop .4s var(--ease); }
@keyframes pop { 0% { transform: translateY(14px) scale(.96); opacity: .4; } 100% { transform: none; opacity: 1; } }
.dialogue { position: relative; z-index: 3; margin: 0 14px calc(18px + var(--sab)); padding: 18px 20px 20px; border-radius: var(--r-lg);
  background: rgba(11,29,51,.86); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 170px; display: flex; flex-direction: column; }
.dialogue .speaker { color: var(--lamp); font-weight: 800; font-size: 14px; letter-spacing: .04em; margin-bottom: 8px; min-height: 18px; }
.dialogue .text { font-size: 17px; line-height: 1.65; flex: 1; word-break: keep-all; }
.dialogue .text.narr { font-family: var(--display); font-style: italic; color: var(--cream-dim); text-align: center; padding-top: 12px; }
.dialogue .hint { text-align: right; font-size: 12px; color: var(--cream-dim); margin-top: 10px; opacity: 0; transition: opacity .3s; }
.dialogue .hint.on { opacity: 1; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ── 게임 ── */
#screen-game { justify-content: flex-start; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 14px 4px; position: relative; z-index: 2; }
.hud .left, .hud .right { display: flex; gap: 8px; align-items: center; }
.hud .right { justify-content: flex-end; }
.hud .score { text-align: center; }
.hud .score .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hud .score .lbl { font-size: 11px; color: var(--cream-dim); letter-spacing: .1em; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.stat .v { font-size: 18px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 10px; color: var(--cream-dim); margin-top: 3px; }
.stat.warn .v { color: var(--coral); }

.objective { margin: 8px 14px 0; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.objective .obj-icon { width: 34px; height: 34px; flex: none; }
.objective .obj-text { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.3; }
.objective .obj-text b { color: var(--lamp); }
.objective .obj-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 6px; overflow: hidden; }
.objective .obj-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lamp), var(--lamp-soft)); transition: width .4s var(--ease); }
.objective .stars-live { display: flex; gap: 3px; }
.objective .stars-live i { width: 14px; height: 14px; background: rgba(255,255,255,.18); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transition: background .3s, transform .3s; }
.objective .stars-live i.on { background: var(--lamp); transform: scale(1.15); }

.board-wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px 14px 0; min-height: 0; }
#board { display: block; border-radius: 18px; touch-action: none; }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.combo-pop { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; text-align: center; opacity: 0; }
.combo-pop.show { animation: comboIn .9s var(--ease) forwards; }
.combo-pop .big { font-size: 34px; font-weight: 900; color: var(--lamp); text-shadow: 0 4px 24px rgba(245,196,81,.7), 0 2px 0 #7A5A0E; letter-spacing: -.02em; }
.combo-pop .sm { font-size: 14px; font-weight: 700; color: var(--cream); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
@keyframes comboIn { 0% { opacity: 0; transform: translate(-50%,-30%) scale(.7); } 25% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); } 75% { opacity: 1; transform: translate(-50%,-55%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-80%) scale(.98); } }

.tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 14px 6px; position: relative; z-index: 2; }
.slot { height: 104px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; touch-action: none; transition: background .2s, transform .2s var(--ease), opacity .3s; }
.slot canvas { pointer-events: none; }
.slot.empty { opacity: 0; transform: scale(.8); }
.slot.dead { opacity: .35; }
.slot.selected { background: rgba(245,196,81,.12); border-color: rgba(245,196,81,.5); }
.slot.appear { animation: slotIn .35s var(--ease); }
@keyframes slotIn { 0% { opacity: 0; transform: translateY(16px) scale(.85); } 100% { opacity: 1; transform: none; } }

.boosters { display: flex; justify-content: center; gap: 10px; padding: 4px 14px calc(12px + var(--sab)); position: relative; z-index: 2; }
.booster { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 78px; padding: 8px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--cream-dim); transition: transform .15s var(--ease), background .2s; }
.booster:active { transform: scale(.95); }
.booster svg { width: 22px; height: 22px; }
.booster .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--lamp); color: #3A2A05; font-size: 11px; display: grid; place-items: center; font-weight: 900; }
.booster .count.zero { background: var(--fog-dark); color: var(--cream); }
.booster.active { background: rgba(245,196,81,.16); border-color: var(--lamp); color: var(--cream); }
#drag-ghost { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; will-change: transform; display: none; filter: drop-shadow(0 14px 18px rgba(0,0,0,.55)); }

/* ── 시트 / 모달 ── */
.sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(4,9,26,.65); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop.on { opacity: 1; pointer-events: auto; }
.sheet { width: 100%; max-height: 92%; overflow-y: auto; border-radius: 26px 26px 0 0; background: linear-gradient(180deg, #16305A, #0D2140); border: 1px solid var(--line); border-bottom: 0;
  padding: 18px 20px calc(24px + var(--sab)); transform: translateY(40px); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
.sheet-backdrop.on .sheet { transform: none; }
.sheet.center { border-radius: 26px; margin: 0 16px 0; border-bottom: 1px solid var(--line); align-self: center; text-align: center; }
.sheet h2 { font-size: 22px; margin-bottom: 6px; }
.sheet p { margin: 6px 0 0; color: var(--cream-dim); line-height: 1.6; font-size: 15px; word-break: keep-all; }
.sheet .row { display: flex; gap: 10px; margin-top: 18px; }
.sheet .row .btn { flex: 1; }
.grabber { width: 42px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); margin: -6px auto 14px; }

/* 결과 */
.result-stars { display: flex; justify-content: center; gap: 12px; margin: 14px 0 8px; }
.result-stars i { width: 52px; height: 52px; background: rgba(255,255,255,.1); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transform: scale(.6); opacity: .5; transition: all .4s var(--ease); }
.result-stars i:nth-child(2) { width: 64px; height: 64px; margin-top: -10px; }
.result-stars i.on { background: linear-gradient(180deg, #FFE59A, var(--lamp)); opacity: 1; transform: scale(1); filter: drop-shadow(0 6px 18px rgba(245,196,81,.6)); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.result-grid .cell { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.result-grid .cell .v { font-size: 22px; font-weight: 800; }
.result-grid .cell .l { font-size: 12px; color: var(--cream-dim); }
.result-grid .cell .v.coin { display: inline-flex; align-items: center; gap: 6px; color: var(--lamp); }
.result-grid .cell .v.coin svg { width: 20px; height: 20px; }

/* 레벨 인트로 */
.intro-obj { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-top: 14px; }
.intro-obj svg { width: 44px; height: 44px; flex: none; }
.intro-obj .t { font-size: 16px; font-weight: 700; }
.intro-obj .d { font-size: 13px; color: var(--cream-dim); margin-top: 2px; }
.star-req { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; text-align: left; }
.star-req div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cream-dim); }
.star-req div b { color: var(--cream); }
.star-req .s { display: flex; gap: 2px; width: 48px; }
.star-req .s i { width: 13px; height: 13px; background: var(--lamp); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

/* 편지 */
.letter-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; text-align: left; }
.letter-item { padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.letter-item svg { width: 28px; height: 28px; flex: none; }
.letter-item .t { font-weight: 700; font-size: 15px; }
.letter-item .d { font-size: 12px; color: var(--cream-dim); }
.letter-item.locked { opacity: .45; }
.letter-paper { margin-top: 14px; padding: 22px 20px; border-radius: 6px; background: linear-gradient(180deg, #FBF3E0, #EFE3C6); color: #3A2A15; text-align: left; font-family: var(--display); font-size: 15px; line-height: 1.85; white-space: pre-wrap; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.4); }
.letter-paper .lt { font-size: 13px; color: #8A6B3A; margin-bottom: 10px; font-family: var(--font); font-weight: 700; }

/* 상점 */
.shop-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.shop-item svg { width: 34px; height: 34px; flex: none; }
.shop-item .t { font-weight: 700; font-size: 15px; }
.shop-item .d { font-size: 12px; color: var(--cream-dim); }
.shop-item .info { flex: 1; }
.shop-item .buy { flex: none; }

/* 설정 */
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.settings-row:last-child { border-bottom: 0; }
.settings-row .t { font-weight: 600; }
.settings-row .d { font-size: 12px; color: var(--cream-dim); }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.14); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.toggle.on { background: var(--lamp); }
.toggle.on::after { transform: translateX(20px); }

/* 튜토리얼 코치마크 */
.coach { position: absolute; left: 14px; right: 14px; z-index: 12; padding: 14px 16px; border-radius: 16px; background: rgba(247,238,220,.97); color: #2A2418; box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; transition: all .3s var(--ease); pointer-events: none; }
.coach.on { opacity: 1; transform: none; pointer-events: auto; }
.coach .t { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.coach .b { font-size: 13px; line-height: 1.5; word-break: keep-all; }
.coach .ok { margin-top: 10px; font-weight: 800; color: #7A5A0E; font-size: 13px; }

/* 토스트 */
#toast { position: absolute; left: 50%; bottom: calc(120px + var(--sab)); transform: translate(-50%, 20px); z-index: 60; padding: 10px 16px; border-radius: 12px; background: rgba(247,238,220,.95); color: #2A2418; font-weight: 700; font-size: 14px; opacity: 0; transition: all .25s var(--ease); pointer-events: none; box-shadow: var(--shadow); white-space: nowrap; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 저조도/모션 */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }

/* ── 라이브옵스 ── */
.live-bar { display: flex; gap: 8px; margin: 0 16px 8px; position: relative; z-index: 3; }
.live-chip { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 800; }
.live-chip svg { width: 18px; height: 18px; flex: none; }
.live-chip .t { font-size: 11px; color: var(--cream-dim); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-chip .plus { width: 18px; height: 18px; border-radius: 50%; background: var(--lamp); color: #3A2A05; font-size: 13px; display: grid; place-items: center; margin-left: 2px; }
.live-chip.star { border-color: rgba(159,216,255,.35); }
.live-events { margin-bottom: 12px; }
.event-banner { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--ev) 45%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--ev) 22%, transparent), var(--card)); margin-bottom: 10px; text-align: left; }
.event-banner .ev-ic { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--ev) 30%, transparent); display: grid; place-items: center; color: var(--ev); flex: none; }
.event-banner .ev-ic svg { width: 20px; height: 20px; }
.event-banner .ev-t { flex: 1; display: flex; flex-direction: column; } .event-banner .ev-t b { font-size: 15px; } .event-banner .ev-t span { font-size: 12px; color: var(--cream-dim); }
.event-banner .ev-time { font-size: 11px; font-weight: 700; color: var(--ev); white-space: nowrap; }
.live-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.live-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--cream-dim); transition: transform .15s var(--ease); }
.live-tile:active { transform: scale(.95); }
.live-tile svg { width: 22px; height: 22px; color: var(--cream); }
.live-tile.hot { border-color: rgba(245,196,81,.5); color: var(--cream); }
.live-tile.shop { background: linear-gradient(180deg, rgba(159,216,255,.16), var(--card)); color: var(--cream); }
.live-tile .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--night); }
.lives-row { display: flex; justify-content: center; gap: 6px; margin: 10px 0 6px; align-items: center; }
.lives-row svg { width: 34px; height: 34px; }
.lives-row.small svg { width: 20px; height: 20px; } .lives-row.small span { font-size: 12px; color: var(--cream-dim); margin-left: 6px; }
.offer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; text-align: left; }
.offer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; transition: transform .15s var(--ease); width: 100%; }
.offer:active { transform: scale(.985); }
.offer > svg { width: 26px; height: 26px; flex: none; color: var(--cream); }
.offer > div { flex: 1; display: flex; flex-direction: column; } .offer b { font-size: 14px; } .offer span { font-size: 12px; color: var(--cream-dim); }
.offer em { font-style: normal; font-weight: 800; font-size: 14px; color: var(--lamp); white-space: nowrap; }
.offer.gold { background: linear-gradient(90deg, rgba(245,196,81,.16), var(--card)); border-color: rgba(245,196,81,.45); }
.offer.big { padding: 16px 14px; }
.offer.done { opacity: .55; } .offer:disabled { opacity: .5; }
.offer.static { cursor: default; } .offer .buy2 { display: flex; flex-direction: column; gap: 6px; }
.offer .buy2 .btn { min-height: 32px; font-size: 12px; padding: 0 10px; white-space: nowrap; }
.product-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.product { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.product { grid-column: span 2; } .product:nth-child(4), .product:nth-child(5) { grid-column: span 3; }
.product svg { width: 30px; height: 30px; } .product b { font-size: 17px; } .product .bonus { font-size: 11px; color: var(--leaf); font-weight: 700; }
.product .first { font-size: 10px; color: var(--coral); font-weight: 800; } .product .price { margin-top: 6px; padding: 5px 10px; border-radius: 9px; background: var(--lamp); color: #3A2A05; font-weight: 800; font-size: 12px; }
.product .tag { position: absolute; top: 0; left: 0; right: 0; font-size: 10px; font-weight: 800; background: rgba(159,216,255,.25); color: #CFEFFF; padding: 2px 0; }
.product.tagged { border-color: rgba(159,216,255,.45); }
.shop-tabs { display: flex; gap: 6px; margin-top: 12px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.2); }
.shop-tabs button { flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--cream-dim); }
.shop-tabs button.on { background: var(--card-strong); color: var(--cream); }
.login-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 10px; }
.login-cell { position: relative; padding: 10px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.login-cell:nth-child(7) { grid-column: span 2; background: linear-gradient(180deg, rgba(245,196,81,.18), var(--card)); border-color: rgba(245,196,81,.4); }
.login-cell .d { font-size: 11px; color: var(--cream-dim); font-weight: 700; } .login-cell .r { font-size: 12px; font-weight: 700; margin-top: 4px; }
.login-cell.done { opacity: .6; } .login-cell.today { border-color: var(--lamp); box-shadow: 0 0 0 1px var(--lamp); }
.login-cell .chk { position: absolute; top: 4px; right: 6px; font-size: 11px; color: var(--lamp); font-weight: 900; }
.mission-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mission { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.mission .mi { flex: 1; } .mission b { font-size: 14px; } .mission span { font-size: 12px; color: var(--cream-dim); }
.mission.claimed { opacity: .55; }
.mbar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); margin: 6px 0 4px; overflow: hidden; } .mbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lamp), var(--lamp-soft)); }
.event-inline { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ev) 45%, transparent); background: color-mix(in srgb, var(--ev) 14%, transparent); text-align: left; }
.event-inline svg { width: 20px; height: 20px; color: var(--ev); } .event-inline b { font-size: 13px; display: block; } .event-inline span { font-size: 12px; color: var(--cream-dim); }
.piggy-visual { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.piggy-visual > svg { width: 44px; height: 44px; color: var(--coral); flex: none; } .piggy-visual > div { flex: 1; } .piggy-visual b { font-size: 20px; }
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pack-grid div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 11px; }
.pack-grid div:nth-child(4), .pack-grid div:nth-child(5) { grid-column: span 1; }
.pack-grid svg { width: 24px; height: 24px; }
.costume-preview { display: flex; justify-content: center; margin-top: 8px; } .costume-preview svg { width: 150px; height: 165px; }
.sandbox-ad { position: absolute; inset: 0; z-index: 80; background: rgba(4,9,26,.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sandbox-inner { width: 100%; max-width: 340px; padding: 22px 20px; border-radius: 20px; background: #F7EEDC; color: #2A2418; text-align: center; box-shadow: var(--shadow); }
.sandbox-tag { font-size: 11px; letter-spacing: .12em; font-weight: 800; color: #B9453D; } .sandbox-title { font-size: 22px; font-weight: 800; margin: 6px 0; }
.sandbox-body { font-size: 13px; line-height: 1.6; color: #5A5040; } .sandbox-body code { background: rgba(0,0,0,.08); padding: 1px 6px; border-radius: 6px; }
.sandbox-count { font-size: 40px; font-weight: 900; margin: 12px 0; color: #B9453D; font-variant-numeric: tabular-nums; }
.sandbox-inner .btn { color: #2A2418; border-color: rgba(0,0,0,.15); } .sandbox-inner .btn.primary { color: #3A2A05; }
.sandbox-inner .row .btn { flex: 1; }
