:root {
  --tatami-hi: #b5b071;
  --tatami: #999559;
  --tatami-lo: #7c7843;
  --tatami-edge: #5d592e;
  --sakura-hi: #c4302c;
  --sakura: #a12120;
  --sakura-lo: #7b1516;
  --sakura-strip: rgba(44, 9, 11, 0.34);
  --silk-peach: #e5b397;
  --silk-rose: #d89b82;
  --silk-cream: #f6e7c9;
  --silk-gold: #e9c996;
  --card-white: #fffdf8;
  --card-cream: #f5eee0;
  --card-edge: #d2c5ae;
  --card-bevel: #bfb198;
  --ink: #2b1d15;
  --ink-mid: #5a4333;
  --ink-dim: #7a624f;
  --paper-light: #fcf6e8;
  --paper-warm: #f2e6cd;
  --gold: #d4a13e;
  --gold-hot: #ffe28c;
  --gold-deep: #966a1d;
  --heart-red: #c8232c;
  --heart-deep: #8f141b;
  --club-blue: #1d4f91;
  --club-deep: #11315e;
  --jade: #1e7a4c;
  --jade-bg: rgba(30, 122, 76, 0.13);
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", "Hiragino Mincho ProN", Georgia, serif;
  --font-num: "Georgia", "Noto Serif SC", "Songti SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--tatami);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

/* 明亮日光编织榻榻米桌面 (Woven Tatami Rush Mat) */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 84% 66% at 50% 42%, rgba(255, 250, 224, 0.34) 0%, transparent 68%),
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 52%, rgba(64, 58, 25, 0.36) 100%),
    linear-gradient(178deg, #ada96a 0%, #999558 48%, #878349 100%);
}

/* 细密蔺草横向编织纹 + 纵向经线 */
.felt-vignette {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 251, 226, 0.2) 0px,
      rgba(255, 251, 226, 0.2) 1.5px,
      rgba(72, 68, 30, 0.16) 1.5px,
      rgba(72, 68, 30, 0.16) 3.5px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(72, 68, 30, 0.08) 0px,
      rgba(72, 68, 30, 0.08) 1px,
      transparent 1px,
      transparent 11px
    );
}

/* 榻榻米席面微光颗粒与自然边缘阴影 */
.felt-noise {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 252, 232, 0.07) 0 42px,
      rgba(68, 62, 26, 0.05) 42px 84px
    ),
    radial-gradient(ellipse at center, transparent 58%, rgba(56, 50, 20, 0.32) 100%);
}

.felt-shine {
  position: absolute;
  width: 78vmax;
  height: 44vmax;
  top: -14%;
  left: 11%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 250, 226, 0.24) 0%,
    rgba(246, 222, 178, 0.08) 52%,
    transparent 74%
  );
  filter: blur(36px);
}

.suit-red {
  color: var(--heart-red);
  font-weight: 800;
}

.suit-blue {
  color: var(--club-blue);
  font-weight: 800;
}

.stage {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 calc(1.8rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 0.65rem;
}

.stage[hidden] {
  display: none;
}

.play-shell {
  display: grid;
  gap: 0.65rem;
}

.brand-block {
  text-align: center;
  animation: slam-in 0.42s cubic-bezier(0.2, 1.15, 0.3, 1) both;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 3.2rem);
  letter-spacing: 0.18em;
  color: #2f1a12;
  text-shadow: 0 1px 0 rgba(255, 249, 232, 0.65);
}

.brand.small {
  font-size: 1.08rem;
  letter-spacing: 0.22em;
  color: var(--sakura);
  text-shadow: none;
}

.tagline {
  margin: 0.14rem 0 0;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(0.86rem, 2.8vw, 1.1rem);
  letter-spacing: 0.26em;
  color: var(--sakura);
  text-shadow: 0 1px 0 rgba(255, 249, 232, 0.6);
}

.lede {
  margin: 0.36rem auto 0;
  color: #3d331d;
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

/* 明亮和纸/桧木桌面信息条 */
.panel {
  position: relative;
  border: 1.5px solid rgba(140, 108, 62, 0.45);
  border-radius: 10px;
  background: linear-gradient(175deg, rgba(253, 248, 236, 0.95), rgba(243, 233, 211, 0.96));
  padding: 0.62rem 0.8rem 0.7rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 4px 12px rgba(52, 44, 18, 0.26),
    0 1.5px 3px rgba(52, 44, 18, 0.22);
}

.panel-title {
  margin: 0 0 0.38rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  color: #462318;
}

.sel-count {
  color: var(--gold-hot);
  margin-left: 0.22rem;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem 0.9rem;
  justify-content: space-between;
}

.status-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.status-value {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 1.14rem;
  color: var(--ink);
}

.status-value .colon {
  margin: 0 0.14rem;
  color: var(--sakura);
}

.series-value {
  color: var(--sakura);
}

.next-seat-wrap {
  margin: 0 0 0.8rem;
}

.next-seat-wrap[hidden] {
  display: none;
}

.overlay-actions .btn[hidden] {
  display: none;
}

.diff-badge {
  color: #6b2517 !important;
  font-size: 1rem !important;
}

.parity-panel {
  display: grid;
  gap: 0.32rem;
}

.parity-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.parity-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.78rem;
  color: #4a2417;
  min-width: 2.2rem;
}

.chip {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.16rem 0.46rem;
  border-radius: 6px;
  border: 1px solid transparent;
}

.chip.red {
  background: rgba(200, 35, 44, 0.12);
  border-color: rgba(200, 35, 44, 0.42);
  color: var(--heart-red);
}

.chip.blue {
  background: rgba(29, 79, 145, 0.12);
  border-color: rgba(29, 79, 145, 0.42);
  color: var(--club-blue);
}

.chip.item {
  background: rgba(212, 161, 62, 0.2);
  border-color: rgba(168, 120, 34, 0.5);
  color: #6e480a;
}

/* 绯红樱花布托盘（对齐参考图的红底樱花暗纹置物盘） */
.unlock-panel,
.hand-panel {
  border: 1.5px solid #6e1416;
  background-color: var(--sakura);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76' viewBox='0 0 76 76'%3E%3Cg fill='%23ffdede' fill-opacity='0.12'%3E%3Cg transform='translate(20,20)'%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(72)'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(144)'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(216)'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(288)'/%3E%3C/g%3E%3Cg transform='translate(58,56) scale(0.8) rotate(28)'%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(72)'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(144)'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(216)'/%3E%3Cpath d='M0,-10 C3,-7 3,-2 0,0 C-3,-2 -3,-7 0,-10Z' transform='rotate(288)'/%3E%3C/g%3E%3Ccircle cx='58' cy='18' r='2'/%3E%3Ccircle cx='16' cy='58' r='1.8'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 224, 210, 0.1) 0%, transparent 18%, rgba(36, 6, 8, 0.22) 100%),
    linear-gradient(168deg, #bc2c29 0%, #9b1f1f 55%, #7f1517 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 200, 0.28),
    inset 0 -2px 6px rgba(48, 8, 10, 0.36),
    0 6px 16px rgba(52, 34, 14, 0.36),
    0 2px 4px rgba(52, 34, 14, 0.28);
}

