/* ============================================================
 * 文件：css/tavern.css —— 童话酒馆（关卡前置架构）
 * 主题：暖木酒馆 × 冥刻风羊皮纸 × 烛光
 * 说明：所有样式统一定义在此，供童话酒馆场景复用。
 *       集成时仅需在 index.html 引入本文件，并按需打开场景。
 * v20260918b：【重置进度】/【离开酒馆】不再被拉伸成与信息 chip 同宽（右侧一大片虚空）——
 *            改为贴合文字宽度 + 加大字间距；幕页签新增「第三幕·噩梦诅咒」的更暗灰样式
 * ============================================================ */

.tavern-root {
  --t-wood-dark: #1c110a;
  --t-wood:      #33211a;
  --t-wood-lite: #4e2f1a;
  --t-edge:      #7a4a24;
  --t-parch:     #d8c196;
  --t-parch-deep:#b9965e;
  --t-ink:       #3a2a1a;
  --t-cream:     #f0e2c0;
  --t-gold:      #e0a33c;
  --t-gold-hi:   #ffd97a;
  --t-ember:     #c85a2a;
  --t-slot:      #241510;
  --t-dim:       #6b5838;
}

/* 全屏场景外层（覆盖整屏，供集成时挂到 body 末端） */
#tavernScene {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; /* v20260918t：inset 简写 Chrome 87+ 才认，老浏览器整条丢弃 → 一律四边写法 */
  z-index: 500;
  display: none;
  flex-direction: column;
  font-family: "Palatino Linotype", Palatino, Georgia, "Songti SC", "SimSun", serif;
  color: var(--t-cream);
  user-select: none;
  overflow: hidden;
}
#tavernScene.tavern-open { display: flex; }

/* 木纹+烛光氛围背景 */
.tavern-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* v20260918t：inset 简写 Chrome 87+ 才认，老浏览器整条丢弃 → 一律四边写法 */
  background:
    radial-gradient(ellipse at 50% -10%, rgba(224,163,60,0.18), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(200,90,42,0.14), transparent 55%),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(0,0,0,0.10) 7px 8px),
    linear-gradient(180deg, #2a1a10 0%, #1c110a 60%, #150c07 100%);
}
.tavern-bg::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* v20260918t：inset 简写 Chrome 87+ 才认，老浏览器整条丢弃 → 一律四边写法 */
  background-image:
    linear-gradient(rgba(255,240,200,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,240,200,0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.5;
  pointer-events: none;
}

/* 顶部装饰：酒馆招牌条 */
.tavern-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  z-index: 3;
  pointer-events: none;
  border-bottom: 1px solid rgba(122,74,36,0.55);
  box-shadow: 0 2px 18px rgba(0,0,0,0.4);
}

/* ---- 顶栏按钮组 ---- */
/* v20260920h：【酒馆公告】移入菜单列表（此前在右下角 .tavern-bottom-right，容器已删） */

/* ---- 酒馆公告（v20260920h 起挂在菜单列表内，与其他三项同宽） ---- */
.tavern-hud .hud-menu-list .tavern-announce-btn {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
}
.tavern-announce-btn {
  pointer-events: auto;
  position: relative;
  white-space: nowrap; /* v20260918p：公告四字永不折行（旧机窄屏曾挤成竖排） */
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--t-gold-hi);
  background: linear-gradient(180deg, #4e2f1a, #33211a);
  border: 1px solid var(--t-edge);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,220,150,0.18);
  transition: transform .12s ease, box-shadow .2s ease, color .2s ease;
}
.tavern-announce-btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(224,163,60,0.3);
}
.tavern-announce-btn:active { transform: scale(0.96); }

/* 公告羊皮纸弹窗 */
.tavern-popup-mask {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* v20260918t：inset 简写 Chrome 87+ 才认，老浏览器整条丢弃 → 一律四边写法 */
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8,4,2,0.55);
  pointer-events: auto;
}
.tavern-popup-mask.tavern-show { display: flex; animation: tavernFade .25s ease; }

