/* 심야포차 UI — Duna 스타일 레퍼런스 적용
   - 99% 무채색, 유일한 색채는 히어로 수채화와 3D 포차 장면
   - Linen 캔버스, Espresso 필 버튼, Aubergine Ink 텍스트
   - 그림자 대신 1px inset 링과 배경 톤 차이로 위계 구분 */

:root {
  --color-aubergine-ink: #1b0624;
  --color-espresso: #160f0c;
  --color-warm-ash: #766a7c;
  --color-graphite: #444444;
  --color-stone: #898683;
  --color-onyx: #0d0d0d;
  --color-smoke: #1a1816;
  --color-charcoal: #292421;
  --color-paper-white: #ffffff;
  --color-linen: #f7f7f5;
  --color-bone: #edece7;
  --color-mist: #eeeeee;

  /* GT America 대체: 라틴은 Inter, 한글은 Pretendard */
  --font-sans: 'Inter', 'Pretendard Variable', Pretendard, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;

  --text-micro: 12px;
  --text-caption: 14px;
  --text-body-sm: 16px;
  --text-body: 18px;
  --text-body-lg: 20px;
  --text-subheading: 24px;
  --text-heading: 32px;
  --text-heading-lg: 44px;
  --text-display: 72px;

  /* 한글은 -0.06em이면 자형이 겹쳐서 디스플레이는 -0.045em로 조정 */
  --tracking-display: -0.045em;
  --tracking-heading-lg: -0.04em;
  --tracking-heading: -0.03em;
  --tracking-subheading: -0.02em;
  --tracking-body-lg: -0.01em;

  --radius-inputs: 8px;
  --radius-xl: 12px;
  --radius-cards: 16px;
  --radius-images: 24px;
  --radius-large-buttons: 60px;
  --radius-pill: 999px;

  --shadow-subtle: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px inset;
  --ring-dark: rgba(27, 6, 36, 0.12) 0px 0px 0px 1px inset;

  --page-max-width: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--color-aubergine-ink);
  background: var(--color-linen);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "tnum";
  word-break: keep-all;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--color-stone); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius-pill);
  padding: 11px 20px; font-size: var(--text-caption); font-weight: 400; line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--color-espresso); color: var(--color-paper-white); }
.btn-primary:hover { background: var(--color-charcoal); }
.btn-primary:disabled { background: var(--color-stone); cursor: not-allowed; }
.btn-large {
  background: var(--color-espresso); color: var(--color-paper-white);
  border-radius: var(--radius-large-buttons); padding: 20px 32px; font-size: var(--text-body-sm);
}
.btn-large:hover { background: var(--color-charcoal); }
.btn-ghost {
  background: var(--color-paper-white); color: var(--color-aubergine-ink);
  box-shadow: inset 0 0 0 1px var(--color-stone);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--color-graphite); }
.btn-block { width: 100%; padding: 14px 20px; font-size: var(--text-body-sm); }
.btn-sm { padding: 7px 14px; font-size: var(--text-micro); }

.pill-dark {
  display: inline-block; background: var(--color-espresso); color: var(--color-paper-white);
  border-radius: var(--radius-pill); padding: 6px 12px; font-size: var(--text-micro); line-height: 1.2;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill); padding: 4px 10px; font-size: var(--text-micro); line-height: 1.2;
  background: var(--color-bone); color: var(--color-charcoal);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge.is-full { background: var(--color-espresso); color: var(--color-paper-white); }
.badge.is-busy { background: var(--color-charcoal); color: var(--color-paper-white); }

/* ---------- 타이포 ---------- */
.display {
  font-size: var(--text-display); font-weight: 400; line-height: 1.04;
  letter-spacing: var(--tracking-display); margin: 20px 0 20px;
}
.heading-lg { font-size: var(--text-heading-lg); font-weight: 400; line-height: 1.12; letter-spacing: var(--tracking-heading-lg); margin: 8px 0 12px; }
.heading { font-size: var(--text-heading); font-weight: 400; line-height: 1.2; letter-spacing: var(--tracking-heading); margin: 0 0 8px; }
.subheading { font-size: var(--text-subheading); font-weight: 500; line-height: 1.3; letter-spacing: var(--tracking-subheading); margin: 0 0 6px; }
.lead { font-size: var(--text-body); color: var(--color-warm-ash); margin: 0; max-width: 620px; }
.eyebrow { font-size: var(--text-caption); color: var(--color-stone); }

/* ---------- 내비 ---------- */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100vw - var(--page-max-width)) / 2));
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 18px; letter-spacing: -0.02em; }
.logo.small { font-size: 15px; }
.logo-mark { font-size: 1.1em; line-height: 1; }
.nav-links { display: flex; gap: 32px; font-size: var(--text-caption); color: var(--color-charcoal); }
.nav .logo { margin-right: 32px; white-space: nowrap; }
html:not([data-lang="ko"]) .nav-links { gap: 24px; white-space: nowrap; }
.nav-links a:hover { color: var(--color-aubergine-ink); }

/* ---------- 히어로 ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
.hero-art { position: absolute; inset: 0; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero-inner { position: relative; z-index: 2; text-align: center; padding: 18vh 24px 0; max-width: 900px; }
.hero-sub { font-size: var(--text-body); color: var(--color-graphite); margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
/* 포장마차 입장 중: 스크립트가 뜨기 전에는 막대가 스스로 35%까지 차오르고, 그 뒤로는 단계마다 채운다 */
.hero-loading { width: min(340px, 100%); margin: 0 auto; padding: 16px 20px 14px; border-radius: 20px; background: rgba(255, 250, 244, .9); box-shadow: 0 8px 28px rgba(27, 6, 36, .18); backdrop-filter: blur(6px); }
.hero-loading-title { font-size: 18px; font-weight: 600; color: var(--color-aubergine-ink); margin: 0 0 12px; }
.load-dots::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: load-dots 1.2s steps(4, end) infinite; }
@keyframes load-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75%, 100% { content: '...'; } }
.load-bar { height: 10px; border-radius: 999px; background: rgba(27, 6, 36, .14); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(27, 6, 36, .06); }
.load-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ff9a3d, #ff6a2a); box-shadow: 0 0 12px rgba(255, 120, 40, .55); animation: load-creep 2.6s cubic-bezier(.2, .7, .3, 1) forwards; }
.load-fill.is-js { animation: none; transition: width .45s ease; }
@keyframes load-creep { from { width: 4%; } to { width: 35%; } }
.hero-loading-step { font-size: 13px; color: var(--color-graphite); margin: 10px 0 0; min-height: 1.4em; }

