/* ==========================================================================
   《喜乐斗地主》 精致国风视觉系统 (game.css v2.9.0)
   深度适配：
   1. 荣耀 Magic8 Pro (约 20:9 超宽挖孔屏 + 大字模式防折行 + 安全区避让)
   2. 荣耀 V Purse (闭合态约 19.4:9 外屏 & 展开态约 7:6 方屏双形态自适应)
   ========================================================================== */
:root {
  --crimson-deep: #3d0c0b;
  --crimson-mid: #7d1916;
  --crimson-bright: #c92a2a;
  --gold-light: #fff0b3;
  --gold-main: #f6c343;
  --gold-rich: #d4941a;
  --gold-dark: #7a4b06;
  --felt-center: #1d6b47;
  --felt-mid: #134e33;
  --felt-edge: #0a2e1e;
  --wood-frame: #4a2112;
  --ivory-card: #fffdf8;
  --card-red: #cf1f25;
  --card-black: #1c2026;
  --text-cream: #fff9eb;
  --text-muted: #e6d2b5;
  --safe-top: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
  --safe-right: 0px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea, code {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--crimson-deep);
  color: var(--text-cream);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.app-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

.hidden {
  display: none !important;
}

/* 竖屏温馨提示条 */
.portrait-tip {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(92vw, 420px);
}
.portrait-tip-box {
  background: rgba(54, 14, 12, 0.94);
  border: 1.5px solid var(--gold-main);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
}
.rotate-icon { font-size: 16px; flex-shrink: 0; }
.rotate-text { flex: 1; color: var(--gold-light); }

/* ==================== 1. 大厅样式（严格单行防折行设计） ==================== */
.lobby-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.lobby-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(45, 14, 10, 0.25) 0%, rgba(28, 7, 6, 0.84) 100%),
    linear-gradient(180deg, rgba(25, 6, 5, 0.78) 0%, rgba(25, 6, 5, 0.18) 32%, rgba(25, 6, 5, 0.86) 100%);
}

.lobby-topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding-top: max(9px, env(safe-area-inset-top, 0px), var(--safe-top, 0px));
  padding-bottom: 4px;
  padding-left: max(14px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px), var(--safe-right, 0px));
  background: linear-gradient(180deg, rgba(38, 8, 7, 0.92) 0%, rgba(38, 8, 7, 0) 100%);
}

