/* 牌桌布局 */
.topbar {
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(20, 14, 9, 0.95), rgba(20, 14, 9, 0.55));
  border-bottom: 1px solid rgba(194, 160, 60, 0.28);
  position: relative; z-index: 20;
}
.topbar__logo { width: 34px; height: 34px; opacity: 0.95; }
.topbar__center { display: flex; align-items: center; gap: 12px; }
.topbar__right { display: flex; align-items: center; gap: 8px; }

.phase-chip {
  font-family: var(--font-serif);
  font-size: 15px; letter-spacing: 0.2em;
  color: var(--gold-2);
  border: 1px solid rgba(194, 160, 60, 0.45);
  border-radius: 999px; padding: 3px 18px;
  background: rgba(194, 160, 60, 0.1);
}
.turn-chip { font-size: 13px; color: var(--text-dim); }
.round-chip {
  font-size: 12px; color: var(--text-dim);
  border: 1px solid rgba(194, 160, 60, 0.25);
  border-radius: 6px; padding: 4px 10px;
}

.table {
  position: absolute; inset: 52px 0 168px;
  display: grid;
  grid-template-columns: 216px 1fr 268px;
  gap: 10px; padding: 10px;
}

.panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }

/* ── 牌堆 ── */
.deck {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(194, 160, 60, 0.2);
  border-radius: 12px;
}
.deck__pile { position: relative; }
.deck__pile--draw { width: 66px; }
.deck__pile--draw img { width: 66px; border-radius: 6px; box-shadow: var(--shadow-md); }
.deck__count {
  position: absolute; bottom: -6px; right: -6px;
  background: var(--ink); color: var(--gold-2);
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--gold-3);
}
.deck__label { font-size: 10px; color: var(--text-dim); display: block; text-align: center; margin-top: 4px; }
.deck__inner { position: relative; width: 66px; height: 92px; }
.deck__inner .card { position: absolute; left: 0; top: 0; }