.unlock-panel .panel-title,
.hand-panel .panel-title {
  color: #fff3db;
  text-shadow: 0 1px 2px rgba(68, 10, 12, 0.65);
}

/* 参考图中的红布托盘暗色透明分隔条 */
.unlock-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1.75rem;
  border-radius: 9px 9px 0 0;
  background: var(--sakura-strip);
  pointer-events: none;
  z-index: 0;
}

.unlock-panel > * {
  position: relative;
  z-index: 1;
}

.lead-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  min-height: 3.1rem;
  align-items: center;
}

/* 实体扑克牌背：白边框 + 经典菱格纹 + 醒目 ♥ / ♣ 徽记 */
.lead-card {
  width: 3rem;
  height: 4rem;
  border-radius: 6px;
  border: 2.5px solid var(--card-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.06rem;
  font-family: var(--font-num);
  font-weight: 900;
  box-shadow:
    0 0 0 1px rgba(130, 114, 88, 0.55),
    0 2px 0 #c6b89e,
    0 5px 10px rgba(48, 36, 16, 0.34);
}

.lead-card.back.red {
  background:
    repeating-linear-gradient(45deg, rgba(255, 236, 212, 0.14) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 236, 212, 0.14) 0 2px, transparent 2px 6px),
    linear-gradient(155deg, #d62e36 0%, var(--heart-red) 55%, var(--heart-deep) 100%);
  color: #fffaf0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 178, 0.55),
    0 0 0 1px rgba(130, 114, 88, 0.55),
    0 2px 0 #c6b89e,
    0 5px 10px rgba(48, 36, 16, 0.34);
}

.lead-card.back.blue {
  background:
    repeating-linear-gradient(45deg, rgba(236, 244, 255, 0.15) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(236, 244, 255, 0.15) 0 2px, transparent 2px 6px),
    linear-gradient(155deg, #2b64ad 0%, var(--club-blue) 55%, var(--club-deep) 100%);
  color: #fffaf0;
  box-shadow:
    inset 0 0 0 1px rgba(212, 230, 255, 0.52),
    0 0 0 1px rgba(130, 114, 88, 0.55),
    0 2px 0 #c6b89e,
    0 5px 10px rgba(48, 36, 16, 0.34);
}

.lead-card .back-emblem {
  font-size: 1.15rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.lead-card .back-sub {
  font-family: var(--font-serif);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  color: #ffe8b0;
}

.lead-card.item {
  width: auto;
  min-width: 4.1rem;
  padding: 0 0.5rem;
  border: 2px solid #966a1d;
  background: linear-gradient(160deg, #fff3cc 0%, #ecc368 55%, #d09e3d 100%);
  color: #541414;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 232, 0.65),
    0 2px 0 #8a6018,
    0 5px 10px rgba(48, 36, 16, 0.3);
}

.lead-hint {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-mid);
}

/* 中央霞光绸麻桌垫（直接平铺于榻榻米上的织物桌席） */
.panel.arena-panel {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.arena {
  position: relative;
  min-height: 124px;
  padding: 0.55rem 0.55rem 1.7rem;
  border-radius: 6px;
  border: 2px solid rgba(255, 245, 224, 0.78);
  outline: 1.5px dashed rgba(168, 108, 72, 0.45);
  outline-offset: -5px;
  background-color: var(--silk-cream);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%239c5d46' stroke-opacity='0.14' stroke-width='0.9'%3E%3Cpath d='M24 0L48 24L24 48L0 24Z'/%3E%3Cpath d='M24 0V48M0 24H48M0 0L48 48M48 0L0 48'/%3E%3Cpath d='M12 12L24 0L36 12L48 24L36 36L24 48L12 36L0 24Z'/%3E%3C/g%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 3px),
    linear-gradient(128deg, #e2ab92 0%, #eec9a8 28%, #f6e7c8 56%, #ebd0a3 82%, #dfa98c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(176, 124, 78, 0.25),
    0 10px 22px rgba(48, 38, 14, 0.36),
    0 3px 6px rgba(48, 38, 14, 0.26);
}

.clash {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  perspective: 800px;
}

.clash-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
}

.mini-row {
  display: flex;
  gap: 0.3rem;
  min-height: 3.35rem;
}

/* 决胜席实体扑克亮牌（左上+右下镜像角标 + 中央大点数花色） */
.mini {
  position: relative;
  width: 2.6rem;
  height: 3.5rem;
  border-radius: 5px;
  border: 1px solid var(--card-edge);
  background: linear-gradient(170deg, #ffffff 0%, var(--card-white) 62%, var(--card-cream) 100%);
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-weight: 900;
  box-shadow:
    0 2px 0 var(--card-bevel),
    0 5px 10px rgba(48, 28, 14, 0.3);
}

.mini.face.odd {
  color: var(--heart-red);
}

.mini.face.even {
  color: var(--club-blue);
}

.mini-idx {
  position: absolute;
  font-size: 0.48rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.mini-idx.tl {
  top: 2px;
  left: 3px;
}

.mini-idx.br {
  bottom: 2px;
  right: 3px;
  transform: rotate(180deg);
}

.mini-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.mini-num {
  font-size: 1rem;
  font-weight: 900;
}

.mini-suit {
  font-size: 0.62rem;
  line-height: 1;
  margin-top: 1px;
}

.mini.back {
  border: 2px solid var(--card-white);
  color: #fffaf0;
}

.mini.back.red {
  background:
    repeating-linear-gradient(45deg, rgba(255, 236, 212, 0.16) 0 2px, transparent 2px 5px),
    linear-gradient(150deg, #d62e36, var(--heart-deep));
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 178, 0.5),
    0 2px 0 var(--card-bevel),
    0 5px 10px rgba(48, 28, 14, 0.3);
}

.mini.back.blue {
  background:
    repeating-linear-gradient(-45deg, rgba(236, 244, 255, 0.16) 0 2px, transparent 2px 5px),
    linear-gradient(150deg, #2b64ad, var(--club-deep));
  box-shadow:
    inset 0 0 0 1px rgba(212, 230, 255, 0.5),
    0 2px 0 var(--card-bevel),
    0 5px 10px rgba(48, 28, 14, 0.3);
}

.mini.back .back-emblem {
  font-size: 1.05rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.mini.item {
  width: auto;
  min-width: 3.35rem;
  padding: 0 0.4rem;
  border: 1.5px solid #966a1d;
  background: linear-gradient(160deg, #fff3cc 0%, #ecc368 55%, #d09e3d 100%);
  color: #541414;
  font-family: var(--font-serif);
  font-size: 0.64rem;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 232, 0.65),
    0 2px 0 #8a6018,
    0 4px 8px rgba(48, 28, 14, 0.28);
}

.eff-tag {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.96rem;
  color: #3d1c14;
  text-shadow: 0 1px 0 rgba(255, 250, 236, 0.7);
}

.eff-tag.foe {
  color: #6b3528;
}

.clash-vs {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  color: var(--sakura);
  text-shadow: 0 1px 0 rgba(255, 248, 228, 0.78);
  transition: transform 0.2s ease;
}

.clash.pulse .clash-vs {
  transform: scale(1.26);
  color: #a8171c;
}

/* 「下克上」和为 14 朱金反杀动画 */
.arena.upset-hit {
  border-color: var(--heart-red);
  outline-color: rgba(200, 35, 44, 0.6);
  background-image:
    radial-gradient(ellipse at 50% 45%, rgba(255, 228, 140, 0.5), rgba(200, 35, 44, 0.16) 58%, transparent 88%),
    linear-gradient(128deg, #e7ad90 0%, #f7e4bc 50%, #e4a386 100%);
  animation: upset-shock 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.arena.upset-hit .clash-vs {
  transform: scale(1.4) rotate(-6deg);
}

.clash-side.upset-win .mini {
  box-shadow:
    0 0 0 2.5px #f0b83e,
    0 0 18px rgba(240, 184, 62, 0.78),
    0 8px 16px rgba(82, 22, 14, 0.38);
  animation: upset-lift 0.55s cubic-bezier(0.2, 1.35, 0.4, 1) forwards;
}

.clash-side.upset-win .eff-tag {
  color: var(--heart-red);
  transform: scale(1.14);
  transition: transform 0.25s ease;
}

.clash-side.upset-ko .mini {
  filter: saturate(0.35) brightness(0.82);
  animation: upset-ko-shake 0.48s ease-out forwards;
}

.clash-side.upset-ko .eff-tag {
  opacity: 0.55;
  text-decoration: line-through;
}

.upset-banner {
  position: absolute;
  top: 0.3rem;
  left: 0.45rem;
  z-index: 3;
  pointer-events: none;
  padding: 0.15rem 0.54rem;
  border-radius: 6px;
  border: 1.5px solid var(--gold-hot);
  background: linear-gradient(135deg, #c62828, #831416);
  color: #fff6dc;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(120, 20, 18, 0.4);
  animation: upset-pop 0.42s cubic-bezier(0.2, 1.45, 0.4, 1) forwards;
}

.upset-banner[hidden] {
  display: none;
}

/* 「第二轮道具刷新」中央桌席朱金横幅（绝不漏看） */
.arena.wave2-hit {
  border-color: #f2be47;
  outline-color: rgba(196, 48, 44, 0.65);
  animation: wave2-arena-burst 0.8s cubic-bezier(0.2, 1, 0.35, 1) forwards;
}

.wave2-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.16rem;
  margin: 0.3rem auto 0;
  padding: 0.3rem 0.72rem;
  max-width: 100%;
  border-radius: 8px;
  border: 1.5px solid var(--gold-hot);
  background: linear-gradient(135deg, #c22826 0%, #8e1617 65%, #6b1012 100%);
  box-shadow:
    0 6px 18px rgba(102, 20, 16, 0.46),
    0 0 0 2px rgba(255, 226, 140, 0.55);
  animation: wave2-banner-slam 0.52s cubic-bezier(0.18, 1.4, 0.35, 1) both;
  z-index: 4;
}

.wave2-banner[hidden] {
  display: none;
}

.wave2-banner-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  color: var(--gold-hot);
  text-shadow: 0 1px 2px rgba(48, 6, 8, 0.75);
}

.wave2-banner-targets {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 0.08rem 0.52rem;
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.96);
  border: 1px solid var(--gold);
  color: #6b1416;
}

@keyframes wave2-arena-burst {
  0% {
    box-shadow: 0 0 0 0 rgba(242, 190, 71, 0.9), 0 10px 22px rgba(48, 38, 14, 0.36);
  }
  50% {
    box-shadow: 0 0 24px 5px rgba(242, 190, 71, 0.65), 0 10px 22px rgba(48, 38, 14, 0.36);
  }
  100% {
    box-shadow: 0 0 12px 2px rgba(242, 190, 71, 0.42), 0 10px 22px rgba(48, 38, 14, 0.36);
  }
}

@keyframes wave2-banner-slam {
  0% {
    opacity: 0;
    transform: scale(1.22) translateY(-6px);
  }
  60% {
    opacity: 1;
    transform: scale(0.97) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 「隐藏成语」朱印盖章横幅 */
.arena.idiom-hit {
  border-color: var(--gold);
  animation: idiom-arena-pulse 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.idiom-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.32rem;
  margin-top: 0.3rem;
  z-index: 3;
}

.idiom-banner[hidden] {
  display: none;
}

.idiom-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.24rem 0.56rem;
  border-radius: 8px;
  border: 1.5px solid var(--gold);
  background: linear-gradient(155deg, #fffaf0, #f5e6c8);
  box-shadow:
    0 5px 14px rgba(72, 34, 16, 0.34),
    inset 0 0 0 1px rgba(200, 35, 44, 0.2);
  animation: idiom-stamp 0.48s cubic-bezier(0.18, 1.45, 0.35, 1) both;
}

.idiom-seal-tag {
  font-family: var(--font-serif);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fffaf0;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  background: var(--heart-red);
  white-space: nowrap;
}

.idiom-seal-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.idiom-seal-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: #5c1414;
}

.idiom-seal-desc {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--ink-mid);
  white-space: nowrap;
}

.idiom-seal-bonus {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.68rem;
  padding: 0.14rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}

.idiom-seal-bonus.you {
  color: #165e39;
  border: 1px solid rgba(30, 122, 76, 0.45);
  background: rgba(30, 122, 76, 0.14);
}

.idiom-seal-bonus.ai {
  color: var(--heart-red);
  border: 1px solid rgba(200, 35, 44, 0.45);
  background: rgba(200, 35, 44, 0.12);
}

.status-block.score.idiom-score-pop {
  border-radius: 6px;
  animation: idiom-score-glow 1.1s ease-out;
}

@keyframes idiom-arena-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 161, 62, 0.85), 0 10px 22px rgba(48, 38, 14, 0.36);
  }
  50% {
    box-shadow: 0 0 22px 4px rgba(212, 161, 62, 0.5), 0 10px 22px rgba(48, 38, 14, 0.36);
  }
  100% {
    box-shadow: 0 10px 22px rgba(48, 38, 14, 0.36);
  }
}

@keyframes idiom-stamp {
  0% {
    opacity: 0;
    transform: scale(1.26) rotate(-2deg) translateY(-6px);
  }
  60% {
    opacity: 1;
    transform: scale(0.97) rotate(0.5deg) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateY(0);
  }
}

@keyframes idiom-score-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 161, 62, 0.85);
    background: rgba(255, 226, 140, 0.55);
  }
  55% {
    box-shadow: 0 0 14px 3px rgba(212, 161, 62, 0.45);
    background: rgba(255, 226, 140, 0.25);
  }
  100% {
    box-shadow: none;
    background: transparent;
  }
}

.round-reveal.upset .reveal-value {
  color: var(--heart-red);
}

@keyframes upset-shock {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 35, 44, 0.72), 0 10px 22px rgba(48, 38, 14, 0.36);
    transform: scale(1.015);
  }
  45% {
    box-shadow: 0 0 24px 4px rgba(240, 184, 62, 0.65), 0 10px 22px rgba(48, 38, 14, 0.36);
    transform: scale(0.996);
  }
  100% {
    box-shadow: 0 10px 22px rgba(48, 38, 14, 0.36);
    transform: scale(1);
  }
}

@keyframes upset-lift {
  0% {
    transform: translateY(0) scale(1);
  }
  55% {
    transform: translateY(-7px) scale(1.12);
  }
  100% {
    transform: translateY(-4px) scale(1.06);
  }
}

@keyframes upset-ko-shake {
  0% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-4px) rotate(-4deg); }
  45% { transform: translateX(4px) rotate(3.5deg); }
  70% { transform: translateX(-2px) rotate(-2deg); }
  100% { transform: translateX(0) rotate(-2deg) scale(0.94); }
}

