@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Noto+Serif+SC:wght@500;700&display=swap');

:root {
  --felt: #1c3a2e;
  --felt-deep: #12261f;
  --wood: #3a2a1c;
  --ink: #f4ebe1;
  --muted: #c4b5a4;
  --gold: #d4a857;
  --blood: #b83a32;
  --line: rgba(212, 168, 87, 0.35);
  --bg-void: #080605;
  --font-ui: "Noto Serif SC", "Songti SC", serif;
  --font-display: "Cinzel", "Noto Serif SC", serif;
  /* 手牌预览：大图在独立层（炉石式），手牌本身只轻微抬起 */
  --hand-preview-w: 200px;
  --hand-preview-h: 280px;
  --bg-image: url("../assets/background/background.jpg");
}

* { box-sizing: border-box; }

html {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg-void);
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--ink);
}

body {
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  background-color: var(--bg-void);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

@media (max-width: 960px) {
  body {
    /* iOS/部分移动端 fixed 背景易抖动，改为随文档 */
    background-attachment: scroll;
  }
}

/* 压暗中心、加重四角，保证牌桌/手牌可读，不与背景台面抢戏 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(6, 4, 3, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 38%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, rgba(8, 6, 4, 0.35) 0%, rgba(8, 6, 4, 0.15) 40%, rgba(4, 3, 2, 0.55) 100%);
}

body > * {
  position: relative;
  z-index: 1;
}

body.phase-ended {
  overflow: auto;
}

body.phase-ended .table-wrap.active {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}

body.phase-ended .bottom-panel {
  max-height: none;
}

button, select, input {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #2a1f16;
  color: var(--ink);
  padding: 8px 12px;
}

button {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

button:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateY(-1px);
}

button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

button.primary {
  background: linear-gradient(180deg, #c45c3e, #8f3a28);
  border-color: #e08a6a;
  color: #fff;
}

/* —— 顶栏 —— */
.topbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(20, 14, 10, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 20;
  min-height: 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  line-height: 1.15;
}

.topbar .meta { color: var(--muted); font-size: 0.78rem; }

.topbar-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.topbar-controls button,
.topbar-controls input,
.topbar-controls select {
  padding: 5px 9px;
  font-size: 0.82rem;
}

#disbandBtn {
  border-color: rgba(180, 60, 50, 0.55);
  color: #f0b4ae;
  background: rgba(80, 22, 18, 0.55);
}

#disbandBtn:hover {
  border-color: rgba(220, 90, 70, 0.8);
  color: #ffd4cf;
}

/* —— 大厅 —— */
.lobby-shell {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 720px;
  width: calc(100% - 32px);
  margin: 24px auto;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(42, 31, 24, 0.92), rgba(26, 20, 15, 0.9));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  overflow: auto;
  backdrop-filter: blur(6px);
}

.lobby-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.lobby-join-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
}

.lobby-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
}

.lobby-field input {
  min-width: 150px;
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #120e0b;
  color: #f2e6d4;
}

.lobby-field input:focus {
  outline: 1px solid var(--gold);
  border-color: var(--gold);
}

#roomNameDisplay {
  min-width: 160px;
  color: var(--muted);
  cursor: default;
  opacity: 0.85;
}

#playerName {
  min-width: 160px;
}

.lobby-shell h2 {
  font-family: var(--font-display);
  color: var(--gold);
  margin: 0 0 8px;
}

.lobby-roster {
  margin: 18px auto 0;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 6, 4, 0.45);
  text-align: left;
}

.lobby-roster-count {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.lobby-roster-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 28px;
}

.lobby-roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8dcc8;
  font-size: 0.9rem;
}

.lobby-roster-item.is-me {
  border-color: rgba(212, 175, 90, 0.45);
  background: rgba(212, 175, 90, 0.08);
}

.lobby-roster-item .tag {
  color: var(--muted);
  font-size: 0.75rem;
}

.lobby-roster-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 4px 2px;
}

/* —— 对局桌面：占满剩余视口，禁止页面滚动 —— */
.table-wrap {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 4px 8px 0;
}

.table-wrap.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4px;
  /* 允许手牌悬停向上溢出到牌桌区域，由 body 锁视口 */
  overflow: visible;
}

.table-wrap.layout-cross {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: visible;
}

.table-wrap.layout-cross .opponents,
.table-wrap.layout-duel .opponents,
.table-wrap.layout-trio .opponents {
  display: none;
}

/* 2 人：对面一座 + 中央毡桌 */
.table-wrap.layout-duel .board-arena {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "top"
    "felt";
  max-width: min(720px, 100%);
}

.table-wrap.layout-duel .seat-left,
.table-wrap.layout-duel .seat-right,
.table-wrap.layout-duel .seat-bottom {
  display: none;
}

.table-wrap.layout-duel .seat-top {
  max-width: 168px;
  justify-self: center;
}

/* 3 人：左右对手 + 中央毡桌 */
.table-wrap.layout-trio .board-arena {
  grid-template-columns: minmax(128px, 168px) minmax(0, 1fr) minmax(128px, 168px);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "left felt right";
}

.table-wrap.layout-trio .seat-top,
.table-wrap.layout-trio .seat-bottom {
  display: none;
}

.round-banner {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.3;
  padding: 2px 0;
  flex-shrink: 0;
}

.round-banner strong { color: var(--gold); }
.round-banner .seat-nr { color: var(--gold); }

/* 四人：上 / 左 / 桌 / 右（底座位空，不占行） */
.board-arena {
  display: grid;
  grid-template-columns: minmax(128px, 168px) minmax(0, 1fr) minmax(128px, 168px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    ". top ."
    "left felt right";
  gap: 2px 8px;
  align-items: center;
  justify-items: center;
  /* 收紧中轴：左右座位贴毡桌，避免宽屏贴边、平板被裁切 */
  max-width: min(980px, 100%);
  margin: 0 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  /* 低于 .bottom-panel，保证手牌悬停可盖到牌桌上；左右「开枪」靠横向排布留在本区内 */
  z-index: 1;
  overflow: visible;
  padding: 0 6px 4px;
}

.seat-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 12px;
  min-width: 0;
  width: 100%;
  max-height: 100%;
  position: relative;
  z-index: 6;
  overflow: visible;
}

.seat-top {
  grid-area: top;
  width: 100%;
  max-width: 168px;
  justify-self: center;
}

.seat-left {
  grid-area: left;
  align-self: center;
  max-height: 100%;
  justify-content: center;
}

.seat-right {
  grid-area: right;
  align-self: center;
  max-height: 100%;
  justify-content: center;
}

/* 左右：开枪放在角色牌靠毡桌一侧，降低总高度，避免压到分界线以下 */
.seat-left .seat-shot-wrap {
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
}

.seat-right .seat-shot-wrap {
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 6px;
}

.seat-left .seat-shoot-btn,
.seat-right .seat-shoot-btn {
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
  padding: 10px 6px;
  min-width: 0;
  min-height: 64px;
}
.seat-bottom {
  display: none;
  grid-area: bottom;
  min-height: 0;
}

.board-arena .felt {
  grid-area: felt;
  width: 100%;
  height: 100%;
  max-width: min(640px, 100%);
  max-height: 100%;
  min-height: 0;
}

/* 组队标识：小色标，不要整块红蓝底框 */
.seat-slot.team-red,
.seat-slot.team-blue {
  background: none;
  border: none;
  box-shadow: none;
}

.seat-slot::before {
  display: none;
  content: none;
}

.seat-slot.team-red::before,
.seat-slot.team-blue::before {
  content: attr(data-tag);
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 8px 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  background: rgba(8, 6, 4, 0.7);
  border: 1px solid rgba(212, 168, 87, 0.2);
}

