/* ============================================================
 *  《단또 원정대》 스타일
 *  기준: 모바일 390x844 (iPhone 14), 데스크톱에선 중앙 정렬
 * ============================================================ */

:root {
  --c-bg: #FFF6E7;
  --c-bg2: #FFE9C4;
  --c-primary: #F29A2E;
  --c-primary-d: #E07B1F;
  --c-point: #F2C94C;
  --c-text: #4A3726;
  --c-text2: #8A7556;
  --c-card: #FFFFFF;
  --c-warm: #FF8A5C;
  --c-good: #5BB97C;
  --c-miss: #E86A5E;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(74,55,38,.12), 0 12px 28px rgba(74,55,38,.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: "Gaegu", "Nanum Gothic", "MB_Corpo", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: #F6E4C4;
  color: var(--c-text);
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-bg2) 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 480px) {
  #app {
    margin-top: 2vh;
    margin-bottom: 2vh;
    height: 96vh;
    border-radius: 34px;
    box-shadow: 0 20px 60px rgba(74,55,38,.25);
  }
}

#screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px 100px;
  scroll-behavior: smooth;
}

.screen-shell {
  min-height: 100%;
  padding-top: 6px;
  animation: screenIn .35s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 12px;
}
.hud-title { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.hud-left { flex: 1; min-width: 0; }
.hud-lv { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lv-badge {
  background: var(--c-primary); color: #fff; font-size: 12px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px; box-shadow: 0 3px 0 var(--c-primary-d);
  white-space: nowrap;
}
.exp-bar {
  flex: 1; height: 9px; background: #FFFFFF; border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(74,55,38,.15); overflow: hidden;
}
.exp-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, #F2C94C, #F29A2E);
  transition: width .6s cubic-bezier(.2,.8,.3,1.2);
}
.hud-point {
  background: #fff; border-radius: 18px; padding: 8px 14px;
  font-size: 16px; font-weight: 800; color: var(--c-text);
  box-shadow: 0 4px 0 rgba(74,55,38,.12); white-space: nowrap;
}

/* ---------- 버튼 ---------- */
.btn {
  position: relative;
  border: none; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 17px;
  padding: 15px 24px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 5px 0 rgba(0,0,0,.13);
  color: #fff; background: #B8B0A4;
  user-select: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.13); }
