/* ============================================================
   神秘酒吧事务司 —— 样式
   配色：暖暗酒吧 + 琥珀色边框 + 霓虹粉点缀
   手机适配：下面有 @media 分段，窄屏时面板铺满、按钮放底部
   ============================================================ */
:root {
  --bg: #120a0c;
  --panel: #2a1d1a;
  --panel-2: #3a2a24;
  --amber: #e0a96d;
  --amber-dark: #8a5a36;
  --text: #f6e7cf;
  --muted: #b79c80;
  --pink: #ff4f9a;
  --ok: #8ccf6a;
  --warn: #f2c14e;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg);
  color: var(--text); font-family: var(--font); touch-action: manipulation;
}
/* 底部留出按钮栏的高度，免得「酒单 / 图鉴」按钮挡住场景底部（出口名牌等） */
#game { position: fixed; inset: 0 0 calc(72px + env(safe-area-inset-bottom)) 0; }
#game canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: auto; }
img.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- 像素风边框盒子 ---------- */
.pixel-box {
  background: var(--panel);
  border: 3px solid var(--amber);
  box-shadow: 0 0 0 3px #120a0c, 0 6px 0 3px #120a0c, 0 12px 30px rgba(0, 0, 0, .55);
  border-radius: 4px;
}

/* ---------- 按钮 ---------- */
.btn {
  font: inherit; font-weight: 700; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 2px solid var(--amber); border-radius: 4px;
  padding: 10px 16px; min-height: 44px; box-shadow: 0 3px 0 #120a0c;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #120a0c; }
.btn-primary { background: #b8453a; border-color: #ffd98a; }
/* 点不了的按钮（比如打烊时的「下单」）：灰掉，不能按 */
.btn:disabled, .btn:disabled:active {
  background: #3a3230; border-color: #5a4e48; color: #8a7e74; cursor: not-allowed;
  transform: none; box-shadow: 0 3px 0 #120a0c;
}
.btn-small { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.btn-close { padding: 0; width: 40px; min-height: 40px; font-size: 24px; line-height: 1; }

/* ---------- 名字牌（小人头顶） ---------- */
.tag {
  position: fixed; transform: translate(-50%, -100%); white-space: nowrap;
  font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 3px;
  background: rgba(18, 10, 12, .78); color: var(--text); border: 1px solid rgba(224, 169, 109, .5);
  text-shadow: 0 1px 0 #000;
}
.tag-self { color: #ffd98a; border-color: #ffd98a; }
.tag-npc { color: #ffb3d1; border-color: var(--pink); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { margin-top: -3px; } }
.tag-self { /* 面板里"你"的小标 */ }
.p-name .tag-self { margin-left: 4px; font-size: 10px; background: #ffd98a; color: #1a1010; border-radius: 2px; padding: 0 3px; }

/* ---------- 小标签 ---------- */
.tag-mini {
  display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700;
  border-radius: 3px; background: #4a3a30; color: var(--muted); vertical-align: middle;
}
.tag-mini.warn { background: var(--warn); color: #2a1a10; margin-left: 0; }
.tag-mini.ok { background: #2f5a34; color: #c9f0b4; margin: 0; }

/* ---------- 全屏覆盖层 ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }

/* ---------- 开始界面 ---------- */
.start-screen { background: rgba(10, 5, 8, .7); z-index: 20; pointer-events: auto; } /* 不用 backdrop-filter：在大屏上每帧模糊动画画面很吃显卡 */
.start-card { width: min(92vw, 380px); padding: 26px 22px 20px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.start-logo {
  font-size: 52px; font-weight: 900; letter-spacing: 6px; color: #ff4f9a; line-height: 1;
  text-shadow: 0 0 10px rgba(255, 79, 154, .8), 0 3px 0 #7a1f4a;
}
.start-title { margin: 0; font-size: 24px; letter-spacing: 2px; }
.start-sub { color: var(--muted); font-size: 13px; margin-top: -8px; }
.name-input {
  font: inherit; font-size: 18px; text-align: center; color: var(--text);
  background: #1a1010; border: 2px solid var(--amber); border-radius: 4px; padding: 12px; outline: none;
}
.name-input:focus { border-color: #ffd98a; box-shadow: 0 0 0 3px rgba(255, 217, 138, .25); }
/* 门口的邀请码：大写、字距拉开，好对着纸条输 */
.name-input.code-input { text-transform: uppercase; letter-spacing: 3px; }
.invite-label { color: #ffd98a; font-size: 13px; font-weight: 700; text-align: left; margin-bottom: -8px; }
.start-card .btn { font-size: 18px; padding: 12px; }
/* 室外（街口、小巷）不显示酒单 / 图鉴 */
body.outdoor #btn-menu, body.outdoor #btn-collection { display: none; }
.via-title { color: var(--muted); font-size: 13px; margin-bottom: -6px; }
.via-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.via-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; font: inherit; font-size: 13px;
  color: var(--muted); background: rgba(0, 0, 0, .25); border: 2px solid #4a3426; border-radius: 4px; cursor: pointer; }
.via-btn img { width: 39px; height: 27px; image-rendering: pixelated; opacity: .55; }
.via-btn:hover { border-color: var(--amber-dark); }
.via-btn.on { color: #ffd98a; border-color: #ffd98a; background: rgba(255, 217, 138, .08); }
.via-btn.on img { opacity: 1; }
.p-name .via-icon { width: 13px; height: 9px; margin-right: 5px; vertical-align: -1px; image-rendering: pixelated; }
.start-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.start-hint.warn { color: var(--warn); }
code { background: #1a1010; padding: 1px 6px; border-radius: 3px; }

/* ---------- 常驻按钮 / 在场名单 ---------- */
.hud-title {
  z-index: 1;
  position: fixed; left: 16px; top: 14px; font-weight: 900; letter-spacing: 2px; font-size: 18px;
  color: #ff8fc0; text-shadow: 0 0 8px rgba(255, 79, 154, .7), 0 2px 0 #000; pointer-events: none !important;
}
.hud-bar {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 12;
}
.hud-bar .btn { min-width: 92px; font-size: 16px; }
.presence-panel {
  position: fixed; right: 12px; top: 12px; width: 230px; padding: 10px 12px; font-size: 14px; z-index: 11;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0; margin-bottom: 6px;
  background: none; border: 0; font: inherit; font-weight: 800; color: #ffd98a; cursor: pointer; text-align: left;
}
.panel-fold::after { content: '▾'; font-size: 13px; padding: 0 2px 0 8px; }
/* 名单太长时在面板里滚动，不铺满屏幕 */
.panel-list { max-height: min(46vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
/* 收起：只剩标题一行 */
.presence-panel.folded { width: auto; padding: 6px 12px; }
.presence-panel.folded .panel-head { margin: 0; }
.presence-panel.folded .panel-fold::after { content: '▸'; }
.presence-panel.folded .panel-list, .presence-panel.folded .panel-foot { display: none; }
.panel-foot { margin-top: 8px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-link { color: #ffd98a; font-size: 13px; font-weight: 700; text-decoration: none; padding: 4px 0; white-space: nowrap; }
.p-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed rgba(224, 169, 109, .25); }
.p-name { font-weight: 700; white-space: nowrap; }
.p-drink { color: var(--muted); font-size: 12px; text-align: right; }

/* ---------- 弹窗（酒单 / 图鉴） ---------- */
.modal-backdrop { background: rgba(10, 5, 8, .6); z-index: 20; }
.modal { width: min(94vw, 560px); max-height: min(86dvh, 720px); display: flex; flex-direction: column; padding: 14px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex: none; }
.modal-head h2 { margin: 0; font-size: 20px; flex: 1; letter-spacing: 2px; color: #ffd98a; }
.coll-progress { font-size: 13px; color: var(--muted); }

/* 标题和标签栏高度固定（flex: none），只有下面的列表可以被压缩、滚动——否则列表一长，标签按钮会被压扁、挡住 */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 0; font: inherit; font-weight: 700; font-size: 14px; text-align: center; color: var(--muted); cursor: pointer;
  background: #1a1010; border: 2px solid #4a3a30; border-radius: 4px; padding: 8px 4px; min-height: 40px; white-space: nowrap; min-width: 0;
}
.tab small { font-weight: 400; opacity: .7; margin-left: 3px; font-size: 11px; }
.tab.active { color: #1a1010; background: var(--amber); border-color: #ffd98a; }

.list { overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.drink-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px;
  border-bottom: 1px dashed rgba(224, 169, 109, .3);
}
.row-icon { width: 36px; height: 30px; object-fit: contain; flex: none; }
.info { flex: 1; min-width: 0; }
.name-zh { font-weight: 800; font-size: 16px; }
.name-en { font-size: 12px; color: var(--muted); }
.ingredients { font-size: 12px; color: #d9c3a5; margin-top: 3px; line-height: 1.5; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.drink-row { cursor: pointer; }
.drink-row.soldout .info, .drink-row.soldout .row-icon { opacity: .45; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.row-price { font-weight: 800; color: var(--amber); font-size: 14px; }
.tag-mini.soldout { background: #5a2a2a; color: #ffb0a0; margin: 0; }
.menu-closed { font-size: 12px; color: var(--warn); margin: -2px 0 8px; }
.abv { display: inline-flex; align-items: center; gap: 4px; }
.abv-bars { display: inline-flex; gap: 2px; }
.abv-bars i { width: 6px; height: 9px; background: #4a3a30; border-radius: 1px; }
.abv-bars i.on { background: var(--amber); }
.glass-tag { display: inline-flex; align-items: center; gap: 3px; }
.glass-tag-icon { height: 14px; width: auto; image-rendering: pixelated; }
/* 详情卡 */
.drink-card { width: min(94vw, 420px); }
.dc-top { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.dc-icon { width: 64px; height: auto; image-rendering: pixelated; flex: none; }
.dc-head { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; }
.dc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.dc-price { font-weight: 800; color: var(--amber); font-size: 18px; }
.dc-radar { display: flex; justify-content: center; margin: 6px 0 2px; }
.radar { width: min(62vw, 200px); height: auto; overflow: visible; }
.radar-ring { fill: none; stroke: rgba(224, 169, 109, .22); stroke-width: 1; }
.radar-ring.outer { stroke: rgba(224, 169, 109, .5); }
.radar-axis { stroke: rgba(224, 169, 109, .22); stroke-width: 1; }
.radar-shape { fill: rgba(255, 79, 154, .35); stroke: var(--pink); stroke-width: 2; stroke-linejoin: round; }
.radar-label { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font); }

/* ---------- 图鉴 ---------- */
.progress { height: 8px; background: #1a1010; border: 1px solid var(--amber-dark); border-radius: 2px; margin-bottom: 10px; }
.progress-fill { height: 100%; background: var(--amber); }
.coll-count { font-size: 11px; color: var(--amber); margin-top: 2px; }
/* 图鉴 · 点单记录（按晚分组） */
.coll-tabs { margin-top: 8px; padding-bottom: 6px; }
.coll-tabs .tab { flex: 1; }
.hist-empty { padding: 24px 8px; color: var(--muted); text-align: center; font-size: 14px; }
.hist-night { margin: 6px 0 12px; }
.hist-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed rgba(224, 169, 109, .35); }
.hist-date { font-weight: 800; color: #ffd98a; font-size: 14px; }
.hist-cups { font-size: 12px; color: var(--muted); }
.hist-head .tag-mini { margin-left: auto; }
.hist-list { display: flex; flex-direction: column; }
.hist-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .04); padding: 6px 2px; cursor: pointer;
}
button.hist-row:hover { background: rgba(224, 169, 109, .08); }
.hist-icon { width: 28px; height: 28px; flex: none; }
.hist-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.hist-name small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.hist-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.collection-body { overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.coll-section { margin: 10px 0 6px; font-weight: 800; color: #ffd98a; font-size: 14px; letter-spacing: 2px; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.coll-card {
  font: inherit; color: var(--text); text-align: center; background: var(--panel-2);
  border: 2px solid var(--amber-dark); border-radius: 4px; padding: 10px 4px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 104px;
}
button.coll-card:active { transform: translateY(2px); }
.coll-card.locked { background: #1a1315; border-color: #3a2e32; cursor: default; color: #5c4d52; }
.coll-card.locked .name-zh { color: #6a5a60; letter-spacing: 3px; }
.card-icon { width: 44px; height: 36px; object-fit: contain; margin-bottom: 2px; }
.coll-card .name-zh { font-size: 14px; }
.coll-card .name-en { font-size: 10px; line-height: 1.2; }

/* ---------- 对话框（RPG 风格） ---------- */
.dialogue-layer { z-index: 30; align-items: flex-end; padding-bottom: calc(14px + env(safe-area-inset-bottom)); cursor: pointer; }
.dialogue { position: relative; width: min(96vw, 720px); min-height: 150px; padding: 14px 16px 12px; background: #1b1216; }
.dlg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.dlg-speaker { background: var(--amber); color: #1a1010; font-weight: 800; padding: 1px 8px; border-radius: 3px; }
.dlg-drink { color: var(--muted); }
.dlg-text { font-size: 18px; line-height: 1.7; min-height: 92px; }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.dlg-arrow { color: #ffd98a; font-size: 16px; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dlg-skip {
  font: inherit; font-size: 12px; color: var(--muted);
  background: none; border: 1px solid #4a3a30; border-radius: 3px; padding: 4px 8px; cursor: pointer; min-height: 28px;
}

/* ---------- 提示 ---------- */
#toasts {
  position: fixed; top: 52px; left: 0; right: 0; z-index: 15; display: flex; flex-direction: column;
  align-items: center; gap: 6px; pointer-events: none;
}
.toast {
  background: rgba(27, 18, 22, .94); border: 2px solid var(--amber); border-radius: 4px; padding: 8px 14px;
  font-weight: 700; text-align: center; max-width: 92vw; animation: toast-in .25s ease-out; transition: opacity .5s;
  box-shadow: 0 3px 0 #120a0c;
}
.toast.out { opacity: 0; }
.toast-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
@keyframes toast-in { from { transform: translateY(-10px); opacity: 0; } }

/* ============================================================
   响应式
   ============================================================ */
/* 宽屏（电脑）：在场名单常驻右上角，"在场"按钮隐藏 */
@media (min-width: 900px) {
  .btn-presence { display: none; }
  .presence-panel { display: block !important; }
}
/* 窄屏（手机）：在场名单默认收起，点"在场"按钮展开，标题隐藏 */
@media (max-width: 899px) {
  .presence-panel { display: none; right: 50%; transform: translateX(50%); top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); width: min(92vw, 340px); z-index: 14; }
  /* 手机：点「在场」打开（盖在方向键上面），名单在面板里滚动；手机上不用收起按钮 */
  .presence-panel.folded { width: min(92vw, 340px); padding: 10px 12px; }
  .presence-panel.folded .panel-list, .presence-panel.folded .panel-foot { display: block; }
  .presence-panel.folded .panel-foot { display: flex; }
  .panel-fold::after, .presence-panel.folded .panel-fold::after { content: '▾ 收起'; font-size: 12px; font-weight: 400; color: var(--muted); }
  .panel-list { max-height: 38dvh; }
  .presence-panel.open { display: block; }
  .hud-title {
  z-index: 1; font-size: 15px; left: 12px; top: 12px; }
  .hud-bar .btn { min-width: 0; flex: 1; padding: 10px 14px; }
  .hud-bar { width: min(94vw, 420px); }
  .modal { width: 96vw; max-height: 88dvh; padding: 12px; }
  .dlg-text { font-size: 17px; min-height: 100px; }
  #toasts { top: 42px; }
  .tab small { display: none; }
}

/* ============================================================
   第二版新增：移动控制 / 地点名牌 / 邀请卡 / 更多名字牌样式
   ============================================================ */
#labels { transition: opacity .3s; }
#labels.hidden { opacity: 0; }
.tag-door { color: #ffd98a; border-color: rgba(255, 217, 138, .6); background: rgba(40, 24, 14, .82); font-size: 11px; }
.tag-sign {
  font-size: 15px; letter-spacing: 3px; color: #ffd0e8; background: rgba(40, 8, 30, .6); border-color: var(--pink);
  text-shadow: 0 0 6px var(--pink), 0 0 12px var(--pink);
}

/* 互动按钮：电脑上在底部按钮栏上方居中；手机上在右下方，拇指够得着 */
.interact-btn {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 13; display: flex; align-items: center; gap: 10px; font-size: 16px; padding: 10px 18px;
  animation: pop .18s ease-out;
}
.interact-btn[hidden] { display: none; }
.interact-btn .key {
  display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 4px;
  background: #ffd98a; color: #2a1810; font-size: 13px; font-weight: 900;
}
@keyframes pop { from { transform: translateX(-50%) translateY(6px); opacity: 0; } }

/* 屏幕方向键（触屏 / 窄屏才显示） */
.dpad { display: none; position: fixed; left: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 138px; height: 138px; z-index: 13; }
.dpad-btn {
  position: absolute; width: 46px; height: 46px; font-size: 18px; color: var(--text); touch-action: none;
  background: rgba(42, 29, 26, .85); border: 2px solid var(--amber); border-radius: 6px; padding: 0; user-select: none; -webkit-user-select: none;
}
.dpad-btn.on { background: var(--amber); color: #1a1010; }
.dpad-up { left: 46px; top: 0; } .dpad-down { left: 46px; top: 92px; }
.dpad-left { left: 0; top: 46px; } .dpad-right { left: 92px; top: 46px; }
@media (pointer: coarse), (max-width: 899px) {
  .dpad { display: block; }
  .interact-btn { left: auto; right: 14px; transform: none; bottom: calc(96px + env(safe-area-inset-bottom)); min-width: 128px; min-height: 52px; animation: none; }
}

/* 进场时的地点名牌 */
.location {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%) translateY(-8px); z-index: 14; pointer-events: none;
  padding: 6px 16px; font-weight: 800; letter-spacing: 2px; color: #ffd98a; opacity: 0; white-space: nowrap;
  background: rgba(20, 12, 14, .88); border: 2px solid var(--amber); border-radius: 4px; box-shadow: 0 3px 0 #120a0c;
  transition: opacity .4s, transform .4s;
}
.location { text-align: center; }
.location-sub { margin-top: 3px; font-size: 12px; font-weight: 500; letter-spacing: 1px; color: var(--text); opacity: .85; }
.location.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 899px) { .location { top: 44px; font-size: 14px; padding: 5px 12px; } #toasts { top: 84px; } }
@media (min-width: 900px) { #toasts { top: 58px; } }

/* "走进故事"邀请卡 */
.offer-layer { z-index: 25; align-items: flex-end; padding-bottom: calc(100px + env(safe-area-inset-bottom)); background: rgba(10, 5, 8, .25); pointer-events: auto; }
.offer { width: min(92vw, 380px); padding: 14px 16px; text-align: center; background: #241829; border-color: #c9a0ff; animation: pop2 .25s ease-out; }
.offer-tag { display: inline-block; background: #c9a0ff; color: #1a1020; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 3px; }
.offer-title { font-size: 20px; font-weight: 800; margin: 8px 0 2px; color: #f0dcff; letter-spacing: 2px; }
.offer-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.offer-actions { display: flex; gap: 10px; justify-content: center; }
.offer-actions .btn-primary { background: #7a4ab8; border-color: #e0c8ff; }
.offer.order { background: #2a1d1a; border-color: var(--amber); }
.offer.order .offer-tag { background: var(--amber); color: #1a1010; }
.offer.order .offer-title { color: var(--text); }
.offer.order .offer-actions .btn-primary { background: #b5562f; border-color: #ffd98a; }
@keyframes pop2 { from { transform: translateY(10px); opacity: 0; } }

.start-cancel { background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 4px; }

/* 声音开关：电脑在标题右边，手机在左上角标题下 */
.sound-btn {
  position: fixed; left: 172px; top: 8px; z-index: 12; min-height: 0; width: 38px; height: 34px; padding: 0;
  font-size: 16px; line-height: 1; background: rgba(42, 29, 26, .85);
}
@media (max-width: 899px) { .sound-btn { left: auto; right: 12px; top: 8px; } }

/* 过场短片：全屏黑底，视频等比居中；右下角"跳过" */
.cutscene-layer { z-index: 40; background: #000; display: grid; place-items: center; pointer-events: auto; }
.cutscene-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cutscene-title {
  position: fixed; left: 16px; top: calc(12px + env(safe-area-inset-top)); color: rgba(240, 228, 204, .55);
  font-size: 13px; letter-spacing: 2px; pointer-events: none;
}
.cutscene-skip {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); min-height: 40px; padding: 8px 16px;
  background: rgba(30, 22, 20, .7); border-color: rgba(224, 169, 109, .7); font-size: 15px;
}
.offer-actions { flex-wrap: wrap; }

/* ============================================================
   外勤报告画板 · 报告卡片 · 提交表单 · 事务司护照
   ============================================================ */
.modal-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.board-modal { width: min(96vw, 780px); max-height: 92dvh; background: #3a2618; border-color: #c99a62; }
.board-modal .modal-head h2 { color: #ffe2b0; }
.board-loading, .board-empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.board-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.board-actions .btn { min-height: 40px; padding: 8px 14px; }
.board-admin-link { margin-left: auto; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.board-topic {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; padding: 8px 10px;
  background: #5a2a1e; border: 2px dashed #ffd98a; border-radius: 3px; font-size: 14px;
}
.board-topic b { color: #ffd98a; letter-spacing: 1px; }
.board-topic span { color: #f0d8c0; font-size: 12px; }
.board-tabs .tab { font-size: 15px; }

/* 地图：小画布放大，保持像素颗粒 */
.board-map { position: relative; width: 100%; margin: 4px 0 12px; border: 3px solid #1a1010; box-shadow: 0 0 0 2px #c99a62; background: #111; overflow: hidden; }
.board-map-img { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: crosshair; }
.map-label { position: absolute; transform: translate(-50%, -50%); font-size: 11px; color: rgba(255, 226, 176, .7); pointer-events: none; text-shadow: 0 1px 0 #000; white-space: nowrap; }
.map-note { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: rgba(255, 255, 255, .35); pointer-events: none; }

/* 拍立得 */
.polaroid {
  --tilt: 0deg; position: relative; display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px;
  padding: 5px 5px 6px; background: #f4efe2; border: 0; cursor: pointer; transform: rotate(var(--tilt)); font: inherit;
  box-shadow: 2px 2px 0 #1a1010, 4px 4px 0 rgba(0, 0, 0, .35); transition: transform .12s;
}
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0deg) scale(1.05); z-index: 3; outline: none; }
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #2a1d1a; image-rendering: auto; }
.polaroid .pin { position: absolute; left: 50%; top: -5px; width: 9px; height: 9px; margin-left: -4px; background: #c4302b; box-shadow: inset -2px -2px 0 #7a1a14, 0 1px 0 #000; }
.polaroid.gold { background: #f6e0a0; box-shadow: 0 0 0 2px #d4a548, 2px 2px 0 2px #1a1010; }
.polaroid.pinned .pin { background: #ffd98a; box-shadow: inset -2px -2px 0 #b8860b, 0 0 6px #ffd98a; }
.pol-cap { font-size: 12px; color: #2a1d1a; font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.polaroid.mini { position: absolute; width: 42px; padding: 3px 3px 7px; transform: translate(-50%, -100%) rotate(var(--tilt)); }
.polaroid.mini:hover { transform: translate(-50%, -100%) scale(1.6); }
.pol-strip { display: flex; gap: 14px; overflow-x: auto; padding: 10px 4px 14px; scroll-snap-type: x proximity; }
.pol-strip .polaroid { flex: 0 0 132px; scroll-snap-align: start; }
.pol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 12px; padding: 10px 4px; }

/* 世界地图上的小旗 */
.flag { position: absolute; transform: translate(-1px, -100%); width: 22px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; }
.flag-pole { position: absolute; left: 0; bottom: 0; width: 2px; height: 22px; background: #1a1010; }
.flag-cloth { position: absolute; left: 2px; top: 0; min-width: 16px; height: 12px; padding: 0 3px; font-size: 9px; line-height: 12px; font-weight: 800; color: #1a1010; background: #ffd98a; box-shadow: 1px 1px 0 #1a1010; }
.flag.hot .flag-cloth { background: #ff7a6a; }
.country-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; color: var(--text); background: #2a1d1a; border: 2px solid var(--amber-dark); border-radius: 3px; padding: 4px 8px; cursor: pointer; }
.chip small { opacity: .7; margin-left: 4px; }
.chip.hot { border-color: #ff7a6a; }
.country-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.country-head .btn { min-height: 34px; padding: 4px 10px; }
.country-head b { color: #ffd98a; font-size: 17px; }
.country-head span { color: var(--muted); font-size: 13px; }

/* 报告卡片 */
.report-card-modal { width: min(94vw, 460px); }
.rc-photo.polaroid.big { display: block; transform: rotate(-1deg); padding: 8px 8px 22px; margin: 4px auto 10px; cursor: default; }
.rc-photo.polaroid.big:hover { transform: rotate(-1deg); }
.rc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.tag-mini.gold { background: #d4a548; color: #1a1010; margin: 0; }
.tag-mini.topic { background: #ff7a6a; color: #1a1010; margin: 0; }
.rc-bar { font-size: 22px; font-weight: 900; color: #ffd98a; letter-spacing: 1px; }
.rc-place { color: var(--text); font-size: 14px; margin-top: 2px; }
.rc-addr { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.5; }
.rc-meta { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 6px; font-size: 13px; color: var(--muted); }
.rc-agent { font: inherit; font-weight: 800; color: #ffb3d1; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; }
.rc-row { font-size: 14px; display: flex; gap: 8px; }
.rc-row b { color: var(--amber); }
.rc-review { margin: 8px 0; font-size: 15px; line-height: 1.6; color: #f6e7cf; }
.rc-actions { display: flex; gap: 10px; margin: 12px 0 8px; }
.rc-react { flex: 1; display: flex; justify-content: center; gap: 8px; }
.rc-react.on { background: #7a4ab8; border-color: #e0c8ff; }
.rc-count { opacity: .8; font-weight: 400; }
.rc-maps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.rc-maps .btn { min-height: 36px; padding: 6px 12px; font-size: 14px; text-decoration: none; }

/* 提交表单 */
.submit-modal { width: min(96vw, 640px); }
.sub-grid { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.sub-preview { display: flex; align-items: center; justify-content: center; min-height: 160px; color: #5a4a3a; font-size: 13px; transform: rotate(-2deg); }
.sub-preview.empty { border: 2px dashed #a08060; }
.sub-preview img { width: 100%; aspect-ratio: auto; max-height: 220px; object-fit: contain; }
.hidden-file { display: none; }
.sub-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-label { font-size: 13px; color: #ffd98a; font-weight: 700; margin-top: 4px; }
.f-label i { font-style: normal; font-size: 11px; color: #1a1010; background: var(--warn); padding: 0 4px; border-radius: 2px; margin-left: 4px; }
.f-in { font: inherit; font-size: 15px; color: var(--text); background: #1a1010; border: 2px solid var(--amber-dark); border-radius: 3px; padding: 8px 10px; min-width: 0; width: 100%; }
.f-in:focus { outline: none; border-color: #ffd98a; }
.f-in[readonly] { opacity: .75; }
.f-pair { display: flex; gap: 6px; }
.f-pair .f-in { flex: 1; }
.sugg { display: flex; flex-direction: column; gap: 3px; }
.sugg-hint { font-size: 12px; color: var(--muted); }
.sugg-hint.ok { color: var(--ok); }
.gps-use { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.gps-use input { margin-top: 2px; }
.consent { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5; background: #3a2418; border: 2px solid var(--warn); border-radius: 3px; cursor: pointer; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.sub-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; }
.form-err { flex: 1; color: var(--warn); font-size: 13px; }
.sub-note { margin-top: 8px; font-size: 11px; color: var(--muted); }
.topic-modal { width: min(94vw, 460px); }
.topic-modal .f-in { margin-bottom: 6px; }

/* 事务司护照 */
.passport-modal { width: min(94vw, 520px); background: #1e2638; border-color: #9ab0d8; }
.passport-modal .modal-head h2 { color: #d8e4ff; }
.pp-cover { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 10px; background: #151b2a; border: 2px solid #4a5a80; }
.pp-emblem { width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 30px; color: #d4a548; border: 3px double #d4a548; }
.pp-org { font-size: 12px; color: #9ab0d8; letter-spacing: 2px; }
.pp-name { font-size: 22px; font-weight: 900; color: #fff; display: flex; gap: 6px; align-items: center; }
.pp-sum { font-size: 13px; color: #b8c4e0; margin-top: 2px; }
.pp-section { margin: 12px 0; }
.pp-title { font-size: 14px; font-weight: 800; color: #d8e4ff; margin-bottom: 8px; border-bottom: 2px dashed #4a5a80; padding-bottom: 4px; }
.pp-title span { color: #9ab0d8; font-weight: 400; }
.pp-stamps { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px; }
.pp-empty { color: #8a96b8; font-size: 13px; }
.stamp {
  --ink: #c4302b; --tilt: 0deg; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--ink); transform: rotate(var(--tilt)); opacity: .92; padding: 6px;
  /* 像素描边：用阶梯状的阴影代替圆滑边框 */
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}
.stamp-city { width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px #1e2638, inset 0 0 0 4px var(--ink); }
.stamp-country { min-width: 84px; height: 54px; }
.stamp-gold { min-width: 110px; min-height: 60px; color: #ffd98a; background: rgba(212, 165, 72, .12); box-shadow: 0 -3px 0 0 #d4a548, 0 3px 0 0 #d4a548, -3px 0 0 0 #d4a548, 3px 0 0 0 #d4a548, 0 0 12px rgba(212, 165, 72, .5); }
.stamp-text { font-weight: 900; font-size: 14px; line-height: 1.2; word-break: break-word; }
.stamp-sub { font-size: 10px; opacity: .85; margin-top: 2px; }
.pp-foot { font-size: 11px; color: #8a96b8; margin-top: 8px; }

@media (max-width: 600px) {
  .sub-grid { grid-template-columns: 1fr; }
  .sub-preview { min-height: 120px; transform: none; }
  .pol-strip .polaroid { flex-basis: 112px; }
  .polaroid.mini { width: 32px; }
  .rc-bar { font-size: 19px; }
  .board-actions .btn { flex: 1; }
}

/* ---------- 电视 ---------- */
.tv-modal { width: min(96vw, 860px); }
.tv-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #050405; border: 3px solid #2a1a14; border-radius: 4px; overflow: hidden; }
.tv-screen video, .tv-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.tv-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8a7a70; font-size: 16px; letter-spacing: 2px; }
.tv-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tv-ch { font: inherit; font-size: 14px; color: var(--text); background: #1a1010; border: 2px solid var(--amber-dark); border-radius: 3px; padding: 6px 10px; cursor: pointer; }
.tv-ch.on { border-color: #ffd98a; color: #ffd98a; }
.tv-ch-no { font-family: monospace; color: #e0a96d; margin-right: 6px; }
.tv-admin { width: min(96vw, 620px); }
.tv-help { font-size: 13px; color: #c8b8a8; margin-bottom: 8px; line-height: 1.5; }
.tv-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(255, 217, 138, .2); }
.tv-row-in { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tv-row-btns { display: flex; gap: 4px; }
.tv-row-btns .btn { padding: 4px 8px; min-width: 0; }
.tv-empty-row { font-size: 13px; color: #8a7a70; padding: 12px 0; }
.tv-status { flex: 1; font-size: 13px; color: #ffd98a; }
@media (max-width: 560px) { .tv-admin .sub-foot { flex-wrap: wrap; } }

/* 「老样子？」：上次怎么来的 */
.welcome-via { display: flex; align-items: center; justify-content: center; gap: 8px; color: #e8d8c0; font-size: 15px; margin: 4px 0 14px; }

/* ---------- 举杯 / 表情 ---------- */
#btn-emote { display: none; }
body.in-bar #btn-emote { display: inline-block; }
body:not(.in-bar) #emote-pop { display: none; }
.emote-pop {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 13;
  display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; justify-content: center; max-width: 94vw;
}
.emote-pop[hidden] { display: none; }
.emote-btn {
  font: inherit; font-size: 24px; line-height: 1; background: #1a1010; border: 2px solid var(--amber-dark); border-radius: 4px;
  width: 46px; height: 46px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.emote-btn:hover { border-color: #ffd98a; }
.emote-btn small { font-size: 10px; color: #ffd98a; margin-top: 2px; }
.emote-cheers { width: 56px; border-color: #ffd98a; }
/* 头顶冒出来的表情气泡（名字牌层里的一种） */
.tag-emote {
  font-size: 20px; line-height: 1; padding: 3px 6px 4px; border-radius: 10px; background: #fff8ea; border: 2px solid #3a2418;
  animation: emote-pop .25s ease-out;
}
.tag-emote::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -4px;
  border: 4px solid transparent; border-top-color: #3a2418;
}
@keyframes emote-pop { from { transform: translate(-50%, -100%) scale(.4); opacity: 0; } }
.tv-banner { margin-top: 8px; font-size: 13px; color: #ffd98a; text-align: center; letter-spacing: 1px; }


/* 墙上小屏的 B 站 / YouTube 播放器：盖在像素电视的屏幕上，点不到（点它 = 点电视） */
.tv-wall { position: fixed; z-index: 4; overflow: hidden; pointer-events: none; background: #000; filter: brightness(.85) saturate(.9); }
.tv-wall iframe { width: 480px; height: 270px; border: 0; transform-origin: 0 0; pointer-events: none; }

/* 故事幻境、和物藏室里：底部只留「在场」，酒单 / 图鉴 / 表情都收起来 */
body.in-realm #btn-menu, body.in-realm #btn-collection, body.in-realm #btn-emote { display: none; }

/* ---------- 霓虹灯招牌（js/ui/neon.js）：白色灯芯 + 粉色光晕，慢慢呼吸，偶尔闪一下 ---------- */
.neon-sign {
  position: fixed; z-index: 4; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-weight: 600; letter-spacing: .14em; padding-left: .14em; line-height: 1; color: #fff3f8;
  text-shadow:
    0 0 .04em #fff, 0 0 .12em #ffd1e6, 0 0 .28em #ff5fa5, 0 0 .55em #ff3d8f, 0 0 1em #ff2a7f, 0 0 1.6em rgba(255, 42, 127, .55);
  animation: neon-breathe 3.2s ease-in-out infinite, neon-flicker 7s linear infinite;
}
.neon-ch { display: inline-block; }
.neon-ch-flick { animation: neon-flicker-one 5.3s linear infinite; }
@keyframes neon-breathe { 50% { filter: brightness(.88); } }
/* 整块招牌：大部分时间亮着，偶尔"滋滋"两下 */
@keyframes neon-flicker {
  0%, 61%, 63.5%, 66%, 100% { opacity: 1; }
  62% { opacity: .35; } 64.5% { opacity: .55; } 65% { opacity: .9; }
}
/* 单独一个字：接触不良，偶尔暗下去一瞬 */
@keyframes neon-flicker-one {
  0%, 30%, 31.5%, 80%, 83%, 100% { opacity: 1; }
  30.6% { opacity: .15; } 81% { opacity: .3; } 82% { opacity: .1; }
}
/* 打烊：灯管熄了，只剩暗暗的玻璃管 */
.neon-sign.off { color: #5f4a55; text-shadow: none; animation: none; }
.neon-sign.off .neon-ch { animation: none; }
@media (prefers-reduced-motion: reduce) { .neon-sign, .neon-ch-flick { animation: none; } }

/* ---------- 地窖 · 秘料档案室 / 和物藏室 ---------- */
.cellar-modal { width: min(94vw, 520px); }
.cellar-lit { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 3px; background: #2a2428; color: #a89aa0; margin-bottom: 8px; }
.cellar-lit.on { background: #3a5a3a; color: #c9f0b4; }
.cellar-flavor { color: #ffd98a; font-weight: 700; margin: 4px 0 8px; }
.cellar-story { line-height: 1.75; margin: 0 0 10px; }
.cellar-meta { font-size: 13px; color: #c8b8a8; line-height: 1.6; margin: 4px 0; }
.note-text { font-size: 18px; line-height: 1.7; margin: 6px 0 10px; color: #f6efe0; }
.note-by { font-size: 13px; color: #c8b8a8; margin: 0 0 10px; }
.note-link { font: inherit; font-size: 13px; color: #e0a96d; background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ledger-modal { width: min(94vw, 560px); }
.ledger-write { padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px dashed rgba(255, 217, 138, .25); }
.ledger-in { resize: none; font-size: 15px; }
.ledger-actions { display: flex; gap: 8px; margin: 6px 0; }
.ledger-pick { flex: 1; }
.ledger-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px dashed rgba(224, 169, 109, .2); padding: 8px 2px; cursor: pointer; }
.ledger-row:hover { background: rgba(255, 217, 138, .06); }
.ledger-text { font-size: 15px; }
.ledger-by { font-size: 12px; color: var(--muted); }
.exhibit-modal.rare { border-color: #e8c45a; box-shadow: 0 0 0 2px #8a6a28, 0 0 24px rgba(232, 196, 90, .35); }
.exhibit-rare { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 2px; padding: 2px 8px; border-radius: 3px; background: #e8c45a; color: #2a1a10; margin-bottom: 8px; }
.exhibit-meta { display: grid; grid-template-columns: 5em 1fr; gap: 4px 10px; margin: 0 0 12px; font-size: 14px; }
.exhibit-meta dt { color: #e0a96d; }
.exhibit-meta dd { margin: 0; }
.cutscene-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #e8d8c0; font-size: 15px; letter-spacing: 3px; animation: neon-breathe 1.6s ease-in-out infinite; pointer-events: none; }

/* 地窖里不能点酒：「酒单」按钮收起来 */
body.no-menu #btn-menu { display: none; }

/* ---------- 管理员模式（只有管理员看得到；js/adminMode.js） ---------- */
.admin-btn {
  position: fixed; left: 216px; top: 8px; z-index: 12; min-height: 0; height: 34px; padding: 0 10px;
  font-size: 13px; line-height: 1; background: rgba(42, 29, 26, .85);
}
@media (max-width: 899px) { .admin-btn { left: auto; right: 58px; } }
.admin-btn.on { background: #6a3aa0; border-color: #d8b0ff; color: #fff; }
.admin-banner {
  position: fixed; top: 48px; left: 50%; transform: translateX(-50%); z-index: 12; max-width: calc(100% - 32px);
  padding: 2px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; color: #f0e0ff; background: rgba(80, 40, 120, .8);
  border: 1px solid #d8b0ff; border-radius: 4px; text-align: center; pointer-events: none;
}
.admin-banner[hidden] { display: none; }
.menu-closed.admin-note { color: #d8b0ff; }