/* ---------- 메인 모드 선택 (심야포차 / 심야학교) ---------- */
.mode-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 780px; margin: 0 auto; text-align: left; }
.mode-card {
  position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 0;
  border: 0; border-radius: var(--radius-images); overflow: hidden; text-align: left;
  background: var(--color-smoke); color: var(--color-paper-white); font: inherit; cursor: pointer;
  box-shadow: 0 18px 44px rgba(27, 6, 36, .16), rgba(255, 255, 255, .1) 0 0 0 1px inset;
  transition: transform .25s ease, box-shadow .25s ease;
}
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-4px); box-shadow: 0 26px 54px rgba(27, 6, 36, .24), rgba(255, 255, 255, .14) 0 0 0 1px inset; outline: none; }
.mode-art { position: relative; display: block; height: 168px; overflow: hidden; flex: 0 0 auto; background: #151019; }
/* 생성 이미지를 카드 상단에 깔고, 마우스를 올리면 천천히 당겨진다. */
.mode-art::before {
  content: ''; position: absolute; inset: -2%;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}
.mode-pocha .mode-art::before { background-image: url('../img/main/mode_pocha.webp'); }
.mode-school .mode-art::before { background-image: url('../img/main/mode_school.webp'); }
.mode-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(12, 8, 16, .18) 0%, transparent 38%, rgba(14, 10, 16, .62) 100%); }
.mode-card:hover .mode-art::before, .mode-card:focus-visible .mode-art::before { transform: scale(1.05); }
.mode-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0, 0, 0, .28) 100%); }
.mode-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 5px; padding: 18px 20px 0; flex: 1; }
.mode-kicker { font-size: 11px; letter-spacing: .14em; opacity: .66; }
.mode-title { font-size: 28px; font-weight: 500; letter-spacing: -.045em; line-height: 1.1; }
.mode-desc { font-size: 13.5px; line-height: 1.5; opacity: .74; max-width: 24em; }
.mode-meta { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; font-size: 12px; opacity: .8; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #ffb46b; box-shadow: 0 0 10px #ffb46b; }
.dot-live.is-red { background: #e9564f; box-shadow: 0 0 10px rgba(233, 86, 79, .9); animation: live-pulse 2.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.mode-go {
  position: relative; z-index: 1; align-self: flex-end; margin: 12px 20px 18px; padding: 8px 14px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
  background: rgba(255, 255, 255, .12); box-shadow: rgba(255, 255, 255, .18) 0 0 0 1px inset;
  transition: background-color .2s ease;
}
.mode-card:hover .mode-go { background: rgba(255, 255, 255, .22); }
.mode-pocha .mode-go { background: #ff9a4d; color: #2a1308; box-shadow: none; }
.mode-pocha:hover .mode-go { background: #ffb06e; }
html[data-lang="en"] .mode-title, html[data-lang="ja"] .mode-title { letter-spacing: -.02em; }

/* ---------- 레이아웃 ---------- */
.container { max-width: var(--page-max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0 0; }
.section-head { margin-bottom: 40px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 40px 0 0; }
.stat-num { font-size: var(--text-display); line-height: 1; letter-spacing: var(--tracking-display); font-feature-settings: "tnum", "zero"; }
.stat-cap { font-size: var(--text-caption); color: var(--color-stone); margin-top: 12px; }

.card { background: var(--color-paper-white); border-radius: var(--radius-cards); box-shadow: var(--shadow-subtle); padding: 32px; }

/* 손님 카드 */
.guest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.preview-card {
  position: relative; background: var(--color-bone); border-radius: var(--radius-images);
  min-height: 420px; overflow: hidden;
}
#preview { position: absolute; inset: 0; }
#preview canvas { display: block; }
.preview-name {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--color-paper-white); border-radius: var(--radius-pill); padding: 6px 14px;
  font-size: var(--text-caption); box-shadow: var(--shadow-subtle);
}
.form-card { display: flex; flex-direction: column; gap: 28px; }
.field { display: flex; flex-direction: column; gap: 10px; position: relative; }
.field-label { font-size: var(--text-caption); color: var(--color-graphite); }
.field-hint { position: absolute; right: 14px; top: 42px; font-size: var(--text-micro); color: var(--color-stone); }
.input, .textarea {
  background: var(--color-mist); border: 1px solid transparent; border-radius: var(--radius-inputs);
  padding: 12px 14px; font-size: var(--text-body-sm); color: var(--color-aubergine-ink); outline: none; width: 100%;
  box-shadow: inset 0 0 0 1px rgba(68, 68, 68, 0.15);
}
.input:focus, .textarea:focus { box-shadow: inset 0 0 0 1px var(--color-espresso); }
.textarea { resize: none; min-height: 120px; line-height: 1.6; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  outline: 1px solid transparent; outline-offset: 3px;
}
.swatch[aria-pressed="true"] { outline-color: var(--color-espresso); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 0; border-radius: var(--radius-pill); padding: 9px 16px; font-size: var(--text-caption);
  background: var(--color-paper-white); box-shadow: inset 0 0 0 1px var(--color-stone); color: var(--color-aubergine-ink);
}
.chip:hover { box-shadow: inset 0 0 0 1px var(--color-graphite); }
.chip[aria-pressed="true"] { background: var(--color-espresso); color: var(--color-paper-white); box-shadow: none; }

/* 지점 */
.branch-list { display: grid; gap: 12px; }
.branch {
  display: grid; grid-template-columns: 56px 1fr 220px auto; gap: 24px; align-items: center;
  background: var(--color-paper-white); border-radius: var(--radius-cards); box-shadow: var(--shadow-subtle);
  padding: 24px 28px;
}
.branch-no { font-size: var(--text-heading); letter-spacing: var(--tracking-heading); color: var(--color-stone); font-feature-settings: "tnum"; }
.branch-name { font-size: var(--text-body-lg); font-weight: 500; letter-spacing: var(--tracking-body-lg); }
.branch-mood { font-size: var(--text-caption); color: var(--color-warm-ash); }
.occ { display: flex; flex-direction: column; gap: 8px; }
.occ-row { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-caption); font-feature-settings: "tnum"; }
.occ-bar { height: 4px; border-radius: 4px; background: var(--color-bone); overflow: hidden; }
.occ-fill { height: 100%; background: var(--color-espresso); border-radius: 4px; }

/* 기능 카드 */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--color-paper-white); border-radius: var(--radius-cards); padding: 32px; }
.feature h3 { font-size: var(--text-body-lg); font-weight: 500; letter-spacing: var(--tracking-body-lg); margin: 20px 0 8px; }
.feature p { margin: 0; color: var(--color-graphite); font-size: var(--text-body-sm); }
.ico { width: 26px; height: 26px; fill: none; stroke: var(--color-charcoal); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ico-s { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 차림표 */
.menu-table { padding: 8px 32px; }
.menu-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--color-bone); align-items: center; }
.menu-row:last-child { border-bottom: 0; }
.menu-name { font-size: var(--text-body-lg); letter-spacing: var(--tracking-body-lg); }
.menu-desc { font-size: var(--text-caption); color: var(--color-warm-ash); }
.price { font-size: var(--text-body); font-feature-settings: "tnum"; }