.tavern-parchment {
  width: 86vw; max-width: 520px;  /* v20260918t：老写法兜底（等价 min(520px,86vw)），下行 min() 供新浏览器 */
  width: min(520px, 86vw);
  padding: 38px 40px 34px;
  position: relative;
  color: var(--t-ink);
  background:
    radial-gradient(circle at 50% 40%, rgba(255,240,210,0.5), transparent 70%),
    linear-gradient(160deg, #e9d7ac, #cfb57d);
  border: 3px solid #7a4a24;
  border-radius: 6px;
  box-shadow: 0 0 0 6px rgba(30,17,10,0.9), 0 18px 60px rgba(0,0,0,0.7);
  text-align: center;
  animation: tavernParchPop .3s cubic-bezier(.3,1.6,.4,1);
}
.tavern-parchment::before {
  content: attr(data-seal);
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: radial-gradient(circle at 35% 30%, #e0a33c, #8a4a18);
  color: #fff;
  border: 3px solid #3a2415;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
.tavern-parchment h2 {
  margin: 6px 0 16px;
  font-size: 22px;
  letter-spacing: 4px;
  color: #6b3a16;
}
.tavern-parchment p {
  font-size: 17px;
  line-height: 1.9;
  color: #4a3320;
}
.tavern-parch-close {
  margin-top: 22px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  color: #f5e6c2;
  background: #6b3a16;
  border: 1px solid #3a2415;
  border-radius: 6px;
  padding: 8px 30px;
  cursor: pointer;
}
.tavern-parch-close:hover { background: #8a4a18; }

/* ---- HUD（左上） ---- */
.tavern-hud {
  position: absolute;
  left: 20px;
  top: 70px;   /* v20260917l：页签并入顶栏后顶栏略高，HUD 下移 6px 防贴边 */
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.tavern-hud .hud-chip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(78,47,26,0.92), rgba(51,33,26,0.92));
  border: 1px solid var(--t-edge);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  font-size: 14px;
  color: var(--t-cream);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.tavern-hud .hud-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3);
  font-size: 15px;
}
.tavern-hud :is(.btn) {
  cursor: pointer;
}
.tavern-hud .btn-danger {
  cursor: pointer;
  background: linear-gradient(180deg, #5a2b1c, #3d1c12);
  color: #ffd0a8;
}
.tavern-hud .btn-danger:hover { filter: brightness(1.15); }
.tavern-hud .btn-warn {
  cursor: pointer;
  background: linear-gradient(180deg, #6a4a16, #3f2c10);
  color: #ffe0a0;
}
.tavern-hud .btn-warn:hover { filter: brightness(1.15); }
/* v20260918b：【重置进度】/【离开酒馆】这两个字少的操作按钮
 * v20260918p：用户要求 HUD 四个按钮统一长度（= 开始游戏），尽量短。
 * ① 去掉 align-self:flex-start，让所有 chip 在列内拉伸到同一宽度（列宽=最宽子项）
 * ② letter-spacing .3em → .2em 收窄
 * ③ 全部 justify-content:center，文字在等宽按钮内居中 */
.tavern-hud .hud-chip.btn-warn,
.tavern-hud .hud-chip.btn-danger {
  letter-spacing: .2em;
  padding: 7px 16px 7px 20px;
}
.tavern-hud .hud-chip { justify-content: center; }
/* 卡组 chip / 开始游戏同样拉伸：列内按钮严格等宽 */
.tavern-hud .hud-chip,
.tavern-hud .tavern-start-btn { align-self: stretch; box-sizing: border-box; }

/* v20260920g：【菜单】折叠按钮 —— 卡组/重置/离开收纳进它，点一下展开 */
.tavern-hud .hud-menu-btn {
  align-self: flex-start;   /* 菜单按钮贴文字宽度，不跟列表拉通 */
  padding: 7px 18px;
  cursor: pointer;
  font-weight: bold;
}
.tavern-hud .hud-menu-list {
  display: none;            /* JS 切换为 flex */
  flex-direction: column;
  gap: 10px;
  align-items: stretch;     /* 展开的三项与列表同宽、彼此等宽 */
}
/* 弹窗里的暖色按钮（重置进度确认） */
.tavern-parch-close.tavern-btn-warn { background: #a3641a; }
.tavern-parch-close.tavern-btn-warn:hover { background: #c07a24; }

/* v20260918i：【冒险卡组】角标可点击 → 弹出卡组详情。给个手型 + hover 提亮，
 * 与旁边 btn-warn/btn-danger 操作按钮区分（信息角标不加 letter-spacing）。 */
.tavern-hud .hud-chip.hud-chip-click { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tavern-hud .hud-chip.hud-chip-click:hover {
  border-color: #c9a860;
  box-shadow: 0 3px 14px rgba(201,168,96,0.25);
}

/* ---- 地图画布（竖版长卷：图二背景 + 线性节点） ---- */
.tavern-map-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 64px;
}
#tavernMap {
  /* v20260918o/t：地图略压缩。兜底行 88vw+max-width 供老浏览器（min() 整条被丢弃），下行 min() 供新浏览器 */
  width: 88vw; max-width: 440px;
  width: min(42vh, 440px, 88vw);
  height: auto;
  max-height: none;
}

#tavernMap .t-path { stroke: #5a3a20; stroke-width: 5; fill: none; stroke-linecap: round; opacity: 0.85; }
#tavernMap .t-path--lock { stroke: #352317; opacity: 0.45; }

#tavernMap .t-node { cursor: pointer; }
#tavernMap .t-node .hit { fill: transparent; }
/* 可达节点：荧光光圈（外环 + 柔光芯，呼吸脉冲） */
#tavernMap .t-node .glow,
#tavernMap .t-node .glow-soft {
  fill: none;
  stroke: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
#tavernMap .t-node.reach .glow {
  fill: none;
  stroke: rgba(255, 220, 130, 0.92);
  stroke-width: 3.2;
  opacity: 1;
  animation: tavernReachRing 1.6s ease-in-out infinite;
}
#tavernMap .t-node.reach .glow-soft {
  fill: rgba(255, 214, 120, 0.16);
  stroke: rgba(255, 232, 160, 0.35);
  stroke-width: 1.5;
  opacity: 1;
  animation: tavernReachSoft 1.6s ease-in-out infinite;
}
#tavernMap .t-node.reach:hover .glow {
  stroke: rgba(255, 240, 170, 1);
  stroke-width: 3.6;
  animation-duration: 1.1s;
}
#tavernMap .t-node.reach:hover .glow-soft {
  fill: rgba(255, 228, 140, 0.28);
  animation-duration: 1.1s;
}

/* 棋子（单个 LOGO 直接在地图上移动）：常亮呼吸光 */
#tavernMap .t-token {
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.65));
}
#tavernMap .t-token .logo {
  font-size: 46px;
  text-anchor: middle;
  dominant-baseline: central;
  transform: translateY(-1px); /* 微调 ⚜️ 字形视觉重心，补偿个别平台 emoji 偏下 */
  filter: drop-shadow(0 0 12px rgba(255, 217, 122, 0.95))
          drop-shadow(0 0 22px rgba(255, 190, 80, 0.55));
  animation: tavernTokenGlow 2.2s ease-in-out infinite;
}