@keyframes upset-pop {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.72);
  }
  70% {
    opacity: 1;
    transform: translateY(1px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.arena-status {
  text-align: center;
  margin-top: 0.28rem;
  font-family: var(--font-serif);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #4c271c;
  font-size: 0.82rem;
}

.arena-status.hidden {
  opacity: 0;
}

.round-reveal {
  position: absolute;
  right: 0.5rem;
  bottom: 0.3rem;
  text-align: right;
}

.round-reveal[hidden] {
  display: none;
}

.reveal-label {
  display: block;
  font-size: 0.56rem;
  font-weight: 700;
  color: #7d4a36;
  letter-spacing: 0.12em;
}

.reveal-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.12rem;
  color: #8f181c;
  text-shadow: 0 1px 0 rgba(255, 250, 236, 0.72);
}

/* 手牌区：绯红樱花布托盘上的实体扑克牌（1–13 ♥红心奇 / ♣梅花偶）+ 烫金道具牌 */
.hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.15rem, 1fr));
  gap: 0.38rem;
}

.hand-card {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-edge);
  border-radius: 6px;
  min-height: 3.7rem;
  background: linear-gradient(170deg, #ffffff 0%, var(--card-white) 62%, var(--card-cream) 100%);
  color: var(--ink);
  font-family: var(--font-num);
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 0 var(--card-bevel),
    0 4px 8px rgba(58, 12, 12, 0.38);
  transition: transform 0.14s cubic-bezier(0.2, 1.25, 0.35, 1), box-shadow 0.16s ease;
  touch-action: manipulation;
  user-select: none;
  padding: 0.18rem 0.12rem;
}

