/* ═══════════════ 斗地主 · 精致视觉 ═══════════════ */
:root {
  --bg: #0a1208;
  --felt: #0d3b24;
  --felt-2: #145c36;
  --felt-3: #0a2e1a;
  --wood: #3a2412;
  --wood-2: #5a3a1c;
  --gold: #e8c878;
  --gold-2: #f0d89a;
  --gold-3: #fff0c0;
  --gold-dim: rgba(232, 200, 120, 0.35);
  --ink: #f4f0e6;
  --ink-2: #c4b89a;
  --mute: #8a7a5c;
  --red: #d64545;
  --red-2: #ff6b6b;
  --black-suit: #1a2430;
  --card-w: 72px;
  --card-h: 104px;
  --radius: 16px;
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --shadow-card: 0 6px 18px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lift: 0 16px 36px rgba(232,200,120,0.35), 0 4px 10px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  background: var(--bg); color: var(--ink); font-family: var(--font);
  overflow: hidden; user-select: none; -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative; width: 100vw; height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 700px at 50% 20%, rgba(232,200,120,0.08), transparent 60%),
    radial-gradient(800px 500px at 80% 100%, rgba(20,92,54,0.25), transparent 55%),
    #071208;
}

/* ── 顶栏 ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; z-index: 30;
  background: linear-gradient(180deg, rgba(8,16,10,0.95), rgba(8,16,10,0.7));
  border-bottom: 1px solid rgba(232,200,120,0.15);
  backdrop-filter: blur(12px);
}
.brand {
  color: var(--gold); font-size: 13px; text-decoration: none;
  opacity: .85; display: flex; align-items: center; gap: 6px;
}
.brand:hover { opacity: 1; color: var(--gold-2); }
.title {
  font-size: 18px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(232,200,120,0.3);
}
.points-box {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(232,200,120,0.18), rgba(232,200,120,0.06));
  border: 1px solid rgba(232,200,120,0.35);
  box-shadow: 0 4px 16px rgba(232,200,120,0.12), inset 0 1px 0 rgba(255,255,255,0.12);
}
.pts-label { font-size: 11px; color: var(--gold); opacity: .85; letter-spacing: 1px; }
#ptsVal {
  font-size: 16px; color: var(--gold-3); font-weight: 800;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(255,240,192,0.35);
}
.sound-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(232,200,120,0.2);
  color: var(--gold); font-size: 16px; cursor: pointer;
  display: grid; place-items: center;
}
.sound-btn:hover { background: rgba(232,200,120,0.18); }

/* ── 牌桌 ── */
#table {
  position: relative; flex: 1; overflow: hidden;
  max-width: 1200px; width: 100%; margin: 0 auto;
}
#table::before {
  content: ""; position: absolute; inset: 12px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, var(--felt-2), var(--felt) 55%, var(--felt-3));
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.45),
    inset 0 2px 0 rgba(255,255,255,0.06),
    0 20px 60px rgba(0,0,0,0.55);
  border: 10px solid var(--wood);
  outline: 2px solid rgba(232,200,120,0.18);
}
#table::after {
  content: ""; position: absolute; inset: 22px;
  border-radius: 20px; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 35%, rgba(255,255,255,0.06), transparent 70%);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.25);
}

/* ── 座位 ── */
.seat {
  position: absolute; top: 28px; z-index: 8;
  display: flex; align-items: center; gap: 12px;
}
.seat-left { left: 36px; }
.seat-right { right: 36px; flex-direction: row-reverse; }

.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #2a4030, #1a2820);
  border: 2.5px solid rgba(232,200,120,0.45);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 0 3px rgba(0,0,0,0.25);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: var(--gold-2);
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  position: relative;
}
.avatar.turn {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(232,200,120,0.35), 0 0 28px rgba(232,200,120,0.45);
  animation: pulseGlow 1.4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232,200,120,0.25), 0 0 22px rgba(232,200,120,0.3); }
  50% { box-shadow: 0 0 0 5px rgba(232,200,120,0.4), 0 0 36px rgba(232,200,120,0.55); }
}

