:root {
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --stage-scale: 1;
  --anim-scale: 1;

  --ink-dark: #1a201c;
  --ink-pine: #1b3a2c;
  --ink-brown: #2b1809;
  --ink-muted: #5a4733;
  --paper-cream: #fff7e6;
  --gold-warm: #f3e1b9;
  --gold-soft: #e6c88b;
  --red-seal: #b8291d;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: clip;
  overscroll-behavior: none;
  background: radial-gradient(circle at 50% 45%, #16291f 0%, #0b1610 100%);
  font-family: var(--font-sans);
  color: var(--ink-dark);
}

.hidden {
  display: none !important;
}

/* ===========================
   画布外悬浮演示控制台
   =========================== */
.director-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(16, 33, 24, 0.96) 0%, rgba(12, 26, 19, 0.92) 100%);
  border-bottom: 1px solid rgba(230, 200, 139, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  color: #f7eed7;
  transition: transform 240ms ease, opacity 240ms ease;
}

.director-bar.collapsed {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.director-left,
.director-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
  white-space: nowrap;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e6503c;
  box-shadow: 0 0 10px rgba(230, 80, 60, 0.8);
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #f7e6bf;
}

.director-divider {
  width: 1px;
  height: 20px;
  background: rgba(230, 200, 139, 0.24);
  margin: 0 2px;
}