.hand-card.odd {
  color: var(--heart-red);
}

.hand-card.even {
  color: var(--club-blue);
}

/* 经典扑克左上角标（点数+花色，绝不与右上角「宝」重叠） */
.hand-card .pk-idx {
  position: absolute;
  top: 2px;
  left: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  pointer-events: none;
}

.hand-card .pk-n {
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hand-card .pk-s {
  font-size: 0.46rem;
  line-height: 0.95;
}

.hand-card .pk-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0.56rem;
  line-height: 1;
  pointer-events: none;
}

.hand-card .face {
  line-height: 0.98;
  font-size: 1.15rem;
  font-weight: 900;
}

.hand-card .pk-suit {
  font-size: 0.64rem;
  line-height: 1;
  margin-top: 0.06rem;
}

/* 可抢解锁板目标手牌实时金框 + 右上角朱金「宝」小印 */
.hand-card.unlock-match {
  border-color: #f3c44e;
  box-shadow:
    0 0 0 2px #ffe07d,
    0 0 12px rgba(255, 224, 125, 0.78),
    0 2px 0 #c9992e,
    0 5px 10px rgba(58, 12, 12, 0.42);
}

.hand-card .unlock-pip {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0.02rem 0.16rem;
  border-radius: 3px;
  background: linear-gradient(145deg, #d8342a, #921614);
  border: 1px solid #ffe28c;
  color: #fff6d4;
  font-family: var(--font-serif);
  font-size: 0.46rem;
  font-weight: 900;
  line-height: 1.12;
  box-shadow: 0 1px 3px rgba(52, 10, 10, 0.4);
  pointer-events: none;
  z-index: 2;
}

.hand-card.unlock-match.wave2-pop {
  animation: hand-wave2-pop 0.85s cubic-bezier(0.2, 1.35, 0.35, 1) 2;
}

@keyframes hand-wave2-pop {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 2px #ffe07d, 0 0 10px rgba(255, 224, 125, 0.75);
  }
  45% {
    transform: translateY(-5px) scale(1.08);
    box-shadow:
      0 0 0 3px #fff0b3,
      0 0 20px rgba(255, 224, 125, 0.98),
      0 8px 14px rgba(58, 12, 12, 0.45);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 2px #ffe07d, 0 0 12px rgba(255, 224, 125, 0.78);
  }
}