.seat-slot.team-red::before {
  color: #f0c8c2;
  box-shadow: inset 3px 0 0 #c45c52;
  border-color: rgba(196, 92, 82, 0.4);
}

.seat-slot.team-blue::before {
  color: #c8d6f2;
  box-shadow: inset 3px 0 0 #6b8fd4;
  border-color: rgba(107, 143, 212, 0.4);
}

.seat-slot[data-tag=""]::before {
  display: none;
  content: none;
}

.team-chip {
  display: inline-block;
  min-width: 1.05em;
  padding: 0 5px;
  margin-right: 5px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.4;
  vertical-align: 1px;
  letter-spacing: 0;
}

.team-chip.is-red {
  color: #ffe0dc;
  background: rgba(120, 36, 32, 0.9);
  border: 1px solid rgba(210, 100, 90, 0.55);
}

.team-chip.is-blue {
  color: #dde8ff;
  background: rgba(32, 52, 110, 0.9);
  border: 1px solid rgba(110, 150, 220, 0.55);
}

.hero-seat.ally .seat-name::after {
  content: '队友';
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(212, 168, 87, 0.12);
  border: 1px solid rgba(212, 168, 87, 0.35);
  vertical-align: 1px;
}

/* 对手区（2~3人经典布局） */
.opponents {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 210px;
  padding: 8px;
}