.footer { display: flex; justify-content: space-between; align-items: center; padding: 120px 24px 48px; font-size: var(--text-caption); }
.footer-links a { color: inherit; }

/* ---------- 게임 HUD ---------- */
#game { position: fixed; inset: 0; background: #14121e; overflow: hidden; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; touch-action: none; }
.world-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.hud-top {
  position: absolute; top: 16px; left: 16px; right: 16px; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start; gap: 8px; pointer-events: none;
}
.hud-left, .hud-right, .hud-center { display: flex; gap: 8px; align-items: center; pointer-events: auto; flex-wrap: wrap; }
.hud-left { grid-column: 1; justify-self: start; }
.hud-center { grid-column: 2; justify-content: center; }
.hud-right { grid-column: 3; justify-self: end; }
.hud-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  background: var(--color-paper-white); color: var(--color-aubergine-ink);
  border-radius: var(--radius-pill); border: 0; box-shadow: var(--shadow-subtle);
  font-size: var(--text-caption); white-space: nowrap; font-feature-settings: "tnum";
}
.hud-btn:hover { background: var(--color-bone); }
.hud-icon { width: 40px; padding: 0; justify-content: center; }
.logo-chip { font-weight: 500; letter-spacing: -0.02em; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-bone); box-shadow: inset 0 0 0 1px var(--color-stone); }
.dots i.on { background: var(--color-espresso); box-shadow: none; }

.toasts { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--color-espresso); color: var(--color-paper-white);
  border-radius: var(--radius-pill); padding: 10px 18px; font-size: var(--text-caption);
  animation: toastIn .25s ease both; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.is-light { background: var(--color-paper-white); color: var(--color-aubergine-ink); box-shadow: var(--shadow-subtle); }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

.context-bar {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.spot-btn {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border: 0; border-radius: var(--radius-pill);
  background: #f2d47a; color: var(--color-aubergine-ink); font-size: 14px; font-weight: 600; line-height: 1.2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28); white-space: nowrap; transition: transform .12s ease, filter .12s ease;
}
.spot-btn:hover { filter: brightness(.97); }
.spot-btn:active, .spot-btn.is-down { transform: scale(.96); }
.spot-btn .ico-s { width: 18px; height: 18px; }
.spot-alt { font-size: 11px; font-weight: 500; opacity: .68; }

.dock-wrap { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(1400px, calc(100vw - 32px)); }
.chat-row { display: flex; gap: 8px; align-items: center; width: min(560px, 100%); }
.chat-bar { display: flex; flex: 1; min-width: 0; background: var(--color-paper-white); border-radius: var(--radius-pill); box-shadow: var(--shadow-subtle); padding: 4px; }
.chat-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 14px; outline: none; font-size: var(--text-caption); }
.chat-send { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--color-espresso); color: var(--color-paper-white); display: grid; place-items: center; }
.dock {
  display: flex; gap: 4px; align-items: center; background: var(--color-paper-white);
  border-radius: var(--radius-pill); padding: 6px; box-shadow: var(--shadow-subtle); max-width: 100%; overflow-x: auto;
  scrollbar-width: none;
}
.dock-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0;
  border-radius: var(--radius-pill); background: transparent; color: var(--color-aubergine-ink);
  font-size: var(--text-caption); white-space: nowrap;
}
.dock-btn:hover { background: var(--color-linen); }
.dock-btn.is-off { color: var(--color-stone); }
.dock-btn kbd { font-family: inherit; font-size: 11px; color: var(--color-stone); border-radius: 6px; padding: 1px 6px; box-shadow: inset 0 0 0 1px var(--color-bone); }
.dock-primary { background: var(--color-espresso); color: var(--color-paper-white); padding: 0 20px; }
.dock-primary:hover { background: var(--color-charcoal); }
.dock-act { background: #f2d47a; color: var(--color-aubergine-ink); font-weight: 500; padding: 0 18px; }
.dock-act:hover { background: #ebca68; }
.dock-sep { width: 1px; height: 24px; background: var(--color-bone); margin: 0 4px; flex: none; }

/* 3D 위 이름표와 말풍선 */
.name-tag {
  position: absolute; left: 0; top: 0; font-size: 11px; line-height: 1.2; padding: 3px 8px;
  border-radius: var(--radius-pill); background: rgba(22, 15, 12, .5); color: rgba(255,255,255,.92); white-space: nowrap;
}
.name-tag.is-me { background: var(--color-paper-white); color: var(--color-aubergine-ink); }
.bubble {
  position: absolute; left: 0; top: 0; max-width: 220px; white-space: normal;
  border-radius: var(--radius-xl); padding: 8px 12px; font-size: 13px; line-height: 1.45;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg); background: inherit; }
.bubble.is-clear { background: var(--color-paper-white); color: var(--color-aubergine-ink); box-shadow: inset 0 0 0 1.5px #f2d47a; }
.bubble.is-clear.is-me { box-shadow: inset 0 0 0 1.5px var(--color-espresso); }
.bubble.is-clear.is-ajumma { background: var(--color-espresso); color: var(--color-paper-white); box-shadow: none; }
.bubble.is-far { background: rgba(22, 15, 12, .5); color: rgba(255,255,255,.6); font-size: 11px; padding: 5px 9px; font-style: italic; }

/* 조이스틱 (터치 기기) */
.joystick { position: absolute; left: 28px; bottom: 150px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); z-index: 5; touch-action: none; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--color-paper-white); }

/* ---------- 모달 ---------- */
.modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(22, 15, 12, .42); animation: fadeIn .2s ease both; }
.modal {
  position: relative; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--color-linen); border-radius: var(--radius-images); padding: 40px; animation: popIn .25s ease both;
}
.modal.wide { width: min(760px, 100%); }
.modal-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--color-paper-white); box-shadow: var(--shadow-subtle); display: grid; place-items: center; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal .lead { font-size: var(--text-body-sm); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

.alt-list { display: grid; gap: 8px; }
.alt { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--color-paper-white); border-radius: var(--radius-cards); padding: 10px 16px; box-shadow: var(--shadow-subtle); }
.alt-name { font-weight: 500; }
.alt-count { display: block; margin-top: 2px; color: var(--color-warm-ash); font-size: var(--text-micro); font-weight: 400; }

.big-num { font-size: var(--text-display); line-height: 1; letter-spacing: var(--tracking-display); font-feature-settings: "tnum"; margin: 8px 0; }

/* 차림표 모달 */
.target-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.menu-modal .menu-row { padding: 16px 0; }
.menu-modal .menu-table { padding: 4px 24px; }