/* 实体烫金道具牌（置于红布樱花托盘上对比极强） */
.hand-card.item {
  border: 1.5px solid #9e711f;
  background:
    linear-gradient(180deg, rgba(255, 250, 230, 0.5) 0 4px, transparent 4px),
    linear-gradient(160deg, #fff3cb 0%, #ecc468 55%, #cf9d3c 100%);
  color: #541414;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 224, 0.7),
    0 2px 0 #8a6018,
    0 4px 8px rgba(58, 12, 12, 0.4);
}

.hand-card .item-face {
  font-family: var(--font-serif);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.18;
  color: #541414;
  letter-spacing: 0.03em;
}

.hand-card .item-qty {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 0.2rem;
  border-radius: 4px;
  background: #8a1618;
  border: 1px solid #ffe28c;
  color: #fff6d6;
  font-family: var(--font-num);
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1.18;
  pointer-events: none;
}

.hand-card.item.has-qty .item-face {
  padding-top: 0.42rem;
}

.hand-card:hover:not(:disabled) {
  transform: translateY(-2px);
}

/* 选牌实体抬升与柔和桌面投影 */
.hand-card.selected {
  transform: translateY(-5px) scale(1.06);
  border-color: #f4c64d;
  box-shadow:
    0 0 0 2.5px #fff0b3,
    0 0 0 4.5px #f0b636,
    0 10px 16px rgba(48, 8, 8, 0.48);
  z-index: 3;
}

.hand-card:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.cta-row {
  display: flex;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 1.5px solid rgba(140, 108, 62, 0.55);
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.16em;
  padding: 0.64rem 1.25rem;
  min-height: 2.6rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.btn.primary {
  border: 1.5px solid #f4cc68;
  background: linear-gradient(180deg, #cf312b 0%, #961a19 100%);
  color: #fffaf0;
  text-shadow: 0 1px 2px rgba(62, 10, 10, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 184, 0.42),
    0 3px 0 #661012,
    0 6px 14px rgba(56, 30, 14, 0.34);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn.primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.ghost {
  background: var(--paper-light);
  color: var(--ink);
  border-color: rgba(140, 108, 62, 0.55);
  box-shadow: 0 2px 0 rgba(120, 92, 50, 0.3);
}

.btn.ghost:hover {
  border-color: var(--sakura);
  color: var(--sakura);
}

.btn.diff,
.btn.seat {
  background: linear-gradient(180deg, #fcf7eb, #efe2c8);
  color: var(--ink-mid);
  border: 1.5px solid rgba(154, 120, 74, 0.42);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  padding: 0.58rem 0.35rem;
  box-shadow: 0 2px 0 rgba(120, 92, 50, 0.32);
}

.btn.diff.selected,
.btn.seat.selected {
  border-color: #d4a13e;
  background: linear-gradient(180deg, #c22b27, #92191a);
  color: #fff8e6;
  text-shadow: 0 1px 1px rgba(56, 8, 8, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 184, 0.35),
    0 2px 0 #631012,
    0 4px 10px rgba(102, 22, 18, 0.28);
}

.result-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

.result-cell {
  width: 1.32rem;
  height: 1.32rem;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1.5px solid rgba(148, 118, 72, 0.38);
  background: rgba(255, 252, 244, 0.9);
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--ink-dim);
}

.result-cell.win {
  color: var(--jade);
  border-color: rgba(30, 122, 76, 0.55);
  background: rgba(30, 122, 76, 0.12);
}

.result-cell.loss {
  color: var(--heart-red);
  border-color: rgba(200, 35, 44, 0.55);
  background: rgba(200, 35, 44, 0.11);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(68, 62, 30, 0.42);
  backdrop-filter: blur(4px);
}

.overlay[hidden] {
  display: none;
}

.start-overlay {
  z-index: 30;
  align-items: center;
  place-items: center;
}

/* 明亮和纸桧木弹窗 */
.overlay-card {
  width: min(440px, 100%);
  border: 2px solid #b88b44;
  border-radius: 12px;
  background:
    linear-gradient(172deg, #fdf8ec 0%, #f4e8ce 100%);
  padding: 1.2rem 1.05rem 1rem;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 18px 40px rgba(46, 38, 16, 0.45),
    0 4px 10px rgba(46, 38, 16, 0.25);
}

.overlay-card.wide {
  width: min(920px, 100%);
  text-align: left;
}

.end-title {
  margin: 0.2rem 0 0.18rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 6.5vw, 2.35rem);
  letter-spacing: 0.16em;
  color: #361c12;
}

.start-title {
  margin-bottom: 0.1rem;
}

.end-sub {
  margin: 0 0 0.72rem;
  color: var(--ink-mid);
  font-size: 0.84rem;
  font-weight: 600;
}

.start-sub {
  margin: 0 0 0.6rem;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.rule-cards {
  display: grid;
  gap: 0.48rem;
  margin: 0 0 0.72rem;
  text-align: left;
}

.rule-card {
  display: grid;
  gap: 0.32rem;
  padding: 0.48rem 0.58rem 0.5rem;
  border-radius: 9px;
  border: 1px solid rgba(164, 124, 68, 0.42);
  background: linear-gradient(170deg, rgba(255, 252, 244, 0.92), rgba(246, 234, 208, 0.94));
  box-shadow: 0 2px 6px rgba(68, 48, 22, 0.12);
}

.rule-card.upset {
  border-color: rgba(196, 48, 44, 0.4);
  background: linear-gradient(170deg, rgba(255, 248, 240, 0.95), rgba(248, 228, 212, 0.94));
}

.rule-head {
  display: flex;
  align-items: center;
  gap: 0.34rem;
}

.rule-idx {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 0.84rem;
  line-height: 1;
  color: var(--sakura);
}

.rule-idx.gold {
  color: var(--heart-red);
}

.rule-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  color: #361c12;
}

.rule-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  padding: 0.34rem 0.42rem;
  border-radius: 7px;
  background: linear-gradient(130deg, rgba(226, 174, 146, 0.38), rgba(246, 231, 200, 0.62));
  border: 1px solid rgba(168, 126, 76, 0.3);
}

/* 开局示意迷你扑克牌 */
.rv-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 2.35rem;
  border-radius: 4px;
  border: 1px solid var(--card-edge);
  background: linear-gradient(170deg, #ffffff, var(--card-cream));
  font-family: var(--font-num);
  font-weight: 900;
  line-height: 1;
  color: var(--heart-red);
  box-shadow: 0 2px 0 var(--card-bevel), 0 3px 6px rgba(68, 36, 18, 0.22);
}

.rv-idx {
  font-size: 0.88rem;
}

.rv-suit {
  font-size: 0.56rem;
  margin-top: 1px;
}

.rv-card.odd {
  color: var(--heart-red);
}

.rv-card.win {
  border-color: #e6b13c;
  box-shadow:
    0 0 0 1.5px #ffd86b,
    0 2px 0 var(--card-bevel),
    0 4px 8px rgba(120, 48, 18, 0.28);
  transform: translateY(-1px) scale(1.04);
}

.rv-card.ko {
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--heart-red);
}

.rv-unlock {
  display: inline-grid;
  justify-items: center;
  gap: 0.04rem;
  padding: 0.2rem 0.46rem;
  border-radius: 6px;
  border: 1.5px solid #d4a13e;
  background: linear-gradient(165deg, #b32524, #7e1516);
  box-shadow: 0 2px 6px rgba(84, 18, 16, 0.25);
}

.rv-unlock-num {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.84rem;
  line-height: 1.05;
  color: var(--gold-hot);
}

.rv-unlock-lbl {
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff6e0;
}

.rv-arrow {
  color: #8f5c28;
  flex: 0 0 auto;
}

.rv-arrow.gold {
  color: var(--heart-red);
}

.rv-op {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.84rem;
  color: var(--ink-mid);
}

.rv-sum {
  display: inline-grid;
  place-items: center;
  min-width: 1.82rem;
  height: 1.58rem;
  padding: 0 0.28rem;
  border-radius: 5px;
  border: 1.5px solid #c9912e;
  background: #fff6dc;
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 0.86rem;
  color: #7c3c0e;
}

.rv-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.46rem;
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.rv-badge.cyan {
  border: 1px solid #c9912e;
  background: linear-gradient(160deg, #fff3cc, #ecc368);
  color: #541414;
}

.rv-badge.gold {
  border: 1px solid #e6b13c;
  background: linear-gradient(135deg, #c62828, #8c1618);
  color: #fff5d8;
}

.rule-cap {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.36;
  color: var(--ink-mid);
  font-weight: 500;
}

.start-label {
  margin: 0.1rem 0 0.28rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: #542216;
  text-align: left;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0 0 0.28rem;
}

.seat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0 0 0.28rem;
}

.diff-hint {
  margin: 0 0 0.6rem;
  color: var(--ink-mid);
  font-size: 0.74rem;
  line-height: 1.36;
  text-align: left;
}

.start-card .btn.primary {
  width: 100%;
}

.start-version {
  margin: 0.46rem 0 0;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-align: center;
}

/* 解锁板：绯红樱花布托盘 + 暗纹槽位 + 第二轮 3D 阶梯翻转闪耀 */
.unlock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.34rem;
}

.unlock-panel .panel-title {
  margin: 0;
}

.wave-badge {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.46rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 232, 184, 0.45);
  background: rgba(54, 10, 12, 0.56);
  color: #f7e4c0;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.wave-badge.wave2 {
  border-color: #fff3c4;
  background: linear-gradient(135deg, #ffe28c, #e5aa36);
  color: #5c1012;
  font-weight: 900;
  box-shadow:
    0 0 12px rgba(255, 226, 140, 0.82),
    0 2px 6px rgba(48, 8, 8, 0.4);
  animation: wave2-badge-glow 1.8s ease-in-out infinite;
}

@keyframes wave2-badge-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 226, 140, 0.65), 0 2px 5px rgba(48, 8, 8, 0.38);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 240, 186, 0.96), 0 2px 8px rgba(48, 8, 8, 0.45);
  }
}