@keyframes tavernTokenGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 217, 122, 0.85))
            drop-shadow(0 0 18px rgba(255, 190, 80, 0.40));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 228, 150, 1))
            drop-shadow(0 0 32px rgba(255, 200, 90, 0.75));
  }
}
@keyframes tavernReachRing {
  0%, 100% {
    opacity: 0.55;
    stroke-width: 2.6;
    filter: drop-shadow(0 0 6px rgba(255, 217, 122, 0.55));
  }
  50% {
    opacity: 1;
    stroke-width: 3.4;
    filter: drop-shadow(0 0 14px rgba(255, 230, 150, 0.95))
            drop-shadow(0 0 22px rgba(255, 200, 80, 0.45));
  }
}
@keyframes tavernReachSoft {
  0%, 100% {
    opacity: 0.35;
    fill: rgba(255, 214, 120, 0.10);
  }
  50% {
    opacity: 1;
    fill: rgba(255, 220, 130, 0.22);
  }
}

/* 底部提示 */
.tavern-hint {
  position: absolute;
  left: 0; right: 0;
  bottom: 14px;
  text-align: center;
  color: #a99362;
  font-size: 13px;
  letter-spacing: 2px;
  z-index: 3;
  pointer-events: none;
  text-shadow: 0 1px 0 #000;
}