/* 中央毡桌 */
.felt {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: min(640px, 100%);
  min-height: 0;
  height: 100%;
  border-radius: 50% / 32%;
  background:
    radial-gradient(ellipse at center, #2f5a45 0%, var(--felt) 45%, var(--felt-deep) 100%);
  border: 10px solid #5a3d28;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.45),
    0 10px 24px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(12px, 2.2vh, 28px) clamp(12px, 2vw, 28px);
  overflow: hidden;
}

/* iPad / 中等宽度：缩小左右座位，避免裁切 */
@media (max-width: 1100px) and (min-width: 721px) {
  .board-arena {
    grid-template-columns: minmax(100px, 138px) minmax(0, 1fr) minmax(100px, 138px);
    gap: 2px 4px;
    max-width: min(900px, 100%);
    padding: 0 4px 4px;
  }

  .seat-top {
    max-width: 132px;
  }

  .board-arena .role-card {
    width: 82px;
    height: 128px;
  }

  .board-arena .role-card .art {
    height: 54px;
  }

  .board-arena .role-card .desc {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    font-size: 0.5rem;
  }

  .board-arena .role-card .body {
    padding: 3px 4px 12px;
  }

  .board-arena .seat-slot {
    padding: 2px;
  }

  .board-arena .seat-slot::before {
    font-size: 0.58rem;
    margin-bottom: 1px;
  }

  .board-arena .seat-name {
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .seat-left .seat-shot-wrap,
  .seat-right .seat-shot-wrap {
    gap: 3px;
  }

  .seat-left .seat-shoot-btn,
  .seat-right .seat-shoot-btn {
    padding: 7px 4px;
    min-height: 48px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .board-arena .felt,
  .felt {
    max-width: min(520px, 100%);
    border-width: 8px;
    padding: clamp(10px, 1.8vh, 20px) clamp(10px, 1.6vw, 18px);
  }

  .board-arena .hero-seat:hover .role-card {
    transform: scale(1.18);
  }
}

.cylinder {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(420px, 100%);
}

.loadout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 4px;
}

.ammo-legend {
  font-size: 0.72rem;
  opacity: 0.7;
  color: #dce8df;
  margin-right: 2px;
}

.ammo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f0e6d8;
}

.ammo-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.ammo-chip.live i { background: #d4544a; box-shadow: 0 0 6px rgba(212,84,74,0.6); }
.ammo-chip.blank i { background: #c5b79a; box-shadow: 0 0 6px rgba(197,183,154,0.45); }
.ammo-chip.special i {
  background: linear-gradient(135deg, #d4a857, #7ec8e3);
  box-shadow: 0 0 6px rgba(212,168,87,0.55);
}

.shell {
  width: 18px;
  height: 28px;
  border-radius: 4px 4px 6px 6px;
  background: linear-gradient(180deg, #8a7a62, #4a4032);
  border: 1px solid #2a2218;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.shell.unknown::after {
  content: '?';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 10px;
  color: #2a2218;
  font-weight: 700;
}

.felt-status {
  font-size: 0.78rem;
  color: #dce8df;
  text-align: center;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.effect-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  color: #f0e6d8;
}

/* 底部：手牌 + 操作栏 —— 按内容撑开，禁止压扁裁切（见 layout.md） */
.bottom-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  max-height: none;
  background: linear-gradient(180deg, rgba(14, 10, 8, 0.35), rgba(12, 9, 7, 0.96));
  border-top: 1px solid var(--line);
  position: relative;
  /* 高于牌桌，手牌悬停可盖住毡桌；左右「开枪」不得伸入本区 */
  z-index: 40;
  overflow: visible;
}

/* 自己区域：人物在左，道具在右 */
.me-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  max-width: none;
  margin: 0;
  width: 100%;
  padding: 8px 10px 6px;
  justify-items: stretch;
  overflow: visible;
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  min-height: auto;
  pointer-events: none;
}

.me-seat-col {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-width: 0;
  position: relative;
  z-index: 8;
  pointer-events: auto;
}

.seat-shot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

/* 自己座位：开枪放角色牌右侧，避免被底边裁切 */
.me-zone .seat-shot-wrap {
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}

.seat-shoot-btn {
  flex: 0 0 auto;
  writing-mode: horizontal-tb;
  padding: 5px 12px;
  min-width: 52px;
  border-radius: 8px;
  border: 1px solid rgba(212, 84, 74, 0.55);
  background: linear-gradient(180deg, #8a322c, #5a1a16);
  color: #ffe6e2;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
  position: relative;
  z-index: 12;
  pointer-events: auto;
}

.seat-shoot-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.seat-shoot-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.hand-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: visible;
  position: relative;
  z-index: 60;
  pointer-events: none;
  min-height: auto;
}

.hand-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
  padding-left: 4px;
  position: relative;
  z-index: 0;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hand-label .hand-hint {
  margin-left: 8px;
  font-size: 0.64rem;
  color: rgba(196, 181, 164, 0.72);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hand-hint-touch {
  display: none;
}

/* 仅手机横屏：点选预览提示（竖屏不改） */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px) {
  .hand-hint-desktop { display: none; }
  .hand-hint-touch { display: inline; }
}

.hand-fan {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  /* 静止态必须能放下完整道具牌；大图预览在独立层，不放大手牌本身 */
  min-height: 128px;
  height: 128px;
  padding: 4px 16px 2px 8px;
  margin-top: 0;
  overflow: visible;
  width: 100%;
  position: relative;
  z-index: 60;
  pointer-events: none;
}

.hand-fan .hand-slot,
.hand-fan .meta {
  pointer-events: auto;
}

/* 稳定命中区：外层不变形；牌面轻微抬起，大图走 .hand-preview */
.hand-slot {
  position: relative;
  flex: 0 0 auto;
  width: 74px;
  height: 120px;
  margin: 0 0 0 -22px;
  z-index: 1;
  cursor: pointer;
}

.hand-slot:first-child {
  margin-left: 0;
}

.hand-slot:hover,
.hand-slot:focus-within {
  z-index: 80;
}

.hand-slot.is-selected {
  z-index: 70;
}

/* 炉石式独立大图预览（盖在牌桌上方，不挤布局） */
.hand-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 140;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(280px, 70vw);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(12px) scale(0.94);
  transition: opacity 0.16s ease, transform 0.18s ease, visibility 0.16s ease;
}

.hand-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* display:flex 会盖过 UA 的 [hidden]，取消时必须立刻消失，否则会淡出闪一下 */
.hand-preview[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

.hand-preview-face {
  width: var(--hand-preview-w);
  height: var(--hand-preview-h);
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: #0d0a08;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(212, 168, 87, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hand-preview-face.has-art {
  padding: 0;
}

.hand-preview-face .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hand-preview-face:not(.has-art) {
  background: linear-gradient(160deg, hsl(var(--hue, 40), 50%, 40%), hsl(var(--hue, 40), 40%, 16%));
}

.hand-preview-face .art-glyph {
  font-size: 3.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.hand-preview-face .fallback-name {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
}

.hand-preview-meta {
  text-align: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.92);
  border: 1px solid rgba(212, 168, 87, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  max-width: 260px;
}

.hand-preview-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.hand-preview-desc {
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(244, 235, 225, 0.88);
}

@media (max-height: 820px) {
  :root {
    --hand-preview-w: 150px;
    --hand-preview-h: 210px;
  }
  .hand-preview-meta {
    padding: 6px 10px;
    max-width: 220px;
  }
  .hand-preview-desc {
    font-size: 0.66rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.private-toast {
  text-align: left;
  color: var(--gold);
  font-size: 0.78rem;
  min-height: 0;
  margin-top: 2px;
  pointer-events: none;
}

.private-toast:empty {
  display: none;
}

.gunpowder-dock {
  margin: 4px 0 0;
  z-index: 5;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(18, 12, 8, 0.92);
  border: 1px solid rgba(212, 168, 87, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.gunpowder-dock[hidden] {
  display: none !important;
}

.gunpowder-dock-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(240, 230, 216, 0.72);
  white-space: nowrap;
}

.gunpowder-dock-shells {
  display: flex;
  gap: 10px;
}

.gunpowder-dock-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.gunpowder-dock-item .shell {
  width: 22px;
  height: 32px;
  border-radius: 4px 4px 7px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.gunpowder-dock-item .shell.live {
  background: linear-gradient(180deg, #e07068, #9a2f28);
  color: #fff5f2;
  border-color: #5a1c18;
}

.gunpowder-dock-item .shell.blank {
  background: linear-gradient(180deg, #ddd0b4, #9a8c72);
  color: #2a2418;
  border-color: #5a5040;
}

.gunpowder-dock-item .shell.special {
  background: linear-gradient(180deg, #e0c078, #5aa8c8);
  color: #1a1410;
  border-color: #6a5830;
}

.gunpowder-dock-ord {
  font-size: 0.62rem;
  color: rgba(240, 230, 216, 0.55);
}

.gunpowder-dock-name {
  font-size: 0.72rem;
  color: var(--gold);
}

.actions-dock {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 8px 10px 10px;
  background: rgba(12, 9, 7, 0.95);
  border-top: 1px solid var(--line);
  pointer-events: auto;
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
}

.actions-dock button {
  padding: 8px 14px;
  font-size: 0.88rem;
}

@media (max-height: 740px) {
  .me-zone .role-card {
    width: 88px;
    height: 136px;
  }
  .me-zone .role-card .art {
    height: 58px;
  }
  .me-zone .role-card .desc {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
  .board-arena .role-card {
    width: 90px;
    height: 142px;
  }
  .board-arena .role-card .art {
    height: 62px;
  }
  .item-card {
    width: 78px;
    height: 110px;
  }
  .hand-slot {
    width: 66px;
    height: 110px;
  }
  .hand-fan {
    min-height: 114px;
    height: 114px;
  }
  .me-zone .seat-shoot-btn {
    padding: 4px 10px;
    font-size: 0.72rem;
  }
  .actions-dock {
    padding: 6px 10px 8px;
  }
}

/* —— 英雄/角色牌 —— */
.hero-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  max-width: 100%;
  position: relative;
  z-index: 2;
}

.hero-seat:hover {
  z-index: 90;
}

.hero-seat .role-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  /* 向上放大，避免盖住下方「开枪」 */
  transform-origin: center bottom;
}

.hero-seat:hover .role-card {
  transform: scale(1.28);
  z-index: 15;
  border-color: transparent;
  box-shadow:
    0 0 0 1px #1a1208,
    0 12px 28px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(212, 168, 87, 0.55),
    0 0 22px rgba(212, 168, 87, 0.22),
    inset 0 1px 0 rgba(255, 236, 190, 0.16);
  animation: none;
}

.me-zone .hero-seat:hover .role-card {
  transform: scale(1.2);
}

.hero-seat.selected .role-card {
  border-color: transparent;
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px var(--gold),
    0 12px 24px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(212, 168, 87, 0.25),
    inset 0 1px 0 rgba(255, 236, 190, 0.16);
}

.hero-seat.selected:hover .role-card {
  transform: scale(1.3);
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px var(--gold),
    0 14px 30px rgba(0, 0, 0, 0.6),
    0 0 22px rgba(212, 168, 87, 0.3),
    inset 0 1px 0 rgba(255, 236, 190, 0.16);
}

.hero-seat.turn .role-card {
  animation: turnPulse 1.6s ease-in-out infinite;
}

.hero-seat.turn:hover .role-card {
  animation: none;
}

.hero-seat.dead {
  opacity: 0.4;
  filter: grayscale(0.8);
  pointer-events: none;
}
.hero-seat.me { cursor: default; }

@keyframes turnPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px #1a1208,
      0 0 0 2px rgba(212, 168, 87, 0.4),
      0 10px 20px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 236, 190, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 1px #1a1208,
      0 0 0 3px rgba(212, 168, 87, 0.9),
      0 14px 28px rgba(212, 168, 87, 0.25),
      inset 0 1px 0 rgba(255, 236, 190, 0.16);
  }
}

.seat-name {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-nr {
  font-weight: 800;
  color: #f2e6d4;
  letter-spacing: 0.02em;
}

.role-card {
  width: 100px;
  height: 158px;
  border-radius: 10px;
  position: relative;
  overflow: visible;
  /* 一圈暗金金属边：渐变只画在 border 环上，不盖立绘 */
  border: 3.5px solid transparent;
  background:
    linear-gradient(#1a1210, #1a1210) padding-box,
    linear-gradient(
      145deg,
      #f0dfa0 0%,
      #c4a062 12%,
      #7a5c2e 26%,
      #3a2810 40%,
      #d4b56a 54%,
      #8a6a32 68%,
      #4a3818 82%,
      #e8d5a3 100%
    ) border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 0 0 1px #1a1208,
    0 8px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 236, 190, 0.12);
  display: flex;
  flex-direction: column;
}

/* 外缘再压一圈暗金细线，增强金属厚度 */
.role-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  box-shadow:
    inset 0 0 0 1px rgba(232, 213, 163, 0.4),
    inset 0 0 0 2px rgba(58, 40, 16, 0.55);
}

/* 低血量警告：卡外血红光晕脉动（≤3），危急（≤1）更快更亮；不盖立绘 */
.role-card.low-hp::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  pointer-events: none;
  z-index: 0;
  box-shadow:
    0 0 0 1px rgba(184, 58, 50, 0.55),
    0 0 14px 2px rgba(184, 58, 50, 0.35),
    0 0 28px rgba(120, 24, 20, 0.28);
  animation: lowHpAura 1.85s ease-in-out infinite;
}

.role-card.low-hp-crit::before {
  inset: -6px;
  box-shadow:
    0 0 0 1px rgba(220, 70, 60, 0.7),
    0 0 18px 3px rgba(200, 48, 40, 0.5),
    0 0 36px rgba(140, 20, 16, 0.4);
  animation-duration: 1.15s;
}

.role-card.low-hp .art {
  filter: saturate(0.92) brightness(0.96);
}

.role-card.low-hp-crit .art {
  filter: saturate(0.85) brightness(0.93) contrast(1.05);
}

.role-card.low-hp .hp-pips {
  border-color: rgba(212, 84, 74, 0.55);
  box-shadow:
    0 0 0 1px rgba(184, 58, 50, 0.25),
    0 0 10px rgba(184, 58, 50, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.45);
  animation: lowHpPips 1.85s ease-in-out infinite;
}

.role-card.low-hp-crit .hp-pips {
  border-color: rgba(255, 120, 110, 0.7);
  animation-duration: 1.15s;
}

@keyframes lowHpAura {
  0%, 100% {
    opacity: 0.42;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.015);
  }
}

@keyframes lowHpPips {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .role-card.low-hp::before,
  .role-card.low-hp .hp-pips {
    animation: none;
    opacity: 0.85;
  }
}

/* 自己座位 */
.me-zone .role-card {
  width: 96px;
  height: 150px;
}

.me-zone .role-card .art {
  height: 68px;
}

.me-zone .role-card .desc {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.56rem;
  line-height: 1.25;
}

.me-zone .role-card .body {
  padding: 4px 5px 14px;
  gap: 2px;
}

.me-zone .hero-seat:hover {
  z-index: 25;
}

/* 桌面座位 */
.board-arena .role-card {
  width: 100px;
  height: 158px;
}

.board-arena .role-card .art {
  height: 72px;
}

.board-arena .role-card .desc {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.56rem;
  line-height: 1.25;
}

.board-arena .role-card .body {
  padding: 4px 5px 14px;
  gap: 2px;
}

.board-arena .seat-slot::before {
  font-size: 0.64rem;
  margin-bottom: 2px;
}

.board-arena .seat-slot:hover {
  z-index: 25;
}

.role-card .frame {
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  pointer-events: none;
  z-index: 2;
  background: transparent;
  border: 1px solid rgba(212, 168, 87, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(28, 18, 8, 0.75),
    inset 0 1px 0 rgba(245, 225, 170, 0.18);
}

.role-card .art {
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25), transparent 45%),
    linear-gradient(160deg, hsl(var(--hue), 55%, 42%), hsl(var(--hue), 45%, 18%));
}

.role-card.has-art .art {
  padding: 0;
  background: #0d0a08;
}

.role-card .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
}

.role-card .art-glyph {
  display: block;
}

.role-card .body {
  flex: 1;
  padding: 6px 8px 22px;
  background: linear-gradient(180deg, #2a211a, #16110d);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.role-card .body .hp-pips {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  align-self: center;
  flex-shrink: 0;
  padding: 3px 6px;
  gap: 4px;
}

.role-card .desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: #d4c4b0;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-height: 0;
}

.skill-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 14px;
  background: rgba(18, 12, 9, 0.96);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #e8dccf;
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition: opacity 0.12s ease;
}

.skill-tip.show {
  opacity: 1;
  visibility: visible;
}

.skill-tip strong {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.skill-tip span {
  display: block;
}

.hp-pips {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 99px;
  background: rgba(10, 6, 4, 0.88);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  z-index: 5;
}

.hp-drop {
  width: 11px;
  height: 11px;
  display: inline-block;
  flex: 0 0 auto;
  /* 血滴：尖头朝上，圆头朝下 */
  border-radius: 70% 70% 70% 0;
  transform: rotate(135deg);
  transition: background 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
}

.hp-drop.filled {
  background: radial-gradient(circle at 30% 30%, #ff9a92, #d4544a 52%, #8a1e18);
  box-shadow: 0 0 5px rgba(212, 84, 74, 0.55);
}

.hp-drop.empty {
  background: radial-gradient(circle at 30% 30%, #4a4542, #1c1816 55%, #0b0908);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.65);
}

.reveal-card .hp-pips {
  gap: 5px;
  padding: 3px 7px;
}

.reveal-card .hp-drop {
  width: 12px;
  height: 12px;
}

.hand-count {
  position: absolute;
  left: -4px;
  bottom: -4px;
  font-size: 0.7rem;
  line-height: 1;
  color: #eee;
  background: rgba(0,0,0,0.75);
  padding: 4px 7px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 5;
}

/* —— 道具牌：手牌轻抬 + 独立大图预览（炉石式）；点选上移固定 —— */
.item-card {
  width: 86px;
  height: 120px;
  margin: 0;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.18);
  background: #1c1510;
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-origin: center bottom;
  user-select: none;
  -webkit-user-select: none;
  /* 命中交给固定尺寸的 .hand-slot */
  pointer-events: none;
  transform: rotate(calc(var(--fan, 0) * 2.4deg));
}

.item-card.has-art {
  padding: 0;
  background: #0d0a08;
}

.item-card .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

/* 未选中：槽位悬停时轻微抬起（大图看 .hand-preview；仅精确指针设备） */
@media (hover: hover) and (pointer: fine) {
  .hand-slot:not(.is-selected):hover .item-card,
  .hand-slot:not(.is-selected):focus-within .item-card {
    transform: translateY(-22px) scale(1.08) rotate(0deg);
    box-shadow: 0 18px 28px rgba(0,0,0,0.55);
    border-color: rgba(255,255,255,0.55);
  }
}

/* 选中：上移固定，金边高亮 */
.hand-slot.is-selected .item-card,
.item-card.selected {
  transform: translateY(-28px) rotate(0deg);
  box-shadow: 0 0 0 2px var(--gold), 0 14px 24px rgba(0,0,0,0.5);
  border-color: var(--gold);
}

.item-card .art-glyph {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.item-card .fallback-name {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
}

.item-card:not(.has-art) {
  background: linear-gradient(160deg, hsl(var(--hue), 50%, 40%), hsl(var(--hue), 40%, 16%));
}

/* —— 顶栏日志（默认收起，点击展开） —— */
.log-popover {
  position: relative;
}

.log-popover > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--gold);
  font-size: 0.85rem;
}

.log-popover > summary::-webkit-details-marker { display: none; }

.log-popover > summary::after {
  content: ' ▾';
  opacity: 0.7;
  font-size: 0.75em;
}

.log-popover[open] > summary {
  background: rgba(212,168,87,0.12);
  border-color: rgba(212,168,87,0.35);
}

.log-popover[open] > summary::after { content: ' ▴'; }

.log-popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(40vh, 320px);
  background: rgba(14, 10, 8, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  overflow: hidden;
  z-index: 30;
}

#log {
  height: min(36vh, 280px);
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

#log div { margin-bottom: 3px; }

/* —— 先手转轮动画 —— */
.first-spin-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(6, 4, 3, 0.84);
  padding: 24px;
}

.first-spin-overlay.show { display: flex; }

.first-spin-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.first-spin-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.first-spin-card {
  width: min(280px, 80vw);
  min-height: 160px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.2), transparent 45%),
    linear-gradient(160deg, hsl(var(--hue, 30), 55%, 38%), hsl(var(--hue, 30), 45%, 14%));
  background-size: cover;
  background-position: center top;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-image 0.08s ease;
}

.first-spin-card.has-art {
  min-height: 220px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
}

.first-spin-card.spinning {
  animation: spinPulse 0.12s ease-in-out infinite;
}

.first-spin-card.land {
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow: 0 0 0 3px var(--gold), 0 18px 40px rgba(212,168,87,0.35);
}

.first-spin-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.first-spin-role {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
}

.first-spin-result {
  min-height: 1.4em;
  font-size: 1.15rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.first-spin-overlay.landed .first-spin-result { opacity: 1; }

/* —— 每轮弹药数量抽取 —— */
.ammo-draw-overlay {
  position: fixed;
  inset: 0;
  z-index: 54;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(6, 4, 3, 0.86);
  padding: 24px;
}

.ammo-draw-overlay.show { display: flex; }

.ammo-draw-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.ammo-draw-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.ammo-draw-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ammo-draw-plus {
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
}

.ammo-draw-tile {
  width: 120px;
  height: 150px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.5);
  background: linear-gradient(165deg, #3a2a22, #16100c);
}

.ammo-draw-tile.live {
  border-color: rgba(212, 84, 74, 0.55);
  background:
    radial-gradient(circle at 30% 20%, rgba(212,84,74,0.35), transparent 50%),
    linear-gradient(165deg, #4a221c, #160c0a);
}

.ammo-draw-tile.blank {
  border-color: rgba(197, 183, 154, 0.5);
  background:
    radial-gradient(circle at 30% 20%, rgba(197,183,154,0.28), transparent 50%),
    linear-gradient(165deg, #3a3428, #14110c);
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.ammo-draw-overlay.phase-blank .ammo-draw-tile.blank,
.ammo-draw-overlay.phase-done .ammo-draw-tile.blank {
  opacity: 1;
}

.ammo-draw-tile.special {
  border-color: rgba(212, 168, 87, 0.55);
  background:
    radial-gradient(circle at 30% 20%, rgba(126,200,227,0.28), transparent 50%),
    linear-gradient(165deg, #3a2e1a, #120e0a);
}

.ammo-draw-special {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ammo-draw-special.pop {
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.ammo-draw-label {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
}

.ammo-draw-num {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0,0,0,0.5);
}

.ammo-draw-tile.live .ammo-draw-num { color: #ff9a92; }
.ammo-draw-tile.blank .ammo-draw-num { color: #e8dcc4; }
.ammo-draw-tile.special .ammo-draw-num { color: #e8c57a; }

.ammo-draw-tile.spinning {
  animation: spinPulse 0.12s ease-in-out infinite;
}

.ammo-draw-tile.land {
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.ammo-draw-tile.live.land {
  box-shadow: 0 0 0 3px rgba(212,84,74,0.7), 0 16px 36px rgba(212,84,74,0.3);
}

.ammo-draw-tile.blank.land {
  box-shadow: 0 0 0 3px rgba(197,183,154,0.65), 0 16px 36px rgba(197,183,154,0.25);
}

.ammo-draw-result {
  min-height: 1.4em;
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-align: center;
}

.ammo-draw-overlay.landed .ammo-draw-result { opacity: 1; }

/* —— 止痛药六面骰 —— */
.dice-overlay {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(6, 4, 3, 0.88);
  padding: 24px;
}

.dice-overlay.show { display: flex; }

.dice-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.dice-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.dice-cube {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  border: 2px solid rgba(255,255,255,0.22);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.2), transparent 50%),
    linear-gradient(155deg, #4a3428, #1a120e);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dice-cube.rolling {
  animation: diceTumble 0.12s ease-in-out infinite;
}

.dice-cube.land {
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.dice-overlay.odd .dice-cube.land {
  box-shadow: 0 0 0 3px rgba(212,84,74,0.75), 0 16px 36px rgba(212,84,74,0.35);
}

.dice-overlay.even .dice-cube.land {
  box-shadow: 0 0 0 3px rgba(111,191,138,0.75), 0 16px 36px rgba(111,191,138,0.3);
}

.dice-face {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0,0,0,0.5);
  line-height: 1;
}

.dice-overlay.odd .dice-face { color: #ff9a92; }
.dice-overlay.even .dice-face { color: #8fd4a8; }

.dice-result {
  min-height: 1.4em;
  font-size: 1.08rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-align: center;
}

.dice-overlay.landed .dice-result { opacity: 1; }

/* —— 开枪弹药全屏揭示（黑卡自上而下揭开） —— */
.shot-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(4, 3, 2, 0.92);
  padding: 24px;
}

.shot-reveal-overlay.show {
  display: flex;
}

.shot-reveal-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold);
  letter-spacing: 0.16em;
}

.shot-reveal-sub {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  max-width: 90vw;
}

.shot-reveal-card {
  position: relative;
  width: min(220px, 56vw);
  height: min(308px, 78vw);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(212, 168, 87, 0.45);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.65);
  transform: translateY(12px) scale(0.94);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  background: #050403;
}

.shot-reveal-card.ready {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.shot-reveal-back {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(212, 168, 87, 0.12), transparent 55%),
    repeating-linear-gradient(45deg, #2a1a12 0 10px, #160f0b 10px 20px);
  z-index: 1;
}

.shot-reveal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 2;
}

.shot-reveal-shutter {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  height: 100%;
  z-index: 3;
  background: #050403;
  box-shadow: inset 0 1px 0 rgba(212, 168, 87, 0.2);
  transition: height 1.45s cubic-bezier(0.22, 0.7, 0.2, 1);
  pointer-events: none;
}

.shot-reveal-overlay.reveal .shot-reveal-shutter {
  height: 0%;
}

.shot-reveal-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  min-height: 1.4em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.shot-reveal-overlay.reveal .shot-reveal-name {
  opacity: 1;
  transform: translateY(0);
}

.shot-reveal-overlay.is-live .shot-reveal-name {
  color: #ff8f86;
}

.shot-reveal-overlay.is-blank .shot-reveal-name {
  color: #e6d7b8;
}

.shot-reveal-overlay.is-special .shot-reveal-name {
  color: #7ec8e3;
}

.shot-reveal-result {
  color: rgba(240, 230, 216, 0.88);
  font-size: 0.88rem;
  text-align: center;
  max-width: min(420px, 90vw);
  line-height: 1.45;
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.shot-reveal-overlay.landed .shot-reveal-result {
  opacity: 1;
}

.shot-reveal-overlay.is-live .shot-reveal-card {
  border-color: rgba(212, 84, 74, 0.7);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(212, 84, 74, 0.25);
}

.shot-reveal-overlay.is-blank .shot-reveal-card {
  border-color: rgba(197, 183, 154, 0.65);
}

.shot-reveal-overlay.is-special .shot-reveal-card {
  border-color: rgba(126, 200, 227, 0.7);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(126, 200, 227, 0.25);
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px) {
  .shot-reveal-card {
    width: min(140px, 28vw);
    height: min(196px, 40vw);
  }
  .shot-reveal-title {
    font-size: 1.05rem;
  }
  .shot-reveal-name {
    font-size: 1.05rem;
  }
  .shot-reveal-sub,
  .shot-reveal-result {
    font-size: 0.72rem;
  }
}

/* —— 退弹弃置动画 —— */
.eject-overlay {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(6, 4, 3, 0.88);
  padding: 24px;
}

.eject-overlay.show { display: flex; }

.eject-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.eject-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.eject-shell {
  width: 92px;
  height: 128px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  background: linear-gradient(165deg, #3a2a22, #16100c);
  transform-origin: center center;
}

.eject-shell.unknown {
  background:
    repeating-linear-gradient(45deg, #3a2418 0 8px, #2a1a12 8px 16px);
}

.eject-shell.flipping {
  animation: ejectFlip 0.9s ease-in-out;
}

.eject-shell.revealed.live,
.eject-overlay.is-live .eject-shell.revealed {
  border-color: rgba(212, 84, 74, 0.7);
  background:
    radial-gradient(circle at 30% 20%, rgba(212,84,74,0.4), transparent 55%),
    linear-gradient(165deg, #5a221c, #160c0a);
  box-shadow: 0 0 0 3px rgba(212,84,74,0.45), 0 16px 36px rgba(212,84,74,0.28);
}

.eject-shell.revealed.blank,
.eject-overlay.is-blank .eject-shell.revealed {
  border-color: rgba(197, 183, 154, 0.65);
  background:
    radial-gradient(circle at 30% 20%, rgba(197,183,154,0.35), transparent 55%),
    linear-gradient(165deg, #3a3428, #14110c);
  box-shadow: 0 0 0 3px rgba(197,183,154,0.4), 0 16px 36px rgba(0,0,0,0.45);
}

.eject-shell.revealed.special,
.eject-overlay.is-special .eject-shell.revealed {
  border-color: rgba(212, 168, 87, 0.7);
  background:
    radial-gradient(circle at 30% 20%, rgba(126,200,227,0.3), transparent 55%),
    linear-gradient(165deg, #3a2e1a, #120e0a);
  box-shadow: 0 0 0 3px rgba(212,168,87,0.45), 0 16px 36px rgba(126,200,227,0.2);
}

.eject-shell-mark {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.eject-shell.revealed.live .eject-shell-mark { color: #ff9a92; }
.eject-shell.revealed.blank .eject-shell-mark { color: #e8dcc4; }
.eject-shell.revealed.special .eject-shell-mark { color: #e8c57a; }

.eject-shell-label {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.8);
}

.eject-result {
  min-height: 1.4em;
  font-size: 1.08rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-align: center;
}

.eject-overlay.landed .eject-result { opacity: 1; }

/* —— 通用道具特效 —— */
.item-fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(6, 4, 3, 0.88);
  padding: 24px;
}

.item-fx-overlay.show { display: flex; }

.item-fx-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.item-fx-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.item-fx-stage {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-fx-result {
  min-height: 1.4em;
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-align: center;
}

.item-fx-overlay.landed .item-fx-result { opacity: 1; }

.item-fx-cast,
.dice-cast,
.eject-cast {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.fx-announce {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.fx-used-card {
  position: relative;
  width: 118px;
  height: 166px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(232, 197, 122, 0.55);
  background: #120e0b;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.fx-used-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fx-used-card .fx-used-name,
.fx-used-card.fallback .fx-used-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 4px;
  font-size: 0.72rem;
  text-align: center;
  color: #f3e2b0;
  background: linear-gradient(transparent, rgba(10, 8, 6, 0.92));
}

.fx-used-card.fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
}

.fx-cast-arrow {
  font-size: 1.8rem;
  color: var(--gold);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(232, 197, 122, 0.35);
}

.fx-target-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.fx-target-chip {
  min-width: 110px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 143, 136, 0.55);
  background: linear-gradient(155deg, #5a2a28, #1a100e);
  box-shadow: 0 12px 28px rgba(212, 84, 74, 0.28);
  text-align: center;
  color: #ffe8e4;
}

.fx-target-chip .fx-target-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: #ffb0a8;
  margin-bottom: 4px;
}

.fx-target-chip strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-seat.fx-caster .role-card {
  border-color: transparent;
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(232, 197, 122, 0.75),
    0 10px 28px rgba(232, 197, 122, 0.25),
    inset 0 1px 0 rgba(255, 236, 190, 0.16);
  animation: fxPulseGold 1.1s ease-in-out infinite;
}

.hero-seat.fx-hit .role-card {
  border-color: transparent;
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(255, 143, 136, 0.85),
    0 10px 28px rgba(212, 84, 74, 0.35),
    inset 0 1px 0 rgba(255, 236, 190, 0.12);
  animation: fxPulseHit 1.1s ease-in-out infinite;
}

.hero-seat.fx-hit:hover .role-card,
.hero-seat.fx-caster:hover .role-card {
  animation: none;
}

@keyframes fxPulseGold {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes fxPulseHit {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.fx-icon {
  min-width: 110px;
  min-height: 72px;
  padding: 14px 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.25;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
  background: linear-gradient(155deg, #4a3428, #1a120e);
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.fx-heal {
  color: #ff8f88;
  box-shadow: 0 0 0 3px rgba(212,84,74,0.4), 0 16px 36px rgba(212,84,74,0.25);
}

.fx-draw { color: #e8c57a; font-size: 2rem; }
.fx-shotgun { color: #ffb08a; }
.fx-reverse { font-size: 1.2rem; letter-spacing: 0.08em; color: #7ec8e3; }
.fx-bind { color: #c5b79a; }
.fx-link { color: #e8a0d0; }
.fx-unlink { color: #b9a794; }

.fx-card-row {
  display: flex;
  gap: 14px;
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.fx-mini-card {
  width: 100px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
  background: #120e0b;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}

.fx-mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fx-mini-card.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--gold);
  font-size: 0.78rem;
  text-align: center;
  font-weight: 700;
}

/* —— 换弹点选弹窗 —— */
.ammo-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 3, 0.86);
  padding: 20px;
}

.ammo-pick-overlay.show {
  display: flex;
}

.ammo-pick-panel {
  width: min(520px, 100%);
  padding: 22px 22px 18px;
  border-radius: 16px;
  border: 1px solid rgba(232, 197, 122, 0.28);
  background: linear-gradient(165deg, #2a2118 0%, #14100c 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.ammo-pick-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.ammo-pick-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ammo-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 22px 0 14px;
}

.ammo-pick-shell {
  width: 56px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #e8dcc8;
  transition: transform 0.15s ease;
}

.ammo-pick-shell:hover {
  transform: translateY(-4px);
}

.ammo-pick-shell .shell {
  width: 34px;
  height: 52px;
  border-radius: 6px 6px 8px 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.ammo-pick-shell .shell.unknown::after {
  font-size: 14px;
}

.ammo-pick-shell .ammo-pick-ord {
  font-size: 0.78rem;
  opacity: 0.85;
}

.ammo-pick-shell.picked .shell {
  box-shadow:
    0 0 0 3px rgba(232, 197, 122, 0.85),
    0 8px 18px rgba(232, 197, 122, 0.28);
  background: linear-gradient(180deg, #c4a574, #6a5538);
}

.ammo-pick-shell.picked .ammo-pick-ord {
  color: var(--gold);
  font-weight: 700;
}

.ammo-pick-hint {
  min-height: 1.3em;
  font-size: 0.92rem;
  color: #f0e6d8;
  margin-bottom: 14px;
}

.ammo-pick-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ammo-pick-actions button {
  min-width: 96px;
}

.discard-hand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 12px;
  max-height: 280px;
  overflow-y: auto;
}

.discard-hand-card {
  width: 84px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #120e0b;
  cursor: pointer;
  overflow: hidden;
  color: #f0e6d8;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.discard-hand-card:hover {
  transform: translateY(-3px);
}

.discard-hand-card.picked {
  border-color: rgba(255, 143, 136, 0.9);
  box-shadow: 0 0 0 2px rgba(212, 84, 74, 0.35);
}

.discard-hand-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.discard-hand-card .dh-name {
  display: block;
  padding: 6px 4px;
  font-size: 0.7rem;
  text-align: center;
}

.discard-hand-card.fallback {
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.4rem;
}

/* —— 通用选人弹窗 —— */
.player-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 3, 0.88);
  padding: 20px;
  animation: playerPickFade 0.22s ease;
}

.player-pick-overlay.show {
  display: flex;
}

@keyframes playerPickFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.player-pick-panel {
  width: min(720px, 100%);
  padding: 22px 20px 18px;
  border-radius: 16px;
  border: 1px solid rgba(232, 197, 122, 0.28);
  background: linear-gradient(165deg, #2a2118 0%, #14100c 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  animation: playerPickIn 0.28s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes playerPickIn {
  to { transform: translateY(0) scale(1); }
}

.player-pick-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.player-pick-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.player-pick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 12px;
}

@media (max-width: 720px) {
  .player-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.player-pick-card {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(160deg, #3a2c22, #18120e);
  padding: 10px 8px 12px;
  cursor: pointer;
  color: #f0e6d8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 168px;
}

.player-pick-card:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: rgba(232, 197, 122, 0.45);
}

.player-pick-card:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.35);
}

.player-pick-card.picked {
  border-color: rgba(255, 143, 136, 0.85);
  box-shadow: 0 0 0 2px rgba(212, 84, 74, 0.35), 0 12px 28px rgba(212, 84, 74, 0.22);
  background: linear-gradient(160deg, #5a2a28, #1a100e);
}

.player-pick-card .pick-art {
  width: 72px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #120e0b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-pick-card .pick-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-pick-card .pick-art .glyph {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.player-pick-card .pick-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.player-pick-card .pick-meta {
  font-size: 0.7rem;
  opacity: 0.75;
}

.player-pick-card .pick-badge {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #ffb0a8;
  min-height: 1em;
}

.player-pick-hint {
  min-height: 1.3em;
  font-size: 0.92rem;
  color: #f0e6d8;
  margin-bottom: 14px;
}

.player-pick-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.player-pick-actions button {
  min-width: 96px;
}

/* —— 双管声明 / 公示 —— */
.db-overlay {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 3, 0.88);
  padding: 20px;
}

.db-overlay.show {
  display: flex;
}

.db-panel {
  width: min(560px, 100%);
  padding: 22px 20px 18px;
  border-radius: 16px;
  border: 1px solid rgba(232, 197, 122, 0.3);
  background: linear-gradient(165deg, #2a2118 0%, #14100c 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: playerPickIn 0.28s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.db-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}

.db-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.db-kind-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 8px 0 14px;
}

.db-kind-btn {
  min-width: 110px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: #1a140f;
  color: #f0e6d8;
  font-weight: 700;
  cursor: pointer;
}

.db-kind-btn[data-kind="live"].picked {
  border-color: rgba(212, 84, 74, 0.85);
  background: linear-gradient(160deg, #5a2a28, #1a100e);
  color: #ffb0a8;
  box-shadow: 0 0 0 2px rgba(212, 84, 74, 0.25);
}

.db-kind-btn[data-kind="blank"].picked {
  border-color: rgba(197, 183, 154, 0.85);
  background: linear-gradient(160deg, #4a4336, #1a160f);
  color: #efe4cb;
  box-shadow: 0 0 0 2px rgba(197, 183, 154, 0.25);
}

.db-reveal-stage {
  margin: 18px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.db-reveal-shells {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.db-reveal-shell {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.45;
}

.db-reveal-shell.focus {
  opacity: 1;
  transform: translateY(-4px);
}

.db-reveal-shell .shell {
  width: 32px;
  height: 48px;
}

.db-reveal-shell .shell.live,
.db-reveal-shell .shell.blank,
.db-reveal-shell .shell.special {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a120e;
  font-size: 12px;
  font-weight: 700;
}

.db-reveal-shell .shell.live {
  background: linear-gradient(180deg, #e07068, #8a2e28);
}

.db-reveal-shell .shell.blank {
  background: linear-gradient(180deg, #ddd0b4, #8a7d62);
}

.db-reveal-shell .shell.special {
  background: linear-gradient(180deg, #e8c57a, #5a9bb8);
}

.db-reveal-shell .shell.unknown::after {
  font-size: 13px;
}

.db-reveal-call {
  font-size: 1.05rem;
  color: #f0e6d8;
  font-weight: 700;
}

.db-reveal-result {
  min-height: 2.4em;
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.25s ease;
  line-height: 1.45;
}

.db-overlay.landed .db-reveal-result {
  opacity: 1;
}

.db-overlay.success .db-reveal-result {
  color: #6fbf8a;
}

.db-overlay.fail .db-reveal-result {
  color: #ff8f88;
}

.fx-shell {
  width: 84px;
  height: 116px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(165deg, #3a2a22, #16100c);
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.fx-shell span { font-size: 2rem; font-weight: 700; color: #fff; }
.fx-shell small { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.fx-shell.unknown {
  background: repeating-linear-gradient(45deg, #3a2418 0 8px, #2a1a12 8px 16px);
}
.fx-shell.live {
  border-color: rgba(212,84,74,0.7);
  background: radial-gradient(circle at 30% 20%, rgba(212,84,74,0.4), transparent 55%), linear-gradient(165deg, #5a221c, #160c0a);
}
.fx-shell.live span { color: #ff9a92; }
.fx-shell.blank {
  border-color: rgba(197,183,154,0.65);
  background: radial-gradient(circle at 30% 20%, rgba(197,183,154,0.35), transparent 55%), linear-gradient(165deg, #3a3428, #14110c);
}
.fx-shell.blank span { color: #e8dcc4; }
.fx-shell.special {
  border-color: rgba(212,168,87,0.7);
  background: radial-gradient(circle at 30% 20%, rgba(126,200,227,0.3), transparent 55%), linear-gradient(165deg, #3a2e1a, #120e0a);
}
.fx-shell.special span { color: #e8c57a; }

.fx-swap {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: landPop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.fx-swap-arrow {
  font-size: 1.8rem;
  color: var(--gold);
  font-weight: 700;
}

@keyframes ejectFlip {
  0% { transform: rotateY(0deg) translateY(0) scale(1); filter: brightness(1); }
  40% { transform: rotateY(90deg) translateY(-24px) scale(1.08); filter: brightness(1.2); }
  70% { transform: rotateY(180deg) translateY(-8px) scale(1.04); }
  100% { transform: rotateY(180deg) translateY(0) scale(1); }
}

@keyframes diceTumble {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.06); }
}

@keyframes spinPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.03); filter: brightness(1.12); }
}

@keyframes landPop {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.reveal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 3, 0.82);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.reveal-overlay.show { display: flex; }

.reveal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  animation: fadeUp 0.5s ease both;
}

.reveal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.reveal-card {
  animation: dealIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(40px) rotateY(70deg) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateY(0) scale(1);
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal-card .role-card {
  width: 168px;
  height: 260px;
  overflow: hidden;
}

.reveal-card .role-card .art {
  height: 140px;
}

.reveal-card .role-card .desc {
  font-size: 0.72rem;
  line-height: 1.45;
  -webkit-line-clamp: 6;
  line-clamp: 6;
}

.reveal-card .role-card .body {
  padding: 8px 10px 36px;
}

.flip-scene {
  perspective: 900px;
  width: 168px;
}

.flip-inner {
  width: 168px;
  height: 260px;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
  position: relative;
}

.flip-inner.flipped { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-back {
  transform: rotateY(180deg);
}

.flip-face .role-card {
  width: 168px;
  height: 260px;
}

.card-back {
  width: 168px;
  height: 260px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 40%, rgba(212,168,87,0.2), transparent 50%),
    repeating-linear-gradient(45deg, #3a2418 0 8px, #2a1a12 8px 16px);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  box-shadow: 0 10px 22px rgba(0,0,0,0.45);
}

/* =========================================================
   手机横屏对局适配（竖屏不做特殊布局）
   策略：底栏改单行横排省高度；牌桌座位缩到迷你卡，左右不被裁切
   ========================================================= */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px) {
  :root {
    --hand-preview-w: 96px;
    --hand-preview-h: 134px;
  }

  .topbar {
    padding: 1px 6px;
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
    gap: 4px;
    min-height: 0;
  }

  .brand {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .topbar .meta {
    font-size: 0.52rem;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-controls {
    gap: 3px;
  }

  .topbar-controls button,
  .topbar-controls summary {
    padding: 2px 6px;
    font-size: 0.62rem;
  }

  #roomInfo {
    display: none;
  }

  .table-wrap {
    padding: 0 4px;
    padding-left: max(4px, env(safe-area-inset-left, 0px));
    padding-right: max(4px, env(safe-area-inset-right, 0px));
  }

  .table-wrap.active,
  .table-wrap.layout-cross {
    gap: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .round-banner {
    font-size: 0.55rem;
    padding: 0 2px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 十字座位拉满宽度，左右列加宽以免裁切 */
  .table-wrap.layout-cross .board-arena,
  .table-wrap.layout-trio .board-arena {
    grid-template-columns: minmax(88px, 120px) minmax(0, 1fr) minmax(88px, 120px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      ". top ."
      "left felt right";
    max-width: 100%;
    width: 100%;
    gap: 0 6px;
    padding: 0 2px;
    overflow: hidden;
    align-items: center;
    justify-items: center;
  }

  .table-wrap.layout-trio .board-arena {
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "left felt right";
  }

  .table-wrap.layout-duel .board-arena {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "top"
      "felt";
    max-width: 100%;
    width: 100%;
    gap: 0;
    padding: 0 2px;
    overflow: hidden;
  }

  .seat-top {
    max-width: 88px;
    align-self: start;
  }

  .seat-left,
  .seat-right {
    align-self: center;
    max-height: 100%;
    overflow: hidden;
    justify-content: center;
  }

  .seat-left,
  .seat-right,
  .seat-top {
    padding: 0;
  }

  /* 名字/阵营不占高度，叠在卡上 */
  .board-arena .seat-slot::before {
    display: none;
  }

  .board-arena .seat-name {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 8;
    max-width: 100%;
    padding: 0 3px;
    font-size: 0.5rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(8, 6, 4, 0.82);
    border-radius: 0 0 4px 4px;
    pointer-events: none;
  }

  .board-arena .hero-seat {
    position: relative;
    gap: 0;
  }

  .board-arena .seat-shot-wrap {
    position: relative;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .board-arena .seat-shoot-btn {
    position: absolute;
    right: -2px;
    bottom: 2px;
    z-index: 9;
    writing-mode: horizontal-tb;
    letter-spacing: 0;
    padding: 1px 5px;
    min-width: 0;
    min-height: 0;
    font-size: 0.55rem;
    border-radius: 4px;
  }

  .seat-top .seat-shoot-btn {
    right: -2px;
    bottom: 2px;
    transform: none;
  }

  .board-arena .role-card {
    width: 52px;
    height: 74px;
  }

  .board-arena .role-card .art {
    height: 42px;
  }

  .board-arena .role-card .desc {
    display: none;
  }

  .board-arena .role-card .body {
    padding: 2px 2px 8px;
    gap: 0;
  }

  .board-arena .hp-drop {
    width: 5px;
    height: 5px;
  }

  .board-arena .hand-count {
    font-size: 0.48rem;
    padding: 1px 3px;
    left: -2px;
    bottom: -2px;
  }

  /* 触摸勿 sticky hover 放大 */
  .hero-seat:hover .role-card,
  .me-zone .hero-seat:hover .role-card,
  .board-arena .hero-seat:hover .role-card,
  .hero-seat.selected:hover .role-card,
  .hero-seat.turn:hover .role-card {
    transform: none;
  }

  .hero-seat:not(.turn):hover .role-card {
    animation: none;
    box-shadow: none;
  }

  .hero-seat.selected .role-card,
  .hero-seat.selected:hover .role-card {
    box-shadow: 0 0 0 2px var(--gold), 0 4px 10px rgba(0,0,0,0.45);
  }

  .board-arena .felt {
    padding: 4px 8px;
    min-height: 0;
    max-width: min(420px, 100%);
    align-self: center;
  }

  .loadout-row {
    gap: 3px;
    margin-bottom: 0;
  }

  .ammo-chip {
    padding: 0 4px;
    font-size: 0.52rem;
  }

  .ammo-chip i {
    width: 7px;
    height: 7px;
  }

  .shell {
    width: 10px;
    height: 16px;
  }

  .felt-status {
    font-size: 0.52rem;
    margin: 0;
  }

  .pill {
    font-size: 0.5rem;
    padding: 0 3px;
  }

  .effect-pills {
    gap: 2px;
  }

  /* —— 底栏：角色 | 手牌 | 按钮 同一行，不再竖堆吃高度 —— */
  .bottom-panel {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    padding-bottom: max(2px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    overflow: visible;
    min-height: 0;
  }

  .me-zone {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    margin: 0;
  }

  .me-seat-col {
    flex: 0 0 auto;
    align-items: center;
  }

  .me-zone .seat-shot-wrap {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .me-zone .hero-seat {
    gap: 0;
  }

  .me-zone .seat-name {
    font-size: 0.5rem;
    max-width: 72px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .me-zone .role-card {
    width: 44px;
    height: 64px;
  }

  .me-zone .role-card .art {
    height: 34px;
  }

  .me-zone .role-card .desc {
    display: none;
  }

  .me-zone .role-card .body {
    padding: 1px 2px 6px;
  }

  .me-zone .seat-shoot-btn {
    padding: 3px 6px;
    font-size: 0.58rem;
    min-width: 0;
  }

  .hand-block {
    flex: 1 1 auto;
    min-width: 0;
    align-items: flex-start;
    justify-content: center;
  }

  .hand-label {
    font-size: 0.5rem;
    margin-bottom: 0;
    max-width: 100%;
  }

  .hand-label .hand-hint {
    display: none;
  }

  .item-card {
    width: 40px;
    height: 56px;
    border-radius: 4px;
  }

  .hand-slot {
    width: 36px;
    height: 56px;
    margin-left: -8px;
  }

  .hand-slot:first-child {
    margin-left: 0;
  }

  .hand-fan {
    min-height: 58px;
    height: 58px;
    padding: 0 4px 0 0;
  }

  .hand-slot.is-selected .item-card,
  .item-card.selected {
    transform: translateY(-8px) rotate(0deg);
  }

  .item-card .art-glyph {
    font-size: 1rem;
  }

  .item-card .fallback-name {
    font-size: 0.48rem;
    margin-top: 1px;
  }

  .private-toast {
    font-size: 0.52rem;
    min-height: 0;
    margin: 0;
  }

  .gunpowder-dock {
    display: none;
  }

  .actions-dock {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 3px;
    padding: 0 0 0 6px;
    margin: 0;
    border-top: none;
    border-left: 1px solid var(--line);
    background: transparent;
    min-width: 72px;
  }

  .actions-dock button {
    padding: 4px 8px;
    font-size: 0.68rem;
    white-space: nowrap;
    width: 100%;
    max-width: none;
  }

  #snakeBar,
  #awaitBar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px !important;
  }

  .hand-preview {
    position: fixed;
    left: 50% !important;
    right: auto;
    bottom: auto;
    top: 46%;
    z-index: 220;
    max-width: min(200px, 36vw);
  }

  .hand-preview.is-visible {
    transform: translateX(-50%) translateY(-50%) scale(1);
  }

  .hand-preview:not(.is-visible) {
    transform: translateX(-50%) translateY(-46%) scale(0.94);
  }

  .hand-preview-meta {
    padding: 3px 6px;
    max-width: 180px;
  }

  .hand-preview-name {
    font-size: 0.7rem;
  }

  .hand-preview-desc {
    font-size: 0.52rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hp-drop {
    width: 5px;
    height: 5px;
  }

  .me-zone .hand-count {
    font-size: 0.48rem;
    padding: 1px 3px;
  }

  .flip-scene,
  .flip-inner,
  .flip-face .role-card,
  .card-back {
    width: min(100px, 22vw);
    height: min(154px, 34vw);
  }
}