.unlock-panel.wave2-flash {
  border-color: #ffe28c;
  animation: wave2-panel-pulse 1.15s cubic-bezier(0.22, 1, 0.36, 1) 2;
}

.unlock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.34rem;
  perspective: 700px;
}

.unlock-cell {
  position: relative;
  display: grid;
  gap: 0.08rem;
  justify-items: center;
  padding: 0.32rem 0.22rem;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 224, 152, 0.55);
  background: rgba(56, 10, 12, 0.52);
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 184, 0.18),
    0 2px 5px rgba(48, 8, 8, 0.3);
  transform-style: preserve-3d;
}

.unlock-panel.wave2-flash .unlock-cell {
  border-color: #fff0b3;
  background: rgba(74, 14, 14, 0.72);
  animation: wave2-slot-flip 0.68s cubic-bezier(0.2, 1.32, 0.35, 1) both;
  animation-delay: calc(var(--slot-idx, 0) * 90ms);
}

@keyframes wave2-panel-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 226, 140, 0.92), 0 6px 16px rgba(52, 34, 14, 0.36);
  }
  50% {
    box-shadow: 0 0 22px 4px rgba(255, 226, 140, 0.68), 0 6px 16px rgba(52, 34, 14, 0.36);
  }
  100% {
    box-shadow: 0 6px 16px rgba(52, 34, 14, 0.36);
  }
}

@keyframes wave2-slot-flip {
  0% {
    opacity: 0.15;
    transform: rotateY(-88deg) translateY(-8px) scale(0.86);
  }
  55% {
    opacity: 1;
    transform: rotateY(10deg) translateY(1px) scale(1.07);
    box-shadow: 0 0 16px rgba(255, 226, 140, 0.88);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) translateY(0) scale(1);
    box-shadow: 0 0 8px rgba(255, 226, 140, 0.45);
  }
}

.unlock-target {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 1.06rem;
  line-height: 1.04;
  color: var(--gold-hot);
  text-shadow: 0 1px 2px rgba(48, 8, 8, 0.75);
}

.unlock-item {
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff8ea;
  line-height: 1.2;
}

.unlock-who {
  font-size: 0.56rem;
  font-weight: 700;
  color: rgba(255, 232, 198, 0.82);
}

.unlock-cell.claimed {
  opacity: 0.56;
  border-style: dashed;
  border-color: rgba(255, 224, 180, 0.32);
  background: rgba(44, 8, 10, 0.42);
}

.unlock-cell.claimed.you {
  border-color: rgba(164, 240, 198, 0.72);
}

.unlock-cell.claimed.you .unlock-who {
  color: #b7f5d2;
}

.unlock-cell.claimed.ai {
  border-color: rgba(255, 196, 184, 0.65);
}

.unlock-cell.claimed.ai .unlock-who {
  color: #ffd5cc;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* 回顾本局：朱印隐藏成语面板（明亮和纸+绯红风格） */
.review-idioms-section {
  margin: 0 0 0.72rem;
  padding: 0.52rem 0.62rem;
  border-radius: 10px;
  border: 1.5px solid rgba(168, 124, 64, 0.45);
  background: linear-gradient(170deg, rgba(255, 251, 240, 0.94), rgba(244, 231, 202, 0.94));
}

.review-idioms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.42rem;
}

.review-idioms-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--sakura);
}

.review-idioms-sub {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ink-dim);
}

.review-idioms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.review-idiom-card {
  display: grid;
  gap: 0.18rem;
  padding: 0.42rem 0.48rem;
  border-radius: 8px;
  border: 1px solid rgba(154, 120, 74, 0.3);
  background: rgba(255, 252, 246, 0.78);
}