.phase-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dir-tab,
.dir-btn,
.dir-icon-btn,
.dir-chip {
  appearance: none;
  border: 1px solid rgba(230, 200, 139, 0.22);
  background: rgba(255, 248, 232, 0.08);
  color: #efe3c8;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

.dir-tab:hover,
.dir-btn:hover,
.dir-icon-btn:hover,
.dir-chip:hover {
  background: rgba(255, 248, 232, 0.16);
  border-color: rgba(243, 225, 185, 0.5);
}

.dir-tab:active,
.dir-btn:active,
.dir-icon-btn:active {
  transform: scale(0.96);
}

.dir-tab.active {
  background: linear-gradient(180deg, #c93b2b 0%, #9b2217 100%);
  border-color: rgba(255, 226, 178, 0.65);
  color: #fff8ea;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(184, 41, 29, 0.45);
}

.dir-btn[data-active="true"] {
  background: rgba(210, 56, 38, 0.88);
  border-color: #ffd9a0;
  color: #fff9ec;
  box-shadow: 0 0 12px rgba(224, 72, 48, 0.5);
}

.dir-btn-accent {
  background: linear-gradient(180deg, #2b684b 0%, #1d4a34 100%);
  border-color: rgba(230, 200, 139, 0.45);
  color: #fff7e6;
  font-weight: 600;
}

.dir-btn-accent.running {
  background: linear-gradient(180deg, #b8291d 0%, #8e1d14 100%);
  border-color: #ffe3ab;
}

.dir-btn-ghost {
  background: transparent;
  border-color: rgba(230, 200, 139, 0.16);
  color: rgba(239, 227, 200, 0.78);
}

.dir-icon-btn {
  width: 32px;
  padding: 0;
  justify-content: center;
  font-size: 14px;
}

.lowcard-group {
  display: inline-flex;
  align-items: center;
}

.lowcard-group .dir-btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.lowcard-group .dir-chip {
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0 8px;
  font-size: 11px;
  color: #f3d79b;
  background: rgba(255, 248, 232, 0.05);
}

.key-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.28);
  color: #f4dfae;
}

.show-bar-pill {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 901;
  appearance: none;
  border: 1px solid rgba(230, 200, 139, 0.35);
  background: rgba(16, 34, 24, 0.84);
  color: #f7e6bf;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.showcase-caption {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 880;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(17, 36, 26, 0.92);
  border: 1px solid rgba(243, 212, 149, 0.45);
  color: #fff6e3;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
}

.caption-badge {
  background: #c53324;
  color: #fff9ed;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.caption-stop {
  appearance: none;
  border: 1px solid rgba(255, 232, 188, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #ffebc2;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}

/* ===========================
   1920x1080 舞台缩放视口
   =========================== */
.viewport {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: clip;
  transition: top 240ms ease;
}

body.bar-hidden .viewport {
  top: 0;
}

.game-stage {
  position: relative;
  width: 1920px;
  height: 1080px;
  flex-shrink: 0;
  transform: scale(var(--stage-scale));
  transform-origin: center center;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  background: #184532;
}

/* ===========================
   L1 背景、茶烟修补与回合柔光
   =========================== */
.layer-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.bg-image {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  object-fit: cover;
}

.smoke-patch-outer {
  position: absolute;
  left: 54px;
  top: 726px;
  width: 188px;
  height: 160px;
  border-radius: 50%;
  background: rgba(25, 71, 52, 0.95);
  filter: blur(18px);
}

.smoke-patch-core {
  position: absolute;
  left: 70px;
  top: 744px;
  width: 154px;
  height: 128px;
  border-radius: 50%;
  background: #184532;
  filter: blur(8px);
}

.turn-glow {
  position: absolute;
  left: -14px;
  top: 758px;
  width: 310px;
  height: 310px;
  pointer-events: none;
  transition:
    left calc(500ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    top calc(500ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1);
}

.turn-glow-ring {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 156, 68, 0.44) 0%, rgba(232, 122, 53, 0.24) 55%, rgba(232, 122, 53, 0) 76%);
  filter: blur(26px);
  animation: turnGlowBreath calc(2.6s * var(--anim-scale)) ease-in-out infinite;
}

.turn-glow-core {
  position: absolute;
  left: 38px;
  top: 38px;
  right: 38px;
  bottom: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 234, 166, 0.68) 0%, rgba(255, 212, 120, 0.34) 55%, rgba(255, 212, 120, 0) 80%);
  filter: blur(18px);
  animation: turnCorePulse calc(2.2s * var(--anim-scale)) ease-in-out infinite;
}

@keyframes turnGlowBreath {
  0%, 100% { opacity: 0.78; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes turnCorePulse {
  0%, 100% { opacity: 0.72; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}

/* ===========================
   L2 顶部全局 HUD
   =========================== */
.layer-hud {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 130px;
  z-index: 15;
  pointer-events: none;
}

.hud-icon-btn {
  position: absolute;
  pointer-events: auto;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform calc(140ms * var(--anim-scale)) ease, filter 160ms ease;
}

.hud-icon-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.hud-icon-btn:active {
  transform: scale(0.95);
}

.settings-btn {
  left: 32px;
  top: 24px;
  width: 84px;
  height: 80px;
}

.settings-btn img,
.rules-btn img {
  width: 100%;
  height: 100%;
  display: block;
}

.rules-btn {
  left: 1712px;
  top: 22px;
  width: 176px;
  height: 88px;
}

/* 极简青玉匾余牌110 */
.remain-plaque {
  position: absolute;
  left: 134px;
  top: 29px;
  width: 276px;
  height: 74px;
  border-radius: 12px;
  background-image: url("./assets/sim_remain_plaque.png");
  background-size: 106% 120%;
  background-position: center;
  box-shadow: 0 6px 14px rgba(10, 24, 16, 0.38);
  pointer-events: auto;
}

.remain-stacks {
  position: relative;
  width: 72px;
  height: 74px;
}

.stack-tile {
  position: absolute;
  width: 24px;
  height: 32px;
  border-radius: 4px;
}

.stack-tile.back {
  left: 28px;
  top: 19px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.stack-tile.front {
  left: 37px;
  top: 23px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}

.remain-label {
  position: absolute;
  left: 78px;
  top: 0;
  width: 58px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  color: #f3e1b9;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.remain-divider {
  position: absolute;
  left: 146px;
  top: 23px;
  width: 2px;
  height: 28px;
  background: rgba(230, 200, 139, 0.45);
}

.remain-value {
  position: absolute;
  left: 158px;
  top: -1px;
  width: 96px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 34px;
  color: #fff7e6;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.48);
  transition: transform 200ms ease;
}

.remain-value.bump {
  animation: countBump calc(320ms * var(--anim-scale)) ease;
}

@keyframes countBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); color: #ffe29e; }
  100% { transform: scale(1); }
}

/* ===========================
   L3 四位角色与名牌手牌
   =========================== */
.layer-characters {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.player-seat {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.char-bust-wrap {
  position: absolute;
  pointer-events: auto;
  filter: brightness(0.92) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.34));
  transition: transform calc(340ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1), filter 320ms ease;
}

.char-bust {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform-origin: 50% 88%;
  will-change: transform;
}

.seat-panda .char-bust { animation: idlePanda calc(3.8s * var(--anim-scale)) ease-in-out infinite; }
.seat-rabbit .char-bust { animation: idleRabbit calc(2.8s * var(--anim-scale)) ease-in-out infinite; }
.seat-rooster .char-bust { animation: idleRooster calc(3.2s * var(--anim-scale)) ease-in-out infinite; }
.seat-tiger .char-bust { animation: idleTiger calc(3.6s * var(--anim-scale)) ease-in-out infinite; }

@keyframes idlePanda {
  0%, 100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
  50% { transform: translateY(1.5px) scale(1.018, 0.992) rotate(-0.7deg); }
}

@keyframes idleRabbit {
  0%, 100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
  50% { transform: translateY(-4px) scale(1.01, 1.02) rotate(1.1deg); }
}

@keyframes idleRooster {
  0%, 100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
  50% { transform: translateY(-3px) scale(1.012, 1.018) rotate(-1.2deg); }
}

@keyframes idleTiger {
  0%, 100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
  50% { transform: translateY(1px) scale(1.015, 0.992) rotate(0.6deg); }
}

.seat-panda .char-bust-wrap { left: 790px; top: -54px; width: 340px; height: 340px; }
.seat-rabbit .char-bust-wrap { left: 52px; top: 226px; width: 336px; height: 336px; }
.seat-rooster .char-bust-wrap { left: 1524px; top: 226px; width: 340px; height: 340px; }
.seat-tiger .char-bust-wrap { left: -16px; top: 748px; width: 308px; height: 308px; }

.player-seat.is-active .char-bust-wrap {
  transform: translateY(-4px) scale(1.03);
  animation: activeCharAura calc(2.1s * var(--anim-scale)) ease-in-out infinite;
}

@keyframes activeCharAura {
  0%, 100% {
    filter:
      brightness(1.03)
      drop-shadow(0 0 8px rgba(255, 228, 148, 0.82))
      drop-shadow(0 0 22px rgba(240, 126, 48, 0.62))
      drop-shadow(0 10px 18px rgba(0, 0, 0, 0.36));
  }
  50% {
    filter:
      brightness(1.08)
      drop-shadow(0 0 14px rgba(255, 234, 166, 0.98))
      drop-shadow(0 0 34px rgba(245, 136, 48, 0.85))
      drop-shadow(0 12px 22px rgba(0, 0, 0, 0.38));
  }
}

/* 名牌 */
.nameplate {
  position: absolute;
  height: 46px;
  width: 172px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 110% 120%;
  background-position: center;
  box-shadow: 0 5px 12px rgba(10, 22, 14, 0.42);
  transition: transform 220ms ease, box-shadow 240ms ease, filter 220ms ease;
}

.nameplate.is-red {
  background-image: url("./assets/sim_name_red.png");
  box-shadow: 0 0 0 2px rgba(255, 224, 150, 0.68), 0 6px 18px rgba(184, 34, 20, 0.58);
}

.nameplate-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 2px;
  color: #fff6e4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.seat-panda .nameplate { left: 874px; top: 210px; }
.seat-rabbit .nameplate { left: 114px; top: 522px; }
.seat-rooster .nameplate { left: 1616px; top: 522px; }
.seat-tiger .nameplate { left: 52px; top: 1012px; height: 44px; }

/* 回合题签 */
.active-turn-plaque,
.self-turn-plaque {
  position: absolute;
  border-radius: 9px;
  background-image: url("./assets/sim_name_red.png");
  background-size: 112% 122%;
  background-position: center;
  box-shadow: 0 0 0 1.5px rgba(255, 226, 152, 0.62), 0 5px 16px rgba(154, 24, 14, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  color: #fff7e6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
}

.seat-panda .active-turn-plaque { left: 889px; top: 2px; width: 142px; height: 34px; font-size: 15px; z-index: 20; }
.seat-rabbit .active-turn-plaque { left: 129px; top: 202px; width: 142px; height: 36px; font-size: 15px; }
.seat-rooster .active-turn-plaque { left: 1623px; top: 202px; width: 142px; height: 36px; font-size: 15px; }

.self-turn-plaque {
  left: 54px;
  top: 704px;
  width: 168px;
  height: 42px;
  font-size: 18px;
  letter-spacing: 1px;
}

/* 对手手牌组与低余牌预警 */
.opponent-hand {
  position: absolute;
  width: 300px;
  height: 74px;
  pointer-events: auto;
  cursor: pointer;
}

.seat-panda .opponent-hand { left: 828px; top: 260px; }
.seat-rabbit .opponent-hand { left: 114px; top: 574px; }
.seat-rooster .opponent-hand { left: 1544px; top: 574px; }

.dark-tiles-row {
  position: relative;
  height: 74px;
}

.dark-tile {
  position: absolute;
  top: 4px;
  width: 50px;
  height: 64px;
  border-radius: 7px;
  object-fit: cover;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.42));
  transition: transform 200ms ease, opacity 200ms ease;
}

.dark-tile:nth-child(1) { left: 0; }
.dark-tile:nth-child(2) { left: 44px; }
.dark-tile:nth-child(3) { left: 88px; }
.dark-tile:nth-child(4) { left: 132px; }

.opponent-hand.low-alert-active .dark-tile:nth-child(4) { opacity: 0.28; }
.opponent-hand.low-alert-active.cards-2 .dark-tile:nth-child(3) { opacity: 0.28; }

.count-pill-wrap {
  position: absolute;
  left: 190px;
  top: 14px;
  width: 72px;
  height: 44px;
}

.count-pill {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 9px;
  padding: 0;
  cursor: pointer;
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 19px;
  color: #fff7e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  transition:
    width calc(260ms * var(--anim-scale)) cubic-bezier(0.34, 1.56, 0.64, 1),
    height calc(260ms * var(--anim-scale)) cubic-bezier(0.34, 1.56, 0.64, 1),
    font-size calc(260ms * var(--anim-scale)) ease,
    border-radius 220ms ease;
}

.low-card-halo,
.low-card-tag {
  opacity: 0;
  pointer-events: none;
}

.low-card-halo {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 106px;
  height: 66px;
  border-radius: 14px;
  background: radial-gradient(circle, rgba(255, 198, 92, 0.55) 0%, rgba(214, 48, 32, 0.72) 60%, rgba(214, 48, 32, 0) 100%);
  filter: blur(3px);
}

.low-card-tag {
  position: absolute;
  left: 12px;
  top: -19px;
  width: 72px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(180deg, #981d12 0%, #72130b 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  color: #ffeab8;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* 低余牌 < X 预警激活态：放大 + 朱砂脉冲 + 外光晕 + 初次抖动 */
.opponent-hand.low-alert-active .count-pill-wrap {
  left: 188px;
  top: 9px;
  width: 96px;
  height: 56px;
}

.opponent-hand.low-alert-active .count-pill {
  background-image: url("./assets/sim_name_red.png");
  background-size: 112% 124%;
  border-radius: 12px;
  font-size: 28px;
  color: #fff9ea;
  box-shadow: 0 6px 16px rgba(176, 26, 16, 0.65);
  animation: lowCardPulse calc(1.35s * var(--anim-scale)) ease-in-out infinite;
}

.opponent-hand.low-alert-active .low-card-halo {
  opacity: 1;
  animation: haloExpand calc(1.35s * var(--anim-scale)) ease-in-out infinite;
}

.opponent-hand.low-alert-active .low-card-tag {
  opacity: 1;
}

.opponent-hand.low-alert-shake .count-pill-wrap {
  animation: lowCardShake calc(480ms * var(--anim-scale)) ease-in-out 1;
}

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

@keyframes haloExpand {
  0%, 100% { transform: scale(0.95); opacity: 0.65; }
  50% { transform: scale(1.16); opacity: 1; }
}

@keyframes lowCardShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-3deg); }
  45% { transform: translateX(7px) rotate(3deg); }
  70% { transform: translateX(-5px) rotate(-2deg); }
  85% { transform: translateX(4px) rotate(1.5deg); }
}

/* 角色表情气泡锚点（独立顶层，不被战报条遮挡） */
.layer-speeches {
  position: absolute;
  inset: 0;
  z-index: 65;
  pointer-events: none;
}

.speech-anchor {
  position: absolute;
  z-index: 65;
  pointer-events: none;
}

.speech-anchor.speech-tiger { left: 214px; top: 736px; }
#speech-panda { left: 1118px; top: 68px; }
#speech-rabbit { left: 274px; top: 212px; }
#speech-rooster { right: 276px; top: 212px; }

.emoji-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf0 0%, #f5e6c8 100%);
  box-shadow: 0 10px 24px rgba(15, 28, 18, 0.35), 0 0 0 1px rgba(150, 118, 70, 0.25);
  animation: bubblePop calc(2.5s * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.emoji-bubble img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.emoji-bubble span {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  color: #2b1809;
  white-space: nowrap;
}

@keyframes bubblePop {
  0% { opacity: 0; transform: translateY(14px) scale(0.65); }
  12% { opacity: 1; transform: translateY(-2px) scale(1.06); }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  82% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-16px) scale(0.94); }
}