/* ---- 事件羊皮纸卡片（节点事件） ---- */
.tavern-event .tavern-parchment { width: 84vw; max-width: 460px; width: min(460px, 84vw); } /* v20260918t 兜底 */
.tavern-event-body { font-size: 16px; line-height: 1.8; color: #4a3320; }
.tavern-event-actions {
  display: flex; gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
.tavern-parch-btn {
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  color: #f5e6c2;
  background: #6b3a16;
  border: 1px solid #3a2415;
  border-radius: 6px;
  padding: 8px 26px;
  cursor: pointer;
}
.tavern-parch-btn:hover { background: #8a4a18; }
.tavern-parch-btn--gold { background: #a06a1a; }
.tavern-parch-btn--gold:hover { background: #c08730; }

/* 选卡面板 */
.tavern-pick-grid {
  display: flex; gap: 14px;
  justify-content: center;
  margin-top: 6px;
}
.tavern-pick-card {
  width: 120px; height: 168px;
  border: 2px solid #6b3a16;
  border-radius: 8px;
  background: linear-gradient(180deg, #ead9ae, #cfb57d);
  color: #4a3320;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
}
.tavern-pick-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  border-color: #e0a33c;
  box-shadow: 0 10px 22px rgba(224,163,60,0.45);
}
.tavern-pick-card .star { font-size: 28px; }
.tavern-pick-card .name { font-size: 14px; font-weight: bold; text-align: center; }
.tavern-pick-card .rank { font-size: 12px; color: #7a5a1a; }

/* 结算横幅 */
.tavern-victory .tavern-parchment { border-color: #c08730; }
.tavern-victory h2 { font-size: 24px; }
.tavern-victory p { font-size: 18px; }

@keyframes tavernFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tavernParchPop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* ============================================================
 * v20260917j：酒馆流程 UI（教学弹窗 / 起始四张 / 三选一加入·替换）
 * ============================================================ */
/* 教学期间隐藏地图（读完规矩才显示） */
.tavern-map-wrap.tavern-map-hidden { opacity: 0; pointer-events: none; }
.tavern-map-wrap { transition: opacity .35s ease; }

/* 教学正文 */
.tavern-tutorial { display: flex; flex-direction: column; gap: 10px; }
.tavern-tut-line {
  margin: 0; font-size: 14px; line-height: 1.7; color: #4a3320;
  background: rgba(255, 245, 220, 0.55);
  border-left: 3px solid #c08730;
  padding: 6px 10px; border-radius: 4px;
}
/* v20260918f：弹窗正文下面的括号小字（注解/提醒，如公告底部的"卡关了试试重置进度"）
 * 比正文（17px）小一档、颜色更淡、不加框 —— 是旁注不是正文，不该抢注意力
 * ⚠ 选择器必须带 .tavern-parchment 前缀：`.tavern-parchment p`（0,1,1）会压过
 *   裸的 `.tavern-foot-note`（0,1,0），小字样式会整个失效（回归测试 test-tavern-flow [1b] 抓到过） */
.tavern-parchment .tavern-foot-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #7a5a1a;
}

/* 起始四张：四张并排时略微收窄 */
.tavern-parchment .tavern-pick-grid { flex-wrap: wrap; }
.tavern-parchment .tavern-pick-grid .tavern-pick-card { width: 104px; height: 150px; }

/* 卡组替换面板 */
.tavern-deck-title {
  margin: 12px 0 6px; font-size: 13px; font-weight: bold; color: #6b3a16;
  border-bottom: 1px dashed #b08a4a; padding-bottom: 4px;
}
.tavern-deck-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 168px; overflow-y: auto; padding-right: 2px;
}
.tavern-deck-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 245, 220, 0.6);
  border: 1px solid #c9a86a; border-radius: 5px;
  padding: 4px 8px;
}
.tavern-deck-star { font-size: 15px; min-width: 46px; }
.tavern-deck-name { font-size: 13px; font-weight: bold; color: #4a3320; flex: 1; }
.tavern-deck-rank { font-size: 11px; color: #7a5a1a; }
.tavern-deck-replace {
  font-size: 11px; padding: 3px 8px; cursor: pointer;
  border: 1px solid #6b3a16; border-radius: 4px;
  background: #e0a33c; color: #fff;
}
.tavern-deck-replace:hover { filter: brightness(1.12); }
.tavern-btn-disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
 * v20260917k：幕页签 / 发牌动画 / 皇家书库卡面徽记 / 骷髅宝箱 / 酒馆地窖
 * ============================================================ */
/* ============================================================
 * v20260917n：右上角按钮组（.tavern-top-right）——【开始游戏】曾从屏幕右中移到
 *             顶栏，紧邻【酒馆公告】左侧；两者整体缩小为小胶囊 / 小方角钮
 * ============================================================ */
/* ============================================================
 * v20260917l：幕页签移到顶栏中间 / 顶栏【开始游戏】/ 自定义图标卡面 /
 *             关卡童话弹窗 / 棋子出生动画
 * ============================================================ */
/* 第一幕 / 第二幕页签（顶栏中间横排，不再压住左侧 HUD） */
.tavern-acts {
  position: static;
  pointer-events: auto;
  display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px;
  z-index: 6;
}
.tavern-act {
  writing-mode: horizontal-tb; text-orientation: mixed;
  padding: 7px 16px; border-radius: 8px; font-size: 13px; letter-spacing: 2px;
  border: 2px solid #6b3a16; background: linear-gradient(180deg, #ead9ae, #cfb57d); color: #4a3320;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  white-space: nowrap;
}
.tavern-act-on { border-color: #e0a33c; color: #7a4a10; font-weight: bold; }
.tavern-act-off {
  filter: grayscale(1) brightness(0.72); cursor: pointer; opacity: .8;
}
.tavern-act-off:hover { opacity: 1; }
/* v20260918b：第三幕·噩梦诅咒 —— 比第二幕更暗一档的灰（更远、还没开幕） */
.tavern-act-locked {
  filter: grayscale(1) brightness(0.62); opacity: .6;
}
.tavern-act-locked:hover { opacity: .6; }
@media (max-width: 560px) {
  .tavern-act { padding: 5px 10px; font-size: 11px; letter-spacing: 1px; }
  .tavern-topbar { padding: 10px 12px; }
}

/* ============================================================
 * v20260918m：手机版排版 —— 隐藏滚动条 + 触摸滚动
 * 手机屏小，酒馆内各页面（地图长卷 / 弹窗 / 卡组列表 / 地窖商店）经常显示不全：
 * 统一改为可触摸上下滚动，同时把滚动条视觉上藏起来
 * （scrollbar-width:none + ::-webkit-scrollbar{display:none}）。
 * 玩家用手指在页面上滑动即可查看被挡住的下半部分。
 * ============================================================ */
.tavern-map-wrap,
.tavern-parch-scroll,
.tavern-deck-list,
.tavern-cellar-inner {
  scrollbar-width: none;              /* Firefox：隐藏滚动条 */
  -ms-overflow-style: none;           /* 旧 Edge：隐藏滚动条 */
  -webkit-overflow-scrolling: touch;  /* iOS 惯性滚动 */
  overscroll-behavior: contain;       /* 滚到头不把手势漏给底下的页面 */
}
.tavern-map-wrap::-webkit-scrollbar,
.tavern-parch-scroll::-webkit-scrollbar,
.tavern-deck-list::-webkit-scrollbar,
.tavern-cellar-inner::-webkit-scrollbar { display: none; }

/* 弹窗羊皮纸（酒馆规矩 / 公告 / 选卡 / 关卡童话……全部走这里）：
 * 此前没有 max-height，手机上内容一多就被屏幕截断且无法滚动。
 * v20260918q：外壳只限高、不滚动 —— overflow-y:auto 会把跨边密封章
 * （::before top:-18px）的上半截裁掉（用户：emoji 被挡住了）。
 * 改为内部滚动层 .tavern-parch-scroll 承担滚动，密封章完整显示；
 * 先写 88vh 兜底，再写 dvh 精确适配手机地址栏伸缩 */
.tavern-parchment {
  max-height: 88vh;
  max-height: min(88vh, calc(100dvh - 28px));
  box-sizing: border-box; /* 限高含边框内边距，总高不超屏 */
  display: flex;
  flex-direction: column;
  overflow: visible;
  touch-action: pan-y;
}
.tavern-parch-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  touch-action: pan-y;
}
/* 遮罩加内边距：小屏上弹窗四周留出呼吸空隙，不再顶边 */
.tavern-popup-mask { padding: 14px; }

/* ---- 顶栏【开始游戏】（没有进度时出现；点它从出生点开局） ---- */
.tavern-start-btn {
  pointer-events: auto;
  position: relative;
  z-index: 8;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-family: inherit;
  font-size: 12px; letter-spacing: 2px;
  color: #fff4d6;
  padding: 4px 14px;
  white-space: nowrap;
  border: 1.5px solid #e0a33c;
  border-radius: 999px;
  background: linear-gradient(180deg, #e0a33c, #a3641a);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,240,200,0.45),
              0 0 0 3px rgba(30,17,10,0.55);
  animation: tavernStartPulse 1.9s ease-in-out infinite;
  transition: filter .15s ease, transform .15s ease;
}
.tavern-start-btn:hover { filter: brightness(1.1); }
.tavern-start-btn:active { transform: scale(0.96); }
.tavern-start-label { line-height: 1; }
/* v20260920c：【开始游戏】移入左侧 HUD 列（与卡组/重置进度/离开酒馆同列），
 * 比顶栏胶囊稍大一号，仍保留金色脉冲光。 */
.tavern-hud .tavern-start-btn {
  font-size: 14px;
  padding: 7px 20px;
}
@keyframes tavernStartPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,240,200,0.45),
                         0 0 0 3px rgba(30,17,10,0.55), 0 0 8px rgba(224,163,60,0.45); }
  50%      { box-shadow: 0 4px 12px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,240,200,0.55),
                         0 0 0 3px rgba(30,17,10,0.55), 0 0 20px rgba(255,205,110,0.95); }
}
@media (max-width: 560px) {
  .tavern-start-btn {
    font-size: 11px; letter-spacing: 1px; padding: 3px 10px; gap: 4px;
  }
  .tavern-hud .tavern-start-btn {
    font-size: 13px; letter-spacing: 2px; padding: 6px 16px;
  }
  .tavern-announce-btn { font-size: 11px; padding: 4px 8px; }
}

/* ---- 自定义图标（data:image PNG，如鸦母/阿伽门农/哥布林投手/闪电法师）---- */
.tavern-card-img { display: block; object-fit: contain; pointer-events: none; }
.tavern-pick-card .star { display: flex; align-items: center; justify-content: center; }
.tavern-pick-card .star .tavern-card-img { width: 46px; height: 46px; }
.tavern-deck-star .tavern-card-img { width: 24px; height: 24px; }
.tavern-perk-card .star .tavern-card-img { width: 40px; height: 40px; }

/* ---- 关卡童话弹窗（树/松林/水晶鞋/舞会/月亮）---- */
.tavern-story { display: flex; flex-direction: column; gap: 8px; }
.tavern-story-line {
  margin: 0; font-size: 15px; line-height: 1.85; color: #4a3320; text-align: left;
}
.tavern-story-hint {
  margin: 6px 0 0; font-size: 12px; letter-spacing: 1px; color: #8a5a1a;
  border-top: 1px dashed #b08a4a; padding-top: 8px; text-align: center;
}

/* ---- 棋子出生动画 ---- */
#tavernMap .t-token { transition: opacity .45s ease; }
#tavernMap .t-token.spawn .logo { animation: tavernTokenSpawn .9s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes tavernTokenSpawn {
  0%   { transform: translateY(-1px) scale(0.15); opacity: .1; }
  60%  { transform: translateY(-1px) scale(1.18); opacity: 1; }
  100% { transform: translateY(-1px) scale(1); opacity: 1; }
}

/* 起始发牌动画（关教学后自动播放，约 2 秒） */
.tavern-deal-anim {
  position: absolute; top:0;right:0;bottom:0;left:0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(255,225,150,0.28), rgba(30,18,8,0.72));
  animation: tavernFade .3s ease;
}
.tavern-deal-anim-glow {
  position: absolute; width: 46vmin; height: 46vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,236,170,0.55), rgba(255,210,110,0) 70%);
  animation: tavernDealGlow 1.1s ease-in-out infinite;
}
.tavern-deal-anim-row { display: flex; gap: 14px; z-index: 1; }
.tavern-deal-anim-card {
  width: 54px; height: 78px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(160deg, #f6e3b0, #d9b872);
  border: 2px solid #6b3a16; box-shadow: 0 8px 18px rgba(0,0,0,0.45);
  animation: tavernDealCard .75s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes tavernDealCard {
  from { transform: translateY(-160px) rotate(-24deg) scale(.7); opacity: 0; }
  to   { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
@keyframes tavernDealGlow {
  0%,100% { transform: scale(.92); opacity: .75; }
  50%     { transform: scale(1.06); opacity: 1; }
}

/* 皇家书库卡面 + 增益徽记 */
.tavern-badge {
  display: inline-block; margin-left: 4px; font-size: 10px;
  padding: 1px 4px; border-radius: 4px; color: #fff;
}
.tavern-badge-hp { background: #d94a6a; }
.tavern-badge-cd { background: #3f7fd9; }

/* 骷髅宝箱：增益五选一 */
.tavern-perk-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.tavern-perk-card {
  width: 132px; min-height: 118px; border: 2px solid #6b3a16; border-radius: 8px;
  background: linear-gradient(180deg, #ead9ae, #cfb57d); color: #4a3320;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 5px; padding: 10px 8px; cursor: pointer; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4); transition: transform .15s ease, border-color .2s;
}
.tavern-perk-card:hover { transform: translateY(-5px); border-color: #e0a33c; }
.tavern-perk-card .star { font-size: 24px; }
.tavern-perk-card .name { font-size: 13px; font-weight: bold; }
.tavern-perk-card .rank { font-size: 11px; color: #7a5a1a; line-height: 1.45; }

/* ============================================================
 * 酒馆地窖（独立全屏商店，构图对齐骷髅小店/纪念品店）
 * ============================================================ */
.tavern-cellar {
  position: fixed; top:0;right:0;bottom:0;left:0; z-index: 9500; display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 20%, rgba(70,46,20,0.96), rgba(16,10,6,0.98));
}
.tavern-cellar-inner {
  width: 94vw; max-width: 760px; width: min(760px, 94vw); max-height: 92vh; overflow-y: auto;
  border: 3px solid #c08730; border-radius: 16px;
  background: linear-gradient(180deg, rgba(58,38,18,0.96), rgba(30,20,10,0.98));
  padding: 14px 18px 22px; box-shadow: 0 0 40px rgba(0,0,0,0.7);
}
.tavern-cellar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tavern-cellar-title { color: #ffd97a; font-size: 18px; font-weight: bold; letter-spacing: 3px; }
.tavern-cellar-back, .tavern-cellar-coins {
  border: 2px solid #8a5a18; border-radius: 8px; padding: 5px 10px;
  background: rgba(0,0,0,0.35); color: #ffe4ad; font-size: 13px; cursor: pointer;
}
.tavern-cellar-coins { cursor: default; }
.tavern-cellar-npc {
  text-align: center; font-size: 58px; line-height: 1.1; margin: 8px 0 2px;
  cursor: pointer; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
  animation: tavernCellarNpc 3.4s ease-in-out infinite;
}
@keyframes tavernCellarNpc { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tavern-cellar-tip { text-align: center; color: #d8c39a; font-size: 12px; margin-bottom: 12px; }
.tavern-cellar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 640px) { .tavern-cellar-grid { grid-template-columns: repeat(2, 1fr); } }
.tavern-cellar-card {
  border: 3px solid #d4a843; border-radius: 12px; min-height: 210px;
  background: linear-gradient(180deg, rgba(86,58,26,0.95), rgba(46,30,14,0.98));
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 12px 10px; text-align: center; gap: 6px;
}
.tavern-cellar-card-soon { border-color: #6b6055; filter: grayscale(0.7) brightness(0.85); }
.tavern-cellar-card-icon { font-size: 40px; }
.tavern-cellar-card-name { color: #ffe4ad; font-size: 15px; font-weight: bold; }
.tavern-cellar-card-desc { color: #cdb894; font-size: 11px; line-height: 1.5; }
.tavern-cellar-buy {
  width: 100%; border: 2px solid #8a5a18; border-radius: 8px; padding: 7px 0;
  background: linear-gradient(180deg, #e0a33c, #b9791f); color: #fff; font-size: 13px; cursor: pointer;
}
.tavern-cellar-buy:hover { filter: brightness(1.1); }
.tavern-cellar-buy-off { background: #5a5148; cursor: not-allowed; }
.tavern-cellar-owned { color: #8fce91; font-size: 12px; font-weight: bold; }
.tavern-cellar-soon { color: #b9b0a4; }
.tavern-cellar-toast {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
  background: rgba(20,12,6,0.92); border: 2px solid #c08730; color: #ffe4ad;
  padding: 8px 14px; border-radius: 10px; font-size: 13px; white-space: pre-line;
  animation: tavernFade .25s ease; max-width: 84vw; text-align: center;
}
/* 返回主菜单：地窖老人交付匹诺曹 */
.tavern-cellar-unlock-mask {
  position: fixed; top:0;right:0;bottom:0;left:0; z-index: 9800; display: flex; align-items: center; justify-content: center;
  background: rgba(8,5,3,0.72); animation: tavernFade .25s ease;
}
.tavern-cellar-unlock {
  width: 88vw; max-width: 420px; width: min(420px, 88vw); border: 3px solid #c08730; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(62,42,20,0.98), rgba(28,18,9,0.99));
  padding: 20px 22px; color: #ffd97a; box-shadow: 0 0 34px rgba(0,0,0,0.7);
}
.tavern-cellar-unlock-npc { font-size: 46px; }
.tavern-cellar-unlock h2 { margin: 6px 0 10px; font-size: 19px; letter-spacing: 2px; }
.tavern-cellar-unlock p { color: #e2d0a8; font-size: 13px; line-height: 1.7; margin: 6px 0; }
.tavern-cellar-unlock p.tavern-cellar-unlock-tip { color: #c9a45f; font-size: 12px; letter-spacing: 1px; }
.tavern-cellar-unlock-card { color: #ffe4ad; font-size: 15px; }
.tavern-cellar-unlock-btn {
  margin-top: 12px; border: 2px solid #8a5a18; border-radius: 8px; padding: 8px 18px;
  background: linear-gradient(180deg, #e0a33c, #b9791f); color: #fff; font-size: 14px; cursor: pointer;
}
.tavern-cellar-unlock-btn:hover { filter: brightness(1.1); }

/* ============================================================
 * v20260918t：老浏览器兜底层（老手机优化）
 * ① -webkit- 前缀 user-select（老 Safari/WebView 不认无前缀版）
 * ② @supports not (gap) —— flex/grid 的 gap 需 Chrome 84+/Safari 14.1+，
 *    老内核直接丢弃 gap → 用 margin 补间距（新浏览器有 gap，不吃这段）
 * ============================================================ */
#tavernScene {
  -webkit-user-select: none;
}
@supports not (gap: 1px) {
  /* 纵向列表类容器：子元素间补垂直间距 */
  .tavern-hud > * + *, .hud-menu-list > * + *, .tavern-deck-list > * + *,
  .tavern-story > * + *, .tavern-cellar-grid > * + *, .tavern-deck-list > * + * {
    margin-top: 10px;
  }
  /* 横向排列类容器：子元素间补水平间距 */
  .tavern-acts > * + *, .tavern-pick-grid > * + *, .tavern-event-actions > * + *,
  .tavern-perk-grid > * + *, .tavern-deal-anim-row > * + * {
    margin-left: 12px;
  }
}