.review-idiom-card.triggered {
  border-color: #d4a13e;
  background: linear-gradient(160deg, #fffaf0, #f9e8be);
  box-shadow: 0 2px 8px rgba(140, 96, 28, 0.18);
}

.review-idiom-card.triggered.by-ai {
  border-color: rgba(200, 35, 44, 0.52);
  background: linear-gradient(160deg, #fff8f6, #fae0dc);
}

.review-idiom-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.24rem;
}

.review-idiom-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.review-idiom-card.triggered .review-idiom-name {
  color: #541414;
}

.review-idiom-state {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  white-space: nowrap;
}

.review-idiom-state.muted {
  color: var(--ink-dim);
  background: rgba(120, 96, 68, 0.1);
}

.review-idiom-state.you {
  color: #165e39;
  border: 1px solid rgba(30, 122, 76, 0.45);
  background: rgba(30, 122, 76, 0.14);
}

.review-idiom-state.ai {
  color: var(--heart-red);
  border: 1px solid rgba(200, 35, 44, 0.45);
  background: rgba(200, 35, 44, 0.12);
}

.review-idiom-meta {
  font-size: 0.64rem;
  color: var(--ink-dim);
  line-height: 1.25;
}

.review-idiom-card.triggered .review-idiom-meta {
  color: var(--ink-mid);
}

.review-table tr.idiom-row td {
  background: rgba(255, 226, 140, 0.28);
}

.idiom-inline-tag {
  display: inline-block;
  margin-left: 0.22rem;
  padding: 0.02rem 0.26rem;
  border-radius: 4px;
  border: 1px solid rgba(200, 35, 44, 0.45);
  background: rgba(200, 35, 44, 0.12);
  color: #8f141b;
  font-size: 0.68rem;
  font-weight: 800;
}

.review-rounds {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 0.85rem;
  border: 1.5px solid rgba(154, 120, 74, 0.42);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  color: var(--ink);
}

.review-table th,
.review-table td {
  padding: 0.45rem;
  border-bottom: 1px solid rgba(154, 120, 74, 0.2);
  white-space: nowrap;
  text-align: left;
}

.review-table th {
  font-family: var(--font-display);
  font-weight: 900;
  color: #fff6e0;
  background: var(--sakura);
}

.review-table tr.upset-row td {
  background: rgba(200, 35, 44, 0.12);
  color: #6b1416;
}

.final-line {
  margin: 0 0 0.8rem;
  color: var(--sakura);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

@keyframes slam-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  html,
  body {
    height: 100%;
    height: 100dvh;
  }

  body {
    overflow: hidden;
  }

  .stage {
    width: min(calc(100% - 0.65rem), 920px);
    height: 100dvh;
    max-height: 100dvh;
    padding: max(0.28rem, env(safe-area-inset-top, 0px)) 0 max(0.28rem, env(safe-area-inset-bottom, 0px));
    gap: 0.22rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .brand-block {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.42rem;
    padding: 0;
    animation: none;
  }

  .brand {
    font-size: 1.04rem;
    letter-spacing: 0.14em;
  }

  .tagline {
    margin: 0;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
  }

  .lede {
    display: none;
  }

  .play-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 0.92fr) minmax(0, 1.05fr) auto auto;
    gap: 0.2rem;
    overflow: hidden;
  }

  .overlay-card.start-card {
    padding: 0.92rem 0.82rem 0.78rem;
  }

  .rule-cards {
    gap: 0.4rem;
    margin-bottom: 0.6rem;
  }

  .rule-card {
    padding: 0.42rem 0.5rem 0.44rem;
    gap: 0.26rem;
  }

  .rule-name {
    font-size: 0.82rem;
  }

  .rule-visual {
    gap: 0.26rem;
    padding: 0.28rem 0.32rem;
  }

  .rv-card {
    width: 1.72rem;
    height: 2.12rem;
  }

  .rv-idx {
    font-size: 0.8rem;
  }

  .rv-suit {
    font-size: 0.5rem;
  }

  .rv-badge {
    font-size: 0.6rem;
    padding: 0.16rem 0.38rem;
  }

  .rule-cap {
    font-size: 0.66rem;
  }

  .start-version {
    margin-top: 0.4rem;
    font-size: 0.61rem;
  }

  .unlock-panel::after {
    height: 1.42rem;
  }

  .unlock-header {
    margin-bottom: 0.18rem;
  }

  .wave-badge {
    font-size: 0.55rem;
    padding: 0.05rem 0.34rem;
  }

  .hand-card .item-qty {
    font-size: 0.44rem;
    padding: 0 0.15rem;
    top: 1px;
    right: 1px;
  }

  .hand-card .unlock-pip {
    font-size: 0.4rem;
    padding: 0 0.12rem;
    top: 1px;
    right: 1px;
  }

  .hand-card.item.has-qty .item-face {
    padding-top: 0.42rem;
  }

  .unlock-grid {
    gap: 0.22rem;
  }

  .unlock-cell {
    padding: 0.22rem 0.14rem;
  }

  .unlock-target {
    font-size: 0.9rem;
  }

  .unlock-item {
    font-size: 0.52rem;
  }

  .seat-grid .btn.seat {
    width: auto;
    min-height: 2.2rem;
  }

  .panel {
    padding: 0.26rem 0.4rem 0.3rem;
    border-radius: 8px;
  }

  .panel.arena-panel {
    padding: 0;
  }

  .panel-title {
    margin: 0 0 0.18rem;
    font-size: 0.68rem;
  }

  .status-row {
    flex-wrap: nowrap;
    gap: 0.2rem;
  }

  .status-value {
    font-size: 0.88rem;
  }

  .diff-badge {
    font-size: 0.8rem !important;
  }

  .status-label {
    font-size: 0.48rem;
    letter-spacing: 0.04em;
  }

  .chip {
    font-size: 0.55rem;
    padding: 0.11rem 0.28rem;
  }

  .lead-card {
    width: 2.32rem;
    height: 3.05rem;
  }

  .lead-card .back-emblem {
    font-size: 0.95rem;
  }

  .lead-card .back-sub {
    font-size: 0.5rem;
  }

  .lead-card.item {
    min-width: 3.3rem;
    font-size: 0.58rem;
  }

  .lead-hint {
    margin-top: 0.18rem;
    font-size: 0.66rem;
  }

  .arena {
    min-height: 0;
    height: 100%;
    padding: 0.28rem 0.42rem 0.34rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .clash {
    gap: 0.55rem;
  }

  .clash-side {
    gap: 0.12rem;
  }

  .mini-row {
    min-height: 2.95rem;
    gap: 0.22rem;
  }

  .mini {
    width: 2.26rem;
    height: 2.98rem;
  }

  .mini-idx {
    font-size: 0.39rem;
  }

  .mini-idx.tl {
    top: 2px;
    left: 2.5px;
  }

  .mini-idx.br {
    bottom: 2px;
    right: 2.5px;
  }

  .mini-num {
    font-size: 0.84rem;
  }

  .mini-suit {
    font-size: 0.48rem;
  }

  .mini.item {
    min-width: 2.7rem;
    padding: 0 0.28rem;
    font-size: 0.56rem;
  }

  .eff-tag {
    font-size: 0.78rem;
  }

  .arena-status {
    margin-top: 0.16rem;
    font-size: 0.64rem;
    line-height: 1.24;
  }

  .round-reveal {
    top: 0.22rem;
    right: 0.42rem;
    bottom: auto;
  }

  .upset-banner {
    top: 0.22rem;
    left: 0.36rem;
    padding: 0.1rem 0.42rem;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }

  .wave2-banner {
    margin-top: 0.16rem;
    padding: 0.18rem 0.5rem;
    gap: 0.08rem;
  }

  .wave2-banner-title {
    font-size: 0.67rem;
    letter-spacing: 0.05em;
  }

  .wave2-banner-targets {
    font-size: 0.58rem;
    padding: 0.04rem 0.38rem;
  }

  .idiom-banner {
    margin-top: 0.16rem;
    gap: 0.2rem;
  }

  .idiom-seal {
    padding: 0.15rem 0.4rem;
    gap: 0.26rem;
    border-radius: 7px;
  }

  .idiom-seal-tag {
    font-size: 0.5rem;
    padding: 0.04rem 0.22rem;
  }

  .idiom-seal-name {
    font-size: 0.74rem;
  }

  .idiom-seal-desc {
    font-size: 0.52rem;
  }

  .idiom-seal-bonus {
    font-size: 0.58rem;
    padding: 0.07rem 0.28rem;
  }

  .review-idioms-section {
    padding: 0.4rem 0.44rem;
    margin-bottom: 0.52rem;
  }

  .review-idioms-grid {
    gap: 0.32rem;
  }

  .review-idiom-card {
    min-width: 0;
    padding: 0.32rem 0.36rem;
  }

  .review-idiom-top {
    flex-wrap: wrap;
    gap: 0.14rem 0.22rem;
  }

  .review-idiom-name {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .review-idiom-state,
  .review-idiom-meta {
    font-size: 0.56rem;
    word-break: break-word;
  }

  /* Mobile Replay: vertical stacked cards with zero horizontal scroll */
  #reviewOverlay .overlay-card.wide {
    padding: 0.85rem 0.65rem 0.8rem;
    overflow-x: hidden;
  }

  #reviewOverlay .table-wrap {
    display: none;
  }

  .review-rounds {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.62rem;
    width: 100%;
    min-width: 0;
  }

  .review-round-card {
    display: grid;
    gap: 0.26rem;
    padding: 0.42rem 0.48rem;
    border-radius: 8px;
    border: 1px solid rgba(154, 120, 74, 0.36);
    background: rgba(255, 252, 245, 0.92);
    min-width: 0;
  }

  .review-round-card.upset-row {
    border-color: rgba(200, 35, 44, 0.5);
    background: linear-gradient(155deg, #fff8f4, #fae2d8);
  }

  .review-round-card.idiom-row {
    border-color: #d4a13e;
    box-shadow: inset 0 0 0 1px rgba(212, 161, 62, 0.25);
  }

  .rr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    min-width: 0;
  }

  .rr-round {
    font-family: var(--font-num);
    font-weight: 900;
    font-size: 0.72rem;
    color: var(--sakura);
    letter-spacing: 0.04em;
  }

  .rr-seat {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--ink-dim);
    margin-left: 0.2rem;
  }

  .rr-result {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.07rem 0.4rem;
    border-radius: 5px;
    white-space: nowrap;
  }

  .rr-result.win {
    color: #165e39;
    border: 1px solid rgba(30, 122, 76, 0.45);
    background: rgba(30, 122, 76, 0.14);
  }

  .rr-result.loss {
    color: var(--heart-red);
    border: 1px solid rgba(200, 35, 44, 0.45);
    background: rgba(200, 35, 44, 0.12);
  }

  .rr-result.draw {
    color: var(--ink-dim);
    border: 1px solid rgba(140, 114, 78, 0.32);
    background: rgba(140, 114, 78, 0.08);
  }

  .rr-result.upset {
    color: #fff6dc;
    border: 1px solid #d4a13e;
    background: linear-gradient(135deg, #c62828, #8a1618);
  }

  .rr-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.28rem;
    padding: 0.24rem 0.36rem;
    border-radius: 6px;
    background: rgba(242, 232, 208, 0.65);
    border: 1px solid rgba(164, 126, 76, 0.24);
    font-size: 0.68rem;
    min-width: 0;
  }

  .rr-side {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    min-width: 0;
    flex-wrap: wrap;
  }

  .rr-side.ai {
    justify-content: flex-end;
    text-align: right;
  }

  .rr-who {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--ink-dim);
  }

  .rr-side.you .rr-who {
    color: var(--jade);
  }

  .rr-side.ai .rr-who {
    color: var(--sakura);
  }

  .rr-play {
    font-weight: 800;
    color: var(--ink);
    word-break: break-word;
  }

  .rr-play.odd {
    color: var(--heart-red);
  }

  .rr-play.even {
    color: var(--club-blue);
  }

  .rr-eff {
    font-family: var(--font-num);
    font-weight: 900;
    font-size: 0.7rem;
    color: #6b3b10;
  }

  .rr-vs {
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 0.6rem;
    color: var(--ink-dim);
  }

  .rr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    min-width: 0;
  }

  .rr-tag {
    font-size: 0.57rem;
    font-weight: 800;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    line-height: 1.25;
    max-width: 100%;
    word-break: break-word;
  }

  .rr-tag.unlock-you {
    color: #165e39;
    background: rgba(30, 122, 76, 0.12);
    border: 1px solid rgba(30, 122, 76, 0.38);
  }

  .rr-tag.unlock-ai {
    color: var(--heart-red);
    background: rgba(200, 35, 44, 0.11);
    border: 1px solid rgba(200, 35, 44, 0.36);
  }

  .rr-tag.wave2 {
    color: #fff6dc;
    background: var(--sakura);
    border: 1px solid #d4a13e;
  }

  .rr-tag.idiom {
    color: #6b3c0a;
    background: rgba(255, 226, 140, 0.45);
    border: 1px solid #d4a13e;
  }

  .reveal-label {
    font-size: 0.52rem;
  }

  .reveal-value {
    font-size: 0.88rem;
  }

  .hand-panel {
    min-height: 0;
    overflow: auto;
  }

  .hand-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.22rem;
  }

  .hand-card {
    min-height: 0;
    aspect-ratio: 0.77;
    padding: 0.1rem 0.06rem;
  }

  .hand-card .pk-idx {
    top: 1.5px;
    left: 2.5px;
  }

  .hand-card .pk-n {
    font-size: 0.44rem;
  }

  .hand-card .pk-s {
    font-size: 0.4rem;
  }

  .hand-card .pk-center {
    padding-top: 0.54rem;
  }

  .hand-card .face {
    font-size: 0.92rem;
  }

  .hand-card .pk-suit {
    font-size: 0.52rem;
    margin-top: 0.03rem;
  }

  .hand-card .item-face {
    font-size: 0.52rem;
  }

  .btn {
    width: 100%;
    min-height: 2.2rem;
    padding: 0.36rem 0.7rem;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
  }

  .result-cell {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.58rem;
  }

  .overlay {
    align-items: end;
    padding: 0.55rem;
    padding-bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
  }

  .start-overlay {
    align-items: center;
    place-items: center;
  }

  .overlay-card,
  .overlay-card.wide {
    width: 100%;
    max-height: min(92dvh, 100%);
    overflow: auto;
  }

  .overlay-actions {
    flex-direction: column;
  }

  .overlay-actions .btn {
    width: 100%;
  }

  .diff-grid .btn.diff {
    width: auto;
    min-height: 2.2rem;
  }
}

@media (max-width: 640px) and (max-height: 720px) {
  .lead-card {
    width: 2.08rem;
    height: 2.75rem;
  }

  .hand-card .pk-suit {
    display: none;
  }
}