.btn .btn-emoji { font-size: 20px; }
.btn-primary { background: var(--c-primary); box-shadow: 0 6px 0 var(--c-primary-d); }
.btn-primary:active { box-shadow: 0 2px 0 var(--c-primary-d); }
.btn-warm { background: var(--c-warm); box-shadow: 0 6px 0 #D96A3C; }
.btn-warm:active { box-shadow: 0 2px 0 #D96A3C; }
.btn-ghost { background: #fff; color: var(--c-text2); box-shadow: 0 4px 0 rgba(74,55,38,.12); }
.btn-big { width: 100%; font-size: 19px; padding: 18px; }
.btn-huge { width: 100%; font-size: 23px; padding: 21px; border-radius: 26px; }
.icon-btn {
  border: none; background: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 19px; cursor: pointer; box-shadow: 0 4px 0 rgba(74,55,38,.12);
}
.back-btn {
  position: absolute; top: 10px; left: 4px; z-index: 5;
  border: none; background: #fff; width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; cursor: pointer; box-shadow: 0 4px 0 rgba(74,55,38,.12);
}

/* ---------- 네비게이션 ---------- */
.nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  border-top: 2px solid rgba(74,55,38,.08);
  z-index: 50;
}
.nav-item {
  border: none; background: none; cursor: pointer;
  font-family: inherit; color: var(--c-text2);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 14px;
  transition: transform .15s ease, color .15s ease;
}
.nav-emoji { font-size: 24px; transition: transform .2s ease; }
.nav-item.active { color: var(--c-primary); }
.nav-item.active .nav-emoji { transform: translateY(-3px) scale(1.12); }
.nav-item:active .nav-emoji { transform: scale(.9); }

/* ---------- 말풍선 ---------- */
.speech {
  position: relative;
  background: #fff; border-radius: 18px; padding: 12px 16px;
  font-size: 15px; font-weight: 700; line-height: 1.45;
  box-shadow: 0 4px 0 rgba(74,55,38,.10);
  max-width: 300px;
}
.speech::after {
  content: ''; position: absolute; left: 26px; bottom: -9px;
  width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 10px solid #fff;
}
.speech.center { margin: 0 auto; }

/* ---------- S01 스플래시 ---------- */
.splash {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  padding-bottom: 40px;
}
.splash-shell { padding: 0; height: 100%; }
.splash-logo {
  font-size: 40px; font-weight: 900; letter-spacing: -2px;
  color: var(--c-primary); text-shadow: 0 4px 0 #fff, 0 8px 16px rgba(74,55,38,.2);
  animation: logoPop .7s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes logoPop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.splash-char-wrap { animation: float 2.2s ease-in-out infinite; }
.splash-sub { font-size: 15px; color: var(--c-text2); font-weight: 700; }
.splash-loading {
  width: 160px; height: 8px; background: #fff; border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(74,55,38,.15); overflow: hidden;
}
.splash-loading-bar {
  height: 100%; width: 0; border-radius: 10px;
  background: linear-gradient(90deg, #F2C94C, #F29A2E);
  animation: loadFill 1.6s ease forwards;
}
@keyframes loadFill { to { width: 100%; } }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- S02 온보딩 ---------- */
.onboarding { padding: 8px 0 20px; }
.ob-char { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ob-card {
  background: var(--c-card); border-radius: 26px; padding: 20px;
  margin-top: 14px; box-shadow: var(--shadow);
}
.ob-label { font-size: 14px; font-weight: 800; color: var(--c-text2); margin-bottom: 8px; }
.ob-input-row { display: flex; gap: 8px; }
.ob-input {
  flex: 1; border: 3px solid #F0DCB8; border-radius: 16px; padding: 14px 16px;
  font-size: 17px; font-family: inherit; font-weight: 700; color: var(--c-text);
  background: #FFFBF2; outline: none; transition: border-color .2s;
}
.ob-input:focus { border-color: var(--c-primary); }
.ob-input::placeholder { color: #C4B294; }
.ob-dice {
  border: none; background: #fff; border-radius: 16px; font-size: 22px;
  width: 54px; cursor: pointer; box-shadow: 0 4px 0 rgba(74,55,38,.12);
}
.ob-hint { font-size: 12px; color: #B7A687; margin-top: 6px; font-weight: 600; }
.ob-chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.ob-char-btn {
  border: 3px solid #F0DCB8; background: #FFFBF2; border-radius: 18px;
  padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 4px; transition: all .18s ease;
  font-family: inherit;
}
.ob-char-btn.selected { border-color: var(--c-primary); background: #FFF4E0; transform: scale(1.05); box-shadow: 0 6px 0 var(--c-primary-d); }
.ob-char-btn:disabled { opacity: .55; cursor: not-allowed; }
.ob-char-name { font-size: 13px; font-weight: 800; }
.ob-char-lock { font-size: 10px; color: var(--c-text2); font-weight: 700; }
.ob-actions { margin-top: 20px; }

/* ---------- S03 튜토리얼 ---------- */
.tutorial { padding: 8px 0 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tut-char { position: relative; display: flex; flex-direction: column; align-items: center; }
.tut-bubble {
  background: #fff; border-radius: 18px; padding: 10px 18px; font-weight: 800;
  font-size: 15px; box-shadow: 0 4px 0 rgba(74,55,38,.10); margin-top: 6px;
  animation: bubbleIn .4s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes bubbleIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tut-card {
  background: var(--c-card); border-radius: 26px; padding: 26px 22px;
  width: 100%; text-align: center; box-shadow: var(--shadow); min-height: 220px;
}
.tut-emoji { font-size: 52px; animation: emojiWiggle 1.6s ease-in-out infinite; }
@keyframes emojiWiggle { 0%,100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.08); } }
.tut-title { font-size: 23px; font-weight: 900; margin: 10px 0 8px; }
.tut-body { font-size: 16px; line-height: 1.6; color: var(--c-text2); font-weight: 600; }
.tut-dots { display: flex; gap: 8px; }
.tut-dot { width: 10px; height: 10px; border-radius: 50%; background: #E5D3AE; transition: all .2s; }
.tut-dot.active { background: var(--c-primary); transform: scale(1.3); }
.tut-actions { display: flex; gap: 10px; width: 100%; align-items: center; }
.tut-actions .btn-ghost { flex: 0 0 auto; }
.tut-actions .btn-primary { flex: 1; }

/* ---------- S04 홈 ---------- */
.home { padding: 4px 0 8px; }
.home-top { display: flex; align-items: center; justify-content: space-between; }
.home-nick { font-size: 17px; font-weight: 800; color: var(--c-text2); }
.home-stage {
  position: relative; height: 270px; display: flex; align-items: flex-end;
  justify-content: center; overflow: hidden; margin: 6px 0 2px;
}
.home-ground {
  position: absolute; bottom: 16px; left: -20px; right: -20px; height: 60px;
  background: radial-gradient(ellipse at center top, #C8E6A0 0%, #B5D68C 70%);
  border-radius: 50% 50% 0 0 / 60px 60px 0 0;
}
.home-stage .danto-char { position: relative; z-index: 2; animation: float 2.6s ease-in-out infinite; }
.home-letters {
  position: absolute; top: 20px; right: 30px; font-size: 24px; z-index: 1;
  animation: float 3s ease-in-out infinite .4s;
}
.daily-card {
  background: #fff; border-radius: 20px; padding: 14px 16px; margin: 10px 0;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 0 rgba(74,55,38,.10); border: 3px solid #F0DCB8;
}
.daily-card.done { background: #F3F8EC; border-color: #D5E9BE; }
.daily-left { display: flex; align-items: center; gap: 12px; }
.daily-emoji { font-size: 30px; }
.daily-title { font-size: 16px; font-weight: 800; }
.daily-sub { font-size: 12px; color: var(--c-text2); font-weight: 600; margin-top: 2px; }
.daily-badge { font-size: 12px; font-weight: 800; color: var(--c-primary); background: #FFF1DC; padding: 6px 12px; border-radius: 20px; white-space: nowrap; }
.daily-card.done .daily-badge { color: var(--c-good); background: #E9F5DE; }
.home-mini { display: flex; gap: 8px; margin-top: 14px; }
.mini-stat {
  flex: 1; background: #fff; border-radius: 16px; padding: 10px 6px;
  text-align: center; box-shadow: 0 4px 0 rgba(74,55,38,.10);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.mini-emoji { font-size: 18px; }
.mini-val { font-size: 16px; font-weight: 900; }
.mini-lbl { font-size: 10px; color: var(--c-text2); font-weight: 700; }

/* ---------- S05 탐험 지도 ---------- */
.map { padding: 4px 0 8px; }
.map-hero { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.map-hero .speech { flex: 1; }
.map-path { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.map-node {
  border: none; background: #fff; border-radius: 22px; padding: 16px 26px;
  width: 92%; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 6px 0 rgba(74,55,38,.14); position: relative;
  transition: transform .18s ease;
  animation: nodeIn .5s cubic-bezier(.2,.9,.3,1.3) both;
  animation-delay: calc(var(--i) * 0.12s);
}
@keyframes nodeIn { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
.map-node:active { transform: scale(.97); }
.map-node:not(.locked):hover { transform: translateY(-4px); }
.map-node.locked { background: #F1E9DA; opacity: .85; }
.map-emoji { font-size: 40px; }
.map-name { font-size: 20px; font-weight: 900; }
.map-lock { font-size: 11px; color: var(--c-text2); font-weight: 700; text-align: center; }
.map-runs { font-size: 12px; color: var(--c-text2); font-weight: 700; }
.map-line { width: 4px; height: 22px; background: repeating-linear-gradient(180deg, #D9C39C 0 6px, transparent 6px 12px); }

/* ---------- S06 지역 상세 ---------- */
.region { padding: 30px 0 8px; position: relative; }
.region-head { text-align: center; }
.region-emoji { font-size: 56px; animation: emojiWiggle 2s ease-in-out infinite; }
.region-name { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
.region-tag { font-size: 14px; color: var(--c-text2); font-weight: 700; }
.region-memory {
  background: #fff; border-radius: 20px; padding: 16px; margin: 16px 0;
  text-align: center; box-shadow: 0 4px 0 rgba(74,55,38,.10);
}
.rm-title { font-size: 14px; font-weight: 800; color: var(--c-text2); margin-bottom: 10px; }
.rm-dots { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }
.piece-dot { width: 16px; height: 16px; border-radius: 50%; background: #EADFC8; box-shadow: inset 0 2px 3px rgba(74,55,38,.12); transition: all .3s; }
.piece-dot.big { width: 20px; height: 20px; }
.piece-dot.on { background: linear-gradient(135deg, #9B7EE8, #B056E8); box-shadow: 0 0 8px rgba(155,126,232,.6); transform: scale(1.1); }
.rm-count { font-size: 12px; font-weight: 700; color: var(--c-text2); margin-top: 8px; }
.region-stage {
  position: relative; height: 200px; display: flex; align-items: flex-end;
  justify-content: center; overflow: visible;
}
.region-glow {
  position: absolute; width: 190px; height: 190px; bottom: 0;
  border-radius: 50%; background: radial-gradient(circle, rgba(242,201,76,.45) 0%, transparent 70%);
  animation: pulseGlow 2.4s ease-in-out infinite;
}
@keyframes pulseGlow { 0%,100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.1); opacity: 1; } }
.region-landmark { position: absolute; top: 6px; font-size: 64px; opacity: .9; animation: float 3s ease-in-out infinite; }
.region-stage .danto-char { position: relative; z-index: 2; animation: float 2.6s ease-in-out infinite; }
.region-rewards { background: #fff; border-radius: 20px; padding: 14px 16px; margin: 8px 0 14px; box-shadow: 0 4px 0 rgba(74,55,38,.10); }
.rr-title { font-size: 14px; font-weight: 800; color: var(--c-text2); margin-bottom: 10px; }
.rr-items { display: flex; gap: 8px; }
.rr-item {
  flex: 1; text-align: center; font-size: 12px; font-weight: 700;
  background: #FFF6E4; border-radius: 14px; padding: 10px 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.rr-item span { font-size: 20px; }
.region-runs { text-align: center; font-size: 12px; color: var(--c-text2); font-weight: 700; margin-top: 10px; }

/* ---------- S07 퀴즈 ---------- */
.quiz { padding: 8px 0 8px; }
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-progress { flex: 1; }
.qp-dots { display: flex; gap: 5px; }
.qp-dot { flex: 1; height: 10px; border-radius: 10px; background: #E5D3AE; transition: all .3s; }
.qp-dot.done { background: var(--c-good); }
.qp-dot.now { background: var(--c-primary); box-shadow: 0 0 8px rgba(242,154,46,.6); transform: scaleY(1.3); }
.qp-count { font-size: 13px; font-weight: 800; color: var(--c-text2); text-align: right; margin-top: 5px; }
.quiz-cat {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cat-color); color: #fff; font-size: 13px; font-weight: 800;
  padding: 6px 14px; border-radius: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.15);
}
.quiz-cat-emoji { font-size: 15px; }
.quiz-char { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.quiz-char .speech { flex: 1; }
.quiz-question {
  background: #fff; border-radius: 22px; padding: 22px 18px;
  font-size: 21px; font-weight: 800; line-height: 1.5; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 16px;
  animation: questionIn .45s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes questionIn { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: none; } }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px;
  border: 3px solid #F0DCB8; background: #fff; border-radius: 20px;
  padding: 16px 18px; cursor: pointer; font-family: inherit;
  font-size: 17px; font-weight: 700; color: var(--c-text);
  text-align: left; transition: all .15s ease;
  animation: optIn .4s cubic-bezier(.2,.9,.3,1.2) both;
}
.quiz-opt:nth-child(1) { animation-delay: .06s; }
.quiz-opt:nth-child(2) { animation-delay: .12s; }
.quiz-opt:nth-child(3) { animation-delay: .18s; }
.quiz-opt:nth-child(4) { animation-delay: .24s; }
@keyframes optIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.quiz-opt:not(:disabled):active { transform: scale(.97); border-color: var(--c-primary); }
.opt-num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: #FFF1DC; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: var(--c-primary-d);
}
.opt-text { flex: 1; }
.quiz-opt.correct { border-color: var(--c-good); background: #EAF8EE; animation: correctPop .5s cubic-bezier(.2,.9,.3,1.4); }
.quiz-opt.wrong { border-color: var(--c-miss); background: #FDEDEB; animation: shakeX .45s ease; }
@keyframes correctPop { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* ---------- S08 피드백 오버레이 ---------- */
.feedback-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 18px calc(90px + env(safe-area-inset-bottom));
  background: rgba(74,55,38,.0);
  opacity: 0; transition: opacity .25s ease;
  pointer-events: none;
}
.feedback-overlay.show { opacity: 1; pointer-events: auto; }
.feedback-card {
  width: 100%; max-width: 460px; border-radius: 26px; padding: 22px;
  background: #fff; box-shadow: 0 -10px 40px rgba(74,55,38,.25);
  border-top: 8px solid var(--c-good); text-align: center;
  transform: translateY(120%); transition: transform .35s cubic-bezier(.2,.9,.3,1.2);
}
.feedback-overlay.show .feedback-card { transform: none; }
.feedback-card.miss { border-top-color: var(--c-miss); }
.fb-result { font-size: 26px; font-weight: 900; margin-bottom: 10px; }
.feedback-card.good .fb-result { color: var(--c-good); }
.feedback-card.miss .fb-result { color: var(--c-miss); }
.fb-explain { font-size: 16px; line-height: 1.6; color: var(--c-text2); font-weight: 600; margin-bottom: 18px; }

/* ---------- S09 결과 ---------- */
.result { padding: 8px 0 16px; text-align: center; }
.result-char { animation: float 2.4s ease-in-out infinite; }
.result-title { font-size: 24px; font-weight: 900; margin-top: 8px; }
.result-score { margin: 12px 0 2px; display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.rs-num { font-size: 58px; font-weight: 900; color: var(--c-primary); }
.rs-div, .rs-den { font-size: 26px; font-weight: 800; color: var(--c-text2); }
.result-cat { font-size: 13px; color: var(--c-text2); font-weight: 700; }
.result-rewards {
  background: #fff; border-radius: 20px; padding: 16px; margin: 16px 0;
  box-shadow: 0 4px 0 rgba(74,55,38,.10); text-align: left;
}
.rr-row { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; padding: 7px 0; }
.rr-row span:first-child { font-size: 22px; }
.rr-row.levelup { color: var(--c-primary); animation: pulseRow 1.2s ease-in-out infinite; }
@keyframes pulseRow { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.treasure-teaser { text-align: center; }
.tt-chest { font-size: 72px; animation: chestWiggle 1.1s ease-in-out infinite; }
@keyframes chestWiggle { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.06); } }
.tt-msg { font-size: 18px; font-weight: 900; margin: 4px 0 16px; }
.treasure-none { font-size: 15px; color: var(--c-text2); font-weight: 700; margin: 8px 0 18px; line-height: 1.6; }

/* ---------- S10 보물상자 ---------- */
.treasure-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74,55,38,.55); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .3s ease;
}
.treasure-overlay.show { opacity: 1; }
.treasure-box {
  position: relative; width: 100%; max-width: 400px; margin: 0 20px;
  border-radius: 30px; background: linear-gradient(180deg, #FFF6E4, #FFE9C4);
  padding: 40px 24px 28px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden;
  transform: scale(.8); transition: transform .35s cubic-bezier(.2,.9,.3,1.3);
}
.treasure-overlay.show .treasure-box { transform: none; }
.chest-glow {
  position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,201,76,.6) 0%, transparent 65%);
  opacity: 0; transition: opacity .5s;
}
.chest { font-size: 88px; position: relative; z-index: 2; transition: transform .4s cubic-bezier(.2,.9,.3,1.4); }
.chest.open { animation: chestOpen .55s cubic-bezier(.2,.9,.3,1.5); }
@keyframes chestOpen {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.25) rotate(-6deg); }
  65% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 0; }
}
.reward-reveal { position: relative; z-index: 3; }
.reward-reveal.pop { animation: rewardPop .55s cubic-bezier(.2,.9,.3,1.5); }
@keyframes rewardPop { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.rr-shine { font-size: 15px; font-weight: 900; color: var(--c-primary-d); margin-bottom: 10px; animation: shineText 1.4s ease-in-out infinite; }
@keyframes shineText { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.rr-emoji {
  font-size: 84px; display: inline-block;
  filter: drop-shadow(0 0 16px var(--rarity));
  animation: emojiWiggle 1.8s ease-in-out infinite;
}
.rr-name { font-size: 24px; font-weight: 900; margin-top: 8px; }
.rr-rarity { font-size: 13px; font-weight: 700; color: var(--c-text2); margin-top: 2px; }
.treasure-box .btn { margin-top: 20px; }
.treasure-box .btn-ghost { margin-top: 8px; }

/* ---------- 기억 해금 ---------- */
.memory-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74,55,38,.6); backdrop-filter: blur(5px);
  padding: 20px; opacity: 0; transition: opacity .3s ease;
  overflow-y: auto;
}
.memory-overlay.show { opacity: 1; }
.memory-card {
  width: 100%; max-width: 420px; border-radius: 28px;
  background: linear-gradient(180deg, #FFFFFF, #FFF4E0);
  padding: 28px 22px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  transform: scale(.85); transition: transform .4s cubic-bezier(.2,.9,.3,1.3);
  margin: auto;
}
.memory-overlay.show .memory-card { transform: none; }
.mem-piece { font-size: 30px; letter-spacing: 6px; }
.mem-shine { font-size: 16px; font-weight: 900; color: #9B7EE8; margin: 8px 0; animation: shineText 1.4s ease-in-out infinite; }
.mem-title { font-size: 24px; font-weight: 900; }
.mem-region { font-size: 13px; color: var(--c-text2); font-weight: 700; margin-top: 2px; }
.mem-story {
  font-size: 15px; line-height: 1.7; color: var(--c-text2); font-weight: 600;
  background: #fff; border-radius: 18px; padding: 16px; margin: 16px 0;
  text-align: left; box-shadow: 0 3px 0 rgba(74,55,38,.08);
}
.mem-knowledge {
  font-size: 13px; line-height: 1.6; color: var(--c-text); font-weight: 600;
  background: #FFF8E6; border-radius: 16px; padding: 14px; text-align: left;
  border: 2px dashed #F2C94C;
}
.mem-reward { font-size: 14px; font-weight: 800; color: var(--c-primary-d); margin-top: 12px; }
.memory-card .btn { margin-top: 18px; }

/* ---------- S11 꾸미기 ---------- */
.closet { padding: 4px 0 8px; }
.closet-preview {
  background: linear-gradient(180deg, #FFF8EC, #FFE9C4);
  border-radius: 26px; padding: 14px 0 8px; text-align: center;
  box-shadow: inset 0 -8px 0 rgba(74,55,38,.06);
}
.cp-stage { display: flex; justify-content: center; }
.cp-stage .danto-char { animation: float 3s ease-in-out infinite; }
.cp-name { font-size: 20px; font-weight: 900; margin-top: 4px; }
.cp-hint { font-size: 12px; color: var(--c-text2); font-weight: 700; }
.closet-tabs {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 14px 0 10px;
}
.closet-tab {
  border: 3px solid transparent; background: #fff; border-radius: 16px;
  padding: 10px 2px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: 0 3px 0 rgba(74,55,38,.10); transition: all .15s ease;
}
.closet-tab.active { border-color: var(--c-primary); background: #FFF4E0; transform: translateY(-3px); box-shadow: 0 5px 0 var(--c-primary-d); }
.ct-emoji { font-size: 19px; }
.ct-name { font-size: 10px; font-weight: 800; }
.ct-count {
  font-size: 10px; font-weight: 800; color: #fff; background: var(--c-primary);
  border-radius: 10px; padding: 1px 6px;
}
.closet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.item-card {
  border: 3px solid #F0DCB8; background: #fff; border-radius: 18px;
  padding: 12px 6px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 4px 0 rgba(74,55,38,.10); transition: all .15s ease; position: relative;
}
.item-card.sm { padding: 10px 4px; }
.item-card:not(.locked):active { transform: scale(.96); }
.item-card.equipped { border-color: var(--c-good); background: #F3FAF5; box-shadow: 0 4px 0 var(--c-good); }
.item-card.locked { opacity: .6; }
.ic-emoji { font-size: 34px; filter: drop-shadow(0 0 8px var(--rarity)); }
.item-card.locked .ic-emoji { filter: grayscale(1); }
.ic-name { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.3; }
.ic-rarity { font-size: 10px; font-weight: 800; }
.ic-equipped {
  position: absolute; top: -8px; right: -6px; z-index: 2;
  background: var(--c-good); color: #fff; font-size: 9px; font-weight: 800;
  padding: 3px 8px; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.15);
}

/* ---------- S12 아이템 상세 ---------- */
.item-detail { padding: 56px 0 20px; text-align: center; position: relative; }
.id-stage { position: relative; display: inline-block; padding: 30px; }
.id-emoji {
  font-size: 110px; filter: drop-shadow(0 0 24px var(--rarity));
  animation: emojiWiggle 2s ease-in-out infinite; display: inline-block;
}
.id-sparkles { position: absolute; top: 10px; right: 0; font-size: 30px; animation: float 2.4s ease-in-out infinite; }
.id-name { font-size: 28px; font-weight: 900; margin-top: 10px; }
.id-tags { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.id-tag { color: #fff; font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 16px; }
.id-tag.ghost { background: #EFE6D2; color: var(--c-text2); }
.id-desc { font-size: 15px; color: var(--c-text2); font-weight: 600; line-height: 1.6; margin: 16px 0 22px; }
.item-detail .btn { margin-bottom: 10px; }

/* ---------- S13 보관함 ---------- */
.inventory { padding: 4px 0 8px; }
.inv-head { display: flex; justify-content: space-between; align-items: baseline; }
.inv-title { font-size: 22px; font-weight: 900; }
.inv-count { font-size: 14px; font-weight: 800; color: var(--c-text2); }
.inv-progress { height: 12px; background: #fff; border-radius: 10px; margin: 8px 0 16px; box-shadow: inset 0 2px 4px rgba(74,55,38,.12); overflow: hidden; }
.inv-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #F2C94C, #F29A2E); transition: width .5s ease; }
.inv-section { margin-bottom: 18px; }
.inv-sec-head { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 900; margin-bottom: 10px; }
.inv-emoji { font-size: 20px; }
.inv-sec-count { font-size: 12px; color: var(--c-text2); font-weight: 800; margin-left: auto; }
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ---------- S14 기억 도감 ---------- */
.book { padding: 4px 0 8px; }
.book-hero { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 22px; padding: 14px 18px; box-shadow: 0 4px 0 rgba(74,55,38,.10); }
.book-stat { flex: 1; }
.bs-row { font-size: 14px; font-weight: 700; color: var(--c-text2); }
.bs-row b { color: var(--c-primary); font-size: 17px; }
.book-region { background: #fff; border-radius: 22px; padding: 16px; margin: 14px 0; box-shadow: 0 4px 0 rgba(74,55,38,.10); }
.br-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.br-emoji { font-size: 26px; }
.br-name { font-size: 19px; font-weight: 900; }
.br-pieces { font-size: 12px; font-weight: 800; color: #9B7EE8; margin-left: auto; }
.br-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.bm-title { font-size: 16px; font-weight: 900; margin: 4px 0 10px; }
.memory-card-list { }
.book-memories .memory-card {
  width: 100%; border: none; background: #fff; border-radius: 18px; padding: 14px;
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  font-family: inherit; box-shadow: 0 4px 0 rgba(74,55,38,.10); margin-bottom: 10px;
  transition: transform .15s ease;
}
.book-memories .memory-card:active { transform: scale(.97); }
.book-memories .memory-card.unlocked { background: linear-gradient(135deg, #FFFFFF, #F3EBFF); border: 2px solid #D9C8F5; }
.mc-piece { font-size: 28px; }
.mc-body { flex: 1; }
.mc-title { font-size: 15px; font-weight: 900; }
.mc-sub { font-size: 11px; color: var(--c-text2); font-weight: 700; margin-top: 2px; }
.mc-bar { height: 7px; background: #EFE6D2; border-radius: 10px; margin-top: 6px; overflow: hidden; }
.mc-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #9B7EE8, #B056E8); }
.mc-emoji { font-size: 18px; }

/* ---------- S15 설정 ---------- */
.settings { padding: 4px 0 8px; }
.set-char { text-align: center; padding: 10px 0 16px; }
.set-nick { font-size: 18px; font-weight: 900; margin-top: 4px; }
.set-group { background: #fff; border-radius: 20px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 4px 0 rgba(74,55,38,.10); }
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; font-size: 16px; font-weight: 800; cursor: pointer;
  border-bottom: 2px solid #F7EFDF;
}
.set-row:last-child { border-bottom: none; }
.set-row.danger { color: var(--c-miss); }
.set-go { font-size: 22px; color: #C4B294; }
.toggle {
  border: none; width: 62px; height: 32px; border-radius: 20px; cursor: pointer;
  background: #D9CDB6; position: relative; transition: background .25s ease;
  font-family: inherit;
}
.toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: left .25s cubic-bezier(.2,.9,.3,1.3);
}
.toggle.on { background: var(--c-good); }
.toggle.on .knob { left: 33px; }
.tg-lbl { display: none; }
.set-foot { text-align: center; font-size: 12px; color: #B7A687; font-weight: 700; line-height: 1.6; padding: 8px 0 16px; }

/* ---------- 공용 애니메이션 ---------- */
.bounce { animation: bounceAnim .5s cubic-bezier(.2,.9,.3,1.4); }
@keyframes bounceAnim { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-3deg); } 100% { transform: scale(1); } }
.shake { animation: shakeX .45s ease; }
.tap-bubble {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 16px; padding: 8px 14px;
  font-size: 13px; font-weight: 800; white-space: nowrap; z-index: 10;
  box-shadow: 0 4px 12px rgba(74,55,38,.2);
  animation: bubbleIn .3s cubic-bezier(.2,.9,.3,1.4), bubbleOut .3s ease 1.3s forwards;
  pointer-events: none;
}
@keyframes bubbleOut { to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* 스크롤바 숨김 */
#screen::-webkit-scrollbar { width: 0; height: 0; }
#screen { scrollbar-width: none; -ms-overflow-style: none; }

/* ============================================================
 *  관리자 페이지
 * ============================================================ */
.admin { padding: 30px 0 16px; }
.admin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.admin-title { font-size: 22px; font-weight: 900; }
.admin-count { font-size: 13px; color: var(--c-text2); font-weight: 800; }
.admin-note {
  font-size: 12px; color: var(--c-text2); font-weight: 600; line-height: 1.5;
  background: #FFF8E6; border: 2px dashed #F2C94C; border-radius: 14px;
  padding: 10px 12px; margin-bottom: 14px;
}
.admin-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.admin-card {
  border: none; background: #fff; border-radius: 18px; padding: 16px 10px;
  cursor: pointer; font-family: inherit; display: flex; flex-direction: column;
  align-items: center; gap: 4px; box-shadow: 0 4px 0 rgba(74,55,38,.12);
  transition: transform .15s ease;
}
.admin-card:active { transform: scale(.96); }
.admin-card.danger { background: #FDEDEB; }
.ac-emoji { font-size: 30px; }
.ac-name { font-size: 14px; font-weight: 800; }
.ac-count { font-size: 11px; color: var(--c-text2); font-weight: 700; }

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.adm-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 3px 0 rgba(74,55,38,.10);
}
.adm-body { flex: 1; min-width: 0; }
.adm-title { font-size: 14px; font-weight: 800; line-height: 1.4; overflow-wrap: break-word; }
.adm-sub { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.adm-tag {
  font-size: 10px; font-weight: 800; color: #fff; background: #B8B0A4;
  border-radius: 10px; padding: 2px 8px; white-space: nowrap;
}
.adm-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.adm-btn {
  border: none; width: 38px; height: 38px; border-radius: 12px; font-size: 16px;
  background: #FFF1DC; cursor: pointer; box-shadow: 0 3px 0 rgba(74,55,38,.12);
}
.adm-btn.danger { background: #FDEDEB; }

.adm-form {
  background: #fff; border-radius: 22px; padding: 18px;
  box-shadow: 0 4px 0 rgba(74,55,38,.10);
}
.adm-form label { display: block; font-size: 12px; font-weight: 800; color: var(--c-text2); margin: 12px 0 5px; }
.adm-form label:first-child { margin-top: 0; }
.adm-input {
  width: 100%; border: 2px solid #F0DCB8; border-radius: 12px; padding: 11px 13px;
  font-size: 15px; font-family: inherit; font-weight: 600; color: var(--c-text);
  background: #FFFBF2; outline: none; transition: border-color .2s;
}
.adm-input:focus { border-color: var(--c-primary); }
textarea.adm-input { resize: vertical; line-height: 1.5; }
select.adm-input { appearance: none; cursor: pointer; }
.adm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.adm-opt-row .adm-input { flex: 1; }
input[type="radio"][name="correct"] { width: 20px; height: 20px; accent-color: var(--c-primary); cursor: pointer; flex: 0 0 auto; }
.adm-radio-lbl { font-size: 16px; font-weight: 900; color: var(--c-primary-d); flex: 0 0 auto; }
.adm-errors { color: var(--c-miss); font-size: 12px; font-weight: 700; margin: 10px 0; line-height: 1.6; }
.adm-form .btn { margin-top: 8px; }

/* 약관/방침 뷰어 */
.legal-card { max-width: 420px; }
.legal-title { font-size: 22px; font-weight: 900; margin-bottom: 12px; }
.legal-body { text-align: left; max-height: 46vh; overflow-y: auto; }
.legal-body p { font-size: 13px; line-height: 1.7; color: var(--c-text2); font-weight: 600; margin: 0 0 10px; }
.legal-overlay .btn { margin-top: 12px; }

/* 지역 도감 */
.book-region-dex { margin: 14px 0; }
.rd-card {
  background: #fff; border-radius: 18px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 4px 0 rgba(74,55,38,.10);
}
.rd-card.locked { opacity: .65; background: #F3EDDE; }
.rd-head { display: flex; align-items: center; gap: 8px; }
.rd-emoji { font-size: 24px; }
.rd-name { font-size: 17px; font-weight: 900; }
.rd-lock { margin-left: auto; font-size: 16px; }
.rd-stats { display: flex; gap: 6px; margin: 10px 0 8px; }
.rd-stat {
  flex: 1; text-align: center; background: #FFF6E4; border-radius: 12px; padding: 7px 2px;
  display: flex; flex-direction: column; gap: 1px;
}
.rd-stat b { font-size: 14px; font-weight: 900; }
.rd-stat span { font-size: 9px; color: var(--c-text2); font-weight: 700; }
.rd-bar { height: 8px; background: #EFE6D2; border-radius: 10px; overflow: hidden; }
.rd-fill { height: 100%; background: linear-gradient(90deg, #9B7EE8, #B056E8); border-radius: 10px; transition: width .5s ease; }

/* 보관함 필터 */
.inv-filters { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; }
.inv-filter {
  flex: 0 0 auto; border: 2px solid #F0DCB8; background: #fff; border-radius: 16px;
  padding: 8px 14px; font-size: 12px; font-weight: 800; color: var(--c-text2);
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s;
}
.inv-filter.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary-d); }

.region-locked-msg {
  text-align: center; font-size: 13px; font-weight: 800; color: var(--c-text2);
  background: #F3EDDE; border-radius: 14px; padding: 10px; margin: 10px 0;
}
.set-row.admin-row { color: #9B7EE8; }

/* API 연결 배지 */
.api-badge {
  position: fixed; top: 8px; right: 12px; z-index: 999;
  background: #E9F8EF; color: #2E8B57; font-size: 11px; font-weight: 800;
  padding: 5px 12px; border-radius: 20px; box-shadow: 0 3px 8px rgba(0,0,0,.15);
  pointer-events: none;
}

/* 관리자: 학습목표 줄 + 메타데이터 섹션 */
.adm-goal {
  font-size: 11px; color: var(--c-text2); font-weight: 600; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adm-tag.warn { background: var(--c-miss); }
.adm-section-title {
  font-size: 13px; font-weight: 900; color: #9B7EE8;
  margin: 18px 0 2px; padding-top: 12px; border-top: 2px dashed #E3D9F2;
}

/* ============================================================
 *  기억 복원 시스템 (spec ①②⑨)
 * ============================================================ */

/* 퀴즈 화면: 복원 중인 장소 표시 */
.quiz-target {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #F3E9FF, #E8F4FF);
  border: 2px solid #D9C2F5; border-radius: 16px;
  padding: 10px 14px; margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: var(--c-text2);
}
.quiz-target.done { background: linear-gradient(135deg, #E9FBF0, #EAF6FF); border-color: #8FE3B0; }
.quiz-target .qt-emoji { font-size: 22px; animation: float 2.4s ease-in-out infinite; }
.quiz-target .qt-text { flex: 1; line-height: 1.4; }
.quiz-target .qt-text b { color: #7B4FE0; font-size: 15px; }
.quiz-target .qt-pieces { color: #9B7EE8; letter-spacing: 2px; font-size: 14px; }
.quiz-target .qt-count { font-weight: 900; color: #7B4FE0; }

/* 힌트로 지워진 오답 */
.quiz-opt.hinted { opacity: .35; text-decoration: line-through; background: #F3E9F0; }

/* 능력 버튼 */
.btn-ability {
  margin: 12px auto 0; display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; color: #9B7EE8; border-color: #D9C2F5;
}
.btn-ability.used { opacity: .5; }

/* ---------- 피드백: 장소 복원 연출 ---------- */
.fb-restore {
  background: linear-gradient(160deg, #F6EEFF, #EAF4FF);
  border-radius: 18px; padding: 16px; margin-bottom: 12px;
  border: 2px dashed #C9A8F2; overflow: hidden; position: relative;
}
.fb-fog {
  font-size: 44px; text-align: center; line-height: 1.2;
  transition: all .6s ease; filter: blur(0);
}
.fb-restore.restored .fb-fog { opacity: 0; filter: blur(8px); transform: scale(1.4); }
.fb-landmark {
  font-size: 56px; text-align: center; line-height: 1.2;
  opacity: 0; transform: scale(.4); transition: all .6s cubic-bezier(.2,1.6,.4,1);
  margin-top: -52px;
}
.fb-restore.restored .fb-landmark { opacity: 1; transform: scale(1); margin-top: 0; }
.fb-restore-msg {
  font-size: 19px; font-weight: 900; color: #7B4FE0; text-align: center; margin-top: 8px;
  opacity: 0; transition: opacity .5s ease .3s;
}
.fb-restore.restored .fb-restore-msg { opacity: 1; animation: shineText 1.4s ease-in-out .3s infinite; }
.fb-restore-desc { font-size: 13px; color: var(--c-text2); font-weight: 600; text-align: center; margin-top: 4px;
  opacity: 0; transition: opacity .5s ease .4s; }
.fb-restore.restored .fb-restore-desc { opacity: 1; }
.fb-piece {
  font-size: 13px; font-weight: 800; color: #9B7EE8; text-align: center;
  background: #F3E9FF; border-radius: 12px; padding: 8px; margin-bottom: 10px;
}
.fb-line {
  font-size: 14px; font-weight: 700; color: var(--c-text2);
  background: #FFF6E8; border-radius: 12px; padding: 9px 12px; margin-bottom: 14px;
  border-left: 4px solid #F2C94C;
}

/* ---------- 결과: 목표형 보상 패널 ---------- */
.goal-panel {
  background: #fff; border-radius: 20px; padding: 16px;
  margin: 14px 0; box-shadow: 0 4px 0 rgba(74,55,38,.10);
  border: 2px solid #F0E4FF;
}
.goal-head { display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 900; color: #7B4FE0; margin-bottom: 10px; }
.goal-pct { font-size: 13px; }
.goal-bar { height: 12px; background: #F3E9FF; border-radius: 10px; overflow: hidden; box-shadow: inset 0 2px 3px rgba(74,55,38,.08); }
.goal-fill { height: 100%; width: 0; border-radius: 10px;
  background: linear-gradient(90deg, #9B7EE8, #C98AF0); transition: width .6s ease; }
.goal-places { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gp-chip { font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 14px; }
.gp-chip.done { background: #E9FBF0; color: #2E8B57; border: 2px solid #8FE3B0; }
.gp-chip.fog { background: #EFEFF5; color: #A0A0B5; border: 2px dashed #C6C6D5; }
.goal-left { font-size: 12px; font-weight: 700; color: var(--c-text2); margin-top: 10px; text-align: center; }
.goal-done { font-size: 14px; font-weight: 900; color: #2E8B57; margin-top: 10px; text-align: center;
  animation: pulseRow 1.4s ease-in-out infinite; }
.goal-reward { font-size: 12px; font-weight: 800; color: #7B4FE0; text-align: center; margin-top: 6px;
  background: #F3E9FF; border-radius: 10px; padding: 7px; }
.tt-bonus { font-size: 12px; font-weight: 800; color: #2E8B57; text-align: center; margin-top: 6px; }

/* ---------- 미니게임 (spec ④) ---------- */
.minigame-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(40,30,60,.62); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.minigame-overlay.show { opacity: 1; pointer-events: auto; }
.mg-card {
  width: min(420px, 92vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(170deg, #FFFFFF, #F8F2FF);
  border-radius: 26px; padding: 22px; text-align: center;
  border: 4px solid #D9C2F5; box-shadow: 0 14px 40px rgba(80,40,140,.35);
  transform: scale(.85); transition: transform .25s cubic-bezier(.2,1.4,.4,1);
}
.minigame-overlay.show .mg-card { transform: none; }
.mg-title { font-size: 22px; font-weight: 900; color: #7B4FE0; }
.mg-desc { font-size: 13px; font-weight: 700; color: var(--c-text2); margin: 6px 0 14px; line-height: 1.5; }
.mg-seq { height: 84px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.mg-hint { font-size: 15px; font-weight: 800; color: var(--c-text2); }
.mg-seq-arrow { font-size: 56px; animation: arrowPop .35s cubic-bezier(.2,1.6,.4,1); display: block; }
@keyframes arrowPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mg-seq-dot { font-size: 30px; color: #D9C2F5; font-weight: 900; transition: all .2s; }
.mg-seq-dot.on { color: #9B7EE8; transform: scale(1.3); }
.mg-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 240px; margin: 0 auto 12px; }
.mg-arrow {
  font-size: 40px; padding: 14px 0; border-radius: 18px; cursor: pointer;
  border: 3px solid #E3D0F8; background: #fff; transition: all .15s; line-height: 1;
}
.mg-arrow:not(:disabled):hover { background: #F6EEFF; transform: translateY(-2px); }
.mg-arrow.flash { background: #E9D6FF; transform: scale(.92); }
.mg-arrow:disabled { opacity: .5; cursor: default; }
.mg-status { font-size: 15px; font-weight: 900; color: var(--c-text2); min-height: 24px; margin-bottom: 8px; }
.mg-status.ok { color: var(--c-good); }
.mg-status.miss { color: var(--c-miss); }
.mg-reward-info { font-size: 12px; font-weight: 800; color: #7B4FE0; background: #F3E9FF; border-radius: 10px; padding: 7px; margin-bottom: 10px; }

/* ---------- 캐릭터 합류 (spec ⑥) ---------- */
.join-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(40,30,60,.62); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.join-overlay.show { opacity: 1; pointer-events: auto; }
.join-card {
  width: min(420px, 92vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(170deg, #FFFFFF, #FFF9EC);
  border-radius: 26px; padding: 22px; text-align: center;
  border: 4px solid #F2D98C; box-shadow: 0 14px 40px rgba(120,90,20,.35);
  transform: scale(.85); transition: transform .25s cubic-bezier(.2,1.4,.4,1);
}
.join-overlay.show .join-card { transform: none; }
.join-shine { font-size: 15px; font-weight: 900; color: #B8860B; animation: shineText 1.4s ease-in-out infinite; }
.join-char { animation: float 2.4s ease-in-out infinite; margin: 6px 0; }
.join-name { font-size: 26px; font-weight: 900; color: #8A6A10; }
.join-desc { font-size: 13px; font-weight: 700; color: var(--c-text2); margin: 6px 0 12px; line-height: 1.5; }
.join-ability { background: #FFF3D6; border: 2px dashed #F2D98C; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.ja-title { font-size: 14px; font-weight: 900; color: #B8860B; }
.ja-desc { font-size: 12px; font-weight: 700; color: var(--c-text2); margin-top: 3px; }

/* ---------- S06 복원지도 게임판 ---------- */
.board {
  background: linear-gradient(160deg, #FBF6EC, #F0E8F8);
  border: 3px solid #D9C2F5; border-radius: 22px; padding: 14px; margin: 12px 0;
}
.board-head { display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 900; color: #7B4FE0; margin-bottom: 8px; }
.board-pct { font-size: 18px; }
.board-bar { height: 12px; background: #EFE6D2; border-radius: 10px; overflow: hidden; box-shadow: inset 0 2px 3px rgba(74,55,38,.1); }
.board-fill { height: 100%; width: 0; border-radius: 10px;
  background: linear-gradient(90deg, #9B7EE8, #C98AF0); transition: width .6s ease; }
.board-map {
  position: relative; height: 200px; margin: 12px 0 8px;
  background:
    radial-gradient(circle at 30% 30%, rgba(155,126,232,.10), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(242,201,76,.12), transparent 40%),
    repeating-linear-gradient(0deg, rgba(155,126,232,.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(155,126,232,.06) 0 1px, transparent 1px 24px);
  border-radius: 16px; border: 2px dashed #D9C2F5;
}
.board-node { position: absolute; transform: translate(-50%, -50%); text-align: center; transition: all .3s; }
.bn-emoji {
  font-size: 32px; width: 52px; height: 52px; line-height: 52px;
  background: #fff; border-radius: 50%; border: 3px solid #8FE3B0;
  box-shadow: 0 4px 10px rgba(46,139,87,.25); animation: float 2.6s ease-in-out infinite;
}
.bn-name { font-size: 11px; font-weight: 800; color: #2E8B57; margin-top: 3px; }
.board-node.fog .bn-emoji {
  font-size: 24px; border-color: #C6C6D5; box-shadow: 0 3px 8px rgba(120,110,140,.2);
  animation: fogPulse 2s ease-in-out infinite;
}
.board-node.fog .bn-name { color: #A0A0B5; }
@keyframes fogPulse { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.board-goal { font-size: 12px; font-weight: 800; color: #7B4FE0; text-align: center; line-height: 1.5; }

/* ---------- S05 지도: 복원 진행 + 원정대 ---------- */
.map-restore { font-size: 12px; font-weight: 800; color: #7B4FE0; margin-top: 4px; }
.map-bar { height: 8px; background: #EFE6D2; border-radius: 10px; overflow: hidden; margin-top: 4px; }
.map-fill { height: 100%; background: linear-gradient(90deg, #9B7EE8, #C98AF0); border-radius: 10px; transition: width .5s ease; }
.map-joiner { font-size: 11px; font-weight: 800; color: #B8860B; background: #FFF3D6; border-radius: 10px; padding: 3px 8px; margin-top: 6px; }
.map-team { background: #fff; border-radius: 20px; padding: 14px 16px; margin-top: 14px; box-shadow: 0 4px 0 rgba(74,55,38,.10); }
.mt-title { font-size: 14px; font-weight: 900; color: var(--c-text2); margin-bottom: 10px; text-align: center; }
.mt-list { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mt-chip { font-size: 12px; font-weight: 800; padding: 7px 12px; border-radius: 16px; border: 2px solid #8FE3B0; background: #E9FBF0; color: #2E8B57; }
.mt-chip.off { border-color: #D8D8E2; background: #F1F1F6; color: #A0A0B5; }

/* ---------- 인트로 연출 ---------- */
.intro-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(40,30,60,.62); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.intro-overlay.show { opacity: 1; pointer-events: auto; }
.intro-card {
  width: min(420px, 92vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(170deg, #FFFFFF, #F4EEFF);
  border-radius: 26px; padding: 22px; text-align: center;
  border: 4px solid #C9A8F2; box-shadow: 0 14px 40px rgba(80,40,140,.35);
  transform: scale(.85); transition: transform .25s cubic-bezier(.2,1.4,.4,1);
}
.intro-overlay.show .intro-card { transform: none; }
.intro-fog { font-size: 40px; letter-spacing: 6px; animation: fogPulse 2s ease-in-out infinite; }
.intro-title { font-size: 21px; font-weight: 900; color: #7B4FE0; margin: 10px 0 8px; line-height: 1.4; }
.intro-char { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.intro-char .speech { flex: 1; max-width: 200px; text-align: left; }
.intro-desc { font-size: 13px; font-weight: 700; color: var(--c-text2); line-height: 1.6; margin-bottom: 14px; }

/* ---------- S11 캐릭터 교체 칩 ---------- */
.closet-chars { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.cc-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 3px solid #E8DCC4; border-radius: 18px; padding: 8px 10px 6px;
  cursor: pointer; font-family: inherit; transition: all .15s; position: relative; min-width: 76px;
}
.cc-chip:not(.locked):hover { transform: translateY(-2px); }
.cc-chip.active { border-color: var(--c-primary); background: #F3E9FF; box-shadow: 0 4px 0 rgba(155,126,232,.3); }
.cc-chip.locked { opacity: .55; }
.cc-chip .cc-name { font-size: 12px; font-weight: 900; color: var(--c-text2); }
.cc-chip.active .cc-name { color: var(--c-primary-d); }
.cc-on { position: absolute; top: -8px; right: -6px; font-size: 14px; }
.cc-hint { font-size: 11px; font-weight: 700; color: var(--c-text2); text-align: center; margin: 0 0 10px; }
.cp-ability { font-size: 12px; font-weight: 800; color: #7B4FE0; background: #F3E9FF; border-radius: 10px; padding: 6px 10px; margin-top: 4px; }

/* ============================================================
 *  복원 순간 시그니처 연출 (spec ①②)
 * ============================================================ */

/* 퀴즈 화면: 장소 성향 표기 + 해티 속삭임 */
.quiz-flavor { font-size: 11px; font-weight: 700; color: var(--c-text2); text-align: center; margin-top: 2px; }
.quiz-whisper {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #FFF9E8, #F3EEFF);
  border: 2px dashed #E3C96A; border-radius: 14px;
  padding: 8px 12px; margin: 8px 0 0; font-size: 12px; font-weight: 700; color: #8A6A10;
  animation: whisperGlow 2.4s ease-in-out infinite;
}
@keyframes whisperGlow { 0%,100% { opacity: .8; } 50% { opacity: 1; } }
.qw-emoji { font-size: 18px; }
.qw-text b { color: #6B4F0E; }

/* 피드백: 기억의 속삭임 (정답, 미완료 조각) */
.fb-whisper {
  background: linear-gradient(135deg, #FFF9E8, #F6EEFF);
  border: 2px dashed #E3C96A; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
}
.fbw-voice { font-size: 14px; font-weight: 900; color: #8A6A10; }
.fbw-scene { font-size: 12px; font-weight: 600; color: #9A7E2E; line-height: 1.5; margin-top: 4px; font-style: italic; }
.fbw-prog { font-size: 12px; font-weight: 800; color: var(--c-primary); margin-top: 6px; }

/* 피드백: 웅실 해설 짚어주기 */
.fb-review { background: #FBF3E6; border: 2px solid #D9A96A; border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.fbr-title { font-size: 14px; font-weight: 900; color: #9A6B43; margin-bottom: 6px; }
.fbr-body { font-size: 15px; line-height: 1.6; font-weight: 700; color: #5B4632; }
.fbr-goal { font-size: 12px; font-weight: 700; color: #2E8B57; margin-top: 8px; background: #E9FBF0; border-radius: 8px; padding: 6px 8px; }
.fbr-note { font-size: 11px; font-weight: 600; color: var(--c-text2); margin-top: 6px; }

/* ---------- 복원 시네마 (spec ①) ---------- */
.cinema-overlay {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  background: rgba(25,18,45,.78); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.cinema-overlay.show { opacity: 1; pointer-events: auto; }
.cinema-card {
  width: min(440px, 92vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(170deg, #FFFFFF, #F4EEFF);
  border-radius: 26px; padding: 24px; text-align: center;
  border: 4px solid #C9A8F2; box-shadow: 0 16px 50px rgba(80,40,140,.45);
  transform: scale(.85); transition: transform .3s cubic-bezier(.2,1.4,.4,1);
}
.cinema-overlay.show .cinema-card { transform: none; }
.cinema-card.shake { animation: cinemaShake .5s ease-in-out 2; }
@keyframes cinemaShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

/* 1단계: 속삭임 */
.cw-fog { font-size: 46px; letter-spacing: 8px; animation: fogPulse 1.6s ease-in-out infinite; }
.cw-line { font-size: 20px; font-weight: 900; color: var(--c-primary-d); margin: 12px 0 6px; }
.cw-voice { font-size: 16px; font-weight: 700; color: #8A6A10; font-style: italic; animation: whisperGlow 1.8s ease-in-out infinite; }

/* 2단계: 안개 걷히고 랜드마크 등장 */
.cs-landmark-wrap { position: relative; height: 120px; margin-bottom: 8px; }
.cs-fog {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 60px; letter-spacing: 10px;
  transition: all 1s ease; filter: blur(0);
}
.cinema-overlay .cinema-phase.play .cs-fog { opacity: 0; filter: blur(12px); transform: scale(1.5); }
.cs-landmark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 82px; opacity: 0; transform: scale(.3);
  transition: all .8s cubic-bezier(.2,1.8,.4,1) .25s;
}
.cinema-overlay .cinema-phase.play .cs-landmark { opacity: 1; transform: scale(1); }
.cs-msg { font-size: 21px; font-weight: 900; color: var(--c-primary-d); margin-top: 6px;
  animation: shineText 1.4s ease-in-out infinite; }
.cs-scene { font-size: 13px; font-weight: 600; color: var(--c-text2); line-height: 1.7; margin-top: 8px; font-style: italic; }

/* scene 별 랜드마크 등장 색감 (spec ②) */
.scene-palace .cinema-card { border-color: #E8C04A; }
.scene-palace .cs-msg { color: #B8860B; }
.scene-river .cinema-card { border-color: #7EC8E3; }
.scene-river .cs-msg { color: #2E7CA8; }
.scene-tower .cinema-card { border-color: #6C5CE7; }
.scene-tower .cs-msg { color: #6C5CE7; }
.scene-gate .cinema-card { border-color: #D94F4F; }
.scene-gate .cs-msg { color: #B83838; }
.scene-stream .cinema-card { border-color: #5BB97C; }
.scene-stream .cs-msg { color: #2E8B57; }

/* 3단계: 의상 등장 */
.cinema-phase.pop { animation: phasePop .5s cubic-bezier(.2,1.5,.4,1); }
@keyframes phasePop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cr-shine { font-size: 15px; font-weight: 900; color: #B8860B; animation: shineText 1.3s ease-in-out infinite; }
.cr-emoji { font-size: 62px; margin: 8px 0; animation: float 2.2s ease-in-out infinite; }
.cr-name { font-size: 23px; font-weight: 900; color: var(--c-primary-d); }
.cr-sub { font-size: 13px; font-weight: 700; color: var(--c-text2); margin-top: 2px; }
.cr-line { font-size: 14px; font-weight: 700; color: var(--c-text2); background: #FFF6E8;
  border-radius: 12px; padding: 9px 12px; margin: 14px 0; border-left: 4px solid #F2C94C; }

/* ---------- 다음 목표 강 노출 (spec ⑥) ---------- */
.goal-next {
  margin-top: 12px; background: linear-gradient(135deg, #FFF3D6, #F3E9FF);
  border: 2px solid #E3C96A; border-radius: 16px; padding: 12px; text-align: left;
  animation: goalPulse 2.4s ease-in-out infinite;
}
@keyframes goalPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(227,201,106,.4); } 50% { box-shadow: 0 0 0 6px rgba(227,201,106,0); } }
.gn-label { font-size: 12px; font-weight: 900; color: #B8860B; }
.gn-name { font-size: 17px; font-weight: 900; color: #6B4F0E; margin-top: 3px; }
.gn-left { font-size: 13px; font-weight: 700; color: var(--c-text2); margin-top: 3px; }
.gn-left b { color: #B83838; font-size: 16px; }
.gn-reward { font-size: 12px; font-weight: 800; color: #7B4FE0; margin-top: 6px; }

/* 홈: 다음 목표 배너 */
.home-goal {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: linear-gradient(135deg, #FFF3D6, #F3E9FF);
  border: 2px solid #E3C96A; border-radius: 18px; padding: 12px 14px;
  margin: 10px 0; cursor: pointer; font-family: inherit; text-align: left;
  animation: goalPulse 2.4s ease-in-out infinite; transition: transform .15s;
}
.home-goal:hover { transform: translateY(-2px); }
.hg-label { flex: 0 0 auto; font-size: 11px; font-weight: 900; color: #B8860B; background: #fff; border-radius: 10px; padding: 4px 8px; }
.hg-text { flex: 1; font-size: 13px; font-weight: 700; color: #6B4F0E; }
.hg-text b { color: #4A3804; }
.hg-go { font-size: 20px; font-weight: 900; color: #B8860B; }

/* ---------- 뚜기 보물 연출 (spec ④) */
.treasure-box.ttugi-bonus .chest { animation: ttugiHop .7s ease-in-out infinite; }
@keyframes ttugiHop { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(-5deg); } }
.chest.ttugi-shake { animation: ttugiShake .4s ease-in-out 3; }
@keyframes ttugiShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.rr-bonus { font-size: 13px; font-weight: 800; color: #2E8B57; background: #E9FBF0; border-radius: 10px; padding: 7px 10px; margin-top: 8px; }

/* ---------- 원정대 사진 (spec ⑤) ---------- */
.photo-overlay {
  position: fixed; inset: 0; z-index: 380; display: flex; align-items: center; justify-content: center;
  background: rgba(25,18,45,.72); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.photo-overlay.show { opacity: 1; pointer-events: auto; }
.photo-card {
  position: relative; width: min(440px, 92vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(170deg, #FFFFFF, #FFF9EC);
  border-radius: 26px; padding: 22px; text-align: center;
  border: 4px solid #F2D98C; box-shadow: 0 16px 50px rgba(120,90,20,.4);
  transform: scale(.85); transition: transform .3s cubic-bezier(.2,1.4,.4,1);
}
.photo-overlay.show .photo-card { transform: none; }
.ph-shine { font-size: 16px; font-weight: 900; color: #B8860B; animation: shineText 1.3s ease-in-out infinite; }
.ph-flash { position: absolute; inset: 0; background: #fff; border-radius: 22px; opacity: 0; pointer-events: none; }
.ph-flash.on { opacity: .9; transition: opacity .1s; }
.ph-frame { margin: 12px 0; }
.ph-line { font-size: 14px; font-weight: 700; color: var(--c-text2); background: #FFF6E8; border-radius: 12px; padding: 9px 12px; border-left: 4px solid #F2C94C; }
.ph-save { font-size: 12px; font-weight: 700; color: var(--c-text2); margin: 10px 0 14px; }

/* 사진 프레임 (앨범에서도 사용) */
.photo-frame {
  background: linear-gradient(170deg, #EAF6FF, #F3E9FF);
  border: 3px solid #D9C2F5; border-radius: 20px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(80,40,140,.18); cursor: default;
}
.pf-scene { position: relative; height: 170px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(155,126,232,.18), transparent 60%), linear-gradient(180deg, #EAF6FF, #F6EEFF); }
.pf-landmark { position: absolute; top: 8px; font-size: 52px; animation: float 3s ease-in-out infinite; opacity: .95; }
.pf-chars { position: absolute; bottom: 6px; display: flex; gap: 2px; }
.pf-char { animation: float 2.4s ease-in-out infinite; }
.pf-char:nth-child(2) { animation-delay: .2s; }
.pf-char:nth-child(3) { animation-delay: .4s; }
.pf-char:nth-child(4) { animation-delay: .6s; }
.pf-char:nth-child(5) { animation-delay: .8s; }
.pf-stars { position: absolute; top: 56px; font-size: 14px; letter-spacing: 6px; animation: sparkle 1.6s ease-in-out infinite; }
@keyframes sparkle { 0%,100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }
.pf-caption { background: #fff; padding: 10px 14px; }
.pf-title { font-size: 15px; font-weight: 900; color: #7B4FE0; }
.pf-sub { font-size: 12px; font-weight: 700; color: var(--c-text2); margin-top: 2px; }

/* 기억 도감: 사진 앨범 */
.br-places { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.book-photos { margin-top: 14px; }
.bp-item { margin-bottom: 12px; }
.bp-item .photo-frame { pointer-events: none; }
.bp-empty { font-size: 13px; font-weight: 700; color: var(--c-text2); text-align: center;
  background: #F3EDDE; border-radius: 14px; padding: 20px; line-height: 1.7; }

/* ============================================================
 *  P1-A: 랜덤 탐험 사건 (퀴즈 중 떠다니는 ? )
 * ============================================================ */
.event-critter {
  position: fixed; z-index: 500; top: 38%; left: -70px;
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 38% 32%, #fff, #FFE9C4 70%, #F2C94C);
  box-shadow: 0 8px 18px rgba(120,90,20,.45), inset 0 0 0 3px #fff;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 0; opacity: 0; transition: transform .2s ease;
}
.event-critter.go { animation: critterRun 7s linear forwards, critterIn .3s ease forwards; }
.event-critter:hover { transform: scale(1.15); }
@keyframes critterIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes critterRun {
  0% { left: -70px; transform: translateY(0) rotate(-6deg); }
  15% { transform: translateY(-26px) rotate(4deg); }
  35% { transform: translateY(14px) rotate(-4deg); }
  55% { transform: translateY(-16px) rotate(6deg); }
  75% { transform: translateY(10px) rotate(-3deg); }
  100% { left: 110%; transform: translateY(0) rotate(0); }
}
.ec-icon { font-size: 26px; line-height: 1; }
.ec-q { font-size: 15px; font-weight: 900; color: #E07B1F; line-height: 1; margin-top: 1px; }
.event-critter::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px dashed rgba(242,201,76,.7); animation: spin 3.2s linear infinite;
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.event-overlay {
  position: fixed; inset: 0; z-index: 520; display: flex; align-items: center; justify-content: center;
  background: rgba(25,18,45,.66); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.event-overlay.show { opacity: 1; pointer-events: auto; }
.event-card {
  width: min(400px, 92vw); text-align: center;
  background: linear-gradient(170deg, #FFFFFF, #FFF6E3);
  border-radius: 26px; padding: 24px 20px;
  border: 4px solid #F2C94C; box-shadow: 0 16px 50px rgba(120,90,20,.4);
  transform: scale(.85); transition: transform .3s cubic-bezier(.2,1.4,.4,1);
}
.event-overlay.show .event-card { transform: none; }
.ev-tag { font-size: 13px; font-weight: 900; color: #E07B1F; letter-spacing: 2px; }
.ev-icon { font-size: 60px; margin: 8px 0 2px; animation: float 2.4s ease-in-out infinite; }
.ev-name { font-size: 20px; font-weight: 900; color: var(--c-text); }
.ev-line { font-size: 14px; font-weight: 700; color: var(--c-text2); margin-top: 6px; line-height: 1.5; }
.ev-char { font-size: 13px; font-weight: 800; color: #7B4FE0; background: #F3E9FF; border-radius: 12px; padding: 8px 10px; margin-top: 10px; }
.ev-reward {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #FFF3D6; border: 2px dashed #F2C94C; border-radius: 14px;
  padding: 12px 14px; margin: 14px 0 4px;
}
.evr-icon { font-size: 26px; }
.evr-text { font-size: 15px; font-weight: 900; color: #B8860B; }

/* ============================================================
 *  P1-B: 캐릭터 합류 이벤트 (콤보 입력)
 * ============================================================ */
.join-overlay.join-event {
  background: rgba(12,8,26,.85); backdrop-filter: blur(6px);
}
.join-overlay.join-event .join-card {
  border-color: #7B4FE0; box-shadow: 0 16px 60px rgba(60,20,120,.55);
}
.je-phase { text-align: center; }
.je-dark { font-size: 15px; font-weight: 800; color: #B9A8E8; letter-spacing: 3px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.je-runner { font-size: 74px; margin: 14px 0 6px; animation: runnerIn 1.2s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes runnerIn { from { transform: translateX(-120%) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.je-line { font-size: 18px; font-weight: 900; color: #FFFFFF; background: rgba(123,79,224,.35); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.je-title { font-size: 18px; font-weight: 900; color: var(--c-text); }
.je-desc { font-size: 13px; font-weight: 700; color: var(--c-text2); margin-top: 4px; }
.jq-seq { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.jq-step {
  width: 52px; height: 52px; border-radius: 14px; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 3px solid #E5D6B8; opacity: .45;
  transition: all .25s ease;
}
.jq-step.on { opacity: 1; border-color: var(--c-good); background: #E9FBF0; transform: scale(1.1); }
.jq-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jq-arrow {
  border: none; border-radius: 14px; height: 58px; font-size: 28px; cursor: pointer;
  background: #fff; box-shadow: 0 4px 0 rgba(74,55,38,.15), inset 0 0 0 2px #E5D6B8;
  transition: transform .1s ease;
}
.jq-arrow.flash { transform: scale(.9); background: #FFF3D6; box-shadow: 0 2px 0 rgba(74,55,38,.2), inset 0 0 0 3px #F2C94C; }
.jq-arrow:disabled { opacity: .4; cursor: default; }
.jq-status { font-size: 14px; font-weight: 900; color: #7B4FE0; margin-top: 12px; min-height: 20px; }
.jq-status.ok { color: var(--c-good); }
.jq-status.miss { color: var(--c-miss); }
.jq-skip { margin-top: 12px; }
.je-qte.play .jq-pad { animation: pop .3s ease both; }

/* ============================================================
 *  P1-C: 미스터리 발견 + 비밀 기억 개봉
 * ============================================================ */
.mystery-overlay, .secret-overlay {
  position: fixed; inset: 0; z-index: 420; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(40,20,80,.82), rgba(8,5,20,.94));
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.mystery-overlay.show, .secret-overlay.show { opacity: 1; pointer-events: auto; }
.mystery-card, .secret-card {
  width: min(430px, 92vw); max-height: 90vh; overflow-y: auto; text-align: center;
  background: linear-gradient(170deg, #2A1B4E, #140C2E);
  border-radius: 26px; padding: 26px 22px;
  border: 3px solid #7B4FE0; box-shadow: 0 0 60px rgba(123,79,224,.45);
  transform: scale(.85); transition: transform .35s cubic-bezier(.2,1.4,.4,1);
}
.mystery-overlay.show .mystery-card, .secret-overlay.show .secret-card { transform: none; }
.my-phase { text-align: center; }
.my-dots { font-size: 30px; color: #B9A8E8; letter-spacing: 8px; animation: pulse 1s ease-in-out infinite; }
.my-beat-text { font-size: 30px; font-weight: 900; color: #E6DFFF; margin-top: 10px; transition: opacity .5s ease; }
.my-beat.fade { opacity: 0; }
.my-emoji { font-size: 64px; margin: 10px 0 4px; animation: float 2.4s ease-in-out infinite; }
.my-found { font-size: 16px; font-weight: 800; color: #C9B6FF; margin-top: 8px; }
.my-strange { font-size: 19px; font-weight: 900; color: #FFFFFF; background: rgba(123,79,224,.4); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.my-marker { font-size: 56px; margin: 8px 0 4px; animation: sparkle 1.6s ease-in-out infinite; }
.my-hint-text { font-size: 15px; font-weight: 800; color: #E6DFFF; line-height: 1.7; margin-top: 8px; }
.my-hint-text b { color: #F2C94C; }
.sc-phase { text-align: center; }
.sc-shadow { font-size: 66px; margin: 6px 0 8px; animation: float 3s ease-in-out infinite; }
.sc-found { font-size: 19px; font-weight: 900; color: #FFFFFF; }
.sc-title { font-size: 22px; font-weight: 900; color: #F2C94C; margin-bottom: 10px; }
.sc-line { font-size: 15px; font-weight: 700; color: #D8CCFF; line-height: 1.9; }
.sc-story.play .sc-line { animation: lineIn .6s ease both; }
.sc-line:nth-child(2) { animation-delay: .15s; }
.sc-line:nth-child(3) { animation-delay: .35s; }
.sc-line:nth-child(4) { animation-delay: .55s; }
.sc-line:nth-child(5) { animation-delay: .75s; }
@keyframes lineIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sc-next { font-size: 16px; font-weight: 900; color: #B9A8E8; margin-top: 12px; }
.sc-next-region { font-size: 14px; font-weight: 800; color: #7B4FE0; background: rgba(123,79,224,.25); border-radius: 12px; padding: 8px 12px; margin-top: 6px; }
.sc-reward { background: rgba(242,201,76,.12); border: 2px dashed rgba(242,201,76,.6); border-radius: 16px; padding: 14px; margin-top: 14px; }
.scr-shine { font-size: 13px; font-weight: 900; color: #F2C94C; animation: shineText 1.3s ease-in-out infinite; }
.scr-emoji { font-size: 46px; margin: 4px 0; }
.scr-name { font-size: 18px; font-weight: 900; color: #FFFFFF; }
.scr-sub { font-size: 12px; font-weight: 800; color: #B9A8E8; }

/* S05: 비밀 기억 마커 바 */
.map-secret-bar { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.map-secret {
  flex: 1 1 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; border-radius: 16px; padding: 12px 14px; cursor: pointer;
  background: linear-gradient(100deg, #F3E9FF, #EAF6FF);
  box-shadow: 0 5px 0 rgba(123,79,224,.18);
  transition: transform .15s ease;
}
.map-secret:active { transform: scale(.98); }
.map-secret.st-ready { background: linear-gradient(100deg, #3D2A6B, #5B3FA8); animation: secretPulse 1.4s ease-in-out infinite; }
.map-secret.st-done { background: linear-gradient(100deg, #E9FBF0, #EAF6FF); }
@keyframes secretPulse { 0%,100% { box-shadow: 0 5px 0 rgba(123,79,224,.3); } 50% { box-shadow: 0 5px 22px rgba(123,79,224,.75); } }
.ms-icon { font-size: 26px; }
.ms-text { font-size: 14px; font-weight: 900; color: #5B3FA8; }
.st-ready .ms-text, .st-done .ms-text { color: #FFFFFF; }
.st-done .ms-text { color: var(--c-good); }
.map-teaser { font-size: 12px; font-weight: 900; color: #7B4FE0; margin-top: 4px; animation: pulse 1.4s ease-in-out infinite; }

/* S06: 지역 컬렉션 패널 (P2) */
.coll-panel {
  margin-top: 14px; background: #FFFFFF; border-radius: 20px; padding: 16px;
  box-shadow: var(--shadow); border: 3px solid #F2E3BC;
}
.coll-head { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 16px; font-weight: 900; color: var(--c-text); }
.coll-pct { font-size: 22px; font-weight: 900; color: #7B4FE0; }
.coll-bar { height: 12px; background: #F3EDDE; border-radius: 8px; margin: 8px 0 12px; overflow: hidden; }
.coll-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #F2C94C, #F29A2E); transition: width .5s ease; }
.coll-rows { display: flex; flex-direction: column; gap: 10px; }
.coll-row { display: flex; align-items: center; gap: 10px; }
.cr-label { flex: 0 0 76px; font-size: 12px; font-weight: 900; color: var(--c-text2); }
.cr-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.cr-count { flex: 0 0 auto; font-size: 12px; font-weight: 900; color: #7B4FE0; }
.cr-chip { font-size: 10px; font-weight: 800; border-radius: 10px; padding: 4px 7px; }
.cr-chip.done { background: #E9FBF0; color: var(--c-good); border: 1px solid #BFE3CC; }
.cr-chip.fog { background: #F3EDDE; color: var(--c-text2); border: 1px dashed #D9C9A8; }
.coll-secret {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; border-radius: 14px; padding: 12px 14px; cursor: pointer;
  background: linear-gradient(100deg, #F3E9FF, #EAF6FF);
  box-shadow: 0 4px 0 rgba(123,79,224,.18);
}
.coll-secret.st-ready { background: linear-gradient(100deg, #3D2A6B, #5B3FA8); animation: secretPulse 1.4s ease-in-out infinite; }
.coll-secret.st-done { background: linear-gradient(100deg, #E9FBF0, #F0F8F2); }
.coll-secret.hidden-row { background: #F3EDDE; box-shadow: none; cursor: default; }
.cs-icon { font-size: 22px; }
.cs-text { font-size: 13px; font-weight: 900; color: #5B3FA8; }
.st-ready .cs-text, .st-done .cs-text { color: #FFFFFF; }
.st-done .cs-text { color: var(--c-good); }