/* 고민 태우기 / 포춘 */
.fortune {
  background: var(--color-paper-white); border-radius: var(--radius-cards); box-shadow: var(--shadow-subtle);
  padding: 40px 32px; text-align: center; margin: 8px 0 0;
}
.fortune-text { font-size: var(--text-subheading); letter-spacing: var(--tracking-subheading); line-height: 1.45; margin: 16px 0; }
.burn-paper { animation: burnAway 1.1s ease forwards; }
@keyframes burnAway { to { opacity: 0; transform: translateY(-30px) scale(.92); filter: blur(3px); } }

/* 낙서장 */
.gb-list { display: grid; gap: 8px; margin-top: 20px; max-height: 340px; overflow: auto; }
.gb-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--color-paper-white); border-radius: var(--radius-xl); padding: 14px 16px; box-shadow: var(--shadow-subtle); }
.gb-text { font-size: var(--text-body-sm); }
.gb-name { font-size: var(--text-micro); color: var(--color-stone); }
.heart-btn { display: inline-flex; gap: 6px; align-items: center; border: 0; border-radius: var(--radius-pill); padding: 6px 12px; font-size: var(--text-micro); background: var(--color-linen); box-shadow: inset 0 0 0 1px var(--color-bone); font-feature-settings: "tnum"; }
.heart-btn[aria-pressed="true"] { background: var(--color-espresso); color: var(--color-paper-white); box-shadow: none; }
.heart-btn[aria-pressed="true"] .ico-s { fill: currentColor; }
.gb-form { display: flex; gap: 8px; }