.seat-meta { min-width: 80px; }
.seat-right .seat-meta { text-align: right; }
.pname {
  font-size: 14px; font-weight: 700; color: var(--ink);
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.role {
  display: inline-block; margin-top: 3px; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(135deg, rgba(214,69,69,0.35), rgba(214,69,69,0.15));
  color: var(--red-2); border: 1px solid rgba(255,107,107,0.35);
}
.role.farmer {
  background: linear-gradient(135deg, rgba(80,180,120,0.3), rgba(80,180,120,0.12));
  color: #8fefb0; border-color: rgba(140,230,170,0.35);
}
.role:empty { display: none; }

.cnt {
  margin-top: 4px; font-size: 12px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.seat-right .cnt { justify-content: flex-end; }
.cnt-badge {
  min-width: 28px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(232,200,120,0.28), rgba(232,200,120,0.1));
  border: 1px solid rgba(232,200,120,0.4);
  color: var(--gold-3); font-weight: 800; font-size: 13px;
  display: inline-grid; place-items: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* 对手剩余牌扇形 */
.card-fan {
  display: flex; align-items: center; margin-top: 6px; height: 36px;
}
.seat-right .card-fan { justify-content: flex-end; }
.fan-card {
  width: 16px; height: 30px; margin-left: -10px; border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, #8b1a1a 0 3px, #b82828 3px 6px, #6b1010 6px 9px);
  border: 1px solid rgba(255,220,180,0.35);
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
.fan-card:first-child { margin-left: 0; }

/* 对手出牌区 */
.played {
  position: absolute; top: 110px; z-index: 6;
  display: flex; gap: 4px; flex-wrap: nowrap;
  min-height: 50px; align-items: center;
  transition: opacity .25s, transform .25s;
}
.seat-left .played { left: 110px; }
.seat-right .played { right: 110px; }

/* 底牌 */
.bottom-cards {
  position: absolute; top: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 7;
}
.bc-label {
  font-size: 11px; color: var(--gold); letter-spacing: 3px; font-weight: 700;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  padding: 3px 12px; border-radius: 999px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(232,200,120,0.25);
}
.bc-row { display: flex; gap: 6px; }

/* 桌面信息 */
.table-info {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; z-index: 5; pointer-events: none;
}
.multi {
  font-size: 28px; font-weight: 900;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 16px rgba(232,200,120,0.45));
  letter-spacing: 2px;
}
.bomb-tag {
  font-size: 13px; color: var(--red-2); margin-top: 6px; min-height: 20px;
  font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 0 16px rgba(255,107,107,0.5);
}
.hint {
  font-size: 13px; color: var(--ink-2); margin-top: 10px; min-height: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.room-tag {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: 11px; color: var(--gold-2); letter-spacing: 1px;
  background: rgba(232,200,120,0.12); border: 1px solid rgba(232,200,120,0.3);
}

/* 我的出牌 */
.my-played {
  position: absolute; bottom: 230px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; justify-content: center; flex-wrap: nowrap;
  min-height: 48px; align-items: center; z-index: 6;
}

/* ── 操作条 ── */
.action-bar, .bid-bar {
  position: absolute; bottom: 168px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 20;
}
.btn {
  padding: 12px 26px; border-radius: 999px; font-size: 14px; font-weight: 700;
  letter-spacing: 1px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  color: var(--ink); border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform .12s, box-shadow .12s, background .12s;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.18); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  color: #2a1c08; border-color: rgba(255,240,192,0.5);
  box-shadow: 0 8px 28px rgba(232,200,120,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
  text-shadow: none;
}
.btn.primary:hover {
  background: linear-gradient(180deg, #fff6d8, var(--gold-2));
  box-shadow: 0 12px 36px rgba(232,200,120,0.5);
}
.btn.warn {
  background: linear-gradient(180deg, rgba(214,69,69,0.35), rgba(214,69,69,0.18));
  color: var(--red-2); border-color: rgba(255,107,107,0.4);
}

/* ── 手牌 ── */
.hand {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(98vw, 1120px);
  max-width: 1120px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: var(--hand-gap, 2px);
  padding: 22px 14px 10px;
  overflow: visible !important;
  background: linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.28));
  border-radius: 18px 18px 12px 12px;
  border: 1px solid rgba(232,200,120,0.12);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.28);
  z-index: 15;
  min-height: calc(var(--hand-h, 100px) + 40px);
}
.hand::-webkit-scrollbar { height: 5px; }
.hand::-webkit-scrollbar-thumb { background: rgba(232,200,120,0.35); border-radius: 4px; }



/* ═══════════ 扑克牌 · 干净经典 · 手机友好 ═══════════ */
.card {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-w);
  height: var(--card-h);
  margin-left: -18px;
  border-radius: 8px;
  background: linear-gradient(160deg, #ffffff 0%, #faf7f0 60%, #f0ebe0 100%);
  color: #1a2028;
  border: 1px solid rgba(120, 100, 70, 0.18);
  box-shadow: 0 2px 5px rgba(0,0,0,0.18), 0 6px 14px rgba(0,0,0,0.12);
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, margin .15s ease;
}
.hand .card:first-child { margin-left: 0; }
.card.red { color: #c23a3a; }

/* 左上角标：点数 + 花色 */
.card .c-corner {
  position: absolute;
  top: 4px;
  left: 5px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  width: 18px;
}
.card .c-corner b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.card .c-corner i {
  font-style: normal;
  font-size: 11px;
  margin-top: 0;
  opacity: 0.9;
}

/* 中心花色 / 面牌 */
.card .c-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding-top: 6px;
}
.card .pip-suit {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.95;
}
.card .face-letter {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.88;
}
.card .face-suit {
  font-size: 14px;
  margin-top: 2px;
  opacity: 0.85;
}

/* 小牌：出牌 / 底牌 */
.card.small {
  width: 46px;
  height: 68px;
  margin-left: -12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.card.small .c-corner { top: 3px; left: 3px; width: 14px; }
.card.small .c-corner b { font-size: 11px; }
.card.small .c-corner i { font-size: 8px; }
.card.small .pip-suit { font-size: 20px; }
.card.small .face-letter { font-size: 18px; }
.card.small .face-suit { font-size: 10px; }

/* 大小王 */
.card.joker-red {
  background: linear-gradient(165deg, #fff2f2 0%, #ffd0d4 55%, #f0aab2 100%);
  color: #b82c2c;
}
.card.joker-black {
  background: linear-gradient(165deg, #f2f4f8 0%, #c8d0dc 55%, #7e8ca4 100%);
  color: #1c2838;
}
.card .joker-label {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 3px;
  writing-mode: vertical-rl;
  line-height: 1.2;
}
.card .c-mark {
  position: absolute;
  bottom: 5px;
  right: 6px;
  font-size: 12px;
  opacity: 0.4;
}

/* 选中：上抬 */
.card.selected {
  transform: translateY(-18px);
  box-shadow: 0 12px 28px rgba(232,200,120,0.4), 0 4px 10px rgba(0,0,0,0.25);
  margin-left: -12px;
  z-index: 3;
  border-color: rgba(232,200,120,0.55);
}
.hand .card.selected:first-child { margin-left: 0; }

/* 牌背 */
.card.back {
  background: linear-gradient(145deg, #7a1820 0%, #a82830 50%, #5c1018 100%);
  border-color: rgba(255,210,170,0.25);
}
.card.back::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 5px;
  border: 1px solid rgba(255,220,180,0.3);
  background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,0.05) 4px 8px);
}

.played .card, .my-played .card { cursor: default; }
.played .card:first-child, .my-played .card:first-child { margin-left: 0; }

/* 手牌间距：保证能看清每张 */
.hand .card { margin-left: -14px; }
.hand .card.selected { margin-left: -8px; }

/* ── 手机端更大更清晰 ── */
@media (max-width: 720px) {
  :root { --card-w: 58px; --card-h: 86px; }
  .card .c-corner b { font-size: 16px; }
  .card .c-corner i { font-size: 12px; }
  .card .pip-suit { font-size: 34px; }
  .card .face-letter { font-size: 30px; }
  .card.small { width: 42px; height: 62px; margin-left: -10px; }
  .card.small .c-corner b { font-size: 10px; }
  .card.small .pip-suit { font-size: 18px; }
  .hand .card { margin-left: -12px; }
  .hand .card.selected { margin-left: -6px; transform: translateY(-16px); }
}
@media (max-width: 420px) {
  :root { --card-w: 52px; --card-h: 78px; }
  .card .c-corner b { font-size: 14px; }
  .card .pip-suit { font-size: 28px; }
  .hand .card { margin-left: -10px; }
}
@media (min-width: 1100px) {
  :root { --card-w: 78px; --card-h: 112px; }
  .hand .card { margin-left: -16px; }
  .card .c-corner b { font-size: 18px; }
  .card .pip-suit { font-size: 40px; }
}

/* ── 覆盖层 ── */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: center;
  background: rgba(4, 10, 6, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
}
.overlay.show { display: grid; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.panel-box {
  width: min(92vw, 440px); padding: 32px 28px;
  background:
    linear-gradient(165deg, rgba(20,32,22,0.96), rgba(12,20,14,0.98));
  border: 1px solid rgba(232,200,120,0.28);
  border-radius: 22px;
  box-shadow:
    0 32px 90px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 60px rgba(232,200,120,0.1);
  text-align: center;
}
.kicker {
  font-size: 11px; letter-spacing: 4px; color: var(--gold);
  opacity: .8; margin-bottom: 12px; font-weight: 700;
}
.panel-box h1 {
  font-size: 32px; margin-bottom: 12px;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.panel-box h2 { font-size: 24px; margin-bottom: 12px; color: var(--ink); }
.panel-box p { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); margin-bottom: 18px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.score-line {
  font-size: 42px; font-weight: 900; margin: 10px 0;
  letter-spacing: 1px;
}
.score-line.neg {
  background: linear-gradient(180deg, #ff8a8a, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.score-line.pos {
  background: linear-gradient(180deg, #a0ffc0, #3ddc7a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.best { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.best span { color: var(--gold-2); font-weight: 700; }
.recharge-box {
  margin: 14px 0; padding: 14px; border-radius: 14px;
  background: rgba(214,69,69,0.12); border: 1px solid rgba(255,107,107,0.3);
}
.recharge-box p { margin-bottom: 10px; color: var(--red-2) !important; font-weight: 700; }

/* 模式选择 */
.mode-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px; margin: 10px 0 6px;
}
@media (min-width: 460px) { .mode-grid { grid-template-columns: 1fr 1fr 1fr; } }
.mode-card {
  padding: 18px 12px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(165deg, rgba(232,200,120,0.1), rgba(232,200,120,0.04));
  border: 1px solid rgba(232,200,120,0.22);
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.mode-card:hover {
  transform: translateY(-3px);
  background: rgba(232,200,120,0.16);
  border-color: rgba(232,200,120,0.5);
  box-shadow: 0 12px 32px rgba(232,200,120,0.18);
}
.mode-icon { font-size: 30px; margin-bottom: 8px; }
.mode-name { font-size: 16px; font-weight: 800; color: var(--gold-2); }
.mode-desc { font-size: 11px; color: var(--ink-2); margin-top: 6px; }

.code-input {
  width: 100%; max-width: 280px; margin: 10px auto;
  display: block; padding: 14px 16px;
  font-size: 24px; letter-spacing: 8px; text-align: center; text-transform: uppercase;
  border-radius: 14px; border: 1px solid rgba(232,200,120,0.4);
  background: rgba(0,0,0,0.3); color: var(--gold-2);
  outline: none; font-family: var(--font);
}
.code-input:focus {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(232,200,120,0.2);
}

.room-players {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 8px;
}
.room-player {
  width: 128px; min-height: 86px; padding: 14px 10px 12px;
  border-radius: 14px; text-align: center;
  background: linear-gradient(165deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(232,200,120,0.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.room-player .rp-seat {
  font-size: 11px; color: var(--gold); letter-spacing: 1px; font-weight: 700;
  opacity: .9; white-space: nowrap;
}
.room-player .rp-name {
  font-size: 15px; font-weight: 800; margin: 8px 0 6px;
  color: var(--ink); max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.room-player .rp-state {
  font-size: 11px; color: var(--ink-2); margin-top: 2px;
  white-space: nowrap;
}
.room-player.empty { opacity: 0.5; border-style: dashed; }
.room-player.me {
  border-color: rgba(232,200,120,0.55);
  box-shadow: 0 0 20px rgba(232,200,120,0.15);
}
.room-player.me .rp-name { color: var(--gold-2); }
.room-player.host .rp-seat::after {
  content: " 房主"; opacity: .85; letter-spacing: 0;
}

/* ── 移动端 ── */
@media (max-width: 720px) {
  :root { --card-w: 56px; --card-h: 82px; }
  .seat { top: 18px; }
  .seat-left { left: 18px; }
  .seat-right { right: 18px; }
  .avatar { width: 44px; height: 44px; font-size: 17px; }
  .played { top: 92px; }
  .seat-left .played { left: 70px; }
  .seat-right .played { right: 70px; }
  .action-bar, .bid-bar { bottom: 140px; }
  .my-played { bottom: 196px; }
  .hand { bottom: 10px; min-height: calc(var(--card-h) + 28px); padding: 10px 10px 8px; }
  .table-info { top: 38%; }
  .multi { font-size: 22px; }
  .title { font-size: 15px; letter-spacing: 2px; }
}
@media (max-height: 560px) {
  :root { --card-w: 48px; --card-h: 70px; }
  .action-bar, .bid-bar { bottom: 118px; }
  .my-played { bottom: 158px; }
  .seat { top: 12px; }
}

/* 顶栏补充 */
.top-actions { display: flex; align-items: center; gap: 10px; }
.gold { color: var(--gold-2); font-weight: 800; }
.start-meta { margin-bottom: 6px !important; }
.start-rules {
  font-size: 12px !important; color: var(--mute) !important;
  margin-bottom: 16px !important; letter-spacing: .3px;
}
.mode-card .mode-icon {
  width: 48px; height: 48px; margin: 0 auto 10px;
  display: grid; place-items: center;
  color: var(--gold-2);
  border-radius: 14px;
  background: rgba(232,200,120,0.08);
  border: 1px solid rgba(232,200,120,0.18);
}
.mode-card:hover .mode-icon {
  background: rgba(232,200,120,0.16);
  border-color: rgba(232,200,120,0.4);
}
.mode-card .mode-icon svg { display: block; }

/* 线性图标统一尺寸 */
.sound-btn svg { display: block; opacity: .9; }
.avatar svg { opacity: .9; }

/* 出牌区文字（不出等） */
.pass-tag {
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; color: var(--ink-2); letter-spacing: 2px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.1);
}

/* 发牌/出牌轨迹层 */
.fx-layer {
  position: fixed; inset: 0; z-index: 998; pointer-events: none;
}


/* 牌背：金牛奇迹 Logo */
.card.back {
  background: #5c1018 url("/game/assets/jnqj-cardback.png") center/72% no-repeat;
  border-color: rgba(255,210,170,0.3);
}
.card.back::after {
  content: none;
}
.card.back::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 6px;
  border: 1px solid rgba(255,210,170,0.35);
  pointer-events: none;
}
.card.small.back {
  background-size: 70%;
}

/* 牌面统一：中心只放大花色 */
.card .c-center {
  padding-top: 4px;
}
.card .pip-suit {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.card.small .pip-suit { font-size: 22px; }
.card .face-letter, .card .face-suit { display: none; }

@media (max-width: 720px) {
  .card .pip-suit { font-size: 36px; }
  .card.small .pip-suit { font-size: 20px; }
}

/* 手牌可点性：悬停置顶，避免叠牌点不中 */
.hand .card:hover {
  z-index: 5;
  transform: translateY(-6px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}
.hand .card.selected:hover {
  transform: translateY(-20px);
  z-index: 6;
}


/* ═══ 对家牌背：大气扇形（参考欢乐斗地主） ═══ */
.card-fan {
  display: flex;
  align-items: center;
  height: 72px;
  margin-top: 8px;
  padding-left: 4px;
}
.seat-right .card-fan { justify-content: flex-end; padding-left: 0; padding-right: 4px; }
.fan-card {
  width: 34px;
  height: 58px;
  margin-left: -18px;
  border-radius: 5px;
  background:
    linear-gradient(145deg, #8b1a1a 0%, #c22828 42%, #6b1010 100%);
  border: 1.5px solid rgba(255, 210, 160, 0.45);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  position: relative;
}
.fan-card:first-child { margin-left: 0; }
.fan-card::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 3px;
  border: 1px solid rgba(255, 210, 160, 0.35);
  background:
    url("/game/assets/jnqj-cardback.png") center/70% no-repeat,
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(255,255,255,0.06) 3px 6px);
}

/* 座位更饱满 */
.avatar {
  width: 64px !important;
  height: 64px !important;
  font-size: 24px !important;
}
.pname {
  font-size: 16px !important;
  font-weight: 800 !important;
}
.cnt-badge {
  min-width: 34px;
  height: 26px;
  font-size: 15px !important;
}
.seat {
  top: 22px;
}
.seat-left { left: 28px; }
.seat-right { right: 28px; }
.played {
  top: 118px;
}

@media (max-width: 720px) {
  .avatar { width: 52px !important; height: 52px !important; font-size: 18px !important; }
  .fan-card { width: 26px; height: 44px; margin-left: -14px; }
  .card-fan { height: 56px; }
  .pname { font-size: 13px !important; }
}


/* ═══════════ 手牌 · 严格自适应不裁切 ═══════════ */
.hand {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(98vw, 1120px);
  max-width: 1120px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: var(--hand-gap, 2px);
  padding: 22px 14px 10px;
  overflow: visible !important;
  background: linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.28));
  border-radius: 18px 18px 12px 12px;
  border: 1px solid rgba(232,200,120,0.12);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.28);
  z-index: 15;
  min-height: calc(var(--hand-h, 100px) + 40px);
}

.hand .card {
  width: var(--hand-w, 68px) !important;
  height: var(--hand-h, 96px) !important;
  margin-left: var(--hand-ml, 0) !important;
  flex: 0 0 auto !important;
  border-radius: 8px;
}
.hand .card:first-child {
  margin-left: 0 !important;
}
.hand .card.selected {
  transform: translateY(-14px);
  margin-left: var(--hand-ml-sel, 0) !important;
  box-shadow: 0 12px 28px rgba(232,200,120,0.35), 0 4px 10px rgba(0,0,0,0.25);
  z-index: 3;
  border-color: rgba(232,200,120,0.55);
}
.hand .card.selected:first-child {
  margin-left: 0 !important;
}
.hand .card:hover {
  z-index: 4;
  transform: translateY(-6px);
}
.hand .card.selected:hover {
  transform: translateY(-14px);
  z-index: 5;
}

/* 牌面文字随牌宽缩放，禁止溢出 */
.card {
  overflow: hidden;
}
.card .c-corner {
  top: 3px;
  left: 4px;
  width: 22px;
  line-height: 1;
}
.card .c-corner b {
  font-size: clamp(9px, calc(var(--hand-w, 68px) * 0.24), 17px);
  font-weight: 800;
}
.card .c-corner i {
  font-size: clamp(8px, calc(var(--hand-w, 68px) * 0.17), 12px);
}
.card .c-center {
  inset: 0;
  padding: 0;
}
.card .pip-suit {
  font-size: clamp(14px, calc(var(--hand-w, 68px) * 0.42), 32px);
  line-height: 1;
}
.card .joker-label {
  font-size: clamp(11px, calc(var(--hand-w, 68px) * 0.22), 15px);
  letter-spacing: 1px;
}

/* 小牌（出牌/底牌）固定合理尺寸 */
.played .card, .my-played .card, .bc-row .card {
  width: 48px !important;
  height: 70px !important;
  margin-left: -8px !important;
}
.played .card:first-child, .my-played .card:first-child, .bc-row .card:first-child {
  margin-left: 0 !important;
}
.played .card .c-corner b { font-size: 11px; }
.played .card .pip-suit { font-size: 18px; }

/* 禁止手牌横向滚动条 */
.hand::-webkit-scrollbar { display: none; }
.hand { scrollbar-width: none; }

@media (max-width: 720px) {
  .hand {
    width: 100vw;
    padding: 18px 8px 8px;
    bottom: 8px;
    border-radius: 14px;
  }
}


/* ═══ 大气桌面 + 放大卡牌（可轻微遮挡） ═══ */

/* 牌桌更宽 */
#table {
  max-width: 1480px !important;
  width: 100% !important;
}
#table::before {
  inset: 10px !important;
  border-radius: 32px !important;
}

/* 手牌更大：允许轻叠，突出大气 */
.hand {
  width: min(99vw, 1400px) !important;
  max-width: 1400px !important;
  padding: 28px 18px 14px !important;
  gap: var(--hand-gap, 2px) !important;
  min-height: calc(var(--hand-h, 120px) + 52px) !important;
}
.hand .card {
  width: var(--hand-w, 88px) !important;
  height: var(--hand-h, 126px) !important;
  border-radius: 10px !important;
}
.hand .card .c-corner b {
  font-size: clamp(12px, calc(var(--hand-w, 88px) * 0.26), 22px) !important;
}
.hand .card .c-corner i {
  font-size: clamp(10px, calc(var(--hand-w, 88px) * 0.18), 15px) !important;
}
.hand .card .pip-suit {
  font-size: clamp(20px, calc(var(--hand-w, 88px) * 0.46), 42px) !important;
}
.hand .card.selected {
  transform: translateY(-18px) !important;
}

/* 对家牌背：大而清晰的金牛 Logo */
.card-fan {
  height: 96px !important;
  margin-top: 10px !important;
}
.fan-card {
  width: 52px !important;
  height: 84px !important;
  margin-left: -22px !important;
  border-radius: 7px !important;
  border: 2px solid rgba(255, 210, 160, 0.55) !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.45) !important;
}
.fan-card:first-child { margin-left: 0 !important; }
.fan-card::after {
  inset: 4px !important;
  border-radius: 5px !important;
  border: 1.5px solid rgba(255, 210, 160, 0.45) !important;
  background:
    url("/game/assets/jnqj-cardback.png") center/82% no-repeat !important;
  opacity: 1 !important;
}

/* 出牌 / 底牌也放大 */
.played .card, .my-played .card, .bc-row .card {
  width: 58px !important;
  height: 84px !important;
  margin-left: -10px !important;
}
.played .card .pip-suit { font-size: 22px !important; }
.played .card .c-corner b { font-size: 13px !important; }

/* 座位更醒目 */
.avatar {
  width: 72px !important;
  height: 72px !important;
  font-size: 28px !important;
}
.pname { font-size: 18px !important; }
.cnt-badge {
  min-width: 40px;
  height: 30px;
  font-size: 17px !important;
}

@media (max-width: 900px) {
  .fan-card {
    width: 40px !important;
    height: 66px !important;
    margin-left: -18px !important;
  }
  .card-fan { height: 76px !important; }
}
@media (max-width: 720px) {
  .hand .card {
    width: var(--hand-w, 56px) !important;
    height: var(--hand-h, 80px) !important;
  }
  .fan-card {
    width: 32px !important;
    height: 54px !important;
    margin-left: -14px !important;
  }
  .avatar { width: 56px !important; height: 56px !important; }
}

.sound-btn.off {
  opacity: 0.38;
  border-color: rgba(255,255,255,0.08);
}
.sound-btn + .sound-btn { margin-left: 6px; }


/* ═══ 地主头像特别标识 ═══ */
.avatar.is-landlord {
  border: 3px solid #ffd76a !important;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,215,106,0.35), transparent 50%),
    linear-gradient(145deg, #8a5a18, #3a2810) !important;
  box-shadow:
    0 0 0 3px rgba(255,215,106,0.35),
    0 0 28px rgba(255,200,80,0.55),
    0 8px 24px rgba(0,0,0,0.4) !important;
  color: #ffd76a !important;
}
.avatar.is-landlord::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 16px;
  background:
    linear-gradient(180deg, #ffe28a, #d4a017);
  clip-path: polygon(0 100%, 8% 35%, 25% 70%, 50% 15%, 75% 70%, 92% 35%, 100% 100%);
  z-index: 2;
}
.avatar.is-landlord::after {
  content: "地主";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #2a1c08;
  background: linear-gradient(180deg, #ffe28a, #e0b84a);
  border: 1px solid rgba(255,255,255,0.35);
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.role.farmer {
  background: linear-gradient(135deg, rgba(80,180,120,0.25), rgba(80,180,120,0.1)) !important;
  color: #9ef0b8 !important;
  border-color: rgba(140,230,170,0.3) !important;
}

@media (max-width: 720px) {
  .avatar.is-landlord::after { font-size: 10px; padding: 1px 6px; }
}


/* ═══ 出牌区：桌面中央 · 放大三倍 · 不规则叠放 ═══ */

/* 中央出牌桌心 */
.play-area {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: min(72vw, 720px);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
}

.played {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  min-width: 160px;
  /* 覆盖旧的座位定位 */
  top: auto !important;
  left: auto !important;
  right: auto !important;
}
.my-played {
  position: relative;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  display: none; /* 统一进 play-area，避免重复 */
}

/* 放大三倍的出牌 */
.played .card,
.play-area .card {
  width: 120px !important;
  height: 172px !important;
  margin-left: -36px !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 36px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3) !important;
}
.played .card:first-child,
.play-area .card:first-child {
  margin-left: 0 !important;
}
.played .card .c-corner {
  top: 8px; left: 9px; width: 36px;
}
.played .card .c-corner b {
  font-size: 26px !important;
}
.played .card .c-corner i {
  font-size: 18px !important;
}
.played .card .pip-suit {
  font-size: 56px !important;
}
.played .card .joker-label {
  font-size: 22px !important;
  letter-spacing: 3px;
}

/* 不规则叠放：由 JS 加 .stk-1..n 决定旋转/位移 */
.play-area .card {
  transform: rotate(var(--stk-rot, 0deg)) translate(var(--stk-x, 0), var(--stk-y, 0));
}
.play-area .card:last-child {
  z-index: 20;
  box-shadow: 0 18px 42px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,220,160,0.15) !important;
}

/* 提示文字：操作按钮上方 */
.table-info {
  top: auto !important;
  bottom: 250px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  text-align: center;
}
.action-bar, .bid-bar {
  bottom: 168px !important;
}

/* 不出标签也在中央 */
.pass-tag {
  padding: 10px 22px;
  font-size: 16px;
  letter-spacing: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .played .card, .play-area .card {
    width: 72px !important;
    height: 104px !important;
    margin-left: -22px !important;
  }
  .played .card .c-corner b { font-size: 16px !important; }
  .played .card .pip-suit { font-size: 32px !important; }
  .play-area { width: 92vw; top: 42%; }
  .table-info { bottom: 210px !important; }
}


/* ===== 右下角状态轮播条 ===== */
.status-ticker {
  position: absolute; right: 14px; bottom: 18px; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  max-width: min(280px, 46vw);
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  background: rgba(8, 14, 12, 0.72);
  border: 1px solid rgba(232, 200, 120, 0.28);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}
.ticker-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
  box-shadow: 0 0 10px rgba(232,200,120,0.8);
  animation: tickerPulse 1.6s ease-in-out infinite;
}
@keyframes tickerPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.ticker-view {
  position: relative; flex: 1; min-width: 0; height: 18px; overflow: hidden;
}
.ticker-line {
  position: absolute; inset: 0;
  font-size: 12px; line-height: 18px; font-weight: 600;
  color: var(--gold-2); letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.ticker-line.is-on { opacity: 1; transform: translateY(0); }
.ticker-line.is-off { opacity: 0; transform: translateY(-10px); }

/* ===== 中央出牌堆叠（不清空，新牌压上） ===== */
.play-area {
  position: absolute; left: 50%; top: 46%;
  width: min(72%, 520px); height: 160px;
  transform: translate(-50%, -50%);
  z-index: 8; pointer-events: none;
}
.play-area .played { display: none; }
.play-group {
  position: absolute; left: 50%; top: 50%;
  display: flex; gap: 2px;
  transform: translate(-50%, -50%);
  transition: transform 0.35s ease, opacity 0.35s ease;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}
.play-group .card { margin-left: -18px; }
.play-group .card:first-child { margin-left: 0; }
.play-group .pass-tag {
  padding: 8px 18px; border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: var(--ink); font-size: 13px; font-weight: 700;
  letter-spacing: 2px;
}


/* ===== 出牌飞行动画 ===== */
.card.fly {
  position: fixed; z-index: 1000;
  pointer-events: none;
  transition:
    left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s ease;
  will-change: left, top, transform, opacity;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,0.45));
}

/* 出牌组入场：从下方弹入 */
.play-group.play-in {
  animation: playIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes playIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 36px)) scale(1.12);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 出牌者标签（牌面上方） */
.who-tag {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  color: #1a1408;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  z-index: 20;
  pointer-events: none;
}
.play-group.seat-1 .who-tag {
  background: linear-gradient(180deg, #9fd8ff, #5eb0e8);
}
.play-group.seat-2 .who-tag {
  background: linear-gradient(180deg, #ffb4c8, #e87a9a);
}
.play-group.seat-0 .who-tag {
  background: linear-gradient(180deg, #f7e7b8, #e8d5a3);
}
.play-group .pass-tag { position: relative; }


/* 出牌叠放：同尺寸 + 后盖前 + 轻阴影 */
.played .card,
.play-area .card {
  width: 118px !important;
  height: 170px !important;
  margin-left: -48px !important;
  border-radius: 11px !important;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18) !important;
  filter: none !important;
  opacity: 1 !important;
}
.played .card:first-child,
.play-area .card:first-child {
  margin-left: 0 !important;
}
.play-area .card {
  transform: rotate(var(--stk-rot, 0deg)) translate(var(--stk-x, 0px), var(--stk-y, 0px));
}
.play-area .card:last-child {
  box-shadow: 0 5px 12px rgba(0,0,0,0.22) !important;
}
.played .card .c-corner b { font-size: 25px !important; }
.played .card .c-corner i { font-size: 17px !important; }
.played .card .pip-suit { font-size: 54px !important; }

@media (max-width: 720px) {
  .played .card, .play-area .card {
    width: 72px !important;
    height: 104px !important;
    margin-left: -28px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.16) !important;
  }
}


/* 飞机动画 */
.plane-fx {
  position: absolute;
  left: -20%;
  top: 30%;
  color: #ffe28a;
  filter: drop-shadow(0 4px 12px rgba(255,200,80,0.55));
  pointer-events: none;
  z-index: 40;
  animation: planeFly 1.05s ease-in-out forwards;
}
@keyframes planeFly {
  0% { transform: translate(0, 20px) rotate(-8deg) scale(0.7); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(120vw, -30px) rotate(8deg) scale(1.15); opacity: 0; }
}
.play-area { overflow: visible; }


/* 三家各自出牌区 */
.play-zone {
  position: absolute;
  width: min(34vw, 380px);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
}
.play-zone.left {
  left: 14%;
  top: 42%;
  transform: translateY(-50%);
}
.play-zone.right {
  right: 14%;
  top: 42%;
  transform: translateY(-50%);
}
.play-zone.me {
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
}
.play-zone .card {
  width: 86px !important;
  height: 124px !important;
  margin-left: -28px !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16) !important;
  filter: none !important;
  opacity: 1 !important;
}
.play-zone .card:first-child { margin-left: 0 !important; }
.play-zone .card .c-corner b { font-size: 18px !important; }
.play-zone .card .c-corner i { font-size: 12px !important; }
.play-zone .card .pip-suit { font-size: 36px !important; }
.play-zone .card .joker-label { font-size: 14px !important; }
.play-zone .card:last-child {
  box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
}
.play-zone .pass-tag {
  padding: 8px 18px;
  font-size: 14px;
  letter-spacing: 3px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink-2);
}
@media (max-width: 720px) {
  .play-zone { width: 42vw; min-height: 100px; }
  .play-zone.left { left: 2%; top: 38%; }
  .play-zone.right { right: 2%; top: 38%; }
  .play-zone.me { top: 52%; }
  .play-zone .card {
    width: 56px !important;
    height: 82px !important;
    margin-left: -18px !important;
  }
}


/* 三家出牌区紧贴中间：左右轻盖我方牌 */
.play-zone.left {
  left: 28% !important;
  top: 54% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9 !important;
}
.play-zone.right {
  right: 28% !important;
  left: auto !important;
  top: 54% !important;
  transform: translate(50%, -50%) !important;
  z-index: 9 !important;
}
.play-zone.me {
  left: 50% !important;
  top: 58% !important;
  transform: translateX(-50%) !important;
  z-index: 8 !important;
}
.play-zone.left .card {
  margin-left: -32px !important;
}
.play-zone.right .card {
  margin-left: -32px !important;
}
@media (max-width: 720px) {
  .play-zone.left { left: 18% !important; top: 50% !important; }
  .play-zone.right { right: 18% !important; top: 50% !important; }
  .play-zone.me { top: 56% !important; }
}


/* 出牌堆：各家面前 · 新牌盖住旧牌 · 紧凑堆叠 */
.play-zone.left {
  left: 22% !important;
  top: 38% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9 !important;
}
.play-zone.right {
  right: 22% !important;
  left: auto !important;
  top: 38% !important;
  transform: translate(50%, -50%) !important;
  z-index: 9 !important;
}
.play-zone.me {
  left: 50% !important;
  top: 52% !important;
  transform: translateX(-50%) !important;
  z-index: 10 !important;
}
.play-zone {
  width: 200px !important;
  min-height: 160px !important;
  position: absolute;
}
.play-zone .card {
  width: 92px !important;
  height: 132px !important;
  margin-left: -40px !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
  filter: none !important;
  opacity: 1 !important;
}
.play-zone .card:first-child { margin-left: 0 !important; }
.play-zone .card .c-corner b { font-size: 18px !important; }
.play-zone .card .c-corner i { font-size: 12px !important; }
.play-zone .card .pip-suit { font-size: 34px !important; }
.play-zone .card:last-child {
  box-shadow: 0 4px 12px rgba(0,0,0,0.22) !important;
}
@media (max-width: 720px) {
  .play-zone { width: 130px !important; min-height: 110px !important; }
  .play-zone.left { left: 12% !important; top: 34% !important; }
  .play-zone.right { right: 12% !important; top: 34% !important; }
  .play-zone.me { top: 48% !important; }
  .play-zone .card {
    width: 58px !important;
    height: 84px !important;
    margin-left: -24px !important;
  }
}


/* 各家出牌区：最新一手永远叠在区域最顶层 */
.play-zone {
  overflow: visible !important;
  display: block !important;
  position: absolute !important;
}
.play-zone .pile {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 132px;
}
.play-zone .pile .card {
  width: 92px !important;
  height: 132px !important;
  margin-left: -36px !important;
  flex: 0 0 auto !important;
}
.play-zone .pile .card:first-child { margin-left: 0 !important; }
.play-zone .pile.latest {
  z-index: 30;
}
.play-zone .pile.older {
  z-index: 10;
  filter: brightness(0.92);
}


/* 终局得分条（无大弹窗） */
.score-float {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 60;
  padding: 18px 36px;
  border-radius: 18px;
  background: rgba(10, 20, 12, 0.82);
  border: 1px solid rgba(232,200,120,0.35);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  text-align: center;
  pointer-events: none;
  animation: scorePop .45s ease-out;
}
.score-float .d {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
}
.score-float .d.pos { color: #5ddea0; }
.score-float .d.neg { color: var(--red-2); }
.score-float .t {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
@keyframes scorePop {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 发牌动画 */
.card.deal-in {
  animation: dealIn .42s cubic-bezier(.22,.9,.28,1) both;
}
@keyframes dealIn {
  0% {
    transform: translate(calc(var(--from-x, 0px)), calc(var(--from-y, -120px))) rotate(-18deg) scale(0.55);
    opacity: 0;
  }
  70% { opacity: 1; }
  100% {
    transform: translate(0,0) rotate(0deg) scale(1);
    opacity: 1;
  }
}
.hand .card.deal-in {
  animation-duration: .38s;
}


/* 终局得分 + 开始按钮 */
.score-float {
  pointer-events: auto !important;
  cursor: default;
}
.score-float .btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  pointer-events: auto;
}
.score-float .sf-btn {
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.score-float .sf-btn.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #2a1c08;
}
.score-float .sf-btn.ghost {
  background: rgba(255,255,255,0.12);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.2);
}


/* 开局发牌：更明显的飞入过渡 */
.hand .card.deal-in {
  animation: dealFly .55s cubic-bezier(.16,.84,.3,1.05) both !important;
}
@keyframes dealFly {
  0% {
    transform: translate(var(--from-x, 0px), var(--from-y, -220px)) rotate(-28deg) scale(.45);
    opacity: 0;
  }
  55% {
    opacity: 1;
    transform: translate(calc(var(--from-x, 0px) * 0.2), calc(var(--from-y, -220px) * 0.15)) rotate(-8deg) scale(.95);
  }
  100% {
    transform: translate(0,0) rotate(0deg) scale(1);
    opacity: 1;
  }
}
.deal-ready .card {
  /* 不永久隐藏，仅动画起点透明 */
  animation-fill-mode: both;
}


/* 出牌动画增强 */
.play-zone .card.deal-in,
.play-zone .card.play-in {
  animation: playPop .38s cubic-bezier(.2,.9,.3,1.1) both !important;
}
@keyframes playPop {
  0% {
    transform: translateY(-48px) scale(1.28) rotate(-10deg);
    opacity: 0;
    filter: blur(2px);
  }
  55% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(6px) scale(1.02) rotate(2deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(var(--stk-rot, 0deg));
    opacity: 1;
    filter: blur(0);
  }
}
.play-zone .card {
  transition: box-shadow .15s ease;
}
.play-zone .card:last-child {
  box-shadow: 0 8px 22px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,230,180,0.12) !important;
}

/* 发牌动画再强化 */
.hand .card.deal-in {
  animation: dealFly2 .52s cubic-bezier(.12,.88,.28,1.02) both !important;
}
@keyframes dealFly2 {
  0% {
    transform: translate(var(--from-x, 0px), var(--from-y, -240px)) rotate(-32deg) scale(.4);
    opacity: 0;
  }
  40% {
    opacity: 1;
    transform: translate(calc(var(--from-x, 0px) * .35), calc(var(--from-y, -240px) * .2)) rotate(-12deg) scale(.9);
  }
  75% {
    transform: translate(0, -8px) rotate(2deg) scale(1.03);
  }
  100% {
    transform: translate(0,0) rotate(0deg) scale(1);
    opacity: 1;
  }
}


/* 不洗牌：手牌两行 + 放大 */
.hand.row2 {
  flex-wrap: wrap !important;
  overflow: visible !important;
  max-width: min(98vw, 1200px);
  width: min(98vw, 1200px);
  gap: 8px 2px;
  padding: 18px 16px 12px;
  min-height: calc(var(--hand-h, 110px) * 2 + 48px) !important;
  align-content: flex-end;
}
.hand.row2 .card {
  width: var(--hand-w, 72px) !important;
  height: var(--hand-h, 104px) !important;
  margin-left: 0 !important;
  margin-right: -10px;
}
.hand.row2 .card.selected {
  transform: translateY(-12px) !important;
  margin-left: 0 !important;
  margin-right: -6px;
}
@media (max-width: 720px) {
  .hand.row2 {
    width: 100vw;
    padding: 10px 6px;
    gap: 6px 0;
    min-height: calc(var(--hand-h, 80px) * 2 + 28px) !important;
  }
}


/* 两行手牌时操作条上移，避免压牌 */
.hand.row2 ~ .action-bar,
.hand.row2 ~ .bid-bar,
#table:has(.hand.row2) .action-bar,
#table:has(.hand.row2) .bid-bar {
  bottom: calc(var(--hand-h, 110px) * 2 + 78px) !important;
}
.hand.row2 ~ .table-info,
#table:has(.hand.row2) .table-info {
  bottom: calc(var(--hand-h, 110px) * 2 + 130px) !important;
}
@media (max-width: 720px) {
  #table:has(.hand.row2) .action-bar,
  #table:has(.hand.row2) .bid-bar {
    bottom: calc(var(--hand-h, 80px) * 2 + 56px) !important;
  }
}