.player-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(48, 12, 10, 0.88);
  border: 1.5px solid rgba(246, 195, 67, 0.55);
  border-radius: 999px;
  padding: 3px 11px 3px 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.avatar-circle {
  width: clamp(34px, 4.4vw, 44px);
  height: clamp(34px, 4.4vw, 44px);
  border-radius: 50%;
  background: linear-gradient(135deg, #d63629, #8f160f);
  border: 2px solid var(--gold-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 2.3vw, 23px);
  flex-shrink: 0;
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.player-name {
  font-weight: 800;
  font-size: clamp(12px, 1.5vw, 15px);
  color: #fff8e7;
  white-space: nowrap;
}

/* 棋牌段位勋章（替代原“实名认证”） */
.rank-tag {
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(90deg, rgba(246, 195, 67, 0.28), rgba(212, 148, 26, 0.42));
  color: #ffe89e;
  border: 1px solid rgba(246, 195, 67, 0.6);
  padding: 0 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.beans-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 999px;
  padding: 1px 3px 1px 6px;
  border: 1px solid rgba(246, 195, 67, 0.35);
  white-space: nowrap;
}

.bean-icon { font-size: 12px; }
.bean-num {
  font-weight: 800;
  color: var(--gold-main);
  font-size: clamp(12px, 1.5vw, 15px);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bean-plus-btn {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #ffd966, #d99014);
  color: #4a1c03;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.online-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(24, 8, 7, 0.78);
  border: 1px solid rgba(255, 240, 179, 0.3);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: clamp(11px, 1.35vw, 13px);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.clickable-pill {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.clickable-pill:hover {
  border-color: var(--gold-main);
  background: rgba(48, 14, 12, 0.88);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #40c057;
  box-shadow: 0 0 8px #40c057;
  flex-shrink: 0;
}

.lobby-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(5px, 0.8vw, 10px);
  flex-shrink: 0;
}

.nav-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px clamp(8px, 1.15vw, 13px);
  border-radius: 11px;
  border: 1.5px solid rgba(246, 195, 67, 0.45);
  background: linear-gradient(180deg, rgba(84, 22, 18, 0.92), rgba(46, 10, 9, 0.92));
  color: var(--gold-light);
  font-weight: 700;
  font-size: clamp(12px, 1.4vw, 14px);
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease;
}

.nav-emoji {
  font-size: clamp(12px, 1.45vw, 15px);
  line-height: 1;
  flex-shrink: 0;
}

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

.nav-welfare-highlight {
  background: linear-gradient(180deg, #d93025 0%, #991611 100%);
  border-color: #ffe082;
  box-shadow: 0 4px 16px rgba(217, 48, 37, 0.48);
}

.red-dot-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  background: #ff2a2a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  white-space: nowrap;
}

.gold-pill-badge {
  position: absolute;
  top: -10px;
  right: -4px;
  background: linear-gradient(90deg, #ffe082, #f5b427);
  color: #4a1504;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.3;
  padding: 1px 5px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* 全服实时喜报广播跑马灯 */
.marquee-wrap {
  position: relative;
  z-index: 5;
  padding: 2px max(14px, env(safe-area-inset-right, 0px), var(--safe-right, 0px)) 2px max(14px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
}

.marquee-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(32, 7, 6, 0.72);
  border: 1px solid rgba(246, 195, 67, 0.28);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11.5px;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-speaker {
  color: var(--gold-main);
  font-weight: 800;
  flex-shrink: 0;
}

.marquee-viewport {
  flex: 1;
  overflow: hidden;
}

.marquee-text {
  color: #fff3d1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.28s ease;
}

/* 大厅双栏主体（同时兼容 20:9 超宽屏与 V Purse 7:6 展开态方屏） */
.lobby-main {
  position: relative;
  z-index: 4;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(252px, 39%) 1fr;
  gap: clamp(10px, 1.6vw, 22px);
  align-items: center;
  padding: 4px max(14px, env(safe-area-inset-right, 0px), var(--safe-right, 0px)) 4px max(14px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
  min-height: 0;
}

.lobby-left-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 14px);
  min-width: 0;
}

.brand-plaque {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(38, 9, 8, 0.8);
  border: 1.5px solid rgba(246, 195, 67, 0.48);
  border-radius: 15px;
  padding: clamp(7px, 1.3vh, 12px) 12px;
  backdrop-filter: blur(6px);
}

.brand-logo-img {
  width: clamp(44px, 5.8vw, 64px);
  height: clamp(44px, 5.8vw, 64px);
  border-radius: 13px;
  border: 2px solid var(--gold-main);
  flex-shrink: 0;
}

.brand-titles { min-width: 0; }

.brand-h1 {
  margin: 0;
  font-size: clamp(17px, 2.3vw, 24px);
  color: var(--gold-light);
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.brand-sub {
  margin: 3px 0 0;
  font-size: clamp(11px, 1.25vw, 12.5px);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.welfare-progress-card {
  background: linear-gradient(145deg, rgba(96, 18, 15, 0.94), rgba(48, 9, 8, 0.95));
  border: 1.5px solid rgba(246, 195, 67, 0.65);
  border-radius: 15px;
  padding: clamp(8px, 1.5vh, 14px) 12px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  transition: transform 0.16s ease;
}

.welfare-progress-card:hover { transform: translateY(-2px); }

.wpc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.wpc-tag {
  background: linear-gradient(90deg, #ffe082, #f5b427);
  color: #4f1404;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.wpc-stock {
  font-size: 11.5px;
  color: #ffd88a;
  font-weight: 800;
  white-space: nowrap;
}

.wpc-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.jd-mini-card {
  width: 48px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e1251b, #a8120b);
  border: 1.5px solid #ffd670;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.jd-mini-brand { font-size: 9px; font-weight: 800; color: #ffe8b3; white-space: nowrap; }
.jd-mini-val { font-size: 13.5px; font-weight: 900; color: #fff; line-height: 1.05; }

.wpc-info { min-width: 0; flex: 1; }

.wpc-main-title {
  font-size: clamp(11.5px, 1.38vw, 14px);
  font-weight: 800;
  color: #fff6db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wpc-desc {
  font-size: 11.5px;
  color: #f3d6a2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  width: 100%;
  height: 9px;
  background: rgba(0, 0, 0, 0.48);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 130, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59f00, #ffe066);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.wpc-footer {
  margin-top: 5px;
  text-align: right;
  font-size: 11px;
  color: var(--gold-main);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-right-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 14px);
  min-width: 0;
}

.room-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.1vw, 14px);
}

.room-card {
  position: relative;
  text-align: left;
  border-radius: 15px;
  padding: clamp(9px, 1.8vh, 16px) clamp(8px, 1.2vw, 14px);
  border: 2px solid rgba(255, 226, 140, 0.55);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.room-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.52);
}

.room-card:active { transform: scale(0.97); }

.room-novice { background: linear-gradient(160deg, #1f6f4a 0%, #113f29 100%); }
.room-classic { background: linear-gradient(160deg, #b8291f 0%, #5e110c 100%); }
.room-master { background: linear-gradient(160deg, #9c5a10 0%, #4a2604 100%); }

.room-ribbon {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 5px;
  white-space: nowrap;
}
.ribbon-hot { background: #ffca28; color: #541404; }
.ribbon-gold { background: #ffe082; color: #472103; }

.room-title {
  font-size: clamp(13.5px, 1.75vw, 18.5px);
  font-weight: 900;
  margin-bottom: 3px;
  white-space: nowrap;
}

.room-base {
  font-size: clamp(11.5px, 1.4vw, 13.5px);
  color: #ffe8a3;
  margin-bottom: 3px;
  white-space: nowrap;
}

.room-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-online {
  font-size: 11px;
  font-weight: 700;
  color: #d8f5a2;
  white-space: nowrap;
}

.quick-start-bar {
  display: flex;
  justify-content: flex-end;
}

.btn-quick-start {
  width: 100%;
  border: 2px solid #fff3bf;
  border-radius: 15px;
  padding: clamp(8px, 1.6vh, 13px) 18px;
  background: linear-gradient(180deg, #ffe066 0%, #f59f00 52%, #d97706 100%);
  color: #4a1703;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(245, 159, 0, 0.45), inset 0 2px 2px rgba(255, 255, 255, 0.7);
  transition: transform 0.14s ease;
}

.btn-quick-start:active { transform: scale(0.98); }
.qs-main { font-size: clamp(16px, 2.2vw, 20px); font-weight: 900; white-space: nowrap; }
.qs-sub {
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(74, 23, 3, 0.14);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.lobby-footer {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 2px 14px max(4px, env(safe-area-inset-bottom, 4px));
  font-size: 10.5px;
  color: rgba(255, 235, 200, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== 2. 牌桌对战样式（安全区避让 + 双形态适配） ==================== */
.table-felt {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, var(--felt-center) 0%, var(--felt-mid) 58%, var(--felt-edge) 100%);
  border: clamp(4px, 0.8vh, 7px) solid var(--wood-frame);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.58);
}

.table-cloud-pattern {
  position: absolute;
  inset: 14px;
  border: 1.5px solid rgba(246, 195, 67, 0.16);
  border-radius: 20px;
  pointer-events: none;
}

.table-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding-top: max(4px, env(safe-area-inset-top, 0px), var(--safe-top, 0px));
  padding-bottom: 4px;
  padding-left: max(14px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px), var(--safe-right, 0px));
  background: linear-gradient(180deg, rgba(8, 30, 19, 0.88) 0%, rgba(8, 30, 19, 0) 100%);
}

.table-top-left, .table-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.table-icon-btn {
  background: rgba(12, 42, 28, 0.88);
  border: 1px solid rgba(246, 195, 67, 0.45);
  color: var(--gold-light);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.table-icon-btn.active {
  background: rgba(212, 148, 26, 0.28);
  border-color: var(--gold-main);
}

.table-room-badge {
  font-size: 12px;
  color: #b2f2bb;
  font-weight: 700;
  white-space: nowrap;
}

.ping-badge {
  font-size: 11px;
  color: #8ce99a;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hole-cards-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(9, 34, 22, 0.9);
  border: 1.5px solid rgba(246, 195, 67, 0.48);
  border-radius: 13px;
  padding: 3px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.hole-cards-box {
  display: flex;
  gap: 4px;
}

.mini-hole-card {
  width: clamp(24px, 3vw, 32px);
  height: clamp(33px, 4.2vw, 44px);
  border-radius: 5px;
  background: var(--ivory-card);
  border: 1px solid #d0c5b1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11.5px;
  line-height: 1.05;
  color: var(--card-black);
}

.mini-hole-card.red { color: var(--card-red); }
.mini-hole-card.back {
  background: linear-gradient(135deg, #b8251e, #78120d);
  border: 1.5px solid #f6c343;
}

.score-mult-box {
  display: flex;
  gap: 9px;
  font-size: 11.5px;
  white-space: nowrap;
}

.sm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
}
.sm-item span { font-size: 10px; color: #a3cfba; white-space: nowrap; }
.sm-item strong { color: var(--gold-main); font-size: 13px; white-space: nowrap; }
.mult-val.bump { animation: popScale 0.4s ease; }

/* 记牌器 */
.card-recorder-bar {
  position: relative;
  z-index: 9;
  margin: 0 auto;
  display: flex;
  gap: 2px;
  background: rgba(8, 28, 19, 0.88);
  border: 1px solid rgba(246, 195, 67, 0.35);
  border-radius: 8px;
  padding: 2px 7px;
  white-space: nowrap;
}

.cr-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(16px, 2.1vw, 23px);
  font-size: 11px;
}
.cr-rank { color: #d8f3dc; font-weight: 700; font-size: 10px; }
.cr-cnt { color: var(--gold-main); font-weight: 800; font-size: 11px; }
.cr-cnt.zero { color: rgba(255, 255, 255, 0.25); }

/* 中央对战舞台与左右对手席位（Flex 联动隔离，100% 杜绝文字与扑克牌互相遮挡） */
.table-play-stage {
  position: relative;
  flex: 1;
  z-index: 6;
  min-height: 0;
  pointer-events: none;
}

.opponent-anchor {
  position: absolute;
  top: 4px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 16px);
}

.opponent-left {
  left: max(10px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
}

.opponent-right {
  right: max(10px, env(safe-area-inset-right, 0px), var(--safe-right, 0px));
}

.seat-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 35, 23, 0.9);
  border: 1.5px solid rgba(246, 195, 67, 0.42);
  border-radius: 14px;
  padding: 6px 10px;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.seat-right {
  flex-direction: row-reverse;
  text-align: right;
}

.seat-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.seat-avatar {
  width: clamp(36px, 4.4vw, 44px);
  height: clamp(36px, 4.4vw, 44px);
  border-radius: 11px;
  border: 2px solid var(--gold-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #2b6cb0;
}

/* 身份标签采用标准文档流置于头像正下方，绝不跨列遮挡剩余牌数与牌背图标 */
.role-badge {
  position: static;
  transform: none;
  display: inline-block;
  white-space: nowrap;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.25;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.role-badge.landlord {
  background: linear-gradient(90deg, #ffca28, #e65100);
  color: #fff;
}

.role-badge.peasant {
  background: linear-gradient(90deg, #40c057, #1b6e32);
  color: #fff;
}

.role-badge.role-inline {
  position: static;
  transform: none;
}

.seat-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.seat-right .seat-info {
  align-items: flex-end;
}

.seat-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.seat-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #fff8e7;
  white-space: nowrap;
}

.double-mini-tag {
  display: inline-block;
  background: linear-gradient(90deg, #ff6b6b, #c92a2a);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #ffe066;
  vertical-align: middle;
  white-space: nowrap;
}

.seat-region-beans {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.seat-right .seat-region-beans { justify-content: flex-end; }

.region-tag {
  background: rgba(255, 255, 255, 0.14);
  padding: 0 5px;
  border-radius: 4px;
  color: #d3f9d8;
  font-size: 10px;
}

.seat-beans { color: var(--gold-main); font-weight: 700; }

.seat-card-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  white-space: nowrap;
}

.card-back-mini {
  width: 13px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(135deg, #d63026, #87140e);
  border: 1px solid var(--gold-main);
  display: inline-block;
  flex-shrink: 0;
}

.seat-card-counter strong {
  font-size: 14.5px;
  line-height: 1;
  color: #fff;
}

.alarm-lamp {
  background: #e03131;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  animation: pulseAlarm 0.75s infinite alternate;
}

@keyframes pulseAlarm {
  from { transform: scale(1); box-shadow: 0 0 4px #ff4d4f; }
  to { transform: scale(1.08); box-shadow: 0 0 12px #ffec3d; }
}

/* 聊天气泡（严格挂载于席位框正下方/状态条正上方外部，绝不遮挡框内文字） */
.chat-bubble {
  position: absolute;
  background: rgba(255, 252, 240, 0.97);
  color: #3b1c0a;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 12px;
  border: 1.5px solid var(--gold-rich);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  z-index: 30;
  animation: popScale 0.22s ease;
}

.chat-left { top: calc(100% + 6px); left: 0; }
.chat-right { top: calc(100% + 6px); right: 0; }
.chat-bottom { bottom: calc(100% + 6px); left: max(16px, env(safe-area-inset-left, 0px), var(--safe-left, 0px)); }

.play-zone {
  display: flex;
  align-items: center;
  min-height: 54px;
}

.zone-left {
  justify-content: flex-start;
}

.zone-right {
  justify-content: flex-end;
}

.zone-bottom {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
}

.call-status-tag {
  background: rgba(10, 38, 25, 0.9);
  border: 1.5px solid var(--gold-main);
  color: var(--gold-light);
  font-weight: 900;
  font-size: clamp(13px, 1.8vw, 16px);
  padding: 4px 13px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.ai-thinking-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.54);
  color: #ffe066;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.played-cards-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.zone-right .played-cards-stack {
  align-items: flex-end;
}

.played-cards-row {
  display: flex;
  align-items: center;
}
.played-cards-row + .played-cards-row {
  margin-top: -18px;
}

.played-card {
  width: clamp(36px, 4.3vw, 48px);
  height: clamp(50px, 6.1vw, 68px);
  margin-left: -17px;
  border-radius: 7px;
  background: var(--ivory-card);
  border: 1px solid #cbbba0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  position: relative;
  padding: 3px 4px;
  color: var(--card-black);
  animation: dealSnap 0.16s ease;
  flex-shrink: 0;
}
.played-card:first-child { margin-left: 0; }
.played-cards-row.compact-row .played-card {
  width: clamp(32px, 3.8vw, 42px);
  height: clamp(45px, 5.3vw, 58px);
  margin-left: -19px;
}
.played-cards-row.compact-row .played-card:first-child { margin-left: 0; }
.played-card.red { color: var(--card-red); }
.played-card .pc-rank { font-size: clamp(12px, 1.55vw, 15.5px); font-weight: 900; line-height: 1; letter-spacing: -0.5px; }
.played-card .pc-joker {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: clamp(9.5px, 1.25vw, 12px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.5px;
}
.played-card .pc-suit { font-size: clamp(10px, 1.25vw, 12.5px); line-height: 1; margin-top: 1px; }
.played-card .pc-center {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: clamp(13px, 1.8vw, 20px);
  opacity: 0.9;
}

.fx-banner {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(26px, 4.2vw, 44px);
  font-weight: 900;
  color: #ffe066;
  text-shadow: 0 4px 0 #8f1d14, 0 8px 24px rgba(0, 0, 0, 0.75);
  letter-spacing: 3px;
  white-space: nowrap;
  z-index: 40;
  animation: fxBurst 0.85s ease forwards;
}

@keyframes fxBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1.06); }
}

.screen-shake { animation: tableShake 0.42s ease; }

@keyframes tableShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 5px); }
  40% { transform: translate(8px, -6px); }
  60% { transform: translate(-6px, -4px); }
  80% { transform: translate(6px, 4px); }
}

/* ==================== 底部手牌与按钮区（兼顾 20:9 与 7:6 方屏） ==================== */
.player-bottom-area {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 15px);
  margin-bottom: clamp(5px, 1.2vh, 10px);
  white-space: nowrap;
}

.turn-clock {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3bf, #f08c00);
  border: 2px solid #fff;
  color: #4a1503;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.turn-clock.clock-urgent {
  background: radial-gradient(circle, #ffc9c9, #e03131);
  color: #fff;
  border-color: #ffe3e3;
  animation: urgentClockPulse 0.55s infinite alternate;
}
@keyframes urgentClockPulse {
  0% { transform: scale(1); box-shadow: 0 0 6px rgba(255, 107, 107, 0.7); }
  100% { transform: scale(1.13); box-shadow: 0 0 16px rgba(255, 59, 59, 0.95); }
}
.seat-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 42, 29, 0.88);
  border: 1.5px solid rgba(255, 224, 102, 0.78);
  color: #ffe8a3;
  font-weight: 900;
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.act-btn {
  border-radius: 999px;
  padding: clamp(6px, 1.2vh, 10px) clamp(15px, 2.2vw, 24px);
  font-size: clamp(13.5px, 1.8vw, 16px);
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.38);
  transition: transform 0.1s ease, opacity 0.15s;
}

.act-btn:active { transform: scale(0.94); }
.act-btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-gold { background: linear-gradient(180deg, #ffe066 0%, #f59f00 100%); color: #4a1803; }
.btn-crimson { background: linear-gradient(180deg, #ff6b6b 0%, #c92a2a 100%); color: #fff; }
.btn-jade { background: linear-gradient(180deg, #51cf66 0%, #2b8a3e 100%); color: #fff; }
.btn-blue { background: linear-gradient(180deg, #74c0fc 0%, #1c7ed6 100%); color: #fff; }
.btn-wide {
  padding-left: clamp(20px, 3vw, 34px);
  padding-right: clamp(20px, 3vw, 34px);
}

.cannot-beat-tip {
  background: rgba(0, 0, 0, 0.55);
  color: #ffe8a3;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* 玩家大字扑克牌（用 vw 锚定比例，确保 V Purse 展开态与 Magic8 Pro 20张牌均完整居中不溢出） */
.player-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: clamp(88px, 12.2vw, 128px);
  padding: 18px max(12px, env(safe-area-inset-right, 0px), var(--safe-right, 0px)) 2px max(12px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
  width: 100%;
  touch-action: none;
}

.hand-card {
  position: relative;
  width: clamp(48px, 6.4vw, 74px);
  height: clamp(70px, 9.4vw, 108px);
  margin-left: clamp(-27px, -2.7vw, -18px);
  border-radius: 9px;
  background: var(--ivory-card);
  border: 1.5px solid #c9bba6;
  box-shadow: -2px 4px 10px rgba(0, 0, 0, 0.38);
  color: var(--card-black);
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.2, 0.85, 0.3, 1), background-color 0.12s;
  flex-shrink: 0;
}

.hand-card:first-child { margin-left: 0; }
.hand-card.red { color: var(--card-red); }

.hand-card.selected {
  transform: translateY(-17px);
  border-color: #f59f00;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(255, 224, 102, 0.75);
}

.hand-card.drag-hover { background: #fff3bf; }

.hc-corner {
  position: absolute;
  top: 4px;
  left: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.hc-rank {
  font-size: clamp(15px, 2.2vw, 22px);
  font-weight: 900;
  letter-spacing: -0.5px;
}

.hc-suit {
  font-size: clamp(12px, 1.7vw, 17px);
  margin-top: 2px;
}

.hc-joker-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: clamp(11.5px, 1.5vw, 15px);
  font-weight: 900;
  letter-spacing: 1px;
}

.hc-big-suit {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: clamp(20px, 3vw, 34px);
  opacity: 0.92;
  line-height: 1;
}

.hc-landlord-flag {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #f59f00, #c92a2a);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 0 7px 0 6px;
}

.player-self-bar {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px max(16px, env(safe-area-inset-right, 0px), var(--safe-right, 0px)) max(4px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px), var(--safe-left, 0px));
  background: rgba(7, 26, 17, 0.8);
  border-top: 1px solid rgba(246, 195, 67, 0.28);
  font-size: 13px;
  white-space: nowrap;
}

.self-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.self-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #b8251e;
  border: 1.5px solid var(--gold-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.self-name { font-weight: 800; color: #fff8e7; }
.self-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.self-beans strong { color: var(--gold-main); font-size: 15px; }
.self-trustee-btn {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(246, 195, 67, 0.55);
  background: rgba(255, 255, 255, 0.1);
  color: #ffe8a3;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.self-trustee-btn.active {
  background: linear-gradient(180deg, #ffe066, #e67700);
  color: #3d1002;
  border-color: #fff3bf;
}
.exit-penalty-box {
  background: rgba(201, 42, 42, 0.25);
  border: 1.5px solid rgba(255, 135, 135, 0.6);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #fff5f5;
  text-align: left;
}
.exit-penalty-box strong { color: #ffe066; font-size: 15px; }

/* 快捷语面板 */
.quick-chat-popover {
  position: absolute;
  top: 44px;
  right: max(18px, env(safe-area-inset-right, 0px), var(--safe-right, 0px));
  z-index: 50;
  background: rgba(16, 48, 33, 0.96);
  border: 1.5px solid var(--gold-main);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.qc-item {
  background: transparent;
  border: none;
  color: #fff8e7;
  text-align: left;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.qc-item:hover { background: rgba(246, 195, 67, 0.2); }

/* ==================== 通用弹窗与福利商城 ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 4, 4, 0.76);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.modal-box {
  width: min(94vw, 680px);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #541411 0%, #2e0908 100%);
  border: 2px solid var(--gold-main);
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.68);
  color: var(--text-cream);
}

.modal-large { width: min(95vw, 800px); }
.modal-narrow { width: min(92vw, 440px); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(246, 195, 67, 0.3);
  margin-bottom: 10px;
}

.mh-title {
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 900;
  color: var(--gold-light);
  white-space: nowrap;
}

.mh-beans { font-size: 13px; color: var(--gold-main); white-space: nowrap; }

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

/* 匹配动画弹窗 */
.matching-card {
  width: min(90vw, 520px);
  background: linear-gradient(180deg, #1b5c3d, #0d3321);
  border: 2px solid var(--gold-main);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

.matching-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: 16px;
}

.matching-seats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.m-seat {
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 12px 8px;
}
.m-seat.ready { border-color: #69db7c; background: rgba(43, 138, 62, 0.25); }
.m-avatar { font-size: 28px; margin-bottom: 6px; }
.m-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-status { font-size: 11px; color: #ffd43b; margin-top: 4px; }
.m-status.ok { color: #8ce99a; font-weight: 800; }
.matching-sub { font-size: 12px; color: #b2f2bb; }

/* 结算弹窗 */
.result-banner {
  text-align: center;
  font-size: clamp(17px, 2.5vw, 23px);
  font-weight: 900;
  padding: 8px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.result-banner.win {
  background: linear-gradient(90deg, rgba(245, 159, 0, 0.2), rgba(245, 159, 0, 0.55), rgba(245, 159, 0, 0.2));
  color: #ffe066;
}
.result-banner.lose {
  background: rgba(255, 255, 255, 0.08);
  color: #ffc9c9;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.r-tag {
  background: rgba(255, 212, 59, 0.22);
  border: 1px solid var(--gold-main);
  color: var(--gold-light);
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}
.result-table th, .result-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.result-table th { color: var(--text-muted); font-size: 12px; }
.result-table tr.me-row { background: rgba(246, 195, 67, 0.16); font-weight: 800; }
.delta-pos { color: #69db7c; font-weight: 900; }
.delta-neg { color: #ffa8a8; font-weight: 900; }

.result-welfare-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 7px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.btn-mini-gold {
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  background: linear-gradient(180deg, #ffe066, #f08c00);
  color: #4a1503;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* 京东E卡福利商城样式 */
.mall-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.mall-tab {
  flex: 1;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(246, 195, 67, 0.4);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.mall-tab.active {
  background: linear-gradient(180deg, #ffe066, #e69900);
  color: #4a1503;
  border-color: #fff;
}

.mall-panel { display: none; }
.mall-panel.active { display: block; }

.mall-hero {
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1.5px solid rgba(246, 195, 67, 0.5);
}

.mall-hero-overlay {
  background: linear-gradient(90deg, rgba(50, 8, 7, 0.94) 0%, rgba(50, 8, 7, 0.58) 100%);
  padding: 11px 16px;
}
.mh-badge {
  display: inline-block;
  background: #ffd43b;
  color: #4a1503;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
}
.mall-hero-overlay h2 { margin: 5px 0 3px; font-size: 17px; color: #fff5d6; }
.mall-hero-overlay p { margin: 0; font-size: 12px; color: #ffe082; font-weight: 700; }

.jd-product-showcase {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 1.5px solid rgba(246, 195, 67, 0.45);
  border-radius: 16px;
  padding: 13px;
  align-items: center;
}

.jd-card-visual {
  background: linear-gradient(135deg, #e1251b 0%, #b5130b 60%, #870b06 100%);
  border: 2px solid #ffd875;
  border-radius: 14px;
  padding: 13px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.jcv-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: #ffe8ad; }
.jcv-value { font-size: 34px; font-weight: 900; margin: 7px 0; text-align: center; }
.jcv-value span { font-size: 19px; margin-right: 2px; }
.jcv-foot { font-size: 10px; text-align: center; color: rgba(255, 255, 255, 0.85); }

.jpd-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.jpd-title-row h3 { margin: 0; font-size: 15.5px; color: #fff4d2; }
.jpd-stock {
  background: rgba(255, 212, 59, 0.2);
  border: 1px solid var(--gold-main);
  color: var(--gold-light);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.jpd-desc { font-size: 12px; color: var(--text-muted); margin: 5px 0 7px; line-height: 1.45; }

.dual-req-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.req-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffd89b;
  white-space: nowrap;
}

.req-pill.met {
  background: rgba(43, 138, 62, 0.32);
  border-color: #69db7c;
  color: #b2f2bb;
}

.mall-prog { margin-bottom: 9px; }

.jpd-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.jpd-diff-tip { font-size: 12px; color: #ffd89b; }

.btn-redeem-now {
  border: 1.5px solid #fff3bf;
  border-radius: 999px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #ffe066, #f08c00);
  color: #4a1503;
  font-weight: 900;
  font-size: 13.5px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(240, 140, 0, 0.45);
}
.btn-redeem-now:disabled { opacity: 0.48; cursor: not-allowed; }

/* 卡包列表 */
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet-empty { text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: 13.5px; }
.wallet-ticket {
  background: linear-gradient(90deg, rgba(166, 24, 18, 0.55), rgba(0, 0, 0, 0.4));
  border: 1.5px solid rgba(246, 195, 67, 0.55);
  border-radius: 14px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wt-title { font-weight: 900; color: #ffe8a3; font-size: 14.5px; }
.wt-meta { font-size: 11px; color: var(--text-muted); margin: 3px 0; }
.wt-codes { font-size: 12.5px; margin-top: 4px; }
.wt-codes code {
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 7px;
  border-radius: 5px;
  color: #ffe066;
  font-weight: 800;
}

/* 兑换成功弹窗 */
.redeem-success-box { text-align: center; }
.rs-confetti { font-size: 22px; font-weight: 900; color: #ffe066; }
.rs-sub { font-size: 13px; color: var(--text-muted); margin: 6px 0 12px; }
.rs-card-ticket {
  background: rgba(0, 0, 0, 0.42);
  border: 1.5px dashed var(--gold-main);
  border-radius: 14px;
  padding: 12px 16px;
  text-align: left;
  margin-bottom: 14px;
}
.rst-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.rst-row.highlight code { color: #ffe066; font-size: 15.5px; font-weight: 900; }
.rs-actions { display: flex; justify-content: center; gap: 12px; }

/* 绑卡步骤、任务、战绩、设置 */
.guide-steps { display: flex; flex-direction: column; gap: 9px; }
.guide-step {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(246, 195, 67, 0.3);
}
.gs-num {
  background: var(--gold-main);
  color: #4a1503;
  font-weight: 900;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  height: fit-content;
  white-space: nowrap;
}
.gs-body h4 { margin: 0 0 3px; color: #ffe8a3; font-size: 14px; }
.gs-body p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.checkin-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(245, 159, 0, 0.16);
  border: 1.5px solid var(--gold-main);
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 10px;
}
.ci-title { font-weight: 900; font-size: 14.5px; color: #ffe8a3; }
.ci-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.tasks-list { display: flex; flex-direction: column; gap: 7px; }
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 9px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ti-title { font-weight: 800; font-size: 13.5px; }
.ti-sub { font-size: 12px; color: var(--gold-main); margin-top: 2px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.stat-box {
  background: rgba(0, 0, 0, 0.32);
  border-radius: 10px;
  padding: 9px;
  text-align: center;
  border: 1px solid rgba(246, 195, 67, 0.25);
}
.stat-val { font-size: 16px; font-weight: 900; color: var(--gold-main); white-space: nowrap; }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }

.sub-heading { margin: 8px 0; font-size: 13.5px; color: var(--gold-light); }
.history-list { display: flex; flex-direction: column; gap: 5px; max-height: 185px; overflow-y: auto; }
.hist-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.profile-form { display: flex; flex-direction: column; gap: 10px; }
.form-label { font-size: 13px; color: var(--gold-light); font-weight: 700; }
.avatar-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.av-opt {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  font-size: 22px;
  cursor: pointer;
}
.av-opt.selected { border-color: var(--gold-main); background: rgba(246, 195, 67, 0.28); }

.text-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1.5px solid rgba(246, 195, 67, 0.5);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
}

.settings-list { display: flex; flex-direction: column; gap: 7px; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  cursor: pointer;
}
.setting-row.setting-col {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  cursor: default;
}
.bgm-mode-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.bgm-opt-btn {
  padding: 7px 8px;
  border-radius: 9px;
  border: 1.5px solid rgba(246, 195, 67, 0.38);
  background: rgba(0, 0, 0, 0.36);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bgm-opt-btn.active {
  background: linear-gradient(180deg, #ffe066, #eb9c0c);
  color: #4a1503;
  border-color: #fff5c4;
  box-shadow: 0 3px 10px rgba(245, 159, 0, 0.4);
}
.setting-row input[type="checkbox"] { width: 19px; height: 19px; accent-color: #f59f00; }
.settings-footer { margin-top: 8px; text-align: center; font-size: 11px; color: rgba(255, 235, 200, 0.55); }
.settings-footer p { margin: 2px 0; }
.version-line { cursor: pointer; padding: 2px 4px; }

/* ==================== 8888 孝心监控与卡密池管理后台 ==================== */
.org-section-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(246, 195, 67, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.org-sec-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.org-sec-title {
  font-size: 13px;
  font-weight: 900;
  color: #ffe082;
  margin-bottom: 8px;
}
.org-sec-head-row .org-sec-title { margin-bottom: 0; }
.org-batch-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.org-tool-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(246, 195, 67, 0.55);
  background: rgba(246, 195, 67, 0.16);
  color: #fff3bf;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.org-tool-btn.primary {
  background: linear-gradient(180deg, #ffd43b, #e67700);
  color: #3b1104;
  border-color: #fff3bf;
}
.org-tool-btn.danger-soft {
  background: rgba(201, 42, 42, 0.24);
  border-color: rgba(255, 135, 135, 0.5);
  color: #ffc9c9;
}
.org-logs-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}
.org-log-item {
  background: rgba(43, 138, 62, 0.22);
  border: 1px solid rgba(105, 219, 124, 0.45);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.org-top-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.small-input { margin-top: 4px; padding: 6px 8px; font-size: 12.5px; }
.org-cards-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
}
.org-card-row {
  display: grid;
  grid-template-columns: 124px 1fr 1fr 84px;
  gap: 8px;
  align-items: center;
  background: rgba(0, 0, 0, 0.34);
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.org-card-row.is-redeemed-row {
  background: rgba(0, 0, 0, 0.52);
  opacity: 0.78;
  border-color: rgba(255, 107, 107, 0.28);
}
.org-card-row.is-redeemed-row .text-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 245, 219, 0.75);
}
.org-redeemed-divider {
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #ffc9c9;
  padding: 5px 8px;
  margin: 4px 0 2px;
  background: rgba(201, 42, 42, 0.22);
  border: 1px dashed rgba(255, 135, 135, 0.45);
  border-radius: 7px;
}
.btn-org-del-card {
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 135, 135, 0.6);
  background: rgba(201, 42, 42, 0.38);
  color: #ffe3e3;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-org-del-card:hover { background: rgba(224, 49, 49, 0.65); }
.org-locked-tag {
  display: inline-block;
  text-align: center;
  font-size: 11px;
  color: #ffa8a8;
  font-weight: 700;
  white-space: nowrap;
}
.org-slot-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 2px;
}
.org-slot-demo { background: rgba(245, 159, 0, 0.28); color: #ffe066; }
.org-slot-real { background: rgba(43, 138, 62, 0.35); color: #8ce99a; }
.org-slot-used { background: rgba(201, 42, 42, 0.45); color: #ffc9c9; }
.org-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* 批量扫码与文本导入弹窗 */
.qr-scanner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(246, 195, 67, 0.45);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}
.qr-video-el {
  width: 100%;
  max-width: 320px;
  max-height: 190px;
  border-radius: 8px;
  background: #000;
  object-fit: cover;
}
.batch-format-spec {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(246, 195, 67, 0.32);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #fff3d6;
  margin-bottom: 8px;
}
.batch-format-spec code {
  color: #ffe066;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}
.batch-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.45;
}

/* Toast */
.toast-box {
  position: fixed;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: rgba(25, 8, 7, 0.94);
  border: 1.5px solid var(--gold-main);
  color: #fff5d6;
  font-weight: 800;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  pointer-events: none;
}

@keyframes popScale {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes dealSnap {
  0% { transform: translateY(-12px) scale(0.92); opacity: 0.4; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 针对荣耀 V Purse 展开态（约 782×672 近方屏）优雅舒展大厅卡片与牌桌纵向布局 */
@media (min-height: 520px) and (max-aspect-ratio: 4/3) {
  .lobby-left-panel, .lobby-right-panel { gap: 16px; }
  .brand-plaque { padding: 14px 16px; }
  .welfare-progress-card { padding: 16px 15px; }
  .room-card { padding: 20px 12px; }
  .btn-quick-start { padding: 15px 20px; }
  .opponent-anchor { top: 20px; }
  .zone-bottom { bottom: 18px; }
  .player-hand { height: 118px; }
}

/* 针对荣耀系统“大字/大显示模式”或紧凑视口 (< 780px) 收紧间距，100% 保证大厅与牌桌顶栏全单行不折行不裁切 */
@media (max-width: 780px) {
  .lobby-topbar { gap: 5px; }
  .online-status-pill { padding: 4px 8px; font-size: 11px; }
  .nav-icon-btn { padding: 5px 8px; font-size: 11.5px; gap: 3px; }
  .player-pill { padding-right: 8px; gap: 6px; }
  .ping-badge { display: none; }
  .table-topbar { gap: 5px; }
  .table-icon-btn { padding: 4px 8px; font-size: 11px; }
  .table-room-badge { font-size: 11px; }
  .hole-cards-panel { gap: 6px; padding: 2px 7px; }
  .score-mult-box { gap: 6px; }
}

@media (max-width: 705px) {
  .online-prefix { display: none; }
  .nav-icon-btn { padding: 5px 7px; font-size: 11px; }
}

@media (max-width: 610px) {
  .online-status-pill, .table-room-badge { display: none; }
  .lobby-main { grid-template-columns: 1fr; overflow-y: auto; }
  .jd-product-showcase, .org-top-inputs, .org-card-row { grid-template-columns: 1fr; }
}