/* ===========================
   L4 桌心宣纸核心区
   =========================== */
.layer-table-core {
  position: absolute;
  left: 430px;
  top: 350px;
  width: 1060px;
  height: 408px;
  z-index: 20;
}

/* 上轮出牌战报条 */
.prev-play-banner {
  position: absolute;
  left: 56px;
  top: 10px;
  width: 846px;
  height: 62px;
  z-index: 30;
  border-radius: 11px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 104% 116%;
  background-position: center;
  box-shadow: 0 6px 14px rgba(24, 18, 10, 0.25);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.banner-avatar-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f4e6c7;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.banner-avatar-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.banner-player-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 64px;
  flex-shrink: 0;
}

.banner-meta-sub {
  font-size: 11px;
  color: #715636;
  line-height: 1.15;
}

.banner-meta-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  color: #1f2d23;
  line-height: 1.25;
}

.banner-tiles {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding-left: 2px;
}

.mini-tile {
  position: relative;
  width: 30px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background-image: url("./assets/tile_face.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 17px;
  color: var(--ink-dark);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.banner-tiles.compact .mini-tile {
  width: 24px;
  height: 34px;
  font-size: 14px;
  padding-bottom: 3px;
}

.banner-tile-count {
  font-size: 12px;
  font-weight: 700;
  color: #5b4326;
  white-space: nowrap;
  flex-shrink: 0;
}

.banner-vote-result {
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 114% 124%;
  background-position: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: #fff8eb;
  font-size: 13px;
  font-weight: 700;
}

.banner-vote-result.rejected {
  background-image: url("./assets/sim_name_red.png");
}

.banner-vote-result img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.banner-records-btn {
  width: 86px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background-image: url("./assets/sim_btn_skip.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.22);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  color: #2b1809;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 120ms ease, filter 150ms ease;
}

.banner-records-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.banner-records-btn:active {
  transform: scale(0.95);
}

/* 水墨圆章倒计时 */
.ink-timer {
  position: absolute;
  left: 922px;
  top: 2px;
  width: 78px;
  height: 78px;
  z-index: 30;
  cursor: pointer;
}

.timer-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 140% 140%;
  background-position: center;
  box-shadow: 0 6px 12px rgba(10, 22, 14, 0.42);
  transition: filter 200ms ease;
}

.ink-timer.urgent .timer-disc {
  background-image: url("./assets/sim_name_red.png");
  animation: timerUrgent calc(650ms * var(--anim-scale)) ease-in-out infinite;
}

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

.timer-svg {
  position: absolute;
  inset: 0;
  width: 78px;
  height: 78px;
}

.timer-track {
  fill: none;
  stroke: rgba(245, 214, 142, 0.25);
  stroke-width: 3;
}

.timer-arc {
  fill: none;
  stroke: #f5d68e;
  stroke-width: 3.4;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 39px 39px;
  transition: stroke-dashoffset 250ms linear;
}

.timer-num {
  position: absolute;
  left: 0;
  top: 11px;
  width: 78px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 27px;
  color: #fff7e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.timer-unit {
  position: absolute;
  left: 0;
  top: 44px;
  width: 78px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #f2d28b;
}

/* 三态视图切换容器 */
.center-view {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity calc(240ms * var(--anim-scale)) ease,
    transform calc(260ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1);
}

.center-view.active {
  opacity: 1;
  pointer-events: none;
  transform: translateY(0);
}

.center-view.active > * {
  pointer-events: auto;
}

/* 视图 A: 我的回合 */
.phase-title-row {
  position: absolute;
  left: 350px;
  top: 84px;
  width: 360px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.red-seal-dot {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #b8291d;
  color: #fff7e6;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(150, 28, 18, 0.35);
}

.phase-main-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 28px;
  color: #1f2e24;
  letter-spacing: 2px;
}

/* 待出牌造句台 */
.staging-tray {
  position: absolute;
  left: 86px;
  top: 134px;
  width: 888px;
  height: 162px;
  border-radius: 14px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 104% 114%;
  background-position: center;
  box-shadow: 0 8px 18px rgba(32, 22, 12, 0.24);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.staging-tray.drop-highlight {
  box-shadow:
    0 10px 26px rgba(184, 41, 29, 0.35),
    0 0 0 3px rgba(212, 146, 54, 0.72) inset;
  transform: scale(1.01);
}

.staging-tiles-row {
  position: relative;
  height: 128px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
}

.staged-tile {
  position: relative;
  width: 78px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background-image: url("./assets/tile_face.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 45px;
  color: var(--ink-dark);
  cursor: grab;
  filter: drop-shadow(0 5px 8px rgba(18, 12, 6, 0.32));
  transition: transform calc(180ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease;
}

.staged-tile.compact {
  width: 62px;
  height: 80px;
  font-size: 34px;
  padding-bottom: 8px;
}

.staged-tile.ultra-compact {
  width: 50px;
  height: 64px;
  font-size: 27px;
  padding-bottom: 6px;
}

.staged-tile:hover {
  transform: translateY(-4px);
}

.staged-tile.just-added {
  animation: tileDropIn calc(280ms * var(--anim-scale)) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.staged-tile.dragging-staged {
  z-index: 40;
  cursor: grabbing;
  transform: scale(1.08);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.38));
}

@keyframes tileDropIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.84); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.add-slot-box {
  width: 78px;
  height: 100px;
  border-radius: 11px;
  background: rgba(222, 198, 153, 0.45);
  box-shadow: inset 0 2px 6px rgba(96, 68, 30, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  color: #705736;
  transition: width 160ms ease, background 160ms ease;
}

.add-slot-box.wide-empty {
  width: 240px;
}

.add-slot-plus {
  font-size: 26px;
  font-weight: 700;
  color: #7e6340;
  line-height: 1;
}

.add-slot-label {
  font-size: 12px;
  font-weight: 600;
  color: #705736;
}

.staging-guide {
  margin: 0;
  position: absolute;
  left: 44px;
  top: 132px;
  width: 800px;
  height: 22px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #5a4733;
}

/* 核心按钮组 */
.action-btn-group {
  position: absolute;
  left: 223px;
  top: 314px;
  width: 614px;
  height: 72px;
}

.game-btn {
  position: absolute;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 900;
  transition:
    transform calc(140ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease,
    filter 180ms ease;
}

.game-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.04);
}

.game-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.game-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.btn-reset {
  left: 0;
  top: 6px;
  width: 156px;
  height: 60px;
  border-radius: 12px;
  background-image: url("./assets/sim_btn_reset.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 6px 14px rgba(18, 22, 16, 0.25);
  color: #1b3a2c;
  font-size: 23px;
}

.btn-play {
  left: 182px;
  top: 0;
  width: 250px;
  height: 72px;
  border-radius: 14px;
  background-image: url("./assets/sim_btn_play.png");
  background-size: 110% 124%;
  background-position: center;
  box-shadow: 0 8px 18px rgba(136, 24, 14, 0.42);
  color: #fff8eb;
  font-size: 31px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-skip {
  left: 458px;
  top: 6px;
  width: 156px;
  height: 60px;
  border-radius: 12px;
  background-image: url("./assets/sim_btn_skip.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 6px 14px rgba(18, 22, 16, 0.25);
  color: #2b1809;
  font-size: 23px;
}

/* 视图 B: 投票回合 */
.voting-header-card {
  position: absolute;
  left: 347px;
  top: 82px;
  width: 366px;
  height: 48px;
  border-radius: 10px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 108% 120%;
  background-position: center;
  box-shadow: 0 4px 10px rgba(24, 18, 10, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.voter-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3e4c3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.voter-mini-avatar img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.voting-header-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  color: #1f2d23;
}

.voting-tiles-row {
  position: absolute;
  left: 110px;
  top: 136px;
  width: 840px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.voting-tile {
  width: 78px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background-image: url("./assets/tile_face.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 44px;
  color: var(--ink-dark);
  filter: drop-shadow(0 5px 8px rgba(18, 12, 6, 0.34));
  animation: voteCardDeal calc(360ms * var(--anim-scale)) cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.voting-tile.compact {
  width: 62px;
  height: 80px;
  font-size: 34px;
  padding-bottom: 8px;
}

.voting-tile.ultra-compact {
  width: 50px;
  height: 64px;
  font-size: 27px;
  padding-bottom: 6px;
}

@keyframes voteCardDeal {
  0% { opacity: 0; transform: translateY(-18px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.table-vote-bar {
  position: absolute;
  left: 113px;
  top: 248px;
  width: 834px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.vote-status-card {
  width: 264px;
  height: 64px;
  border-radius: 11px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 108% 120%;
  background-position: center;
  box-shadow: 0 5px 12px rgba(20, 14, 8, 0.22);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
}

.vote-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f3e4c3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
}

.vote-card-avatar img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.vote-card-name {
  flex: 1;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: #1e2621;
}

.vote-card-seal {
  width: 98px;
  height: 42px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.vote-card-seal.seal-self {
  background: rgba(206, 178, 126, 0.45);
  color: #5b4326;
}

.vote-card-seal.seal-pending {
  background: rgba(214, 194, 154, 0.42);
  color: #6b5234;
}

.vote-card-seal.seal-agree {
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 112% 124%;
  background-position: center;
  color: #fff8eb;
  box-shadow: 0 3px 8px rgba(15, 42, 26, 0.35);
}

.vote-card-seal.seal-doubt {
  background-image: url("./assets/sim_name_red.png");
  background-size: 112% 124%;
  background-position: center;
  color: #fff8eb;
  box-shadow: 0 3px 8px rgba(128, 22, 14, 0.38);
}

.vote-card-seal.seal-stamp-anim {
  animation: inkStamp calc(340ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1);
}

.vote-card-seal img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@keyframes inkStamp {
  0% { opacity: 0; transform: scale(1.85) rotate(-14deg); }
  65% { opacity: 1; transform: scale(0.92) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.my-vote-bar {
  position: absolute;
  left: 244px;
  top: 324px;
  width: 572px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.my-vote-label {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  color: #1e2621;
  white-space: nowrap;
}

.vote-btn {
  width: 196px;
  height: 62px;
  border: none;
  border-radius: 13px;
  padding: 0 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 25px;
  color: #fff7e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform calc(140ms * var(--anim-scale)) ease, filter 160ms ease, opacity 160ms ease;
}

.vote-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.06);
}

.vote-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.vote-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.vote-btn.chosen {
  box-shadow: 0 0 0 3px #f6d78a, 0 8px 20px rgba(0, 0, 0, 0.35);
}

.vote-btn-agree {
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 6px 14px rgba(15, 42, 26, 0.38);
}

.vote-btn-doubt {
  background-image: url("./assets/sim_name_red.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 6px 14px rgba(128, 22, 14, 0.42);
}

.vote-btn-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.vote-verdict-stamp {
  position: absolute;
  left: 50%;
  top: 158px;
  transform: translateX(-50%);
  padding: 14px 28px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 28px;
  color: #fff9ec;
  z-index: 45;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  animation: bigVerdictSlam calc(380ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.vote-verdict-stamp.passed {
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 110% 120%;
}

.vote-verdict-stamp.rejected {
  background-image: url("./assets/sim_btn_play.png");
  background-size: 110% 120%;
}

.vote-verdict-stamp img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

@keyframes bigVerdictSlam {
  0% { opacity: 0; transform: translateX(-50%) scale(1.75) rotate(-10deg); }
  70% { opacity: 1; transform: translateX(-50%) scale(0.95) rotate(1.5deg); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) rotate(0deg); }
}

/* 视图 C: 等待对手出牌 */
.waiting-scroll-card {
  position: absolute;
  left: 155px;
  top: 98px;
  width: 750px;
  height: 144px;
  border-radius: 14px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 106% 116%;
  background-position: center;
  box-shadow: 0 8px 18px rgba(26, 18, 10, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
}

.waiting-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 28px;
  color: #1f2e24;
  letter-spacing: 1px;
}

.thinking-dots i {
  font-style: normal;
  display: inline-block;
  animation: dotBounce calc(1.4s * var(--anim-scale)) infinite;
}

.thinking-dots i:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.waiting-subtitle {
  margin: 0;
  font-size: 15px;
  color: #5b4732;
}

.fast-forward-btn {
  position: absolute;
  right: 16px;
  bottom: 12px;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  background-image: url("./assets/sim_btn_skip.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  color: #2b1809;
  cursor: pointer;
  transition: transform 120ms ease, filter 140ms ease;
}

.fast-forward-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.quick-emoji-tray {
  position: absolute;
  left: 155px;
  top: 258px;
  width: 750px;
  height: 134px;
  border-radius: 14px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 106% 116%;
  background-position: center;
  box-shadow: 0 8px 18px rgba(26, 18, 10, 0.22);
}

.emoji-tray-label {
  position: absolute;
  left: 42px;
  top: 10px;
  width: 140px;
  height: 22px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  color: #3a2c1b;
  display: flex;
  align-items: center;
}

.emoji-cards-row {
  position: absolute;
  left: 42px;
  top: 38px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.emoji-card-btn {
  position: relative;
  width: 92px;
  height: 78px;
  border: none;
  border-radius: 11px;
  padding: 0;
  cursor: pointer;
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 114% 124%;
  background-position: center;
  box-shadow: 0 4px 10px rgba(15, 36, 22, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform calc(140ms * var(--anim-scale)) ease, filter 150ms ease;
}

.emoji-card-btn:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.05);
  filter: brightness(1.08);
}

.emoji-card-btn:active:not(:disabled) {
  transform: scale(0.93);
}

.emoji-card-btn img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.emoji-card-btn.cooldown {
  cursor: wait;
  filter: grayscale(0.4) brightness(0.8);
}

.emoji-cooldown-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: #f5d68e;
  transform-origin: left center;
  animation: cooldownShrink calc(3s * var(--anim-scale)) linear forwards;
}

@keyframes cooldownShrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ===========================
   L5 底部己方手牌区 (14张，拖拽换位)
   =========================== */
.layer-self-hand {
  position: absolute;
  left: 0;
  top: 790px;
  width: 1920px;
  height: 260px;
  z-index: 30;
}

.hand-board {
  position: relative;
  width: 1920px;
  height: 204px;
}

.hand-tile {
  position: absolute;
  top: 80px;
  width: 88px;
  height: 114px;
  border-radius: 11px;
  overflow: hidden;
  background-image: url("./assets/tile_face.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 48px;
  color: var(--ink-dark);
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.38));
  transition:
    left calc(180ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    top calc(190ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    transform calc(160ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    filter 160ms ease;
}

.hand-tile:hover:not(.dragging) {
  transform: translateY(-8px);
}

.hand-tile.selected {
  top: 52px;
  filter:
    drop-shadow(0 0 14px rgba(246, 210, 122, 0.82))
    drop-shadow(0 10px 14px rgba(0, 0, 0, 0.4));
}

.hand-tile.selected:hover:not(.dragging) {
  transform: translateY(-5px);
}

.hand-tile.dragging {
  cursor: grabbing;
  z-index: 95;
  transition: none;
  filter:
    drop-shadow(0 0 18px rgba(246, 210, 122, 0.85))
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.48));
}

.hand-tile.settled {
  animation: tileSettle calc(200ms * var(--anim-scale)) cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tileSettle {
  0% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

.bottom-guide-text {
  margin: 0;
  position: absolute;
  left: 460px;
  top: 214px;
  width: 1000px;
  height: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: rgba(243, 232, 206, 0.88);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* ===========================
   飞牌层与舞台内 Toast
   =========================== */
.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.flying-tile {
  position: absolute;
  width: 82px;
  height: 106px;
  border-radius: 10px;
  overflow: hidden;
  background-image: url("./assets/tile_face.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 44px;
  color: var(--ink-dark);
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.44));
  transition:
    left calc(380ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    top calc(380ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    transform calc(380ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease;
}

.stage-toast {
  position: absolute;
  left: 50%;
  top: 764px;
  transform: translateX(-50%);
  z-index: 120;
  min-width: 460px;
  max-width: 780px;
  height: 54px;
  padding: 0 38px;
  border-radius: 12px;
  overflow: hidden;
  background-image: url("./assets/sim_toast_banner.png");
  background-size: 104% 120%;
  background-position: center;
  box-shadow: 0 10px 26px rgba(8, 18, 12, 0.52);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff7e6;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
  animation: toastFadeIn 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stage-toast::before,
.stage-toast::after {
  content: "◆";
  color: #e8c77f;
  font-size: 11px;
  opacity: 0.85;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===========================
   L6 弹窗层（04 · 本局出牌记录弹窗等）
   =========================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 150;
  background: rgba(10, 20, 14, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: backdropFade 180ms ease;
}

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

.game-modal {
  position: relative;
  border-radius: 18px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 105% 108%;
  background-position: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  animation: modalPopIn calc(240ms * var(--anim-scale)) cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-records {
  width: 860px;
  height: 540px;
}

.modal-info {
  width: 680px;
  max-height: 520px;
}

.records-header {
  position: relative;
  height: 86px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  border-bottom: 1px solid rgba(114, 88, 52, 0.16);
}

.records-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 30px;
  color: #1f2e24;
  letter-spacing: 2px;
}

.modal-close-btn {
  position: absolute;
  right: 36px;
  top: 22px;
  width: 104px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background-image: url("./assets/sim_btn_play.png");
  background-size: 112% 124%;
  background-position: center;
  box-shadow: 0 4px 10px rgba(128, 22, 14, 0.35);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: #fff7e6;
  cursor: pointer;
  transition: transform 120ms ease, filter 140ms ease;
}

.modal-close-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.modal-close-btn:active {
  transform: scale(0.95);
}

.records-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 36px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.records-list::-webkit-scrollbar {
  width: 6px;
}

.records-list::-webkit-scrollbar-thumb {
  background: rgba(105, 82, 48, 0.35);
  border-radius: 999px;
}

.record-row {
  min-height: 114px;
  width: 788px;
  border-radius: 12px;
  background-image: url("./assets/sim_scroll_panel.png");
  background-size: 106% 120%;
  background-position: center;
  box-shadow: 0 4px 12px rgba(32, 22, 10, 0.18);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.record-player-col {
  width: 124px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-round {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  color: #463520;
}

.record-player-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f3e4c3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.record-avatar img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.record-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  color: #1f2d23;
  white-space: nowrap;
}

.record-tiles-wrap {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.record-tile {
  width: 42px;
  height: 54px;
  border-radius: 7px;
  overflow: hidden;
  background-image: url("./assets/tile_face.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 5px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 22px;
  color: var(--ink-dark);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.22));
}

.record-status-pill {
  width: 140px;
  height: 44px;
  border-radius: 9px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
}

.record-status-pill.passed {
  background-image: url("./assets/sim_btn_agree.png");
  background-size: 112% 124%;
  background-position: center;
  color: #fff8eb;
  box-shadow: 0 4px 8px rgba(15, 36, 22, 0.28);
}

.record-status-pill.rejected {
  background-image: url("./assets/sim_name_red.png");
  background-size: 112% 124%;
  background-position: center;
  color: #fff8eb;
  box-shadow: 0 4px 8px rgba(128, 22, 14, 0.32);
}

.record-status-pill.voting {
  background-image: url("./assets/sim_btn_skip.png");
  background-size: 112% 124%;
  background-position: center;
  color: #2b1809;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.16);
}

.record-status-pill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.info-modal-body {
  padding: 22px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.info-block {
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(247, 234, 206, 0.65);
  box-shadow: inset 0 0 0 1px rgba(132, 98, 52, 0.15);
}

.info-block h4 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: #1b3a2c;
}

.info-block p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #3f3020;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(247, 234, 206, 0.65);
  font-size: 16px;
  font-weight: 600;
  color: #2b1d10;
  cursor: pointer;
}

.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1b4d35;
  cursor: pointer;
}

.threshold-pills {
  display: inline-flex;
  gap: 8px;
}

.th-btn {
  border: 1px solid rgba(90, 68, 40, 0.28);
  background: #fff5e1;
  color: #3a2b1a;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.th-btn.active {
  background: #b8291d;
  border-color: #b8291d;
  color: #fff8eb;
}

/* ===========================
   右侧交互与动效说明滑出抽屉
   =========================== */
.spec-drawer {
  position: fixed;
  top: 50px;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 92vw;
  z-index: 890;
  background: linear-gradient(180deg, #faf3e3 0%, #f3e6cc 100%);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.42);
  border-left: 1px solid rgba(128, 98, 56, 0.28);
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    top 240ms ease,
    visibility 0s linear 260ms;
}

body.bar-hidden .spec-drawer {
  top: 0;
}

.spec-drawer.open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    top 240ms ease,
    visibility 0s linear 0s;
}

.spec-drawer-header {
  padding: 18px 20px;
  background: #173828;
  color: #fff7e6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.spec-eyebrow {
  font-size: 11px;
  color: #e6c88b;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.spec-drawer-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.4;
  color: #fff8eb;
}

.spec-close-btn {
  border: 1px solid rgba(255, 232, 188, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff7e6;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.spec-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spec-card {
  background: rgba(255, 251, 242, 0.85);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(140, 110, 68, 0.18);
  box-shadow: 0 3px 10px rgba(40, 28, 12, 0.06);
}

.spec-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: #183d2b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-card p {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.65;
  color: #3e2e1d;
  white-space: pre-line;
}

.spec-card p:last-child {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .director-bar {
    height: auto;
    min-height: 48px;
    padding: 6px 12px;
    flex-wrap: wrap;
  }
}