.rolebox {
  flex: 1; min-height: 0;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(194, 160, 60, 0.2);
  border-radius: 12px; padding: 12px 14px;
  overflow: auto;
}
.rolebox h4 {
  font-family: var(--font-serif); font-size: 14px; color: var(--gold-2);
  letter-spacing: 0.14em; margin-bottom: 8px;
}
.rolebox .role-name { font-size: 18px; font-family: var(--font-serif); margin-bottom: 2px; }
.rolebox .role-goal { font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.rolebox .role-badge {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid currentColor; margin-bottom: 8px;
}
.role-lord { color: var(--gold-2); }
.role-loyal { color: #7fc0a8; }
.role-rebel { color: #e8756a; }
.role-hidden { color: #b39ae0; }
.rolebox .skill-list { margin-top: 10px; font-size: 12px; color: var(--text-dim); line-height: 1.7; }

/* ── 中央棋盘 ── */
.board { position: relative; min-height: 0; }
.board__seats { position: absolute; inset: 0; }

.seat {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 104px;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: filter 0.2s;
}
.seat__frame {
  position: relative;
  width: 78px; height: 98px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(194, 160, 60, 0.4);
  background: #1a1512;
  box-shadow: var(--shadow-md);
  cursor: default;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.seat--is-target .seat__frame { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(47, 125, 99, 0.4); cursor: pointer; }
.seat--is-target:hover .seat__frame { transform: scale(1.06); }
.seat--is-picked .seat__frame { border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(168, 51, 42, 0.5); }
.seat--is-current .seat__frame { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194, 160, 60, 0.35), var(--shadow-md); }
.seat--is-me .seat__frame { box-shadow: 0 0 0 2px var(--gold-2), var(--shadow-md); }
.seat--is-dead { filter: grayscale(1) brightness(0.5); }
.seat--is-dead::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(10, 6, 4, 0.5);
}
.seat__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; }
.seat__frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 6, 4, 0.85) 100%);
}
.seat__name {
  position: absolute; left: 3px; right: 3px; bottom: 3px;
  font-family: var(--font-serif); font-size: 12px; text-align: center;
  color: #f0e4c8; text-shadow: 0 1px 2px #000; z-index: 2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-lang="en"] .seat__name { font-size: 10px; }
.seat__role {
  position: absolute; top: 3px; left: 3px;
  font-size: 9px; padding: 1px 5px; border-radius: 3px; z-index: 2;
  background: rgba(10, 6, 4, 0.7);
}
.seat__role--lord { color: var(--gold-2); }
.seat__role--loyal { color: #7fc0a8; }
.seat__role--rebel { color: #e8756a; }
.seat__role--hidden { color: #b39ae0; }
.seat__role--unknown { color: var(--text-dim); }
.seat__chain {
  position: absolute; right: 3px; top: 3px; z-index: 2;
  width: 14px; height: 14px; border-radius: 3px;
  border: 2px solid #cfd6e0; transform: rotate(45deg);
  background: rgba(0, 0, 0, 0.4);
}
.seat__chain--on { border-color: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }

.seat__hp {
  display: flex; gap: 3px; align-items: center;
  font-size: 11px; color: var(--text-dim);
}
.hp-pip {
  width: 9px; height: 9px; border-radius: 2px;
  transform: rotate(45deg);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
}
.hp-pip.is-full { background: linear-gradient(135deg, #e05a4a, #a8332a); border-color: #e05a4a; }
.hp-pip.is-hurt { background: rgba(255, 255, 255, 0.18); }
.seat__hp--danger { color: #ff9c8f; }
.seat__meta { display: flex; gap: 3px; align-items: center; height: 26px; }
.seat__count {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(194, 160, 60, 0.3);
  color: var(--text-dim);
}
.seat__count--judge { color: var(--violet); border-color: var(--violet); }
.seat__flag {
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--gold-3); color: var(--gold-2);
}
.seat__take {
  font-size: 9px; padding: 2px 6px; border-radius: 999px;
  border: 1px solid var(--gold-3); background: rgba(0, 0, 0, 0.4); color: var(--gold-2);
}
.seat__take:hover { background: var(--gold); color: #2a1d08; }
.seat__take.is-on { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar-2); }
.seat__flag--active { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.seat--turn::before {
  content: ""; position: absolute; inset: -14px;
  border: 1px dashed rgba(194, 160, 60, 0.35);
  border-radius: 16px; pointer-events: none;
}

/* 提示面板 */
.prompt {
  position: absolute; left: 50%; bottom: 146px; transform: translateX(-50%);
  min-width: 320px; max-width: 66%;
  background: rgba(16, 11, 7, 0.94);
  border: 1px solid var(--gold-3);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-md);
  z-index: 15;
}
.prompt__who { font-size: 11px; color: var(--gold); letter-spacing: 0.1em; }
.prompt__text { font-size: 14px; line-height: 1.6; margin: 2px 0 8px; }
.prompt__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prompt__actions .btn { padding: 6px 16px; font-size: 13px; }
.prompt--wait { opacity: 0.75; }

/* 结束 */
.over {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(8, 5, 3, 0.7);
  z-index: 30; border-radius: 12px;
  /* 内容比屏幕高时要能滚，否则底部按钮（比如「再来一局」）永远点不到 */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  /* safe 很关键：普通 center 会把超高的内容顶部裁掉，滚上去也看不到 */
  align-content: safe center;
  justify-items: center;
}
.over__inner { max-width: 100%; display: flex; flex-direction: column; align-items: center; }
.over__title { font-family: var(--font-serif); font-size: 34px; color: var(--gold-2); letter-spacing: 0.2em; text-align: center; }
.over__sub { text-align: center; color: var(--text-dim); margin: 8px 0 20px; font-size: 14px; }
.over__team { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.over__team .side-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(194, 160, 60, 0.3);
  color: var(--text-dim);
  min-width: 170px;
}
.over__team .side-card h4 { color: var(--gold-2); letter-spacing: 0.14em; }
.over__team .side-card.is-win {
  background: rgba(194, 160, 60, 0.18);
  border-color: var(--gold);
  color: var(--text);
  box-shadow: 0 0 18px rgba(194, 160, 60, 0.25);
}
.over__team .side-card.is-lose { opacity: 0.5; }
.over__actions { display: flex; gap: 10px; justify-content: center; }
.over__actions .btn { white-space: nowrap; }

/* 日志 */
.log {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(194, 160, 60, 0.2);
  border-radius: 12px;
  overflow: hidden;
}
.log__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; font-size: 12px; letter-spacing: 0.18em; color: var(--gold-2);
  border-bottom: 1px solid rgba(194, 160, 60, 0.2);
}
.log__clear { color: var(--text-dim); font-size: 15px; }
.log__body { flex: 1; overflow-y: auto; padding: 8px 10px; font-size: 12px; line-height: 1.7; }
.log__line { padding: 3px 6px; border-radius: 4px; color: var(--text-dim); border-left: 2px solid transparent; }
.log__line--round { color: var(--gold); border-left-color: var(--gold-3); margin: 6px 0 2px; letter-spacing: 0.1em; }
.log__line--turn { color: #e0d3b6; border-left-color: rgba(194, 160, 60, 0.5); }
.log__line--damage { color: #f0918a; border-left-color: var(--cinnabar); }
.log__line--skill { color: #9fd0bd; border-left-color: var(--jade); }
.log__line--death { color: #ff8b7f; border-left-color: var(--cinnabar); font-weight: 600; }
.log__line--win { color: var(--gold-2); font-weight: 700; }
.log__line--phase { opacity: 0.72; }

/* ── 底部操作区 ── */
.dock {
  position: absolute; left: 0; right: 0; bottom: 0; height: 168px;
  display: grid; grid-template-columns: 200px 1fr 210px;
  align-items: end; gap: 8px; padding: 6px 14px 10px;
  background: linear-gradient(0deg, rgba(12, 8, 5, 0.98), rgba(12, 8, 5, 0.6) 70%, transparent);
  z-index: 18;
}
.dock__me {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(194, 160, 60, 0.25);
  border-radius: 12px; padding: 8px 10px;
  align-self: stretch; display: flex; gap: 9px;
}
.dock__me img { width: 58px; height: 72px; object-fit: cover; object-position: 50% 20%; border-radius: 6px; }
.me-info { flex: 1; min-width: 0; font-size: 11px; color: var(--text-dim); line-height: 1.6; }
.me-info b { display: block; font-family: var(--font-serif); font-size: 14px; color: var(--text); }
.me-info .me-hp { font-size: 15px; color: var(--gold-2); }
.me-skill { display: block; color: var(--gold); cursor: help; }
.me-skill:hover { text-decoration: underline; }

.dock__hand { display: flex; align-items: flex-end; justify-content: center; height: 150px; }
.dock__hand .card { margin: 0 -9px; }
.dock__hand .card:hover { margin: 0 -4px; }

.dock__side { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.dock__acts { display: flex; flex-wrap: wrap; gap: 5px; }
.dock__acts .btn { padding: 4px 11px; font-size: 12px; letter-spacing: 0.04em; }

/* 选牌托盘 */
.pick-tray {
  position: absolute; left: 50%; bottom: 172px; transform: translateX(-50%);
  background: rgba(14, 10, 6, 0.96);
  border: 1px solid var(--gold-3);
  border-radius: 12px; padding: 12px 16px;
  z-index: 40; box-shadow: var(--shadow-lg);
  max-width: 88vw;
}
.pick-tray__title { font-size: 12px; color: var(--gold-2); margin-bottom: 8px; letter-spacing: 0.08em; }
.pick-tray__row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pick-tray__row--equip .card { margin: 0; }
.pick-tray__acts { display: flex; gap: 8px; margin-top: 10px; justify-content: center; }

@media (max-width: 1180px) {
  .table { grid-template-columns: 150px 1fr 190px; }
  .dock { grid-template-columns: 150px 1fr 150px; }
  .seat { width: 88px; }
  .seat__frame { width: 64px; height: 82px; }
}

/* ── 悬停提示 ── */
.tip {
  position: fixed; z-index: 90; max-width: 300px;
  background: rgba(12, 8, 5, 0.97);
  border: 1px solid var(--gold-3);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px; line-height: 1.65;
  color: var(--text);
  white-space: pre-line;
  pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: var(--shadow-md);
}
.tip.is-on { opacity: 1; transform: translateY(0); }

/* 目标选择：距离标 / 不可选原因 */
.seat__dist {
  position: absolute; left: 3px; bottom: 3px; z-index: 3;
  font-size: 9px; padding: 1px 4px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.6); color: var(--gold-2);
  border: 1px solid rgba(194, 160, 60, 0.4);
}
.seat--is-blocked .seat__frame { filter: grayscale(0.75) brightness(0.55); }
.seat--is-blocked { cursor: help; }
.seat--is-blocked .seat__take { opacity: 0.7; }
.seat__frame.is-flash { animation: flash 0.5s ease 2; }
@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194, 160, 60, 0); }
  50% { box-shadow: 0 0 0 4px rgba(194, 160, 60, 0.75); }
}
.seat__frame.is-hurt { animation: hurtflash 0.45s ease; }
@keyframes hurtflash {
  0% { box-shadow: 0 0 0 3px rgba(224, 90, 74, 0.9); }
  100% { box-shadow: 0 0 0 0 rgba(224, 90, 74, 0); }
}

/* ── 结算统计 ── */
.over__stats { margin: 0 auto 16px; max-width: 420px; }
.over__stats-title { font-size: 12px; letter-spacing: 0.2em; color: var(--gold); margin-bottom: 6px; }
.dmgbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; border: 1px solid rgba(194,160,60,.3); }
.dmgbar__seg { min-width: 3px; }
.dmgbar__seg--slash { background: #a8332a; }
.dmgbar__seg--savage { background: #b8892b; }
.dmgbar__seg--arrow { background: #2f6f8f; }
.dmgbar__seg--duel { background: #5a4a7a; }
.dmgbar__seg--fireAttack { background: #c2482c; }
.dmgbar__seg--lightning { background: #e6c96b; }
.dmgbar__seg--chain { background: #6b6350; }
.dmgbar__seg--other { background: #4a4038; }
.dmgbar__legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--text-dim); }
.dmgbar__legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.dot--slash { background: #a8332a; } .dot--savage { background: #b8892b; } .dot--arrow { background: #2f6f8f; }
.dot--duel { background: #5a4a7a; } .dot--fireAttack { background: #c2482c; } .dot--lightning { background: #e6c96b; }
.dot--chain { background: #6b6350; } .dot--other { background: #4a4038; }
.played-strip { display: flex; flex-wrap: wrap; gap: 3px; max-height: 92px; overflow: hidden; margin-top: 3px; }
.played-strip .card { cursor: help; }

/* ══════════════════════════════════════════════════════════
   窄屏 / 移动端布局：桌面三栏在 390px 下完全不可用，
   这里改为「顶部信息条 + 座位网格 + 底部手牌」的竖排结构。
   ══════════════════════════════════════════════════════════ */
.mobile-only { display: none; }

@media (max-width: 860px), (max-height: 560px) {
  :root { --card-w: 62px; --card-h: 87px; }

  .topbar { height: 46px; padding: 0 8px; }
  .topbar__logo { width: 26px; height: 26px; }
  .phase-chip { font-size: 12px; padding: 2px 10px; letter-spacing: 0.08em; }
  .turn-chip { display: none; }
  .round-chip { display: none; }
  .icon-btn { width: 30px; height: 30px; font-size: 13px; }
  .mobile-only { display: grid; }

  .table {
    inset: 46px 0 152px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 6px; padding: 6px;
  }
  .panel--left {
    flex-direction: row; align-items: center; gap: 8px; padding: 6px 8px;
  }
  .panel--left .rolebox { display: none; }          /* 身份信息挪到弹层 */
  .panel--left .deck { padding: 0; background: none; border: none; }
  .deck__pile--draw { width: 34px; }
  .deck__pile--draw img { width: 34px; }
  .deck__inner { width: 34px; height: 48px; }
  .deck__inner .card { --cw: 34px; --ch: 48px; }
  .deck__label { display: none; }
  .panel--right { display: none; }
  body.show-log .panel--right {
    display: block; position: absolute; inset: 46px 6px 158px; z-index: 30;
  }
  body.show-log .panel--right .log { height: 100%; }

  .board { min-height: 0; }
  .board__seats {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 4px;
    align-content: safe center;
    height: 100%;
    overflow-y: auto;
  }
  .seat {
    position: static !important;
    transform: none !important;
    width: auto;
    align-items: stretch;
  }
  .seat--turn::before { display: none; }
  .seat__frame { width: 100%; height: 84px; }
  .seat__name { font-size: 10px; }
  .seat__meta { height: 18px; flex-wrap: wrap; gap: 2px; }
  .seat__count, .seat__flag { font-size: 8px; padding: 0 3px; }
  .seat__take { font-size: 9px; padding: 1px 4px; }
  .seat__hp { font-size: 9px; gap: 2px; }
  .hp-pip { width: 7px; height: 7px; }
  .seat__dist { font-size: 8px; }

  .prompt {
    bottom: 8px; min-width: 0; width: calc(100% - 12px); max-width: none;
    padding: 8px 10px;
  }
  .prompt__text { font-size: 13px; margin-bottom: 6px; }
  .prompt__actions .btn { padding: 6px 14px; font-size: 12px; }
  .pick-tray { bottom: 156px; max-width: calc(100vw - 12px); }
  .pick-tray__row { justify-content: flex-start; }
  .pick-tray .card { --cw: 56px; --ch: 79px; }

  .dock {
    height: 152px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 4px; padding: 4px 8px 6px;
  }
  .dock__me {
    height: auto; align-items: center; padding: 4px 6px;
    display: grid; grid-template-columns: 34px 1fr auto; gap: 6px;
  }
  .dock__me img { width: 34px; height: 42px; }
  .me-info { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; line-height: 1.3; }
  .me-info b { font-size: 12px; width: auto; }
  .me-info .me-hp { font-size: 13px; }
  .me-skill { font-size: 10px; }
  .dock__side { display: none; }
  .dock__hand {
    height: auto; overflow-x: auto; overflow-y: hidden;
    justify-content: flex-start; padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .dock__hand .card { --cw: 62px; --ch: 87px; margin: 0 2px; }
  .dock__hand .card:hover { transform: translateY(-6px); }
  .dock__acts { display: flex; }
  /* 移动端把「结束回合」放进顶部提示区可用，dock 侧栏隐藏 */
  .over__title { font-size: 24px; }
  .over__stats { max-width: 92%; }
  /* 竖屏窄：阵营卡横排放不下就两列，别堆成一条把按钮顶到屏幕外 */
  .over__team {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; width: 100%; margin-bottom: 12px;
  }
  .over__team .side-card { padding: 8px 10px; }
  .over__team .side-card .sc-list { display: none; }
  .over__actions { flex-wrap: wrap; gap: 8px; }
  .over__actions .btn { flex: 1 1 30%; min-width: 104px; white-space: nowrap; padding: 12px 10px; }
  .modal__box { padding: 18px 16px 20px; }
  .hero-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ── 横屏手机：高度极窄，把堆叠的 dock 改回横排，把屏幕让给牌桌 ── */
@media (max-height: 560px) and (orientation: landscape) {
  :root { --card-w: 52px; --card-h: 73px; }

  .topbar { height: 44px; }          /* 要装得下触摸设备的 36px 按钮 */
  .table { inset: 44px 0 96px; padding: 4px 6px; gap: 4px; }
  .seat__frame { height: 78px; }
  .seat__take { min-height: 36px; padding: 3px 8px; font-size: 10px; }
  .board__seats { grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); }

  .dock {
    height: 96px;
    grid-template-columns: 152px 1fr;
    grid-template-rows: 1fr;
    align-items: center; gap: 8px; padding: 4px 8px;
  }
  .dock__me { height: 88px; padding: 4px 6px; grid-template-columns: 30px 1fr auto; }
  .dock__me img { width: 30px; height: 38px; }
  .dock__hand { height: 88px; overflow-x: auto; overflow-y: hidden; align-items: center; }
  .dock__hand .card { --cw: 52px; --ch: 73px; }
  .prompt { bottom: 104px; padding: 6px 12px; max-width: 60%; }
  .prompt__text { font-size: 12px; margin-bottom: 4px; }
  .pick-tray { bottom: 104px; }
  .pick-tray .card { --cw: 48px; --ch: 67px; }

  /* 结算页：竖排的阵营卡会把按钮顶出屏幕，横屏改成横排并压缩 */
  .over { padding: 8px; }
  .over__title { font-size: 22px; letter-spacing: 0.12em; }
  .over__sub { margin: 4px 0 10px; font-size: 12px; }
  .over__stats { max-width: 100%; font-size: 11px; }
  .over__team {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px; margin-bottom: 10px; width: 100%;
  }
  .over__team .side-card { padding: 6px 10px; min-width: 0; }
  .over__team .side-card .sc-list { display: none; }
  .over__actions { gap: 8px; }
  .over__actions .btn { padding: 10px 18px; min-height: 44px; }
}

@media (max-width: 860px) {
  .card { --cw: 62px; --ch: 87px; }
  .card__name { font-size: 11px; }
  .card__name--long { font-size: 9px; }
  .card__name--xlong { font-size: 7.5px; }
  .card__suit { font-size: 12px; }
}

/* ── 对局回放 ── */
.replay__bar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.replay__bar .btn {
  padding: 5px 12px; font-size: 13px; letter-spacing: 0.06em;
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px;
  background: rgba(60, 44, 20, 0.9); color: #f0d68a; border-color: #8a6d1c;
}
.replay__bar .btn:hover { background: rgba(90, 68, 28, 0.95); }
.replay__pos { font-size: 12px; color: #7a6a52; margin: 0 4px; }
.replay__step {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(138, 109, 30, 0.3);
  border-radius: 8px; padding: 12px 14px; display: flex; align-items: center; gap: 14px;
}
.replay__who { font-family: var(--font-serif); font-size: 15px; min-width: 108px; }
.replay__tag { display: block; font-size: 10px; color: #8a7a60; letter-spacing: 0.1em; }
.replay__text { flex: 1; font-size: 14px; line-height: 1.6; }
.replay__list {
  list-style: none; margin-top: 12px; max-height: 34vh; overflow: auto;
  border-top: 1px solid rgba(138, 109, 30, 0.25); padding-top: 8px;
}
.replay__list li { font-size: 12.5px; line-height: 1.7; padding: 3px 8px; border-radius: 4px; cursor: pointer; color: #5a4a32; }
.replay__list li:hover { background: rgba(138, 109, 30, 0.12); }
.replay__list li.is-cur { background: rgba(194, 160, 60, 0.28); color: #2a1d08; font-weight: 700; }
.replay__list b { font-family: var(--font-serif); margin-right: 6px; }

/* ── 新手教学横幅 ── */
#tut-banner {
  position: fixed; left: 50%; top: 10px; transform: translateX(-50%);
  z-index: 40; max-width: min(680px, 92vw);
  background: linear-gradient(180deg, #f6ecd6, #ead9b6);
  border: 1px solid #b08f2e; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  padding: 12px 16px 10px; color: #3a2c14; font-size: 14px; line-height: 1.6;
}
#tut-banner[hidden] { display: none; }
.tut-banner__row { display: flex; align-items: baseline; gap: 10px; }
.tut-banner__step {
  flex: none; font-size: 11px; letter-spacing: 0.12em; color: #8a6d1e;
  border: 1px solid #b08f2e; border-radius: 999px; padding: 2px 8px;
}
.tut-banner__text { font-weight: 600; }
.tut-banner__hint { margin-top: 5px; font-size: 13px; color: #6a5636; }
.tut-banner__skip {
  margin-top: 8px; padding: 4px 12px; font-size: 12px; letter-spacing: 0.04em;
  background: rgba(90, 68, 28, 0.12); color: #6d5416; border-color: #b08f2e;
}
@media (pointer: coarse) {
  .tut-banner__skip { min-height: 40px; padding: 6px 16px; font-size: 13px; }
}

/* ─────────────────────────────────────────────────────────────
   触摸设备：可点区域至少 44px
   媒体查询里那些 30px 是给「鼠标 + 小窗」用的；真实手指点不准，
   所以指针是 coarse 时统一放大。放在文件最后，确保能覆盖前面的规则。
   ───────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .icon-btn { width: 42px; height: 42px; font-size: 15px; }
  .topbar { padding: 0 6px; gap: 4px; }
  .lang-toggle, #btn-lang2 { min-height: 42px; padding: 0 12px; }
  .modal__close { width: 42px; height: 42px; font-size: 26px; line-height: 42px; }
  .dock__acts .btn { min-height: 44px; padding: 6px 14px; }
  .seat__take { min-height: 40px; padding: 4px 12px; font-size: 11px; }
  .over__actions .btn, .prompt__actions .btn { min-height: 44px; }
  .prompt__actions .btn { padding: 10px 18px; }
  .icon-btn, .modal__close { touch-action: manipulation; }
}

/* ── 窄屏顶栏：360px 上 7 个按钮要 417px，会溢出屏幕 ──
   身份信息左栏本来就有（.rolebox / panel--left），窄屏上把这个按钮收掉。 */
@media (max-width: 400px) {
  .topbar { padding: 0 4px; gap: 3px; }
  .topbar__logo { width: 24px; height: 24px; }
  .phase-chip { font-size: 11px; padding: 2px 7px; letter-spacing: 0.04em; }
  #btn-role { display: none; }              /* 身份信息左栏已有 */
}
@media (pointer: coarse) and (max-height: 560px) and (orientation: landscape) {
  .icon-btn { width: 36px; height: 36px; font-size: 14px; }
  .lang-toggle, #btn-lang2 { min-height: 36px; padding: 0 9px; font-size: 12px; letter-spacing: 0; }
}
@media (pointer: coarse) and (max-width: 400px) {
  .icon-btn { width: 36px; height: 36px; font-size: 14px; }
  .topbar__right { gap: 4px; }
  .lang-toggle, #btn-lang2 { min-height: 36px; padding: 0 9px; font-size: 12px; letter-spacing: 0; }
}

/* ── 触摸端：教学横幅收窄，别把牌桌挤掉一半 ── */
@media (pointer: coarse) and (max-width: 620px) {
  #tut-banner { max-width: calc(100vw - 12px); padding: 8px 12px; }
  .tut-banner__row { gap: 7px; }
  .tut-banner__step { font-size: 10px; padding: 1px 6px; }
  .tut-banner__text { font-size: 13px; line-height: 1.45; }
  .tut-banner__hint { font-size: 11.5px; line-height: 1.4; margin-top: 2px; }
  .tut-banner__skip { margin-top: 6px; min-height: 36px; padding: 4px 14px; font-size: 12px; }
  /* 落到顶栏下面，别盖住语言/关闭这些按钮 */
  #tut-banner { top: 52px; }
}