/* 标题真正居中 */
.topbar {
  position: relative;
  justify-content: space-between;
}
.topbar .title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  pointer-events: none;
  z-index: 2;
}


/* 终局亮牌：两行自适应 */
.card-fan.reveal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  max-width: 220px;
  height: auto !important;
  min-height: 64px;
  gap: 2px;
  overflow: hidden;
}
.card-fan.reveal .card {
  margin-left: -8px !important;
  margin-top: 2px;
}
.seat-right .card-fan.reveal {
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .card-fan.reveal { max-width: 140px; }
}


/* 终局亮牌：清出牌区，手牌两行整齐展示 */
.play-zone { overflow: visible; }
.card-fan.reveal {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 36px);
  gap: 2px;
  max-width: 200px;
  width: 200px;
  height: auto !important;
  min-height: 0;
  padding: 4px;
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
}
.card-fan.reveal .card {
  width: 34px !important;
  height: 50px !important;
  margin: 0 !important;
  transform: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}
.card-fan.reveal .card .c-corner b { font-size: 9px !important; }
.card-fan.reveal .card .c-corner i { font-size: 7px !important; }
.card-fan.reveal .card .pip-suit { font-size: 12px !important; }
.card-fan.reveal .card .joker-label { font-size: 8px !important; }
.seat-right .card-fan.reveal { margin-left: auto; }


/* 牌背：复杂纹理 + 金牛 Logo */
.card.back {
  background:
    url("/game/assets/jnqj-cardback.png") center/62% no-repeat,
    radial-gradient(circle at 30% 25%, rgba(255,210,160,0.18), transparent 45%),
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.04) 0 2px,
      transparent 2px 6px),
    repeating-linear-gradient(-45deg,
      rgba(0,0,0,0.08) 0 2px,
      transparent 2px 8px),
    linear-gradient(160deg, #8b1a1a 0%, #c22828 45%, #5c1010 100%);
  background-blend-mode: normal, overlay, soft-light, soft-light, normal;
  border: 1.5px solid rgba(255,210,160,0.45) !important;
}
.card.back::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 6px;
  border: 1px solid rgba(255,210,160,0.4);
  background:
    url("/game/assets/jnqj-cardback.png") center/80% no-repeat;
  opacity: 0.55;
  pointer-events: none;
}
.fan-card {
  background:
    url("/game/assets/jnqj-cardback.png") center/70% no-repeat,
    repeating-linear-gradient(30deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #7a1820, #a82830 50%, #5c1018) !important;
}
