/* City_Expedition 기본 스타일: 귀여운 일러스트 느낌 (둥근 모서리, 밝은 색) */
:root {
  --bg: #FFF8EC;
  --paper: #FFFFFF;
  --ink: #3A3335;
  --muted: #7A6F72;
  --line: #E8DCC8;
  --accent: #FF7A59;
  --accent-ink: #FFFFFF;
  --good: #3BAA6E;
  --bad: #E0525A;
  --shadow: 0 4px 0 rgba(58, 51, 53, .12), 0 8px 18px rgba(58, 51, 53, .08);
  --radius: 14px;
  --font-title: 'Jua', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --font-body: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --board: min(94vw, calc(100vh - 90px), 860px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(#F3E6CF 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
[hidden] { display: none !important; }

/* ---------- 위쪽 막대 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
}
.logo { font-family: var(--font-title); font-size: 22px; }
.top-actions { display: flex; flex-shrink: 0; }
.ver { font-family: var(--font-body); font-size: 12px; color: var(--muted); margin-left: 4px; }
.icon-btn {
  border: 2px solid var(--line); background: var(--paper); border-radius: 50%;
  width: 40px; height: 40px; font-size: 18px; margin-left: 6px; box-shadow: var(--shadow);
}
.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 16px 16px; }

/* ---------- 버튼 ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-size: 16px; font-weight: 700;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.good { background: var(--good); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border: 2px solid var(--line); }
.btn.big { font-size: 20px; padding: 14px 28px; font-family: var(--font-title); }

/* ---------- 시작 설정 ---------- */
.setup { display: flex; justify-content: center; padding: 8px 16px 24px; }
.setup-card {
  width: 100%; max-width: 620px; background: var(--paper); border-radius: 24px;
  padding: 24px; box-shadow: var(--shadow); border: 3px solid var(--line);
}
.setup-card h1 { font-family: var(--font-title); font-weight: 400; font-size: 34px; margin: 0; text-align: center; }
.tagline { text-align: center; color: var(--muted); margin: 6px 0 18px; }
.field { margin: 16px 0; }
.field h2 { font-family: var(--font-title); font-weight: 400; font-size: 20px; margin: 0 0 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  flex: 1 1 0; min-width: 90px; border: 2px solid var(--line); background: #FFFDF8; border-radius: 12px;
  padding: 10px 8px; font-size: 16px; font-weight: 700; color: var(--ink);
}
.seg button.on { border-color: var(--accent); background: #FFEDE6; color: #C9472A; }
.seg.small button { padding: 6px 8px; font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0; }
.error { color: var(--bad); font-weight: 700; min-height: 1.2em; text-align: center; }
#btnStart { display: block; margin: 8px auto 0; }

.player-rows { display: grid; gap: 8px; margin-top: 10px; }
.player-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.player-row input {
  flex: 1 1 140px; min-width: 0; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px;
}
.swatches { display: flex; gap: 6px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- 게임 화면 ---------- */
.game { display: flex; gap: 16px; padding: 0 16px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.board-wrap { flex: 0 0 auto; }
.board {
  width: var(--board); height: var(--board);
  display: grid;
  grid-template-columns: 1.35fr repeat(7, 1fr) 1.35fr;
  grid-template-rows: 1.35fr repeat(7, 1fr) 1.35fr;
  gap: 3px; padding: 6px;
  background: #F6E7CC; border-radius: 22px; box-shadow: var(--shadow); border: 3px solid #E5CFA8;
}
.cell {
  position: relative; background: var(--paper); border-radius: 9px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2px; border: 2px solid transparent;
  font-size: calc(var(--board) / 72); line-height: 1.15;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cell .band { position: absolute; left: 0; right: 0; top: 0; height: 16%; }
.cell .icon { font-size: calc(var(--board) / 34); margin-top: 8%; }
.cell .name { font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; position: relative; z-index: 1; }
.cell .price { color: var(--muted); font-size: .92em; }
.cell.corner { background: #FFF3D6; }
.cell.corner .icon { font-size: calc(var(--board) / 22); margin-top: 0; }
.cell .icon.img { line-height: 0; margin-top: 12%; }
.cell .icon.img img { height: calc(var(--board) / 15); width: auto; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.cell.corner .icon.img img { height: calc(var(--board) / 10); }
.cell.special .icon.img img { height: calc(var(--board) / 17); }
.postcard img.ph-mini { width: auto; height: 78%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.cell.corner .name { font-family: var(--font-title); font-weight: 400; font-size: 1.35em; }
.cell.special { background: #FFFBF2; }
.cell.owned { border-width: 3px; }
.cell .levels { position: absolute; bottom: 1px; left: 0; right: 0; font-size: 1em; letter-spacing: -2px; }
.cell .owner-flag { position: absolute; top: 18%; right: 3px; font-size: .95em; }
.cell .tokens { position: absolute; inset: 0; pointer-events: none; display: flex; flex-wrap: wrap; align-content: flex-end; justify-content: center; gap: 1px; padding-bottom: 14%; }
.cell.pick { cursor: pointer; box-shadow: 0 0 0 3px var(--accent); animation: pulse 1s infinite alternate; }
.cell.flash { animation: flash .9s ease; }
.cell.here { box-shadow: 0 0 0 3px #FFD166; }

.token {
  width: calc(var(--board) / 30); height: calc(var(--board) / 30); border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 2px 3px rgba(0,0,0,.3);
  color: #fff; font-weight: 700; font-size: calc(var(--board) / 60);
  display: flex; align-items: center; justify-content: center;
}
.token.hop { animation: hop .2s ease; }

.center {
  grid-column: 2 / 9; grid-row: 2 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 40%, #FFFDF6, #FBEFD8);
  border-radius: 16px; padding: 12px; text-align: center;
}
.center-title { font-family: var(--font-title); font-size: calc(var(--board) / 22); color: #B5835A; }
/* 판 가운데 그림: 글자가 잘 보이도록 가운데를 밝게 덮는다 */
.center { position: relative; overflow: hidden; justify-content: flex-start; padding-top: 4%; }
.center-art {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background-size: cover; background-position: center; opacity: .9; transition: opacity .6s ease;
}
.center-art::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 42% at 50% 62%, rgba(255,251,240,.78), rgba(255,251,240,.15) 70%, rgba(255,251,240,0));
}
.center > :not(.center-art) { position: relative; z-index: 1; }
.center-title span, .center-info span {
  background: rgba(255,251,240,.85); border-radius: 999px; padding: 0 12px; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.board.fx-on .center-art { opacity: .2; }
.board.fx-on .center-title span, .board.fx-on .center-info span { background: rgba(0,0,0,.25); }
.turn-label { font-family: var(--font-title); font-size: calc(var(--board) / 30); min-height: 1.2em; }
.dice-row { display: flex; gap: 14px; }
.die {
  width: calc(var(--board) / 10); height: calc(var(--board) / 10); background: #fff; border-radius: 16px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--board) / 18); font-weight: 700; border: 2px solid var(--line);
}
.die.rolling { animation: shake .12s infinite; }
.die.double { border-color: #FFD166; box-shadow: 0 0 16px #FFD166; }
.center-msg { min-height: 2.6em; max-width: 90%; font-size: calc(var(--board) / 48); color: var(--ink); white-space: pre-line; }
.center-info { display: flex; gap: 14px; color: var(--muted); font-size: calc(var(--board) / 56); }

/* ---------- 옆 패널 ---------- */
.side { flex: 1 1 280px; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.players { display: grid; gap: 8px; }
.pcard {
  position: relative; background: var(--paper); border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow); border-left: 8px solid #ccc;
}
.pcard.active { outline: 3px solid var(--accent); }
.pcard.out { opacity: .45; filter: grayscale(1); }
.pcard .pname { font-family: var(--font-title); font-size: 18px; }
.pcard .pmoney { font-size: 20px; font-weight: 700; }
.pcard .pmeta { font-size: 13px; color: var(--muted); }
.pcard .float {
  position: absolute; right: 12px; top: 6px; font-weight: 700; font-size: 18px; pointer-events: none;
  animation: floatUp 1.2s ease forwards;
}
.float.plus { color: var(--good); }
.float.minus { color: var(--bad); }
.log-box { background: var(--paper); border-radius: var(--radius); padding: 8px 12px; box-shadow: var(--shadow); }
.log-box h3 { margin: 0 0 4px; font-family: var(--font-title); font-weight: 400; }
.log { margin: 0; padding-left: 18px; max-height: 260px; overflow-y: auto; font-size: 13px; color: var(--muted); }
.log li { margin: 2px 0; }
.log li:first-child { color: var(--ink); font-weight: 700; }

/* ---------- 창 (모달) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(40, 30, 20, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
  animation: fadeIn .2s ease;
}
.modal {
  width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto;
  background: var(--paper); border-radius: 22px; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  border: 3px solid var(--line); animation: popIn .25s cubic-bezier(.2, 1.4, .4, 1);
}
.modal h2 { font-family: var(--font-title); font-weight: 400; margin: 0 0 10px; font-size: 24px; text-align: center; }
.modal .body { font-size: 16px; line-height: 1.55; }
.modal .buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.modal .buttons .btn { flex: 1 1 140px; }
.modal .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.modal .check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-weight: 700; }
.modal .check input { width: 20px; height: 20px; }
.modal .note { color: var(--muted); font-size: 14px; }

/* 엽서 액자 (실사 사진 자리) */
.postcard {
  position: relative; margin: 0 auto 12px; width: 100%; aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(45deg, #FFF6E5, #FFF6E5 10px, #FFEFD3 10px, #FFEFD3 20px);
  border: 8px solid #fff; outline: 3px dashed #E5CFA8; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  box-shadow: var(--shadow); transform: rotate(-1.2deg); overflow: hidden;
}
.postcard img { width: 100%; height: 100%; object-fit: cover; }
.postcard .ph-icon { font-size: 64px; }
.postcard .ph-text { font-size: 12px; color: var(--muted); }
.postcard .stamp {
  position: absolute; right: 8px; top: 8px; background: #fff; border: 2px dashed var(--accent);
  padding: 2px 6px; font-size: 12px; font-weight: 700; color: var(--accent); transform: rotate(6deg);
}
.side-tag { display: inline-block; border-radius: 999px; padding: 2px 10px; color: #fff; font-size: 12px; font-weight: 700; }

/* 퀴즈 */
.quiz-quote { background: #FFF6E5; border-left: 5px solid #F4A259; padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-weight: 700; }
.quiz-opts { display: grid; gap: 8px; margin-top: 12px; }
.quiz-opts .btn { text-align: left; border-radius: 12px; font-weight: 700; }
.quiz-opts .btn.right { background: var(--good); color: #fff; }
.quiz-opts .btn.wrong { background: var(--bad); color: #fff; }
.result-big { font-size: 56px; text-align: center; }

/* 역사 열쇠 두루마리 */
.scroll {
  background: linear-gradient(#F9EBC8, #F3DDA8); border-radius: 10px; padding: 16px 18px;
  border-top: 10px solid #C99A5B; border-bottom: 10px solid #C99A5B; text-align: center;
  animation: unroll .5s ease;
}
.scroll .year { font-family: var(--font-title); font-size: 30px; color: #8B5A2B; }
.scroll .ttl { font-family: var(--font-title); font-size: 22px; margin: 4px 0 8px; }

.rank li { font-size: 17px; margin: 6px 0; }

/* ---------- 2.5D 무대 (v1.1) ---------- */
.stage { position: relative; width: var(--board); perspective: 1500px; padding-top: 14px; }
/* v2.1.1: 판을 기울이면 위쪽 절반이 이 상자 뒤로 들어가 클릭이 막혔다 → 상자는 클릭을 통과시키고 판만 받는다 */
.board-tilt { transform-style: preserve-3d; transform: scale(.95); pointer-events: none; }
.board-tilt .board { pointer-events: auto; }
body { overflow-x: hidden; }
.board { position: relative; transform: rotateX(var(--tilt, 26deg)); transform-origin: 50% 55%; }
.board > .cell, .board > .center { z-index: 1; }
.board::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 0;
  background: var(--fx-bg, transparent); opacity: 0; transition: opacity .6s ease; pointer-events: none;
}
.board.fx-on::before { opacity: 1; }
.board.fx-on .cell { box-shadow: 0 0 10px rgba(255, 255, 255, .55); }
.board.fx-on .center { background: rgba(255, 253, 246, .2); }
.board.fx-on .center-title, .board.fx-on .center-info { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.board.fx-dance .cell { animation: cellDance .5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 35ms); }
.board.fx-glow { box-shadow: 0 0 0 4px #FFD166, 0 0 40px #FFD166, var(--shadow); transition: box-shadow .3s; }
.cell .tokens { display: none; }

/* 캐릭터 */
.actors { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.actor {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transition: transform .17s linear;
}
.actor .body {
  position: absolute; left: 0; bottom: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.actor .sprite {
  height: calc(var(--board) * .12); width: auto; display: block;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.25));
  transform-origin: 50% 100%;
}
.actor .sprite.flip { transform: scaleX(-1); }
.actor .ring {
  position: absolute; left: 50%; bottom: calc(var(--board) * -.008); transform: translateX(-50%);
  width: calc(var(--board) * .06); height: calc(var(--board) * .02); border-radius: 50%;
  background: radial-gradient(ellipse, var(--c) 30%, transparent 72%); opacity: .85;
}
.actor .react { position: relative; transform-origin: 50% 100%; }
.actor .react.r-jump { animation: reactJump .9s ease-in-out; }
.actor .react.r-dance { animation: reactDance 1.4s ease-in-out; }
.actor .react.r-sad { animation: reactSad 1s ease-in-out; }
.actor .bubble {
  position: absolute; bottom: calc(100% + var(--board) * .03); left: 50%; transform: translateX(-50%) scale(0);
  background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 14px;
  padding: 2px 10px; font-family: var(--font-title); font-size: calc(var(--board) / 42); white-space: nowrap;
  transform-origin: 50% 100%; opacity: 0; pointer-events: none;
}
.actor .bubble::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--ink);
}
.actor .bubble.show { animation: bubblePop 1.7s ease forwards; }
.actor .bubble.sad { background: #E8F0FF; }
.music-sel {
  height: 40px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper);
  padding: 0 10px; font-family: inherit; font-size: 14px; box-shadow: var(--shadow); margin-left: 6px;
}
.icon-btn.off { opacity: .45; }
@media (max-width: 520px) { .music-sel { width: 92px; font-size: 12px; } .icon-btn { width: 36px; height: 36px; margin-left: 4px; } }
.actor .tag {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: calc(var(--board) / 62); font-weight: 700; color: #fff;
  background: var(--c); padding: 1px 6px; border-radius: 999px; opacity: 0; transition: opacity .2s;
}
.actor.active .tag { opacity: 1; }
.actor.active .ring { animation: ringPulse 1s ease-in-out infinite alternate; }
.actor.idle .sprite { animation: idleBob 1.6s ease-in-out infinite; }
.actor.running .sprite { animation: runHop .17s ease-in-out infinite; }
.actor.running .sprite.flip { animation-name: runHopFlip; }
.actor.running.legs .sprite { animation-name: runBob; }
.actor.running.legs .sprite.flip { animation-name: runBobFlip; }
.actor.pop .body { animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.actor.fallback .sprite { display: none; }
.actor .dot {
  display: none; width: calc(var(--board) / 30); height: calc(var(--board) / 30); border-radius: 50%;
  background: var(--c); border: 2px solid #fff; color: #fff; font-weight: 700; font-size: calc(var(--board) / 60);
  align-items: center; justify-content: center;
}
.actor.fallback .dot { display: flex; }

/* 가운데 안내 */
.hud {
  position: absolute; left: 50%; top: 66%; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 60%; text-align: center;
  pointer-events: none;
}
.hud .btn { pointer-events: auto; }
.hud .turn-label { background: rgba(255,255,255,.85); padding: 2px 14px; border-radius: 999px; }
.hud .center-msg { background: rgba(255,255,255,.75); border-radius: 12px; padding: 2px 10px; min-height: 0; }
.hud .center-msg:empty { display: none; }

/* 3D 주사위 */
.dice-stage {
  position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); z-index: 7;
  display: flex; gap: calc(var(--board) * .05); align-items: flex-end; pointer-events: none;
  --die: calc(var(--board) * .075);
}
.dice-stage.idle .die3d { opacity: .9; }
.die3d { width: var(--die); height: var(--die); perspective: 600px; position: relative; z-index: 2; }
.die3d::after {
  content: ''; position: absolute; left: 10%; right: 10%; bottom: -14%; height: 16%;
  background: radial-gradient(ellipse, rgba(0,0,0,.35), transparent 70%); z-index: -1;
}
.die3d .cube {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
}
.die3d .face {
  position: absolute; inset: 0; background: linear-gradient(145deg, #FFFFFF, #F1ECE4);
  border-radius: 18%; border: 1px solid #E0D6C6;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 12%;
  box-shadow: inset 0 0 8px rgba(0,0,0,.08); backface-visibility: hidden;
}
.die3d .face span { display: flex; align-items: center; justify-content: center; }
.die3d .face span.pip::before { content: ''; width: 70%; height: 70%; border-radius: 50%; background: #2B2B2B; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.die3d .face span.pip.red::before { background: #D7263D; width: 90%; height: 90%; }
.die3d .front { transform: translateZ(calc(var(--die) / 2)); }
.die3d .back { transform: rotateY(180deg) translateZ(calc(var(--die) / 2)); }
.die3d .right { transform: rotateY(90deg) translateZ(calc(var(--die) / 2)); }
.die3d .left { transform: rotateY(-90deg) translateZ(calc(var(--die) / 2)); }
.die3d .top { transform: rotateX(90deg) translateZ(calc(var(--die) / 2)); }
.die3d .bottom { transform: rotateX(-90deg) translateZ(calc(var(--die) / 2)); }
.die3d.double .face { border-color: #FFD166; box-shadow: 0 0 14px #FFD166, inset 0 0 8px rgba(0,0,0,.08); }
.thrower {
  position: absolute; left: 50%; bottom: calc(var(--board) * -.2); height: calc(var(--board) * .3);
  transform: translateX(-50%) scale(.6); opacity: 0; pointer-events: none; z-index: 1;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.3));
}
.thrower.in { animation: throwIn .4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.thrower.out { animation: throwOut .45s ease forwards; }

/* 축하 공연 */
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; }
.fx-banner {
  position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0) scale(.5); z-index: 9;
  font-family: var(--font-title); font-size: calc(var(--board) / 16); color: #fff; white-space: nowrap;
  text-shadow: 0 3px 0 #C9472A, 0 0 20px rgba(255, 200, 80, .9); opacity: 0; pointer-events: none;
}
.fx-banner.show { animation: bannerPop 2.4s ease forwards; }

/* 시작 화면 캐릭터 고르기 */
.char-pick { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.char-btn {
  width: 52px; height: 64px; border-radius: 12px; border: 2px solid var(--line); background: #FFFDF8;
  padding: 2px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.char-btn img { height: 100%; width: auto; }
.char-btn.on { border-color: var(--accent); background: #FFEDE6; box-shadow: 0 0 0 2px var(--accent); }
.player-row { border: 2px dashed var(--line); border-radius: 14px; padding: 8px; }

/* ---------- 실사 사진 엽서 (v1.7) ---------- */
.postcard.has-photo { background: #fff; }
.postcard img.ph-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.postcard img.ph-badge {
  position: absolute; left: 6px; bottom: 6px; width: 22%; height: auto;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); transform: rotate(-4deg);
}
.photo-credit { font-size: 11px; color: var(--muted); margin: -6px 0 6px; text-align: right; word-break: break-all; }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 12px; padding: 0; }
.credits { padding-left: 18px; font-size: 13px; max-height: 50vh; overflow-y: auto; }
.credits li { margin: 4px 0; }

/* ---------- 분위기: 테마 · 날씨 (v1.7) ---------- */
.atmo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.atmo-row label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.atmo-row select { border: 2px solid var(--line); border-radius: 10px; padding: 6px 8px; font-family: inherit; font-size: 15px; background: #FFFDF8; }
.theme-greeting { text-align: center; font-family: var(--font-title); font-size: 20px; margin: -8px 0 6px; min-height: 0; }
.theme-greeting:empty { display: none; }
.weather-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }
.theme-deco { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.theme-deco .deco { position: absolute; font-size: calc(var(--board) / 13); animation: decoBob 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.theme-deco .deco.tl { left: -2%; top: 0; }
.theme-deco .deco.tr { right: -2%; top: 0; animation-delay: .6s; }
.theme-deco .deco.bl { left: -2%; bottom: -2%; animation-delay: 1.2s; }
.theme-deco .deco.br { right: -2%; bottom: -2%; animation-delay: 1.8s; }
.theme-deco .deco-garland {
  position: absolute; left: 8%; right: 8%; top: 0; overflow: hidden; white-space: nowrap; text-align: center;
  font-size: calc(var(--board) / 40); letter-spacing: 4px; opacity: .9;
}
@keyframes decoBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

/* 테마별 배경과 판 테두리 */
body.theme-seollal { background-color: #FFF0E6; background-image: radial-gradient(#F3B6A0 1.4px, transparent 1.4px); }
body.theme-seollal .board { background: #F9D9C9; border-color: #D64545; }
body.theme-seollal .setup-card { border-color: #E9A08A; }
body.theme-valentine { background-color: #FFF0F5; background-image: radial-gradient(#FFB6CE 1.6px, transparent 1.6px); }
body.theme-valentine .board { background: #FFD6E5; border-color: #FF6F9F; }
body.theme-whiteday { background-color: #F4FFFD; background-image: radial-gradient(#BDEFE9 1.6px, transparent 1.6px); }
body.theme-whiteday .board { background: #E3F7F4; border-color: #8FD6CE; }
body.theme-childrensday { background-color: #F1F8FF; background-image: radial-gradient(#B9DAFF 1.6px, transparent 1.6px); }
body.theme-childrensday .board { background: #DDEFFF; border-color: #5AA9F0; }
body.theme-chuseok { background-color: #1F2A44; background-image: radial-gradient(#3B4B70 1.4px, transparent 1.4px); }
body.theme-chuseok .board { background: #F3E2B8; border-color: #C9A227; }
body.theme-chuseok .topbar .logo, body.theme-chuseok .footer, body.theme-chuseok .footer .link-btn, body.theme-chuseok .ver { color: #FBE9B7; }
body.theme-halloween { background-color: #2B1D3A; background-image: radial-gradient(#4E356B 1.4px, transparent 1.4px); }
body.theme-halloween .board { background: #F7C59F; border-color: #FF7518; }
body.theme-halloween .topbar .logo, body.theme-halloween .footer, body.theme-halloween .footer .link-btn, body.theme-halloween .ver { color: #FFD9B0; }
body.theme-pepero { background-color: #FFF6EC; background-image: radial-gradient(#E3C3A0 1.4px, transparent 1.4px); }
body.theme-pepero .board { background: #F3DCC2; border-color: #8B4513; }
body.theme-christmas { background-color: #F3FAF5; background-image: radial-gradient(#C5E3CF 1.6px, transparent 1.6px); }
body.theme-christmas .board { background: #E4F2E7; border-color: #D62828; box-shadow: 0 0 0 4px #2A9D8F inset, var(--shadow); }

/* ---------- 큰 글자 연출 (v1.8) ---------- */
.pop-text {
  position: absolute; left: 50%; top: 42%; z-index: 30; pointer-events: none; white-space: nowrap;
  font-family: var(--font-title); font-size: calc(var(--board) / 11); line-height: 1;
  color: #FFD23F; -webkit-text-stroke: calc(var(--board) / 220) #5A2D0C;
  text-shadow: 0 5px 0 #5A2D0C, 0 8px 16px rgba(0,0,0,.35);
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(.2); opacity: 0;
  animation: popBig 1.8s cubic-bezier(.2, 1.5, .4, 1) forwards;
}
.pop-text.at-actor { font-size: calc(var(--board) / 18); animation: popFloat 1.5s ease-out forwards; }
.pop-text.bad { color: #9EC5FF; -webkit-text-stroke-color: #1D3557; text-shadow: 0 5px 0 #1D3557, 0 8px 16px rgba(0,0,0,.35); }
.pop-text.plus { color: #7CF29A; -webkit-text-stroke-color: #145A32; text-shadow: 0 4px 0 #145A32, 0 6px 12px rgba(0,0,0,.3); }
.pop-text.minus { color: #FF6B6B; -webkit-text-stroke-color: #6B0F1A; text-shadow: 0 4px 0 #6B0F1A, 0 6px 12px rgba(0,0,0,.3); }
.pop-text.info { color: #D7B8FF; -webkit-text-stroke-color: #3C096C; text-shadow: 0 5px 0 #3C096C; }
@keyframes popBig {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(.2); }
  14% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.25); }
  24% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(.95); }
  32% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.05); }
  40%, 78% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) rotate(var(--rot)) scale(1.1); }
}
@keyframes popFloat {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.4); }
  18% { opacity: 1; transform: translate(-50%, -60%) scale(1.2); }
  30% { transform: translate(-50%, -70%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}
/* 만화식 의태어 */
.comic-text {
  position: absolute; z-index: 28; pointer-events: none; white-space: nowrap;
  font-family: var(--font-title); font-size: calc(var(--board) / 20); line-height: 1.1;
  padding: .12em .4em .05em; border-radius: 16px; border: 3px solid #333; background: #FFFDF2;
  color: #FF7A00; -webkit-text-stroke: 1px #5A2D0C; box-shadow: 3px 4px 0 rgba(0,0,0,.25);
  transform: translate(-50%, -110%) rotate(var(--rot, 0deg)) scale(0); transform-origin: 50% 100%;
  animation: comicPop 1.6s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
.comic-text.great { color: #FF2E88; background: #FFF4FA; }
.comic-text.sad { color: #3A6EA5; background: #EEF5FF; -webkit-text-stroke-color: #1D3557; }
.comic-text::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: inherit;
}
@keyframes comicPop {
  0% { opacity: 0; transform: translate(-50%, -110%) rotate(var(--rot)) scale(0); }
  15% { opacity: 1; transform: translate(-50%, -125%) rotate(var(--rot)) scale(1.3); }
  28% { transform: translate(-50%, -118%) rotate(var(--rot)) scale(.95); }
  38%, 80% { opacity: 1; transform: translate(-50%, -120%) rotate(var(--rot)) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -170%) rotate(var(--rot)) scale(1); }
}

/* ---------- 땅 주인 표시 (v1.8) ---------- */
.cell.owned { border-width: 4px; }
.cell.owned::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 9%; background: var(--own); opacity: .9; pointer-events: none;
}
.cell .owner-flag { top: 14%; right: 2px; z-index: 2; }
.owner-face {
  display: block; width: calc(var(--board) / 26); height: calc(var(--board) / 26); border-radius: 50%;
  border: 3px solid var(--c); background-color: #fff; background-repeat: no-repeat;
  background-size: 210% auto; background-position: 50% 6%; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.cell.owned .levels { bottom: 10%; }

/* ---------- 급매 창 (v1.8) ---------- */
.sell-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.sell-head > div { background: #FFF6E5; border-radius: 10px; padding: 6px; text-align: center; }
.sell-head span { display: block; font-size: 12px; color: var(--muted); }
.sell-head b { font-size: 17px; }
.sell-head .short { background: #FFE3E3; }
.sell-head .short b { color: var(--bad); }
.sell-list { display: grid; gap: 6px; max-height: 38vh; overflow-y: auto; margin: 6px 0; }
.sell-row {
  display: grid; grid-template-columns: 22px 44px 1fr auto; align-items: center; gap: 8px;
  border: 2px solid var(--line); border-radius: 12px; padding: 6px 8px; cursor: pointer; background: #fff;
}
.sell-row.on { border-color: var(--bad); background: #FFF2F2; }
.sell-row input { width: 18px; height: 18px; }
.sell-row img { width: 44px; height: 44px; object-fit: contain; }
.sr-name small { display: block; color: var(--muted); font-size: 12px; }
.sr-price { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.sr-price s { color: var(--muted); font-size: 12px; }
.sr-price b { color: var(--bad); font-size: 16px; }
.sr-price em { font-style: normal; font-size: 11px; color: #fff; background: var(--bad); border-radius: 999px; padding: 0 6px; }
.sell-sum { display: grid; gap: 2px; background: #F7F3EC; border-radius: 10px; padding: 8px 10px; }
.sell-sum > div { display: flex; justify-content: space-between; }
.sell-sum .neg { color: var(--bad); }
.sell-sum .pos { color: var(--good); }
.warn { color: var(--bad); font-weight: 700; font-size: 14px; margin: 6px 0 0; }

/* ---------- 움직임 ---------- */
@keyframes runBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes runBobFlip { 0%, 100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-4px); } }
@keyframes reactJump {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  10% { transform: translateY(0) scale(1.1, .88); }
  22% { transform: translateY(-26px) scale(.95, 1.06); }
  34% { transform: translateY(0) scale(1.1, .9); }
  46% { transform: translateY(-20px) scale(.96, 1.05); }
  58% { transform: translateY(0) scale(1.08, .92); }
  72% { transform: translateY(-12px) scale(1, 1); }
  84% { transform: translateY(0) scale(1.04, .96); }
}
@keyframes reactDance {
  0%, 100% { transform: translateY(0) rotate(0); }
  15% { transform: translateY(-22px) rotate(-10deg); }
  30% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-22px) rotate(10deg); }
  60% { transform: translateY(0) rotate(0); }
  75% { transform: translateY(-30px) scale(1.1); }
  90% { transform: translateY(0) scale(1); }
}
@keyframes reactSad {
  0%, 100% { transform: rotate(0) scaleY(1); }
  15% { transform: rotate(-8deg) scaleY(.94); }
  30% { transform: rotate(8deg) scaleY(.92); }
  45% { transform: rotate(-6deg) scaleY(.92); }
  60% { transform: rotate(5deg) scaleY(.93); }
  80% { transform: rotate(0) scaleY(.94); }
}
@keyframes bubblePop {
  0% { opacity: 0; transform: translateX(-50%) scale(0); }
  12% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  20% { transform: translateX(-50%) scale(1); }
  85% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(1); }
}
@keyframes cellDance { from { transform: translateY(0); } to { transform: translateY(-5px) scale(1.03); } }
@keyframes ringPulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.5); } }
@keyframes idleBob { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-2px) scaleY(1.02); } }
@keyframes runHop { 0% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-9px) rotate(5deg); } 100% { transform: translateY(0) rotate(-5deg); } }
@keyframes runHopFlip { 0% { transform: scaleX(-1) translateY(0) rotate(-5deg); } 50% { transform: scaleX(-1) translateY(-9px) rotate(5deg); } 100% { transform: scaleX(-1) translateY(0) rotate(-5deg); } }
@keyframes throwIn { from { opacity: 0; transform: translateX(-50%) translateY(30px) scale(.6); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes throwOut { from { opacity: 1; transform: translateX(-50%) scale(1); } to { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.8); } }
@keyframes bannerPop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  25% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -20px) scale(1); }
}
@keyframes hop { 0% { transform: translateY(0); } 50% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes shake { 0% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } 100% { transform: rotate(-10deg); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes flash { 0% { transform: scale(1); } 30% { transform: scale(1.18); box-shadow: 0 0 20px #FFD166; } 100% { transform: scale(1); } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-30px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes unroll { from { transform: scaleY(.1); } to { transform: scaleY(1); } }

@media (max-width: 760px) {
  :root { --board: min(calc(100vw - 28px), 620px); }
  .game { padding: 0 8px; }
  .side { max-width: none; }
  .center-msg { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 은행 대출 (v1.9.0) ---------- */
.hud-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn.bank { background: #FFF3C4; color: #6B4E00; border: 2px solid #E8B400; pointer-events: auto; }
.btn.bank.owe { background: #FFE3E3; color: #9B1C1C; border-color: #E06666; }
.pcard .pdebt { font-size: 13px; font-weight: 700; color: #9B1C1C; background: #FFF0F0; border-radius: 8px; padding: 1px 6px; margin: 2px 0; display: inline-block; }
.pcard .pdebt.urgent { background: #E03131; color: #fff; animation: debtBlink 1s ease-in-out infinite; }
@keyframes debtBlink { 50% { opacity: .55; } }
.stars { color: #F2A900; letter-spacing: 1px; }
.bank-box .neg, .loan-choice .neg, .modal .neg { color: var(--bad); }
.rate-line { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); margin: 4px 0; }
.rate-line span { background: #F3F0E8; border-radius: 999px; padding: 1px 8px; }
.rate-line span.on { background: #FFE08A; color: #6B4E00; font-weight: 700; }
.bank-act { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #F6FAFF; border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.bank-act em { color: var(--muted); font-style: normal; font-size: 13px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #DCE8FF; font-size: 18px; font-weight: 700; cursor: pointer; }
.stepper b { min-width: 64px; text-align: center; font-size: 18px; }
.bank-tip { background: #FFFBEA; border-left: 4px solid #F2C94C; border-radius: 6px; padding: 6px 10px; font-size: 13px; margin: 8px 0 0; }
.loan-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }
.loan-choice .lc { background: #F6FAFF; border-radius: 10px; padding: 8px; text-align: center; }
.loan-choice .lc:last-child { background: #FFF6E5; }
.loan-choice p { margin: 4px 0 0; font-size: 13px; }
@media (max-width: 520px) { .loan-choice { grid-template-columns: 1fr; } }
/* 매입 대출 (v2.0.0) */
.buy-loan { background: #F6FAFF; border: 2px dashed #8DB3F0; border-radius: 10px; padding: 6px 10px; margin: 6px 0; font-size: 14px; }
.buy-loan .neg { color: var(--bad); }

/* ---------- 재미 더하기 (v2.1.0) ---------- */
.start-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.start-row .btn.big { flex: 1 1 220px; }
.start-row .btn.ghost { flex: 0 0 auto; }
.ai-sel { padding: 7px 8px; border-radius: 10px; border: 2px solid var(--line); font: inherit; background: #fff; }
.player-row.is-ai input { background: #EEF3FF; }
.ai-badge { display: inline-block; font-size: 11px; background: #E7EEFF; color: #3A56B0; border-radius: 8px; padding: 1px 6px; vertical-align: 2px; }
.modal { position: relative; }
.auto-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); border-radius: 0 0 0 20px; animation: autoBar linear forwards; }
@keyframes autoBar { from { width: 0; } to { width: 100%; } }

/* 뉴스 속보 */
.center-news { margin: 4px auto 0; background: #1F3A68; color: #fff; border-radius: 10px; padding: 3px 10px; font-size: calc(var(--board) / 52); width: fit-content; animation: newsPulse 1.6s ease-in-out infinite; }
@keyframes newsPulse { 50% { box-shadow: 0 0 0 5px rgba(31, 58, 104, .25); } }
.cell.news-hot { box-shadow: inset 0 0 0 3px #FFB020, 0 0 12px rgba(255, 176, 32, .7); }
.news { text-align: center; }
.news-icon { font-size: 54px; line-height: 1.1; }
.news-title { font-family: var(--font-title); font-size: 26px; margin: 4px 0; color: #1F3A68; }
.modal .sale { font-style: normal; font-size: 12px; color: #C25B00; }

/* 모두의 퀴즈 */
.gq-turn { margin-top: 8px; min-height: 22px; }
.gq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gq-chip { border: 2px solid var(--c); border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--muted); background: #fff; }
.gq-chip.done { color: var(--ink); font-weight: 700; }
.gq-chip.ok { background: var(--c); color: #fff; font-weight: 700; }
.gq-chip.no { opacity: .6; }

/* 미니게임 */
.mg-rewards { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mg-rewards span { background: #FFF4D6; border-radius: 10px; padding: 4px 8px; font-size: 13px; color: #B07A00; display: flex; flex-direction: column; align-items: center; }
.mg-rewards b { color: var(--ink); }
.mg { text-align: center; user-select: none; -webkit-user-select: none; }
.mg-status { font-weight: 700; margin-bottom: 10px; min-height: 24px; }
.mg-marks { font-size: 22px; min-height: 30px; margin-top: 8px; letter-spacing: 4px; }
.mg .btn.big { width: 100%; font-size: 22px; padding: 16px; touch-action: manipulation; }
.mg-bar { position: relative; height: 34px; background: #F1E6D2; border-radius: 17px; margin: 8px 0 12px; overflow: hidden; border: 3px solid var(--line); }
.mg-zone { position: absolute; top: 0; bottom: 0; background: #7BD389; }
.mg-needle { position: absolute; top: -2px; bottom: -2px; width: 6px; margin-left: -3px; background: var(--ink); border-radius: 3px; }
.mg-bar.hit { border-color: var(--good); }
.mg-bar.miss { border-color: var(--bad); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.mg-say { font-size: 15px; color: var(--muted); min-height: 24px; margin-bottom: 8px; }
.mg-river { position: relative; height: 70px; background: linear-gradient(#9AD3F5, #5FB2E6); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.mg-boat { position: absolute; left: 0; top: 14px; font-size: 38px; transform: translateX(-10%) scaleX(-1); transition: left .12s ease-out; }
.mg-boat.kick { animation: bob .18s; }
@keyframes bob { 50% { top: 9px; } }
.mg-flag { position: absolute; top: 4px; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: #fff; background: rgba(0,0,0,.25); border-radius: 6px; padding: 1px 5px; }
.mg-flag.f3 { font-size: 18px; background: none; }
.mg-count { font-family: var(--font-title); font-size: 26px; margin-bottom: 8px; }
.mg-guardman { font-size: 54px; position: relative; height: 80px; }
.mg-showflag { position: absolute; left: 58%; top: 6px; min-width: 46px; padding: 8px 6px; border-radius: 6px; font-size: 18px; font-weight: 700; opacity: 0; transform: rotate(-12deg) scale(.6); transition: .15s; border: 2px solid rgba(0,0,0,.15); color: #222; }
.mg-showflag.on { opacity: 1; transform: rotate(-12deg) scale(1); }
.mg-flags { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mg-flagbtn { border: 3px solid rgba(0,0,0,.12); background: var(--fc); border-radius: 14px; padding: 12px 4px; font-weight: 700; font-size: 16px; color: #222; touch-action: manipulation; }
.mg-flagbtn span { display: block; font-size: 26px; }
.mg-flagbtn small { display: block; font-size: 11px; opacity: .6; }
.mg-flagbtn.lit { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 0 18px var(--fc); }

/* 업적 알림 */
.toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(92vw, 380px); }
.ach-toast { display: flex; gap: 10px; align-items: center; background: #fff; border: 3px solid #F2B134; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); animation: popIn .3s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; }
.ach-toast.out { opacity: 0; transform: translateY(-10px); }
.ach-toast .ai { font-size: 30px; }
.ach-toast small { display: block; color: var(--muted); font-size: 12px; }

/* 탐험 도감 */
.modal.book-modal { max-width: 640px; }
.bk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-head select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 2px solid var(--line); }
.bk-prog { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.bk-prog span { background: #FFF4D6; border-radius: 10px; padding: 4px 10px; font-size: 14px; }
.bk-h { font-family: var(--font-title); font-weight: 400; margin: 12px 0 6px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bk-tile { border: 2px dashed var(--line); border-radius: 12px; padding: 6px; text-align: center; filter: grayscale(1); opacity: .55; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bk-tile img { width: 44px; height: 44px; object-fit: contain; }
.bk-emo { font-size: 32px; }
.bk-tile.v { filter: none; opacity: 1; border-style: solid; }
.bk-tile.q { border-color: #F2B134; background: #FFF8E1; }
.bk-name { font-size: 12px; line-height: 1.25; }
.bk-stamps { font-size: 14px; min-height: 18px; }
.bk-achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.bk-ach { display: flex; gap: 8px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 6px 8px; opacity: .55; }
.bk-ach.got { opacity: 1; border-color: #F2B134; background: #FFF8E1; }
.bk-ach span { font-size: 24px; }
.bk-ach small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.result-big.mg-stars { color: #F2B134; letter-spacing: 4px; text-shadow: 0 2px 0 rgba(0,0,0,.12); }

/* ---------- 카메라 따라가기 (v2.2.0) ---------- */
/* 판과 캐릭터는 #cam 안에서 함께 확대·이동하고, 주사위·안내판·축하 효과는 무대(#stage)에 고정된다 */
.stage { perspective: none; padding-top: 0; }
.cam-view { position: relative; overflow: hidden; border-radius: 26px; }
.cam { position: relative; transform-origin: 0 0; perspective: 1500px; padding-top: calc(var(--board) * .05); }
.cam .actors { z-index: 5; }
.btn.cam-btn { background: #fff; }
/* 따라가기 모드: 안내판을 판 가운데 대신 무대 아래쪽에 둔다 (캐릭터를 가리지 않게) */
.game.cam-on .hud { top: auto; bottom: 2.5%; width: 74%; }
.game.cam-on .hud .turn-label { font-size: calc(var(--board) / 34); }
.hud-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
button, .cell, .seg button { touch-action: manipulation; }

/* ---------- 휴대폰 화면 (v2.2.0) ---------- */
@media (max-width: 600px) {
  :root { --board: calc(100vw - 12px); }
  .topbar { padding: 6px 8px; }
  .logo { font-size: 17px; }
  .logo .logo-text { display: none; }
  .music-sel { width: 84px; height: 36px; font-size: 12px; padding: 0 6px; margin-left: 3px; }
  .icon-btn { width: 36px; height: 36px; font-size: 16px; margin-left: 3px; }
  .setup { padding: 4px 6px 16px; }
  .setup-card { padding: 14px 12px; border-radius: 18px; }
  .setup-card h1 { font-size: 26px; }
  .game { padding: 0 6px; gap: 8px; }
  .board { --tilt: 16deg; }
  /* 안내판과 버튼은 판 아래로 (판을 가리지 않게, 손가락으로 누르기 쉽게) */
  .hud, .game.cam-on .hud { position: static; transform: none; width: 100%; margin-top: 6px; gap: 6px; }
  .hud .turn-label, .game.cam-on .hud .turn-label { font-size: 19px; }
  .hud .center-msg { font-size: 14px; max-width: 100%; }
  .hud-btns { width: 100%; flex-wrap: nowrap; }
  .hud-btns .btn { font-size: 16px; padding: 12px 12px; white-space: nowrap; }
  .hud-btns #btnRoll { flex: 1 1 auto; font-size: 18px; }
  .dice-stage { top: 40%; --die: calc(var(--board) * .11); }
  .actor .tag { font-size: 11px; }
  .actor .bubble { font-size: 13px; }
  .side { flex: 1 1 100%; max-width: none; gap: 8px; }
  .players { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .pcard { padding: 6px 8px; border-left-width: 6px; }
  .pcard .pname { font-size: 15px; }
  .pcard .pmoney { font-size: 16px; }
  .pcard .pmeta { font-size: 11px; line-height: 1.35; }
  .log { max-height: 130px; font-size: 12px; }
  .modal { padding: 16px 14px; border-radius: 18px; max-height: 88vh; }
  .modal h2 { font-size: 21px; }
  .pop-text { font-size: 26px; }
}
@media (max-width: 600px) {
  .hud-btns { gap: 6px; }
  .hud-btns .btn { padding: 12px 10px; min-width: 0; }
  .hud-btns #btnRoll { flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; }
  .hud-btns #btnCam, .hud-btns #btnBank { flex: 0 0 auto; font-size: 15px; }
}
@media (max-width: 600px) {
  .theme-deco .deco.tl, .theme-deco .deco.bl { left: 0; }
  .theme-deco .deco.tr, .theme-deco .deco.br { right: 0; }
  .stage { overflow-x: clip; }
}

/* ---------- 조커 카드 · 손가락 확대 (v2.3.0) ---------- */
.cam-view { touch-action: pan-y; }
.cam-view.zoomed { touch-action: none; }
.btn.joker, .btn.joker-btn { background: linear-gradient(135deg, #7B4DFF, #C04CFD); color: #fff; }
.modal.joker-modal { max-width: 620px; }
.joker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.joker-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 3px solid #E4D9FF; background: linear-gradient(180deg, #FFFFFF, #F5F0FF); border-radius: 16px; padding: 12px 10px;
  box-shadow: var(--shadow); color: var(--ink); transition: transform .12s, border-color .12s;
}
.joker-card:hover, .joker-card:focus { transform: translateY(-3px); border-color: #9B6BFF; }
.joker-card .jk-icon { font-size: 34px; }
.joker-card b { font-family: var(--font-title); font-weight: 400; font-size: 18px; }
.joker-card small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.joker-card em { font-style: normal; font-size: 12px; color: #7B4DFF; background: #EFE8FF; border-radius: 999px; padding: 1px 8px; }
.pjoker { margin-top: 4px; font-size: 12px; font-weight: 700; color: #6A3FE0; background: #F1EBFF; border-radius: 8px; padding: 2px 8px; width: fit-content; }
.pjoker.used { color: var(--muted); background: #F1F1F1; text-decoration: line-through; }
.jk-lands { display: grid; gap: 8px; margin-top: 8px; }
.jk-land { text-align: left; border-radius: 12px; }
.jk-land small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
@media (max-width: 600px) {
  .joker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .joker-card { padding: 8px 6px; }
  .joker-card .jk-icon { font-size: 26px; }
  .joker-card b { font-size: 15px; }
  .joker-card small { font-size: 11px; }
  .hud-btns #btnJoker { flex: 0 0 auto; font-size: 15px; }
}
@media (max-width: 600px) {
  /* 주사위 버튼은 한 줄 전체, 나머지 버튼은 그 아래 줄에 */
  .hud-btns { flex-wrap: wrap; }
  .hud-btns #btnRoll { flex: 1 1 100%; order: -1; font-size: 19px; padding: 13px; }
  .hud-btns #btnCam, .hud-btns #btnBank, .hud-btns #btnJoker { flex: 1 1 0; }
}

/* v2.3.1: 자세별 그림을 미리 넣어 두고 지금 자세만 보인다 */
.actor .sprites { display: block; line-height: 0; }
.actor .sprites .sprite { display: none; }
.actor .sprites .sprite.on { display: block; }

/* v2.3.2: 휴대폰 링크(Artifact)에는 "img { max-width: 100%; height: auto }" 같은 기본 스타일이 붙는다.
   캐릭터를 감싸는 .actor 는 위치만 잡는 폭 0 상자라 그림 폭이 0이 되어 보이지 않았다 → 캐릭터 그림은 제한을 풀어 준다 */
.actor .body { width: max-content; }
.actor .sprites .sprite, .actor .sprite { max-width: none; width: auto; height: calc(var(--board) * .12); }
.dice-stage .thrower { max-width: none; }
.char-btn img { max-width: none; }
