/* =========================================================
   枪王斗地主 · AK47 / 98K 特别版
   视觉：深绿牌桌 + 黄铜金 + 纸牌米白
   ========================================================= */

:root {
  --ink: #17130d;
  --paper: #f7f0df;
  --paper-2: #fffaf0;
  --gold: #d6b25e;
  --gold-bright: #f1d68d;
  --gold-deep: #9b762f;
  --green-950: #061b15;
  --green-900: #09261d;
  --green-800: #0d3327;
  --green-700: #124433;
  --green-600: #185841;
  --red: #b63131;
  --red-bright: #df4b4b;
  --muted: #9db6a9;
  --line: rgba(214, 178, 94, 0.28);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --card-w: 72px;
  --card-h: 100px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #06140f;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 50% 8%, #183d2f 0%, #0b241b 44%, #05120e 100%),
    #05120e;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 7px);
  mix-blend-mode: soft-light;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

#app {
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(16px, 3vw, 46px);
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(214, 178, 94, 0.13);
  background: linear-gradient(180deg, rgba(4, 17, 13, 0.78), rgba(4, 17, 13, 0.16));
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 250px;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(214, 178, 94, 0.65);
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 236, 174, 0.24), transparent 56%),
    linear-gradient(145deg, #163a2d, #081b14);
  box-shadow: inset 0 0 0 4px rgba(4, 17, 13, 0.55), 0 8px 20px rgba(0, 0, 0, 0.3);
}

.emblem-suit {
  font-size: 23px;
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.emblem-cross::before,
.emblem-cross::after {
  content: "";
  position: absolute;
  background: var(--gold);
  opacity: 0.4;
}
.emblem-cross::before { width: 1px; height: 52px; left: 50%; top: -5px; }
.emblem-cross::after { height: 1px; width: 52px; top: 50%; left: -5px; }

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f5e8c8;
}

.brand-text p {
  margin: 3px 0 0;
  color: #9eb8a8;
  font-size: 10px;
  letter-spacing: 0.24em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-text p span {
  color: var(--gold);
  border: 1px solid rgba(214, 178, 94, 0.35);
  border-radius: 999px;
  padding: 1px 6px;
  letter-spacing: 0.12em;
  font-size: 9px;
}

.top-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  padding: 8px 18px;
  border: 1px solid rgba(214, 178, 94, 0.12);
  border-radius: 999px;
  background: rgba(5, 20, 15, 0.36);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.stat-label { color: #8da99a; font-size: 10px; letter-spacing: 0.08em; }
.stat-item strong { color: #f2dfae; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.stat-divider { width: 1px; height: 14px; background: rgba(214, 178, 94, 0.18); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #b8c9bd;
  border: 1px solid transparent;
  transition: 180ms ease;
}

.icon-btn:hover {
  color: var(--gold-bright);
  border-color: rgba(214, 178, 94, 0.25);
  background: rgba(214, 178, 94, 0.06);
}

.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

.icon-btn.text-btn {
  width: auto;
  min-width: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.muted { color: #64786d; }

/* ---------------- 牌桌 ---------------- */
.game-main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 clamp(10px, 3vw, 44px) 14px;
  position: relative;
}

.table-stage {
  height: 100%;
  min-height: 560px;
  max-width: 1500px;
  margin: 0 auto;
  position: relative;
}

.felt {
  position: absolute;
  inset: 9px 1.5% 0;
  border-radius: 48% 48% 24% 24% / 38% 38% 16% 16%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(54, 132, 96, 0.21), transparent 56%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.34), transparent 62%),
    linear-gradient(180deg, #104633 0%, #0b3829 45%, #082b20 100%);
  border: 1px solid rgba(213, 177, 95, 0.32);
  box-shadow:
    inset 0 0 0 7px rgba(4, 19, 14, 0.35),
    inset 0 0 90px rgba(0, 0, 0, 0.48),
    0 30px 80px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.felt::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.085) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.felt-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.36) 100%);
  pointer-events: none;
}

.felt-line {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(214, 178, 94, 0.16);
  border-radius: 50%;
}

.felt-line-outer { inset: 4.6% 5.2% 9%; }
.felt-line-inner { inset: 7.2% 8.4% 12.5%; border-color: rgba(214, 178, 94, 0.09); }

.felt-watermark {
  position: absolute;
  font-family: var(--serif);
  font-size: clamp(100px, 15vw, 220px);
  color: rgba(214, 178, 94, 0.045);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.watermark-left { left: 5%; top: 26%; transform: rotate(-14deg); }
.watermark-right { right: 5%; top: 26%; transform: rotate(14deg); }

.felt-center-mark {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0.055;
  pointer-events: none;
  user-select: none;
}

.felt-center-mark span {
  display: block;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 86px);
  letter-spacing: 0.2em;
  color: #f3e2b4;
}

.felt-center-mark small {
  font-size: 10px;
  letter-spacing: 0.52em;
  color: #f3e2b4;
}

/* ---------------- 顶部底牌 / 底分 ---------------- */
.table-top {
  position: absolute;
  top: 2.1%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 46px);
  z-index: 4;
}

.bottom-cards-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bottom-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a9c1b3;
  font-size: 10px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.bottom-label i {
  font-style: normal;
  color: var(--gold);
  font-size: 9px;
  border: 1px solid rgba(214, 178, 94, 0.26);
  padding: 1px 6px;
  border-radius: 99px;
}

.bottom-cards { display: flex; gap: 5px; }

.bottom-cards .pcard {
  width: 42px;
  height: 58px;
  border-radius: 4px;
}

.bottom-cards .pcard-rank { font-size: 12px; }
.bottom-cards .pcard-suit { font-size: 10px; }
.bottom-cards .pcard-center { font-size: 17px; }
.bottom-cards .pcard-corner.br { display: none; }

.pot-wrap {
  min-width: 105px;
  padding: 4px 10px 0;
  text-align: center;
}

.pot-label { color: #9ab1a4; font-size: 9px; letter-spacing: 0.16em; }

.pot-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-family: var(--serif);
  color: #e8d19a;
  margin-top: 2px;
}