/* 이모님 상담 */
.talk-log { display: flex; flex-direction: column; gap: 10px; height: 300px; overflow: auto; padding: 4px 2px 12px; }
.talk { max-width: 82%; padding: 10px 14px; border-radius: var(--radius-xl); font-size: var(--text-caption); line-height: 1.55; }
.talk.from-ajumma { align-self: flex-start; background: var(--color-paper-white); box-shadow: var(--shadow-subtle); }
.talk.from-me { align-self: flex-end; background: var(--color-espresso); color: var(--color-paper-white); }
.talk.typing { color: var(--color-stone); }
.talk-who { font-size: var(--text-micro); color: var(--color-stone); margin-bottom: 2px; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: var(--text-caption); align-items: center; }
.help-grid kbd { font-family: inherit; background: var(--color-paper-white); box-shadow: var(--shadow-subtle); border-radius: 6px; padding: 2px 8px; justify-self: start; }
.help-more { margin-top: 18px; border-top: 1px solid var(--color-bone); padding-top: 14px; }
.help-more summary { cursor: pointer; font-size: 13px; color: var(--color-graphite); list-style: none; display: flex; align-items: center; gap: 6px; }
.help-more summary::-webkit-details-marker { display: none; }
.help-more summary::after { content: '▾'; font-size: 11px; transition: transform .15s ease; }
.help-more[open] summary::after { transform: rotate(180deg); }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  :root { --text-display: 48px; --text-heading-lg: 32px; }
  .nav-links { display: none; }
  .stats, .feature-grid, .guest-grid { grid-template-columns: 1fr; }
  .stat-num { font-size: 56px; }
  .branch { grid-template-columns: 40px 1fr; }
  .branch .occ, .branch .btn { grid-column: 1 / -1; }
  .hud-center { display: none; }
  .dock-btn kbd { display: none; }
  .dock-btn { padding: 0 12px; }
  .modal { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* 공유 미리보기 이미지 캡처용 (?shot) */
.shot-mode .hud-top, .shot-mode .dock-wrap, .shot-mode .toasts,
.shot-mode .world-overlay, .shot-mode #modalRoot, .shot-mode .joystick { display: none !important; }

/* ---------- 콘텐츠 보강: 이모트 · 칭호 · 상점 · 젓가락 뽑기 ---------- */
.toasts { position: fixed; z-index: 70; }
.emote-bar {
  display: flex; gap: 4px; background: var(--color-paper-white); border-radius: var(--radius-pill);
  padding: 6px; box-shadow: var(--shadow-subtle);
}
.emote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 12px;
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-aubergine-ink);
  font-size: 15px; line-height: 1.1;
}
.emote-btn small { font-size: 11px; color: var(--color-stone); }
.emote-btn:hover { background: var(--color-linen); }
.emote-bar { flex-direction: column; border-radius: 22px; }
.emote-row { display: flex; gap: 4px; align-items: center; }
.emote-row.is-drunk-row { border-top: 1px solid var(--color-linen); padding-top: 4px; }
.emote-row-label { font-size: 11px; color: var(--color-stone); padding: 0 6px 0 8px; white-space: nowrap; }
.emote-btn { position: relative; }
.emote-btn.is-drunk span { color: #c8432f; }
.emote-btn.is-locked { opacity: .45; }
.emote-btn.is-locked span { color: inherit; }
.emote-lv { position: absolute; top: 2px; right: 6px; font-style: normal; font-size: 6px; letter-spacing: 1px; color: #e87a5a; }
.bubble.is-emote.is-clear { background: var(--color-espresso); color: var(--color-paper-white); box-shadow: none; font-size: 14px; padding: 6px 12px; border-radius: var(--radius-pill); }
.bubble.is-emote::after { display: none; }

.name-tag .tag-title, .tag-title.static {
  display: inline-block; margin-right: 5px; padding: 0 6px; border-radius: var(--radius-pill);
  background: #f2d47a; color: var(--color-espresso); font-size: 10px; line-height: 1.6; font-weight: 500;
}
.tag-title.static { font-size: 12px; padding: 2px 10px; }
.name-tag.is-remote { cursor: pointer; }

.swatch.is-locked, .chip.is-locked { opacity: .55; }
.swatch.is-locked { background-image: linear-gradient(135deg, transparent 45%, rgba(255,255,255,.75) 46%, rgba(255,255,255,.75) 54%, transparent 55%); }
.chip .lock { font-size: 11px; color: var(--color-stone); margin-left: 4px; }
.shop-swatch { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); flex: none; }
.event-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: 2px; background: #2a2430; color: #ffb35c; }
.event-badge.is-jp { background: #7a1f26; color: #ffe0b0; }
.swatch.is-event { box-shadow: 0 0 0 2px #e8772e; }
.chip.is-event:not([aria-pressed="true"]) { border-color: #e8772e; }
.price-old { text-decoration: line-through; color: var(--color-stone); font-size: .85em; margin-right: 4px; }

.chopsticks { display: flex; gap: 18px; justify-content: center; align-items: flex-end; height: 190px; margin: 28px 0 8px; }
.stick-col { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; background: transparent; padding: 6px 10px; border-radius: 14px; font: inherit; color: inherit; }
.stick-col.is-pickable { cursor: pointer; transition: transform .16s ease, background .16s ease; }
.stick-col.is-pickable:hover { transform: translateY(-10px); background: rgba(22, 15, 12, .06); }
.stick-col.is-pickable:active { transform: translateY(-4px) scale(.97); }
.stick-col.is-pickable .stick-name { font-weight: 600; color: var(--color-espresso); background: var(--color-paper-white); padding: 4px 10px; border-radius: var(--radius-pill); box-shadow: var(--shadow-subtle); }
.stick-col.is-mine .stick-name { font-weight: 700; color: var(--color-espresso); }
.stick {
  width: 12px; height: 140px; border-radius: 6px; background: linear-gradient(#d9b98a, #b9915e);
  transform-origin: bottom; animation: stickPull .35s calc(var(--i) * .08s) ease-out both; transition: height .3s ease, transform .3s ease;
}
.chopsticks.is-picking .stick { height: 120px; box-shadow: 0 18px 0 4px var(--color-bone); }
.chopsticks.is-picking .stick-col { gap: 28px; }
.chopsticks.is-revealed .stick.is-short { height: 70px; background: linear-gradient(#e0352c, #b8261a); }
.chopsticks.is-revealed .stick:not(.is-short) { opacity: .55; }
.chopsticks.is-revealed .stick-col.is-mine .stick { opacity: 1; transform: translateY(-8px); }
.stick-name { font-size: 13px; max-width: 88px; text-align: center; word-break: keep-all; }
@keyframes stickPull { 0% { transform: translateY(40px) scaleY(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
#gameResult, #gameActions { transition: opacity .4s ease; }
@media (max-width: 900px) {
  .emote-btn { min-width: 52px; padding: 6px 8px; }
  #hudWeather { display: none; }
}

/* 아래 버튼 줄은 항상 한 줄 (자주 쓰는 것만 두고 나머지는 더보기). 좁으면 단축키 표시를 빼고, 그래도 넘치면 가로로 민다 */
@media (min-width: 901px) {
  .dock { flex-wrap: nowrap; justify-content: safe center; }
  .dock-btn { padding: 0 14px; }
}
@media (max-width: 1365px) {
  .dock-btn kbd { display: none; }
  .dock-btn { padding: 0 10px; }
}
/* 더 좁은 PC 창: 고민 태우기·낙서장은 더보기 시트에서 (연탄 화로·가벽 낙서장을 클릭해도 열린다) */
@media (max-width: 1099px) {
  #btnBurn, #btnGuestbook { display: none; }
}


/* ---------- 미니게임 ---------- */
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.game-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: var(--color-paper-white); border: 0; border-radius: var(--radius-cards); box-shadow: var(--shadow-subtle);
  padding: 18px; color: var(--color-aubergine-ink); min-height: 120px;
}
.game-card b { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.game-card span { font-size: 13px; color: var(--color-warm-ash); line-height: 1.5; }
.game-card em { margin-top: auto; font-style: normal; font-size: 12px; color: var(--color-charcoal); background: var(--color-bone); border-radius: var(--radius-pill); padding: 2px 10px; }
.game-card:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--color-espresso); }
.game-card:disabled { opacity: .45; cursor: not-allowed; }

.bottle-ring { position: relative; width: 300px; height: 300px; margin: 16px auto 0; border-radius: 50%; background: var(--color-bone); }
.ring-name { position: absolute; transform: translate(-50%, -50%); font-size: 13px; background: var(--color-paper-white); border-radius: var(--radius-pill); padding: 4px 10px; box-shadow: var(--shadow-subtle); white-space: nowrap; }
.spin-bottle { position: absolute; left: 50%; top: 50%; width: 34px; height: 130px; transform: translate(-50%, -50%) rotate(0deg); transition: transform 3s cubic-bezier(.17,.67,.21,1); }
.bottle-neck { position: absolute; left: 50%; top: 0; width: 12px; height: 38px; margin-left: -6px; background: #3fae5a; border-radius: 6px 6px 2px 2px; }
.bottle-body { position: absolute; left: 0; top: 34px; width: 34px; height: 96px; background: #4cc06a; border-radius: 10px; }

.rps { display: flex; gap: 12px; justify-content: center; }
.rps-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 110px; padding: 18px 0; border: 0; border-radius: var(--radius-cards); background: var(--color-paper-white); box-shadow: var(--shadow-subtle); font-size: 14px; }
.rps-btn span { font-size: 40px; line-height: 1; }
.rps-btn:hover { box-shadow: inset 0 0 0 1px var(--color-espresso); }

.cap-bar { position: relative; height: 18px; border-radius: var(--radius-pill); background: var(--color-bone); margin: 8px 0 20px; overflow: hidden; }
.cap-target { position: absolute; left: 44%; width: 12%; top: 0; bottom: 0; background: #e0352c; opacity: .8; }
.cap-marker { position: absolute; top: -4px; width: 6px; height: 26px; margin-left: -3px; background: var(--color-espresso); border-radius: 3px; }

.time-bar { height: 6px; border-radius: var(--radius-pill); background: var(--color-bone); overflow: hidden; margin: 8px 0 4px; }
.time-bar > div { height: 100%; width: 100%; background: var(--color-espresso); }

.oden-canvas { display: block; margin: 0 auto; border-radius: var(--radius-cards); max-width: 100%; touch-action: none; cursor: pointer; }
@media (max-width: 900px) { .game-grid { grid-template-columns: 1fr 1fr; } .bottle-ring { width: 240px; height: 240px; } }


/* =====================================================================
   폰 최적화 (body.is-mobile) — 스크롤로 앱 창이 닫히지 않게, 엄지로 조작하기 쉽게
   ===================================================================== */
html, body { overscroll-behavior: none; }
body.in-game { position: fixed; inset: 0; overflow: hidden; touch-action: none; overscroll-behavior: none; }
#game { height: 100vh; height: 100dvh; }
.modal { overscroll-behavior: contain; }
.m-only { display: none !important; }
#mMoreTop { display: none !important; }

/* 앱 안 브라우저 안내 */
.inapp-banner {
  position: sticky; top: 0; z-index: 80; display: flex; gap: 10px; align-items: center;
  background: var(--color-espresso); color: var(--color-paper-white); padding: 10px 14px; font-size: 13px; line-height: 1.4;
}
.inapp-banner span { flex: 1; }
.inapp-banner .btn-primary { background: var(--color-paper-white); color: var(--color-espresso); }
.inapp-x { border: 0; background: transparent; color: inherit; width: 30px; height: 30px; display: grid; place-items: center; }


.is-mobile .m-controls { display: flex !important; }
.m-controls {
  position: absolute; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 6;
  gap: 10px; align-items: flex-end;
}
.m-round {
  width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--color-paper-white); color: var(--color-aubergine-ink); box-shadow: var(--shadow-subtle);
}
.m-round.is-on { background: var(--color-espresso); color: var(--color-paper-white); }
.m-btn {
  width: 64px; height: 64px; border-radius: 50%; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255,255,255,.94); color: var(--color-aubergine-ink); font-size: 11px; box-shadow: var(--shadow-subtle);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.m-btn:active, .m-round:active, .m-act.is-down { transform: scale(.94); }
.m-btn .ico-s { width: 20px; height: 20px; }
/* 폰 상황 버튼 하나: 라벨·아이콘이 지금 할 수 있는 행동으로 바뀌고, 길게 누르면 곁들임 행동 */
.m-act {
  width: 88px; height: 88px; gap: 1px; padding: 0 8px;
  background: var(--color-espresso); color: var(--color-paper-white); font-size: 12px; font-weight: 600; line-height: 1.1;
}
.m-act .ico-s { width: 24px; height: 24px; }
.m-act span { max-width: 100%; white-space: normal; word-break: keep-all; text-align: center; }
.m-act-alt { font-size: 9px; font-weight: 400; line-height: 1.1; opacity: .62; white-space: nowrap; }
.m-act-alt[hidden] { display: none; }

.is-mobile .hud-top { top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px; gap: 6px; }
.is-mobile .hud-chip { height: 34px; padding: 0 12px; font-size: 12px; }
.is-mobile .hud-icon { width: 34px; }
.is-mobile .hud-center, .is-mobile .logo-chip, .is-mobile #hudDrunk,
.is-mobile #btnHelp { display: none !important; }
/* 폰 상단 우측: 소리 켜기/끄기 (손가락으로 누르기 쉽게 44px) */
.is-mobile #btnSound { width: 44px; height: 44px; padding: 0; justify-content: center; }
#btnSound:active { background: var(--color-bone); }
#btnSound:focus-visible { outline: 2px solid var(--color-espresso); outline-offset: 2px; }
#btnSound[aria-pressed="true"] { color: var(--color-warm-ash); }
.is-mobile #hudBranch { max-width: 62vw; display: flex; gap: 4px; min-width: 0; }
.is-mobile #hudBranch > .hud-branch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 지점 pill 자체가 버튼: 누르면 지점 이동 시트가 바로 열린다 */
#hudBranch:active { background: var(--color-bone); }
#hudBranch:focus-visible { outline: 2px solid var(--color-espresso); outline-offset: 2px; }
#hudBranch::after {
  content: ''; flex: none; width: 6px; height: 6px; margin-left: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px); opacity: .45;
}
/* 폰 화면 아래에서부터: 채팅 줄(항상 보임) → 조이스틱·큰 버튼 → 상황 안내 → 최근 대화 */
.is-mobile .dock { display: none; }
.is-mobile .dock-wrap { bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); gap: 8px; z-index: 7; }
.is-mobile .chat-row { width: 100%; }
.is-mobile .chat-bar { height: 48px; padding: 4px; align-items: center; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.is-mobile .chat-input { font-size: 16px; padding: 0 12px 0 16px; height: 40px; } /* 16px 미만이면 iOS가 입력할 때 화면을 확대한다 */
.is-mobile .chat-send { width: 40px; height: 40px; flex: none; }
.is-mobile .chat-row .m-round { display: grid !important; width: 48px; height: 48px; flex: none; }
.is-mobile .m-controls { bottom: calc(70px + env(safe-area-inset-bottom)); }
.is-mobile .joystick { left: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 120px; height: 120px; background: rgba(255,255,255,.16); }
.is-mobile .context-bar { bottom: calc(232px + env(safe-area-inset-bottom)); max-width: 88vw; }
.is-mobile .emote-bar { overflow-x: auto; max-width: 100%; }
/* 채팅 중: 키보드 바로 위에 입력창, 조작 버튼은 잠깐 숨기고 대화는 크게 */
body.is-mobile.chat-open .dock-wrap { bottom: calc(8px + var(--kb, 0px)); }
body.is-mobile.chat-open .m-controls, body.is-mobile.chat-open .joystick, body.is-mobile.chat-open .context-bar { visibility: hidden; }
body.is-mobile.chat-open .chat-row .m-round { display: none !important; }

/* 최근 대화 (폰) */
.chat-log { display: none; }
.is-mobile .chat-log {
  position: absolute; left: 12px; bottom: calc(268px + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: min(78vw, 340px); pointer-events: none;
}
.chat-line {
  background: rgba(22, 15, 12, .62); color: #fff; border-radius: 14px; padding: 5px 11px;
  font-size: 13px; line-height: 1.4; word-break: break-word; transition: opacity .6s ease;
}
.chat-line b { font-weight: 500; color: #f2d47a; margin-right: 6px; }
.chat-line.is-me { background: rgba(247, 247, 245, .92); color: var(--color-aubergine-ink); }
.chat-line.is-me b { color: var(--color-stone); }
.chat-line.is-old { opacity: 0; }
body.is-mobile.chat-open .chat-log { bottom: calc(66px + var(--kb, 0px)); }
body.is-mobile.chat-open .chat-line.is-old { opacity: 1; }
.is-mobile .toasts { top: calc(50px + env(safe-area-inset-top)); width: calc(100vw - 24px); }
.is-mobile .toast { white-space: normal; text-align: center; font-size: 13px; padding: 9px 14px; }
.is-mobile .name-tag { font-size: 10px; }
.is-mobile .bubble { font-size: 12px; max-width: 180px; padding: 6px 10px; }

/* 팝업 → 아래에서 올라오는 시트 */
.is-mobile .modal-root { place-items: end stretch; padding: 0; }
.is-mobile .modal, .is-mobile .modal.wide {
  width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 24px 24px 0 0;
  padding: 30px 18px calc(22px + env(safe-area-inset-bottom)); animation: sheetUp .25s ease both; touch-action: pan-y;
}
.is-mobile .modal::before { content: ''; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--color-bone); }
.is-mobile .modal-x { top: 12px; right: 12px; width: 32px; height: 32px; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: .3; } }
.is-mobile .heading { font-size: 24px; }
.is-mobile .modal .lead { font-size: 14px; margin-bottom: 16px; }
.is-mobile .menu-row { grid-template-columns: 1fr auto; gap: 10px; }
.is-mobile .menu-name { font-size: 16px; }
.is-mobile .menu-table { padding: 4px 16px; }
.is-mobile .game-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.is-mobile .game-card { min-height: 104px; padding: 14px; }
.is-mobile .rps-btn { width: 30%; }
.is-mobile .modal-actions .btn { flex: 1; }

/* 더보기 시트 */
.more-info { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.more-info span { font-size: 12px; background: var(--color-paper-white); border-radius: var(--radius-pill); padding: 5px 10px; box-shadow: var(--shadow-subtle); }
.more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.more-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border: 0;
  border-radius: var(--radius-cards); background: var(--color-paper-white); box-shadow: var(--shadow-subtle);
  color: var(--color-aubergine-ink); font-size: 12px; line-height: 1.2; text-align: center;
}
.more-btn .ico-s { width: 22px; height: 22px; }
.more-btn.is-on { background: var(--color-espresso); color: var(--color-paper-white); }

/* 내 정보 (포차 안에서 닉네임·모양새·지점 바꾸기) */
.pf .field-label { margin: 18px 0 8px; }
.pf .field-label:first-child { margin-top: 0; }
.pf-attend { margin-top: 14px; }
.pf-nick { display: flex; gap: 8px; }
.pf-nick .input { flex: 1; min-width: 0; font-size: 16px; }
.pf-nick .btn, .pf-branch .btn { min-height: 44px; flex: none; }
.pf .swatch { width: 44px; height: 44px; }
.pf .chip { min-height: 44px; }
.pf-note { font-size: 13px; margin: 10px 0 0; }
.pf-branch { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* 내 인형 */
.doll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.doll-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border: 0;
  border-radius: var(--radius-cards); background: var(--color-paper-white); box-shadow: var(--shadow-subtle);
  color: var(--color-aubergine-ink); font-size: 12px; cursor: pointer;
}
.doll-cell img { width: 64px; height: 64px; object-fit: contain; }
.doll-cell:not(:disabled):hover { transform: translateY(-2px); }
.doll-cell.is-empty { cursor: default; background: var(--color-linen); }
.doll-cell.is-empty img { filter: brightness(0) opacity(.18); }
.doll-n { position: absolute; top: 6px; right: 8px; font-weight: 700; font-size: 12px; }
.doll-rare { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 1px 5px; border-radius: 999px; background: #ffe3ef; color: #d9356b; }
.doll-event { background: #fff1d6; color: #a8611a; }
/* 도움말 맨 아래 출처 표기 (날씨 정보 등) */
.help-credit { font-size: 13px; color: var(--color-graphite); margin: 16px 0 0; }
.help-credit a { color: inherit; text-decoration: underline; display: inline-block; padding: 10px 0; }
.doll-held { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 12px; border-radius: var(--radius-cards); background: var(--color-linen); }
.doll-held img { width: 40px; height: 40px; object-fit: contain; }
.doll-held span { flex: 1; font-size: 14px; }

/* 랜딩 (폰) */
.is-mobile .hero-inner { padding-top: 15vh; }
.is-mobile .display { font-size: 44px; }
.is-mobile .hero-sub { font-size: 15px; }
.is-mobile .hero-sub br { display: none; }
.is-mobile .mode-choice { grid-template-columns: 1fr; gap: 12px; max-width: 420px; }
.is-mobile .mode-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-rows: 1fr auto; min-width: 0; min-height: 0; }
.is-mobile .mode-art { grid-column: 1; grid-row: 1 / 3; width: 116px; min-height: 132px; }
.is-mobile .mode-body { grid-column: 2; grid-row: 1; min-width: 0; padding: 14px 14px 8px; }
.is-mobile .mode-title { font-size: 22px; }
.is-mobile .mode-desc { font-size: 12.5px; overflow-wrap: break-word; }
.is-mobile .mode-go { grid-column: 2; grid-row: 2; justify-self: end; align-self: end; white-space: nowrap; margin: 0 12px 12px; padding: 7px 11px; }
@media (max-width: 720px) {
  .mode-choice { grid-template-columns: 1fr; gap: 12px; max-width: 420px; }
  .mode-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); grid-template-rows: 1fr auto; min-width: 0; min-height: 0; }
  .mode-art { grid-column: 1; grid-row: 1 / 3; width: 116px; min-height: 132px; }
  .mode-body { grid-column: 2; grid-row: 1; min-width: 0; padding: 14px 14px 8px; }
  .mode-title { font-size: 22px; }
  .mode-desc { font-size: 12.5px; overflow-wrap: break-word; }
  .mode-go { grid-column: 2; grid-row: 2; justify-self: end; align-self: end; white-space: nowrap; margin: 0 12px 12px; padding: 7px 11px; }
}
.is-mobile .btn-large { padding: 18px 30px; }
.is-mobile .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 8px; }
.is-mobile .stat-num { font-size: 30px; }
.is-mobile .stat-cap { font-size: 11px; margin-top: 6px; }
.is-mobile .section { padding-top: 56px; }
.is-mobile .section-head { margin-bottom: 20px; }
.is-mobile .heading-lg { font-size: 28px; }
.is-mobile .lead { font-size: 15px; }
.is-mobile .preview-card { min-height: 260px; }
.is-mobile .card { padding: 20px; }
.is-mobile .form-card { gap: 20px; }
.is-mobile .branch { padding: 16px 18px; gap: 12px; }
.is-mobile .branch-no { font-size: 22px; }
.is-mobile .feature-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.is-mobile .feature { padding: 16px; }
.is-mobile .feature h3 { font-size: 15px; margin: 10px 0 0; }
.is-mobile .feature p { display: none; }
.is-mobile .footer { padding: 64px 18px 32px; flex-direction: column; gap: 8px; align-items: flex-start; }

/* 포차 밖: 편의점 */
.store-list { display: grid; gap: 8px; }
.store-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: var(--radius-cards); box-shadow: var(--shadow-subtle); background: var(--color-paper-white); }
.store-name { font-size: 15px; font-weight: 500; }

/* 포차 밖: 인형뽑기 (기계 안은 장면처럼 색을 쓴다) */
.claw-box { position: relative; height: 220px; border-radius: var(--radius-cards); overflow: hidden; background: linear-gradient(#2a1830, #3b2040); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.claw-rail { position: absolute; left: 0; right: 0; top: 8px; height: 3px; background: #c0c4ca; }
.claw { position: absolute; top: 8px; left: 50%; width: 0; }
.claw-wire { position: absolute; left: -1px; top: 0; width: 2px; height: 10px; background: #c0c4ca; transition: height .7s ease; }
.claw-hand { position: absolute; left: -14px; top: 20px; width: 28px; height: 16px; border: 3px solid #c0c4ca; border-top: 0; border-radius: 0 0 14px 14px; transition: top .7s ease, width .2s, left .2s; }
.claw-hand.is-closed { width: 18px; left: -9px; }
.claw-doll { position: absolute; bottom: 4px; width: 52px; height: 52px; margin-left: -26px; background: center / contain no-repeat; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); transition: bottom .7s ease; }
.claw-mine img { width: 22px; height: 22px; object-fit: contain; }
.claw-chute { position: absolute; left: 0; bottom: 0; width: 15%; height: 46px; background: rgba(0,0,0,.35); color: rgba(255,255,255,.6); font-size: 11px; display: grid; place-items: center; }
.claw-msg { margin: 12px 0 0; font-size: 14px; text-align: center; min-height: 20px; }
.claw-shelf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.claw-mine { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); box-shadow: var(--shadow-subtle); font-size: 13px; }
.claw-mine i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* ---------- 언어 고르기 ---------- */
.lang-select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; color: var(--color-aubergine, inherit); background: var(--color-paper-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23736b6b' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.6 2.5 2.6 14.5 0 17M12 3.5c-2.6 2.5-2.6 14.5 0 17'/%3E%3C/svg%3E") no-repeat 10px center / 15px; border: 1px solid var(--color-bone); border-radius: 999px; padding: 7px 14px 7px 31px; cursor: pointer; }
.lang-select:focus-visible { outline: 2px solid var(--color-espresso); outline-offset: 2px; }
.lang-nav { margin-left: auto; margin-right: 12px; }
.help-lang { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
/* 일본어·중국어는 한글 글꼴 대신 그 언어 글꼴을 먼저 쓴다 */
html[data-lang="ja"] { --font-sans: 'Inter', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'Noto Sans JP', system-ui, sans-serif; }
html[data-lang="zh-CN"] { --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Source Han Sans SC', system-ui, sans-serif; }
html[data-lang="zh-TW"] { --font-sans: 'Inter', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Source Han Sans TC', system-ui, sans-serif; }
/* 영어·스페인어는 글자가 길어지므로 버튼 글자가 넘치지 않게 */
html[data-lang="en"] .dock-btn, html[data-lang="es"] .dock-btn { white-space: nowrap; }

/* 야구 연습장 HUD */
.bat-hud { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.bat-hud[hidden] { display: none; }
.bat-board { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto;
  background: rgba(16, 20, 28, .82); color: #fff; border-radius: 14px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.bat-board > div { min-width: 64px; text-align: center; }
.bat-board b { display: block; font-size: 22px; line-height: 1.1; }
.bat-k { font-size: 11px; opacity: .7; }
.bat-guide {
  position: absolute; top: 132px; left: 50%; transform: translateX(-50%);
  background: rgba(16, 20, 28, .76); color: rgba(255, 255, 255, .92); border-radius: 999px;
  padding: 5px 14px; font-size: 12px; white-space: nowrap;
}
.bat-speed { position: absolute; top: 168px; left: 50%; transform: translateX(-50%); color: #ffd84a; font-weight: 700; font-size: 14px; text-shadow: 0 1px 3px #000; }
.bat-call { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%) scale(.7); opacity: 0; font-size: 48px; font-weight: 900;
  color: #fff; text-shadow: 0 3px 0 #2b1d1a, 0 0 18px rgba(0,0,0,.6); transition: transform .18s cubic-bezier(.2,1.6,.4,1), opacity .18s; white-space: nowrap; }
.bat-call.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bat-call.homer { color: #ffd84a; font-size: 64px; }
.bat-call.miss { color: #ff8a80; }
.bat-call.foul { color: #b8c4d6; }
.bat-actions { position: absolute; right: 24px; bottom: 120px; display: flex; gap: 10px; align-items: center; pointer-events: auto; }
.bat-swing { width: 96px; height: 96px; border-radius: 50%; font-size: 18px; font-weight: 800; }
.kbd { font-size: 11px; opacity: .6; margin-left: 4px; }
body.is-batting #contextBar { visibility: hidden; }
/* 야구·펀치·인형뽑기 중: 아래 버튼 줄·폰 오른손 버튼은 숨긴다 (인형뽑기는 조이스틱·전용 방향키로 집게 이동) */
body.is-batting .m-controls, body.is-batting .dock, body.is-batting .joystick { visibility: hidden; }
body.is-claw .joystick { visibility: visible; }
body.is-punching .dock, body.is-punching .joystick { display: none; }
@media (prefers-reduced-motion: reduce) { .bat-call { transition: none; } }
@media (max-width: 720px) {
  .bat-board { top: 56px; } .bat-board > div { min-width: 52px; } .bat-board b { font-size: 18px; }
  .bat-guide { top: 112px; max-width: 90vw; white-space: normal; text-align: center; }
  .bat-speed { top: 148px; }
  .bat-call { font-size: 36px; } .bat-call.homer { font-size: 46px; }
  .bat-actions { right: 16px; bottom: 96px; } .bat-swing { width: 84px; height: 84px; }
}

/* 3D 인형뽑기 HUD */
.claw-hud { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.claw-hud[hidden] { display: none; }
/* 안내판은 왼쪽 위: 가운데 두면 천장 레일의 집게를 가린다 */
.claw-top { position: absolute; top: 124px; left: 16px; pointer-events: auto; text-align: left;
  background: rgba(16, 20, 28, .82); color: #fff; border-radius: 14px; padding: 8px 16px; min-width: 260px; }
.claw-title { font-weight: 700; font-size: 14px; }
.claw-title .muted { color: rgba(255,255,255,.65); font-weight: 400; font-size: 12px; }
.claw-msg3 { font-size: 15px; margin-top: 2px; }
.claw-time { font-size: 22px; font-weight: 800; color: #ffd84a; font-variant-numeric: tabular-nums; }
.claw-time.is-hurry { color: #ff8a80; }
.claw-view-hint { font-size: 11px; color: rgba(255,255,255,.7); margin-top: 2px; }
.claw-view-hint:empty { display: none; }
.claw-mine-row { position: absolute; top: 252px; left: 16px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; pointer-events: auto; max-width: 300px; font-size: 12px; }
.claw-mine-row .muted { color: #fff; text-shadow: 0 1px 2px #000; align-self: center; }
.claw-mine-row .claw-mine { background: rgba(255,255,255,.9); color: var(--color-aubergine-ink); border-radius: 999px; padding: 2px 8px 2px 2px; display: inline-flex; align-items: center; gap: 4px; }
.claw-mine-row .claw-mine img { width: 22px; height: 22px; }
.claw-pad { position: absolute; left: 24px; bottom: 110px; width: 150px; height: 150px; pointer-events: auto; }
.claw-pad.is-off { opacity: .35; }
.claw-dir { position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--color-aubergine-ink); font-size: 18px; touch-action: none; }
.claw-dir.is-on { background: #ffd84a; }
.claw-dir.up { left: 49px; top: 0; } .claw-dir.down { left: 49px; bottom: 0; }
.claw-dir.left { left: 0; top: 49px; } .claw-dir.right { right: 0; top: 49px; }
.claw-go { font-size: 16px; }
@media (max-width: 720px) {
  .claw-top { top: 56px; left: 50%; transform: translateX(-50%); text-align: center; min-width: 0; width: 86vw; }
  .claw-mine-row { top: 150px; left: 50%; transform: translateX(-50%); justify-content: center; max-width: 90vw; }
  .claw-pad { left: 14px; bottom: 96px; transform: scale(.9); transform-origin: left bottom; }
}