.pot-value span { font-size: 18px; opacity: 0.72; }
.pot-value i { font-style: normal; font-size: 12px; color: #86a193; }
.pot-value strong { font-size: 24px; color: var(--gold-bright); font-weight: 600; }
.pot-sub { color: #7f9b8c; font-size: 9px; letter-spacing: 0.08em; }

/* ---------------- 玩家席位 ---------------- */
.seat {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  width: clamp(150px, 15vw, 206px);
  padding: 8px 10px;
  border-radius: 18px;
  transition: background 220ms ease;
}

.seat-left { left: 2.4%; top: 41%; }
.seat-right { right: 2.4%; top: 41%; flex-direction: row-reverse; }

.seat-avatar {
  width: clamp(48px, 5vw, 68px);
  height: clamp(48px, 5vw, 68px);
  flex: 0 0 auto;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.15), transparent 42%),
    linear-gradient(145deg, #305947, #122d22);
  border: 1px solid rgba(214, 178, 94, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(5, 19, 14, 0.4);
}

.avatar-letter {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  color: #f0dda9;
  opacity: 0.92;
}

.seat-right .seat-avatar {
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.15), transparent 42%),
    linear-gradient(145deg, #4a3a2c, #221710);
}

.turn-orbit {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
}

.seat.active .turn-orbit,
.human-avatar.active .turn-orbit {
  border-color: rgba(241, 214, 141, 0.88);
  box-shadow: 0 0 18px rgba(241, 214, 141, 0.45), inset 0 0 12px rgba(241, 214, 141, 0.16);
  animation: orbitPulse 1.8s ease-in-out infinite;
}

.seat-info { min-width: 0; }
.seat-right .seat-info { text-align: right; }

.seat-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.seat-right .seat-name-row { justify-content: flex-end; }

.seat-name {
  color: #f1e4c1;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ai-tag {
  font-size: 8px;
  line-height: 1;
  color: #86a193;
  border: 1px solid rgba(134, 161, 147, 0.32);
  border-radius: 3px;
  padding: 2px 4px;
}

.seat-count {
  color: #a2b8ab;
  font-size: 11px;
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.seat-count strong { color: #f3dda8; font-family: var(--serif); font-size: 15px; }

.seat-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
  color: #7e998a;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.seat-right .seat-score { justify-content: flex-end; }
.seat-score strong { color: #e5cc8e; font-family: var(--serif); font-size: 12px; font-weight: 600; }
.seat-score strong.minus { color: #d89b9b; }

.human-score {
  color: #7e998a;
  font-size: 8px;
  letter-spacing: 0.04em;
  margin-left: 5px;
}
.human-score strong { color: #e5cc8e; font-family: var(--serif); font-size: 11px; }
.human-score strong.minus { color: #d89b9b; }

.seat-strength {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}

.seat-right .seat-strength { justify-content: flex-end; }

.seat-strength span {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.seat-strength span.on { background: rgba(214, 178, 94, 0.58); }

.role-badge {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 8px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 99px;
  white-space: nowrap;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #18372a;
  color: #d4e6da;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.role-badge.landlord {
  background: linear-gradient(180deg, #e6c577, #a67c2f);
  color: #261706;
  border-color: rgba(255, 241, 197, 0.6);
  font-weight: 700;
}

.seat-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 20%;
  padding: 5px 11px;
  border-radius: 10px 10px 10px 2px;
  background: rgba(249, 243, 226, 0.94);
  color: #3d3323;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: bubbleIn 200ms ease-out;
  z-index: 8;
}

.seat-right .seat-bubble {
  left: auto;
  right: 20%;
  border-radius: 10px 10px 2px 10px;
}

.seat-think {
  position: absolute;
  top: calc(100% + 8px);
  left: 18%;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(7, 27, 20, 0.82);
  border: 1px solid rgba(214, 178, 94, 0.22);
  backdrop-filter: blur(8px);
  z-index: 8;
}

.seat-right .seat-think { left: auto; right: 18%; }

.seat-think i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e8cf90;
  animation: thinkDot 1.2s infinite;
}
.seat-think i:nth-child(2) { animation-delay: 0.15s; }
.seat-think i:nth-child(3) { animation-delay: 0.3s; }
.seat-think em {
  font-style: normal;
  color: #adc4b6;
  font-size: 9px;
  margin-left: 3px;
  letter-spacing: 0.08em;
}

/* ---------------- 中央出牌区 ---------------- */
.center-area {
  position: absolute;
  left: 50%;
  top: 27.5%;
  transform: translateX(-50%);
  width: min(680px, 64%);
  min-height: 190px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.turn-label {
  min-height: 24px;
  padding: 4px 16px;
  border-radius: 99px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #e4d4a8;
  background: rgba(5, 22, 16, 0.46);
  border: 1px solid rgba(214, 178, 94, 0.16);
  opacity: 0;
  transition: opacity 180ms ease;
}

.turn-label.show { opacity: 1; }

.turn-label.your-turn {
  color: #2a1b08;
  background: linear-gradient(180deg, #f2d488, #c49a43);
  border-color: #f7e5b7;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(224, 187, 101, 0.35);
}

.last-play-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 122px;
  justify-content: center;
}

.last-play-meta {
  min-height: 18px;
  color: #a8c0b1;
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 7px;
  text-align: center;
}

.last-play-meta strong { color: #ecdaa9; font-weight: 500; }
.last-play-meta .combo-name { color: var(--gold-bright); margin-left: 6px; }

.last-play-cards {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 88px;
  flex-wrap: wrap;
  gap: 2px;
  gap: 0;
  max-width: 100%;
}

.last-play-cards .pcard {
  width: 58px;
  height: 81px;
  margin-left: 0;
  border-radius: 5px;
  animation: playIn 240ms cubic-bezier(0.2, 0.8, 0.3, 1);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
}
.last-play-cards .pcard-rank { font-size: 13px; }
.last-play-cards .pcard-suit { font-size: 11px; }
.last-play-cards .pcard-center { font-size: 20px; }

.last-play-cards .pcard.special-card {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(214, 178, 94, 0.45), 0 12px 24px rgba(0, 0, 0, 0.4);
}

.empty-play {
  color: rgba(223, 239, 230, 0.3);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.24em;
  min-height: 88px;
  display: grid;
  place-items: center;
}

.action-bubble {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 18px;
  border-radius: 99px;
  background: rgba(5, 22, 16, 0.84);
  border: 1px solid rgba(214, 178, 94, 0.3);
  color: #f2dfac;
  font-size: 11px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  animation: bubbleIn 220ms ease-out;
  z-index: 10;
}

/* ---------------- 手牌区 ---------------- */
.human-zone {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(980px, 96%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  padding-top: 4px;
}

.human-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 2px;
  min-height: 38px;
}

.human-identity { display: flex; align-items: center; gap: 9px; }

.human-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  font-family: var(--serif);
  font-size: 15px;
  color: #2a1c09;
  background: linear-gradient(145deg, #efd693, #b88c3d);
  border: 1px solid rgba(255, 240, 194, 0.6);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.human-avatar .turn-orbit { inset: -4px; }

.human-name-block { line-height: 1.1; }
.human-name-row { display: flex; align-items: center; gap: 6px; }
.human-name-row strong { font-size: 13px; color: #f3e5c0; letter-spacing: 0.06em; }
.human-role { position: static; transform: none; }

.human-count { color: #9fb8aa; font-size: 10px; margin-top: 3px; }
.human-count strong { color: var(--gold-bright); font-family: var(--serif); font-size: 13px; }

.special-ready {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 14px;
}

.special-ready:empty { display: none; }

.special-ready span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  border: 1px solid rgba(214, 178, 94, 0.34);
  background: rgba(214, 178, 94, 0.08);
  color: #e9d19a;
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.special-ready span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 5px rgba(241, 214, 141, 0.5);
}

.human-hand-hint {
  color: rgba(198, 218, 206, 0.45);
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-left: auto;
}

.sort-btn {
  border: 1px solid rgba(214, 178, 94, 0.2);
  color: #a9bdb0;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 99px;
  letter-spacing: 0.08em;
  transition: 160ms ease;
  white-space: nowrap;
  flex: 0 0 auto;
}

.sort-btn:hover { color: var(--gold-bright); border-color: rgba(214, 178, 94, 0.45); }

.sort-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  flex: 0 0 auto;
}

.sort-tools .sort-btn { padding: 5px 9px; font-size: 11px; }

.sort-btn.special-sort-btn {
  color: #e3c27c;
  border-color: rgba(214, 178, 94, 0.34);
  background: rgba(214, 178, 94, 0.06);
}

.hand .pcard.arranged-card {
  border-color: rgba(241, 214, 141, 0.9);
  box-shadow: 0 -3px 0 rgba(241, 214, 141, 0.9), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.hand .pcard.arranged-group-start {
  border-left: 2px solid rgba(241, 214, 141, 0.95);
  margin-left: calc(var(--hand-gap, -34px) + var(--arranged-group-gap, 8px));
}

@media (max-width: 620px) {
  .hand { --arranged-group-gap: 5px; }
}

.hand .pcard.arranged-card.selected {
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.42), 0 0 0 2px var(--gold-bright), 0 -4px 0 var(--gold-bright);
}

.hand .pcard.arranged-highlight {
  animation: groupGlow 700ms ease-in-out 2;
}

.sort-btn.cancel-sort-btn {
  color: #cf9a9a;
  border-color: rgba(196, 111, 111, 0.3);
}

.sort-btn.cancel-sort-btn:hover:not(:disabled) {
  color: #f1b8b8;
  border-color: rgba(220, 126, 126, 0.55);
}

.sort-btn.cancel-sort-btn:disabled { opacity: 0.35; }

@keyframes groupGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.counter-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(214, 178, 94, 0.17);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.counter-btn-hidden { display: none !important; }

.counter-drawer { width: min(440px, 94vw); }

.counter-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 178, 94, 0.25) transparent;
}

.counter-body::-webkit-scrollbar { width: 5px; }
.counter-body::-webkit-scrollbar-thumb { background: rgba(214, 178, 94, 0.25); border-radius: 4px; }

.counter-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.counter-summary div {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(214, 178, 94, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.counter-summary span {
  display: block;
  color: #80998b;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.counter-summary strong {
  display: block;
  margin-top: 3px;
  color: #efdca9;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.counter-summary strong small {
  color: #8ea698;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  margin-left: 3px;
}

.counter-wild {
  margin: -7px 0 14px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(181, 103, 91, 0.28);
  background: rgba(181, 103, 91, 0.08);
  color: #dec1a8;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.counter-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 0 9px;
  color: #d8c596;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.counter-section-title span {
  color: #758f81;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.counter-player {
  padding: 10px 12px;
  margin-bottom: 7px;
  border-radius: 9px;
  border: 1px solid rgba(214, 178, 94, 0.12);
  background: rgba(255, 255, 255, 0.018);
}

.counter-player-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.counter-player-head strong { color: #dfd0a7; font-size: 11px; font-weight: 600; }
.counter-player-head em {
  margin-left: auto;
  font-style: normal;
  color: #7e988a;
  font-size: 9px;
}
.counter-player-head .counter-role {
  color: var(--gold);
  border: 1px solid rgba(214, 178, 94, 0.28);
  border-radius: 99px;
  padding: 1px 5px;
  font-size: 7px;
  letter-spacing: 0.06em;
}

.played-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 20px;
  align-items: center;
}

.played-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: #f4ecda;
  color: #241d13;
  border: 1px solid rgba(80, 60, 30, 0.2);
  font-family: Georgia, var(--serif);
  font-size: 10px;
  line-height: 20px;
  white-space: nowrap;
}

.played-chip.red { color: var(--red); }
.played-chip.joker { color: #7c4f19; font-family: var(--sans); font-size: 8px; }
.played-none { color: #647b6e; font-size: 9px; letter-spacing: 0.06em; }

.rank-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.rank-tile {
  min-height: 47px;
  border-radius: 6px;
  border: 1px solid rgba(214, 178, 94, 0.14);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
}

.rank-tile strong {
  color: #e8d7a9;
  font-family: Georgia, var(--serif);
  font-size: 14px;
  line-height: 1;
}

.rank-tile span {
  color: #8ea698;
  font-size: 8px;
  line-height: 1;
}

.rank-tile.empty {
  opacity: 0.28;
  background: rgba(0, 0, 0, 0.12);
}

.rank-tile.empty strong { text-decoration: line-through; }

.rank-tile.joker-tile strong { font-size: 10px; }

.counter-note {
  margin: 12px 0 0;
  color: #6f887a;
  font-size: 9px;
  line-height: 1.7;
}

/* 特殊牌型设置 */
#settingsModal .sheet { width: min(640px, 94vw); }

.special-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.special-config-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(214, 178, 94, 0.16);
  background: rgba(4, 18, 13, 0.36);
}

.special-config-card.is-disabled { opacity: 0.62; }

.special-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.special-config-name { display: flex; flex-direction: column; gap: 2px; }
.special-config-name strong { color: #efdca9; font-family: var(--serif); font-size: 18px; letter-spacing: 0.08em; }
.special-config-name span { color: #7e988a; font-size: 8px; letter-spacing: 0.12em; }

.special-target-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.special-target-grid label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 5px;
  color: #a9bfb1;
  font-size: 9px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: 140ms ease;
}

.special-target-grid label:hover { background: rgba(214, 178, 94, 0.06); }
.special-target-grid input { width: 12px; height: 12px; accent-color: #d6b25e; margin: 0; }
.special-target-grid label:has(input:checked) {
  color: #f0dca8;
  border-color: rgba(214, 178, 94, 0.2);
  background: rgba(214, 178, 94, 0.07);
}
.special-config-card.is-disabled .special-target-grid { opacity: 0.4; pointer-events: none; }

.special-config-note {
  min-height: 14px;
  margin-top: 7px;
  color: #789083;
  font-size: 8px;
  line-height: 1.5;
}

.special-config-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.special-config-actions .game-btn { height: 32px; min-width: 0; padding: 0 12px; font-size: 10px; }
.special-config-actions span { color: #6f887a; font-size: 9px; }

.inline-link {
  color: #c9ae74;
  font-size: 10px;
  border-bottom: 1px solid rgba(201, 174, 116, 0.3);
  padding: 0;
  margin-left: 4px;
}
.inline-link:hover { color: var(--gold-bright); }

@media (max-width: 900px) {
  .sort-tools { margin-left: auto; }
  .sort-tools .sort-btn { font-size: 9px; padding: 4px 6px; }
  .special-config { grid-template-columns: 1fr; }
  .rank-grid { grid-template-columns: repeat(8, 1fr); }
}

@media (max-width: 620px) {
  .combo-choices { max-height: 48px; padding: 2px 4px 0; gap: 3px; }
  .combo-choice { height: 21px; padding: 0 7px; font-size: 8px; }
  .top-actions { gap: 1px; }
  .icon-btn.text-btn { padding: 0 5px; font-size: 9px; }
  .counter-badge { min-width: 15px; height: 15px; font-size: 8px; margin-left: 2px; }
  .human-head { flex-wrap: wrap; row-gap: 3px; }
  .human-identity { order: 1; }
  .special-ready { order: 2; margin-left: 4px; }
  .sort-tools { order: 3; width: 100%; justify-content: flex-end; margin-left: 0; margin-top: 2px; gap: 3px; }
  .sort-tools .sort-btn { font-size: 8px; padding: 3px 5px; }
  .special-target-grid { grid-template-columns: 1fr 1fr; }
  .special-config-card { padding: 10px; }
  .special-config-name strong { font-size: 16px; }
  .rank-grid { grid-template-columns: repeat(6, 1fr); }
  .rank-tile { min-height: 43px; }
  .counter-drawer { width: 94vw; }
}


.hand {
  width: 100%;
  min-height: calc(var(--card-h) + 26px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 22px 10px 4px;
  position: relative;
  touch-action: pan-x;
}

.hand .pcard {
  --card-w: clamp(46px, 5.15vw, 74px);
  --card-h: calc(var(--card-w) * 1.4);
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 160ms ease, margin 220ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  will-change: transform;
}

.hand .pcard + .pcard { margin-left: var(--hand-gap, -34px); }

.hand .pcard:hover { transform: translateY(-8px); z-index: 30; }

.hand .pcard.selected {
  transform: translateY(-22px);
  z-index: 40;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.42), 0 0 0 2px var(--gold-bright);
}

.hand .pcard.selected:hover { transform: translateY(-25px); }

.hand .pcard.hint-glow {
  box-shadow: 0 0 0 2px rgba(241, 214, 141, 0.7), 0 0 18px rgba(241, 214, 141, 0.3);
}

.hand.drag-selecting {
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.hand .pcard.long-press {
  transform: translateY(-8px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.42), 0 0 0 2px rgba(237, 200, 114, 0.7);
}

.hand .pcard.dealt { animation: dealIn 340ms cubic-bezier(0.2, 0.8, 0.3, 1) both; }

.hand-empty {
  color: rgba(206, 227, 215, 0.24);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.24em;
  height: 90px;
  display: grid;
  place-items: center;
}

/* ---------------- 操作栏 ---------------- */
.combo-choices {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 2px;
  max-height: 58px;
  overflow-y: auto;
}

.combo-choice {
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  border: 1px solid rgba(214, 178, 94, 0.26);
  background: rgba(5, 22, 16, 0.72);
  color: #c4d5c9;
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: 140ms ease;
}

.combo-choice:hover { color: var(--gold-bright); border-color: rgba(214, 178, 94, 0.55); }
.combo-choice.selected {
  color: #2a1b07;
  background: linear-gradient(180deg, #f1d68d, #c99b42);
  border-color: #f7e5b7;
  font-weight: 700;
}
.combo-choice.invalid { opacity: 0.35; text-decoration: line-through; }
.combo-choice:disabled { cursor: not-allowed; }

.action-bar {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 8px 2px;
  position: relative;
}

.selection-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  max-width: 34%;
  color: #9eb4a7;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(214, 178, 94, 0.5);
  flex: 0 0 auto;
}

.selection-preview.valid { color: #f2dda8; }
.selection-preview.valid .preview-dot { background: var(--gold-bright); box-shadow: 0 0 8px rgba(241, 214, 141, 0.6); }
.selection-preview.invalid { color: #f09a9a; }
.selection-preview.invalid .preview-dot { background: #dd6666; }

.action-buttons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.game-btn {
  height: 42px;
  min-width: 88px;
  padding: 0 22px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: transform 150ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
  border: 1px solid transparent;
  position: relative;
}

.game-btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.game-btn:disabled { opacity: 0.36; cursor: not-allowed; }

.game-btn.primary {
  color: #2a1b07;
  background: linear-gradient(180deg, #f2d58d, #c99b42);
  border-color: rgba(255, 245, 207, 0.6);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.game-btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #f8e3a9, #d6a94e);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), 0 0 22px rgba(224, 187, 101, 0.2);
}

.game-btn.primary.gold { background: linear-gradient(180deg, #f7e1a4, #c49234); }

.game-btn.ghost {
  color: #d6e3d9;
  background: rgba(7, 29, 21, 0.6);
  border-color: rgba(214, 178, 94, 0.25);
  backdrop-filter: blur(8px);
}

.game-btn.ghost:hover:not(:disabled) {
  color: #f5e4b5;
  border-color: rgba(214, 178, 94, 0.55);
  background: rgba(16, 49, 37, 0.74);
}

.game-btn.wide { width: 100%; }

.waiting-note {
  margin-left: auto;
  color: rgba(190, 211, 199, 0.5);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding-right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.waiting-note::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: thinkDot 1.2s infinite;
}

/* ---------------- 扑克牌 ---------------- */
.pcard {
  --card-w: 64px;
  padding: 0;
  margin: 0;
  font-family: inherit;
  text-align: left;
  --card-h: 90px;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  background:
    radial-gradient(circle at 24% 16%, rgba(255, 255, 255, 0.9), transparent 40%),
    linear-gradient(145deg, #fffdf6, #f1e8d5);
  border: 1px solid rgba(92, 71, 38, 0.24);
  color: #211b13;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.pcard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.pcard.red { color: var(--red); }

.pcard-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  font-family: Georgia, "Times New Roman", var(--serif);
  z-index: 2;
}

.pcard-corner.tl { top: 5px; left: 6px; }
.pcard-corner.br { bottom: 5px; right: 6px; transform: rotate(180deg); }

.pcard-rank { font-size: 17px; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; }
.pcard-suit { font-size: 13px; margin-top: 2px; }

.pcard-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  opacity: 0.9;
  padding-top: 2px;
}

.pcard-center.small { font-size: 20px; opacity: 0.72; }

.pcard.joker {
  background:
    radial-gradient(circle at 24% 16%, rgba(255, 255, 255, 0.92), transparent 40%),
    linear-gradient(145deg, #fffdf6, #eee4cf);
}

.pcard.joker .pcard-joker-band {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: #9b762f;
  opacity: 0.7;
  white-space: nowrap;
}

.pcard.joker .pcard-joker-name {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: #7d2b2b;
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
}

.pcard.joker.big .pcard-joker-name { color: #9a5b19; }

.pcard.joker .pcard-star {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--gold-deep);
  opacity: 0.8;
}

/* 牌背 */
.card-back {
  width: 42px;
  height: 58px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 6px),
    linear-gradient(145deg, #7d2d2d, #4a1717);
  border: 1px solid rgba(245, 218, 160, 0.42);
  box-shadow: inset 0 0 0 2px rgba(255, 235, 188, 0.08), 0 4px 9px rgba(0, 0, 0, 0.25);
  position: relative;
}

.card-back::after {
  content: "♠";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(247, 222, 167, 0.36);
  font-size: 17px;
}

.card-back.mini { width: 28px; height: 39px; border-radius: 3px; }
.card-back.mini::after { font-size: 11px; }

/* ---------------- 提示 / 抽屉 ---------------- */
.toast-stack {
  position: absolute;
  left: 50%;
  top: 17%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 8px 18px;
  border-radius: 99px;
  background: rgba(6, 23, 17, 0.9);
  border: 1px solid rgba(214, 178, 94, 0.32);
  color: #eddaa9;
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  animation: toastIn 240ms ease-out;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.toast.error { color: #ffb4b4; border-color: rgba(220, 96, 96, 0.42); }
.toast.out { animation: toastOut 220ms ease-in forwards; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(2, 9, 7, 0.52);
  backdrop-filter: blur(3px);
}

.log-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 92vw);
  z-index: 80;
  background:
    linear-gradient(180deg, rgba(10, 32, 24, 0.98), rgba(5, 19, 14, 0.99));
  border-left: 1px solid rgba(214, 178, 94, 0.22);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.log-drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 24px 18px;
  border-bottom: 1px solid rgba(214, 178, 94, 0.14);
}

.drawer-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: #f2e0b4;
  letter-spacing: 0.08em;
}

.drawer-head p { margin: 5px 0 0; color: #7f9b8c; font-size: 10px; letter-spacing: 0.14em; }

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #9fb4a7;
  font-size: 24px;
  line-height: 1;
  border: 1px solid rgba(214, 178, 94, 0.16);
  display: grid;
  place-items: center;
  transition: 160ms ease;
}

.close-btn:hover { color: #f2dda9; border-color: rgba(214, 178, 94, 0.45); transform: rotate(90deg); }

.log-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 178, 94, 0.25) transparent;
}

.log-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: #a9bdb0;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(214, 178, 94, 0.16);
}

.log-item .log-name { color: #e9d6a5; font-weight: 600; }
.log-item .log-combo { color: var(--gold-bright); }
.log-item.system {
  color: #829c8e;
  background: transparent;
  border-left-color: transparent;
  padding-left: 14px;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.log-item.pass { opacity: 0.72; }
.log-item.bomb { border-left-color: #cf5d5d; background: rgba(207, 93, 93, 0.06); }

.drawer-foot {
  padding: 14px 24px 22px;
  border-top: 1px solid rgba(214, 178, 94, 0.12);
  color: #748f81;
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------------- 弹层通用 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at center, rgba(6, 24, 18, 0.55), rgba(2, 9, 6, 0.84));
  backdrop-filter: blur(9px);
  animation: fadeIn 220ms ease-out;
}

.sheet-modal { z-index: 110; }

.sheet {
  width: min(920px, 94vw);
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(214, 178, 94, 0.1), transparent 32%),
    linear-gradient(165deg, #102f24, #071b14 72%);
  border: 1px solid rgba(214, 178, 94, 0.28);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 240, 197, 0.12);
  overflow: hidden;
  animation: sheetIn 280ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.sheet-modal.small .sheet { width: min(560px, 94vw); }

.sheet-head {
  padding: 24px 28px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(214, 178, 94, 0.14);
  flex: 0 0 auto;
}

.sheet-kicker {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.sheet-head h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  color: #f4e3b6;
  letter-spacing: 0.08em;
}

.sheet-body {
  padding: 24px 28px 32px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 178, 94, 0.28) transparent;
}

.sheet-body::-webkit-scrollbar { width: 5px; }
.sheet-body::-webkit-scrollbar-thumb { background: rgba(214, 178, 94, 0.25); border-radius: 4px; }

.sheet-body section { margin-bottom: 30px; }
.sheet-body section:last-child { margin-bottom: 0; }

.sheet-body h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: #edd9a7;
  letter-spacing: 0.06em;
}

.sheet-body h3 span {
  font-family: var(--sans);
  font-size: 9px;
  color: var(--gold);
  border: 1px solid rgba(214, 178, 94, 0.3);
  border-radius: 99px;
  padding: 2px 7px;
  letter-spacing: 0.08em;
}

/* ---------------- 开始界面 ---------------- */
.start-modal {
  z-index: 100;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(54, 112, 85, 0.32), transparent 46%),
    radial-gradient(ellipse at center, rgba(4, 19, 13, 0.62), rgba(2, 9, 6, 0.94));
  overflow: hidden;
}

.start-backdrop-art { position: absolute; inset: 0; pointer-events: none; }

.art-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(214, 178, 94, 0.11);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 { width: min(900px, 88vw); height: min(900px, 88vw); }
.ring-2 { width: min(680px, 64vw); height: min(680px, 64vw); border-style: dashed; opacity: 0.6; }

.art-suit {
  position: absolute;
  font-family: var(--serif);
  color: rgba(214, 178, 94, 0.08);
  font-size: clamp(60px, 11vw, 150px);
  line-height: 1;
}

.art-suit-1 { left: 7%; top: 16%; transform: rotate(-14deg); }
.art-suit-2 { right: 8%; top: 22%; color: rgba(185, 60, 60, 0.11); transform: rotate(11deg); }
.art-suit-3 { left: 12%; bottom: 12%; transform: rotate(8deg); }
.art-suit-4 { right: 11%; bottom: 9%; color: rgba(185, 60, 60, 0.09); transform: rotate(-9deg); }

.start-card {
  position: relative;
  z-index: 2;
  width: min(510px, 92vw);
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  padding: clamp(24px, 4vh, 40px) clamp(22px, 4vw, 44px) 28px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 178, 94, 0.15), transparent 42%),
    linear-gradient(165deg, rgba(17, 51, 39, 0.94), rgba(5, 19, 14, 0.98));
  border: 1px solid rgba(214, 178, 94, 0.36);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 197, 0.14);
  text-align: center;
  scrollbar-width: thin;
}

.start-card::before,
.start-card::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 178, 94, 0.36), transparent);
}
.start-card::before { top: 16px; }
.start-card::after { bottom: 16px; }

.start-kicker {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.3em;
  margin-bottom: 12px;
}

.start-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 62px);
  line-height: 1.02;
  font-weight: 700;
  color: #f5e7c4;
  letter-spacing: 0.08em;
  text-shadow: 0 5px 30px rgba(0, 0, 0, 0.35);
}

.start-title span {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #f8e8b8, #bd8c35);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.start-subtitle {
  margin: 14px auto 0;
  max-width: 360px;
  color: #a9c1b2;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.06em;
}

.special-chips {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 24px;
}

.special-chip {
  min-width: 126px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(214, 178, 94, 0.28);
  background: rgba(4, 17, 12, 0.46);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #efdba6;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.special-chip small {
  font-family: var(--sans);
  font-size: 9px;
  color: #8ba596;
  letter-spacing: 0.16em;
}

.special-chip.ak { border-color: rgba(209, 155, 68, 0.38); }
.special-chip.nk { border-color: rgba(160, 91, 91, 0.4); }

.start-setting { text-align: left; margin-bottom: 20px; }
.setting-label { color: #93ad9f; font-size: 10px; letter-spacing: 0.16em; margin-bottom: 8px; }

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.difficulty-options button {
  padding: 10px 8px;
  border-radius: 9px;
  border: 1px solid rgba(214, 178, 94, 0.16);
  background: rgba(4, 17, 12, 0.4);
  text-align: left;
  transition: 160ms ease;
}

.difficulty-options button strong {
  display: block;
  color: #c9d9cf;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.difficulty-options button span {
  display: block;
  color: #718b7d;
  font-size: 9px;
  margin-top: 3px;
}

.difficulty-options button:hover { border-color: rgba(214, 178, 94, 0.4); }

.difficulty-options button.active {
  border-color: rgba(241, 214, 141, 0.72);
  background: linear-gradient(180deg, rgba(214, 178, 94, 0.18), rgba(214, 178, 94, 0.06));
  box-shadow: inset 0 0 18px rgba(214, 178, 94, 0.08);
}

.difficulty-options button.active strong { color: var(--gold-bright); }
.difficulty-options button.active span { color: #b9aa81; }

.start-btn {
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #f5dda0, #c99b42);
  color: #2a1b07;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2em;
  border: 1px solid rgba(255, 247, 214, 0.66);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: 180ms ease;
}

.start-btn i { font-style: normal; transition: transform 180ms ease; }
.start-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36), 0 0 30px rgba(224, 187, 101, 0.16); }
.start-btn:hover i { transform: translateX(4px); }

.start-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #6f897b;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.start-links button { color: #b9a374; font-size: 9px; border-bottom: 1px solid rgba(185, 163, 116, 0.25); }
.start-links button:hover { color: var(--gold-bright); }

.start-record {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 178, 94, 0.1);
  color: #789184;
  font-size: 10px;
  letter-spacing: 0.05em;
}

/* ---------------- 结算 ---------------- */
.result-modal { z-index: 115; }
.result-card {
  width: min(460px, 92vw);
  border-radius: 20px;
  padding: 30px 32px 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 178, 94, 0.18), transparent 46%),
    linear-gradient(165deg, #11352a, #061a13);
  border: 1px solid rgba(214, 178, 94, 0.4);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 240, 197, 0.16);
  animation: resultIn 420ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.result-emblem {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 30px;
  color: #2a1b07;
  background: radial-gradient(circle at 35% 25%, #f9e8b4, #c2943b);
  border: 2px solid rgba(255, 244, 204, 0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 30px rgba(214, 178, 94, 0.25);
}

.result-kicker { color: var(--gold); font-size: 9px; letter-spacing: 0.28em; }

.result-title {
  margin: 7px 0 6px;
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.1;
  color: #f4e3b6;
  letter-spacing: 0.14em;
}

.result-title.lose { color: #d8b5b5; }
.result-desc { margin: 0; color: #9db4a7; font-size: 11px; line-height: 1.7; letter-spacing: 0.04em; }

.result-scoreboard {
  margin: 20px 0 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.result-player {
  padding: 9px 4px;
  border-radius: 8px;
  border: 1px solid rgba(214, 178, 94, 0.13);
  background: rgba(255, 255, 255, 0.025);
}

.result-player .rp-name { color: #bdcec4; font-size: 10px; }
.result-player .rp-role { display: block; color: #7e9789; font-size: 8px; margin-top: 2px; letter-spacing: 0.08em; }
.result-player .rp-score { display: block; font-family: var(--serif); font-size: 17px; margin-top: 5px; color: #a8d4b8; }
.result-player .rp-score.minus { color: #d99a9a; }
.result-player.you { border-color: rgba(214, 178, 94, 0.45); background: rgba(214, 178, 94, 0.07); }

.result-formula { color: #849d8f; font-size: 10px; letter-spacing: 0.06em; margin-bottom: 20px; }
.result-formula strong { color: #e3cd96; font-weight: 500; }

.result-actions { display: flex; gap: 10px; }
.result-actions .game-btn { flex: 1; min-width: 0; }

/* ---------------- 规则内容 ---------------- */
.rule-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 30px;
}

.rule-hero-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(214, 178, 94, 0.22);
  background: rgba(4, 18, 13, 0.45);
}

.rule-suit {
  width: 42px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 24px;
  color: #1e1911;
  background: linear-gradient(145deg, #fffdf6, #eee3cb);
}

.rule-suit.red { color: var(--red); }
.rule-hero-card strong { font-family: var(--serif); font-size: 24px; color: #f1dca6; letter-spacing: 0.08em; }
.rule-hero-card p { margin: 3px 0 0; color: #91aa9c; font-size: 10px; }
.rule-hero-card em { margin-left: auto; font-style: normal; color: #c7b484; font-size: 9px; text-align: right; line-height: 1.5; }

.rule-table {
  border: 1px solid rgba(214, 178, 94, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

.rule-row {
  display: grid;
  grid-template-columns: 110px 1.15fr 1.35fr;
  gap: 12px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.65;
  color: #b4c9bc;
  border-top: 1px solid rgba(214, 178, 94, 0.1);
}

.rule-row:first-child { border-top: 0; }
.rule-row strong { color: #ecd9a5; font-weight: 600; }
.rule-head { background: rgba(214, 178, 94, 0.08); color: #c9b783; font-size: 9px; letter-spacing: 0.12em; }
.rule-head span { color: #c9b783; }
.txt-ak { color: #e5b568 !important; }
.txt-nk { color: #d99191 !important; }

.rule-note {
  margin: 10px 2px 0;
  color: #7e988a;
  font-size: 10px;
  line-height: 1.7;
}

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.compare-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(214, 178, 94, 0.16);
  background: rgba(4, 18, 13, 0.36);
}

.compare-cards { display: flex; gap: 3px; margin-bottom: 10px; }

.mini-card {
  width: 34px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: linear-gradient(145deg, #fffdf6, #efe5d1);
  color: #211b13;
  font-family: Georgia, var(--serif);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(92, 71, 38, 0.2);
}

.mini-card.red { color: var(--red); }
.compare-card strong { display: block; color: #ecd9a5; font-size: 12px; margin-bottom: 4px; }
.compare-card p { margin: 0; color: #8fa99a; font-size: 10px; line-height: 1.65; }

.suit-order {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(214, 178, 94, 0.06);
  border: 1px solid rgba(214, 178, 94, 0.14);
  font-size: 11px;
  margin-bottom: 12px;
}

.suit-order > span { color: #819b8d; font-size: 9px; letter-spacing: 0.1em; margin-right: 4px; }
.suit-order strong { font-weight: 600; }
.suit-order i { font-style: normal; color: #5f7a6c; }
.spade, .club { color: #e8e2d0; }
.heart, .diamond { color: #e18686; }

.rule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rule-list li {
  position: relative;
  padding-left: 15px;
  color: #a9c0b2;
  font-size: 11px;
  line-height: 1.7;
}

.rule-list li::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: -2px;
  color: var(--gold);
  font-size: 18px;
}

.base-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.base-types span {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid rgba(214, 178, 94, 0.15);
  color: #a7bdaf;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.02);
}

/* ---------------- 设置 ---------------- */
.settings-body { display: flex; flex-direction: column; gap: 22px; }
.setting-block { padding-bottom: 20px; border-bottom: 1px solid rgba(214, 178, 94, 0.1); }
.setting-block:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-block.row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.setting-title { color: #e1d0a3; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; }
.setting-help { margin: 5px 0 0; color: #7e9889; font-size: 10px; line-height: 1.65; max-width: 360px; }
.settings-difficulty { margin-top: 12px; }

.switch {
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 99px;
  padding: 3px;
  border: 1px solid rgba(214, 178, 94, 0.24);
  background: rgba(4, 17, 12, 0.6);
  transition: 180ms ease;
}

.switch span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #7f9588;
  transition: 180ms ease;
}

.switch.active { background: rgba(214, 178, 94, 0.26); border-color: rgba(241, 214, 141, 0.5); }
.switch.active span { transform: translateX(20px); background: var(--gold-bright); box-shadow: 0 0 10px rgba(241, 214, 141, 0.5); }

/* ---------------- 确认 ---------------- */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 9, 6, 0.72);
  backdrop-filter: blur(6px);
}

.confirm-card {
  width: min(380px, 92vw);
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(165deg, #123429, #071c15);
  border: 1px solid rgba(214, 178, 94, 0.32);
  box-shadow: var(--shadow);
  animation: resultIn 220ms ease-out;
}

.confirm-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; color: #f0dca7; }
.confirm-card p { margin: 0 0 20px; color: #9ab1a4; font-size: 11px; line-height: 1.7; }
.confirm-actions { display: flex; gap: 9px; justify-content: flex-end; }
.confirm-actions .game-btn { height: 38px; min-width: 78px; }

/* ---------------- 动画 ---------------- */
@keyframes orbitPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 14px rgba(241, 214, 141, 0.32); }
  50% { opacity: 0.72; box-shadow: 0 0 26px rgba(241, 214, 141, 0.55); }
}

@keyframes thinkDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translate(-50%, 5px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.seat-bubble, .seat-think { animation-name: bubbleInSeat; }
@keyframes bubbleInSeat {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes playIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dealIn {
  from { opacity: 0; transform: translateY(26px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-6px); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes resultIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1150px) {
  .top-stats { display: none; }
  .brand { min-width: 220px; }
  .seat { width: 158px; }
  .seat-left { left: 1.2%; }
  .seat-right { right: 1.2%; }
  .center-area { width: 60%; }
}

@media (max-width: 900px) {
  .topbar { height: 60px; gap: 12px; padding: 0 14px; }
  .brand-emblem { width: 36px; height: 36px; }
  .brand-text h1 { font-size: 18px; }
  .brand-text p { font-size: 8px; letter-spacing: 0.16em; }
  .brand { min-width: 0; }
  .top-actions { margin-left: auto; }
  .icon-btn { width: 32px; height: 32px; }
  .text-btn { padding: 0 9px; font-size: 11px; }

  .game-main { padding: 0 4px 8px; }
  .table-stage { min-height: 520px; }
  .felt { inset: 5px 0 0; border-radius: 38% 38% 20% 20% / 30% 30% 14% 14%; }

  .seat { width: auto; padding: 6px; gap: 7px; top: 34%; }
  .seat-left { left: 1%; }
  .seat-right { right: 1%; }
  .seat-left, .seat-right { flex-direction: column; text-align: center; }
  .seat-right .seat-info { text-align: center; }
  .seat-right .seat-name-row, .seat-right .seat-strength { justify-content: center; }
  .seat-avatar { width: 48px; height: 48px; }
  .seat-info { background: rgba(5, 22, 16, 0.48); border-radius: 8px; padding: 3px 7px; }
  .seat-strength { display: none; }
  .seat-name { font-size: 12px; }
  .ai-tag { display: none; }
  .seat-count { margin-top: 1px; font-size: 9px; }
  .seat-count strong { font-size: 12px; }
  .seat-bubble {
    left: 0;
    transform: none;
    max-width: 132px;
    white-space: normal;
    text-align: center;
    line-height: 1.45;
    animation-name: bubbleInMobile;
  }
  @keyframes bubbleInMobile {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .seat-right .seat-bubble { left: auto; right: 0; border-radius: 10px; }
  .seat-think { left: 50%; right: auto; transform: translateX(-50%); }

  .table-top { top: 1.4%; gap: 10px; }
  .bottom-cards .pcard { width: 34px; height: 47px; }
  .bottom-cards .pcard-rank { font-size: 10px; }
  .bottom-cards .pcard-suit { font-size: 8px; }
  .bottom-cards .pcard-center { font-size: 13px; }
  .pot-wrap { min-width: 70px; padding-top: 3px; }
  .pot-value span { font-size: 14px; }
  .pot-value strong { font-size: 19px; }
  .pot-label, .pot-sub { font-size: 8px; }
  .bottom-label { font-size: 8px; }

  .center-area { top: 24%; width: 58%; min-height: 155px; }
  .last-play-wrap { min-height: 100px; margin-top: 6px; }
  .last-play-cards { min-height: 65px; gap: 2px; }
  .last-play-cards .pcard { width: 44px; height: 62px; margin-left: 0; }
  .last-play-cards .pcard-rank { font-size: 11px; }
  .last-play-cards .pcard-suit { font-size: 9px; }
  .last-play-cards .pcard-center { font-size: 15px; }
  .empty-play { min-height: 65px; font-size: 10px; }
  .turn-label { font-size: 9px; padding: 3px 11px; }

  .human-zone { width: 100%; bottom: -2px; }
  .human-head { padding: 0 8px; min-height: 32px; }
  .human-avatar { width: 28px; height: 28px; font-size: 12px; }
  .human-hand-hint { display: none; }
  .sort-btn { font-size: 9px; padding: 4px 8px; }
  .hand { min-height: calc(var(--card-h) + 20px); padding: 18px 4px 2px; }
  .hand .pcard { --card-w: clamp(42px, 9.4vw, 62px); }
  .action-bar { min-height: 48px; padding: 3px 6px 0; gap: 6px; }
  .selection-preview { min-width: 0; max-width: 34%; font-size: 9px; }
  .game-btn { height: 38px; min-width: 68px; padding: 0 14px; font-size: 12px; }
  .waiting-note { font-size: 9px; }

  .rule-hero { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .rule-row { grid-template-columns: 78px 1fr 1.2fr; font-size: 10px; padding: 10px; gap: 8px; }
  .sheet-head { padding: 18px 18px 14px; }
  .sheet-body { padding: 18px 18px 24px; }
  .sheet-head h2 { font-size: 22px; }
  .start-card { padding: 26px 20px 22px; }
  .start-title { font-size: 46px; }
  .special-chips { gap: 8px; }
  .special-chip { min-width: 0; flex: 1; padding: 8px 10px; font-size: 15px; }
}

@media (max-width: 620px) {
  #app { min-height: 560px; }
  .brand-text p span { display: none; }
  .brand-text p { letter-spacing: 0.08em; }
  .brand-text h1 { font-size: 16px; }
  .brand-emblem { width: 32px; height: 32px; }
  .emblem-suit { font-size: 18px; }
  .top-actions { gap: 2px; }
  .icon-btn { width: 29px; height: 29px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .text-btn { padding: 0 7px; font-size: 10px; }

  .seat { top: 28%; gap: 5px; }
  .seat-avatar { width: 40px; height: 40px; }
  .avatar-letter { font-size: 17px; }
  .seat-info { padding: 2px 5px; }
  .seat-name { font-size: 11px; }
  .seat-count { font-size: 8px; }
  .role-badge { font-size: 7px; padding: 2px 5px; bottom: -6px; }

  .center-area { top: 21%; width: 66%; }
  .table-top { top: 0.8%; }
  .bottom-cards .pcard { width: 30px; height: 42px; }
  .pot-wrap { min-width: 55px; }
  .pot-value strong { font-size: 17px; }
  .pot-value span { font-size: 12px; }
  .pot-sub { display: none; }

  .human-head { min-height: 28px; }
  .human-identity { gap: 6px; }
  .human-name-row strong { font-size: 11px; }
  .human-count { font-size: 8px; }
  .human-count strong { font-size: 11px; }
  .human-avatar { width: 24px; height: 24px; font-size: 10px; }
  .sort-btn { padding: 3px 7px; font-size: 8px; }

  .hand .pcard { --card-w: clamp(38px, 11.8vw, 54px); }
  .hand { padding-top: 16px; }
  .hand .pcard-rank { font-size: 14px; }
  .hand .pcard-suit { font-size: 11px; }
  .hand .pcard-center { font-size: 21px; }

  .action-bar { flex-wrap: wrap; justify-content: center; min-height: 84px; padding-top: 3px; }
  .selection-preview { order: 1; flex: 0 0 100%; max-width: 100%; justify-content: center; min-height: 15px; }
  .action-buttons { order: 2; margin-left: 0; width: 100%; justify-content: center; }
  .waiting-note { margin: 0; order: 2; }
  .game-btn { height: 38px; min-width: 80px; }
  .game-btn.ghost, .game-btn.primary { padding: 0 16px; }

  .sheet { max-height: 94vh; max-height: 94dvh; border-radius: 14px; }
  .sheet-head { padding: 16px 16px 12px; }
  .sheet-body { padding: 16px 16px 22px; }
  .rule-hero-card { padding: 11px; }
  .rule-suit { width: 34px; height: 44px; font-size: 19px; }
  .rule-hero-card strong { font-size: 19px; }
  .rule-hero-card em { display: none; }
  .rule-row { grid-template-columns: 64px 1fr 1.1fr; font-size: 9px; }
  .rule-row strong { font-size: 10px; }
  .compare-cards { justify-content: center; }
  .suit-order { gap: 5px; font-size: 9px; padding: 9px 10px; }
  .base-types span { font-size: 9px; padding: 4px 8px; }

  .start-title { font-size: 40px; }
  .start-subtitle { font-size: 11px; }
  .start-card { max-height: 96vh; max-height: 96dvh; }
  .special-chip { font-size: 13px; }
  .start-links { flex-wrap: wrap; }
  .result-card { padding: 24px 18px 20px; }
  .result-title { font-size: 30px; }
  .result-scoreboard { gap: 5px; }
  .result-player .rp-score { font-size: 14px; }
  .result-actions .game-btn { min-width: 0; padding: 0 8px; font-size: 11px; }

  .toast-stack { top: 13%; width: 90%; }
  .toast { font-size: 10px; padding: 7px 12px; }
}

@media (max-width: 380px) {
  .topbar { padding: 0 8px; gap: 6px; }
  .brand { gap: 7px; }
  .brand-emblem { width: 28px; height: 28px; }
  .emblem-suit { font-size: 16px; }
  .brand-text h1 { font-size: 15px; }
  .brand-text p { display: none; }
  .brand-text p span { display: none; }
  .icon-btn.text-btn { padding: 0 3px; font-size: 8px; }
  .counter-badge { display: none; }
  .special-ready { display: none; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .topbar { height: 60px; }
  .table-top { top: 1%; }
  .center-area { top: 23%; }
  .seat { top: 36%; }
  .hand { min-height: calc(var(--card-h) + 14px); padding-top: 16px; }
  .hand .pcard { --card-w: clamp(42px, 4.6vw, 62px); }
  .human-head { min-height: 30px; }
  .action-bar { min-height: 48px; }
  .game-btn { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- 双玩法入口 ---------------- */
.brand-mode-text {
  border: 0 !important;
  padding: 0 !important;
  color: #9eb8a8 !important;
  font-size: 10px !important;
  letter-spacing: 0.14em !important;
}

.mode-title { font-size: clamp(38px, 6vw, 54px); }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 22px 0 18px;
}

.mode-card {
  min-height: 230px;
  text-align: left;
  padding: 16px 15px 14px;
  border-radius: 13px;
  border: 1px solid rgba(214, 178, 94, 0.24);
  background:
    radial-gradient(circle at 20% 0%, rgba(214, 178, 94, 0.1), transparent 42%),
    rgba(4, 18, 13, 0.42);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.mode-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -35px;
  bottom: -45px;
  border-radius: 50%;
  border: 1px solid rgba(214, 178, 94, 0.12);
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(241, 214, 141, 0.62);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28), 0 0 26px rgba(214, 178, 94, 0.08);
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 50px;
  border-radius: 5px;
  background: linear-gradient(145deg, #fffdf6, #e9ddc3);
  color: #211b13;
  font-family: var(--serif);
  font-size: 24px;
  margin-bottom: 11px;
}

.lai-mode-card .mode-icon { color: var(--red); }

.mode-card-kicker {
  display: block;
  color: #9b8a61;
  font-size: 7px;
  letter-spacing: 0.24em;
  margin-bottom: 4px;
}

.mode-card strong {
  display: block;
  color: #f0dca9;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.mode-card p {
  margin: 8px 0 10px;
  color: #8fa99a;
  font-size: 10px;
  line-height: 1.7;
  min-height: 50px;
}

.mode-card em {
  display: block;
  color: #c6ae78;
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.mode-card i {
  display: block;
  margin-top: 11px;
  color: var(--gold-bright);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.custom-mode-card {
  border-color: rgba(116, 172, 143, 0.35);
  background:
    radial-gradient(circle at 15% 0%, rgba(116, 172, 143, 0.12), transparent 42%),
    rgba(4, 18, 13, 0.44);
}
.custom-mode-card .mode-icon {
  color: #d9f0e1;
  background: linear-gradient(160deg, #2d6550, #153d2d);
  border-color: rgba(174, 224, 196, 0.5);
}
.custom-mode-card strong { color: #d8efdf; }

.guandan-mode-card {
  border-color: rgba(196, 154, 92, 0.4);
  background:
    radial-gradient(circle at 15% 0%, rgba(196, 154, 92, 0.13), transparent 42%),
    rgba(20, 16, 8, 0.46);
}
.guandan-mode-card .mode-icon {
  color: #f4dca8;
  background: linear-gradient(160deg, #6c4a25, #35230f);
  border-color: rgba(232, 199, 134, 0.52);
  font-size: 16px;
}
.guandan-mode-card strong { color: #f1ddb2; }

.universal-mode-card {
  border-color: rgba(214, 178, 94, 0.38);
  background:
    radial-gradient(circle at 85% 0%, rgba(229, 195, 117, 0.16), transparent 42%),
    rgba(4, 18, 13, 0.48);
}
.universal-mode-card .mode-icon {
  color: #2a1b07;
  background: linear-gradient(160deg, #f7e1a4, #b9852f);
  border-color: rgba(255, 241, 197, 0.7);
}
.universal-mode-card strong { color: #f7df9f; }

.lai-mode-card {
  border-color: rgba(166, 100, 86, 0.3);
  background:
    radial-gradient(circle at 20% 0%, rgba(175, 82, 72, 0.14), transparent 42%),
    rgba(18, 10, 8, 0.32);
}

.lai-mode-card strong { color: #ecc7b5; }

.setup-back {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid rgba(214, 178, 94, 0.2);
  color: #9db4a7;
  font-size: 9px;
  letter-spacing: 0.06em;
  margin-bottom: 13px;
}

.setup-back:hover { color: var(--gold-bright); border-color: rgba(214, 178, 94, 0.45); }
.setup-title { font-size: clamp(34px, 5.5vw, 46px); }

.setup-mode-block {
  margin: 0 0 18px;
  padding: 13px 14px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(214, 178, 94, 0.2);
  background: rgba(4, 18, 13, 0.38);
}

.setup-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.setup-block-head strong { color: #ead7a8; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.setup-block-head span { color: #738d7f; font-size: 8px; letter-spacing: 0.08em; }
.setup-mode-block p { margin: 7px 0 0; color: #8fa99a; font-size: 9px; line-height: 1.65; }
.setup-block-actions { margin-top: 9px; }
.setup-link { color: #d2b678; font-size: 9px; letter-spacing: 0.06em; border-bottom: 1px solid rgba(210, 182, 120, 0.3); padding: 0; }
.setup-link:hover { color: var(--gold-bright); }

.lai-setup-block {
  border-color: rgba(166, 100, 86, 0.3);
  background: radial-gradient(circle at 10% 0%, rgba(175, 82, 72, 0.1), transparent 50%), rgba(18, 10, 8, 0.28);
}

.lai-rule-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.lai-rule-chips span {
  padding: 3px 7px;
  border-radius: 99px;
  border: 1px solid rgba(214, 178, 94, 0.18);
  color: #bcaa80;
  font-size: 8px;
  letter-spacing: 0.04em;
}

/* 天地癞子局内标记 */
.wild-info {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 120px;
  padding: 4px 2px 0;
}

.wild-info-label {
  width: 100%;
  text-align: center;
  color: #a9c1b3;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.wild-chip {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 99px;
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid rgba(214, 178, 94, 0.3);
  background: rgba(214, 178, 94, 0.08);
  color: #e5cb91;
}

.wild-chip.di { border-color: rgba(181, 103, 91, 0.42); background: rgba(181, 103, 91, 0.1); color: #ecc3b5; }

.pcard.wild-card {
  border-color: rgba(214, 178, 94, 0.88);
  box-shadow: inset 0 0 0 1px rgba(214, 178, 94, 0.38), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.pcard .wild-mark {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f3d68d, #bd8c35);
  color: #2a1b07;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.lai-hero .rule-suit { color: #8e5b26; font-size: 17px; }
.lai-bomb-table .rule-row { grid-template-columns: 86px 1.3fr 1.1fr; }

@media (max-width: 620px) {
  .mode-grid { grid-template-columns: 1fr; margin-top: 16px; }
  .mode-card { min-height: 0; padding: 12px 13px; }
  .mode-icon { float: left; margin: 0 10px 8px 0; width: 34px; height: 41px; font-size: 19px; }
  .mode-card strong { font-size: 20px; }
  .mode-card p { min-height: 0; font-size: 9px; margin: 5px 0 7px; }
  .mode-card i { margin-top: 6px; }
  .mode-title { font-size: 38px; }
  .setup-title { font-size: 32px; }
  .wild-info { min-width: 0; }
  .wild-info-label { display: none; }
  .wild-chip { height: 17px; font-size: 8px; padding: 0 5px; }
  .wild-mark { width: 15px; height: 15px; font-size: 8px; top: 3px; right: 3px; }
}

/* 关闭动画 */
body.no-anim *,
body.no-anim *::before,
body.no-anim *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}


/* ---------- 叫分 / 加倍 / 明牌 ---------- */
.bid-mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bid-mode-options button {
  border: 1px solid rgba(214, 178, 94, 0.22);
  background: rgba(5, 22, 16, 0.6);
  border-radius: 10px;
  padding: 9px 8px;
  color: #b9ccbf;
  text-align: left;
  transition: 150ms ease;
}
.bid-mode-options button strong { display: block; color: #ebd9ad; font-family: var(--serif); font-size: 13px; }
.bid-mode-options button span { display: block; margin-top: 3px; color: #718b7c; font-size: 8px; }
.bid-mode-options button:hover { border-color: rgba(214, 178, 94, 0.5); }
.bid-mode-options button.active {
  border-color: rgba(229, 195, 117, 0.72);
  background: linear-gradient(180deg, rgba(214, 178, 94, 0.2), rgba(5, 22, 16, 0.72));
  box-shadow: inset 0 0 0 1px rgba(229, 195, 117, 0.16);
}
.bid-mode-options button.active strong { color: #f4dfaa; }

.score-bid-buttons { flex-wrap: wrap; }
.score-bid-buttons .score-btn { min-width: 58px; }
.score-bid-buttons .score-btn:disabled { opacity: 0.35; pointer-events: none; }

.double-buttons { flex-wrap: wrap; gap: 6px; }
.double-buttons .game-btn { min-width: 76px; padding-left: 10px; padding-right: 10px; }

.reveal-panel {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: min(760px, 92%);
  max-height: 150px;
  overflow-y: auto;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(214, 178, 94, 0.2);
  background: rgba(3, 15, 11, 0.84);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.reveal-row { display: flex; align-items: flex-start; gap: 7px; padding: 3px 0; }
.reveal-row + .reveal-row { border-top: 1px solid rgba(214, 178, 94, 0.1); }
.reveal-name {
  flex: 0 0 auto; padding-top: 3px; color: #e5cc8e; font-family: var(--serif);
  font-size: 10px; white-space: nowrap;
}
.reveal-name .reveal-badge { margin-left: 3px; color: #b99a5a; font-family: sans-serif; font-size: 8px; }
.reveal-cards { display: flex; flex-wrap: wrap; gap: 3px; }
.reveal-chip {
  display: inline-flex; align-items: center; gap: 1px; height: 19px; padding: 0 5px;
  border-radius: 4px; border: 1px solid rgba(214, 178, 94, 0.16);
  background: #f4ead2; color: #20251e; font-size: 9px; font-weight: 700;
  white-space: nowrap;
}
.reveal-chip.red { color: #a9382e; }
.reveal-chip.wild { background: #e7d5a1; }
.reveal-chip.joker { background: #eadfc6; font-size: 8px; }

@media (max-width: 620px) {
  .bid-mode-options { gap: 5px; }
  .bid-mode-options button { padding: 7px 6px; }
  .bid-mode-options button strong { font-size: 11px; }
  .bid-mode-options button span { font-size: 7px; }
  .score-bid-buttons .score-btn { min-width: 48px; }
  .double-buttons .game-btn { min-width: 66px; font-size: 10px; }
  .reveal-panel { top: 66px; max-height: 116px; padding: 5px 7px; }
  .reveal-name { font-size: 9px; }
  .reveal-chip { height: 17px; font-size: 8px; }
}

.seat-flags {
  min-height: 10px;
  margin-top: 1px;
  color: #c8a866;
  font-size: 8px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.seat-right .seat-flags { text-align: right; }
.human-flag {
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(214, 178, 94, 0.16);
  color: #e2c47e;
  font-size: 8px;
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .seat-flags { font-size: 7px; }
  .human-flag { font-size: 7px; padding: 1px 4px; }
}

/* ---------- 万能牌 ---------- */
.pcard.universal-card {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 246, 209, 0.9), transparent 40%),
    linear-gradient(145deg, #f7e3ad, #c49338);
  border-color: rgba(255, 239, 186, 0.9);
  color: #2b1b06;
  box-shadow: 0 0 0 1px rgba(255, 240, 191, 0.45), 0 10px 24px rgba(0, 0, 0, 0.34);
}
.pcard.universal-card .pcard-center { color: #8a5b16; font-size: 24px; }
.pcard.universal-card .pcard-suit { color: #8a5b16; }
.universal-mark {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2a1a06;
  color: #f8df9f;
  font-size: 10px;
  line-height: 1;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.universal-setup-block { border-color: rgba(214, 178, 94, 0.3); }

.universal-hero .rule-suit {
  color: #2a1b07;
  background: linear-gradient(160deg, #f7e1a4, #b9852f);
  border-color: rgba(255, 241, 197, 0.7);
  font-size: 18px;
}

.custom-hero .rule-suit {
  color: #d9f0e1;
  background: linear-gradient(160deg, #2d6550, #153d2d);
  border-color: rgba(174, 224, 196, 0.5);
  font-size: 18px;
}
