:root {
  --bg-deep: #071f18;
  --felt-main: #0f4434;
  --felt-light: #165b46;
  --gold: #f5c451;
  --gold-bright: #ffe082;
  --red-team: #ef5350;
  --blue-team: #42a5f5;
  --card-bg: #fffdf9;
  --card-selected: #fff6d6;
  --text-light: #f1f7f5;
  --text-muted: #9ebbb2;
  --panel-bg: rgba(9, 32, 25, 0.92);
  --border-subtle: rgba(245, 196, 81, 0.28);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 50% 38%, var(--felt-light) 0%, var(--felt-main) 48%, var(--bg-deep) 100%);
  color: var(--text-light);
}

/* 竖屏提示条（仅在窄屏竖屏时显示） */
.portrait-tip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fff;
  font-size: 12px;
  z-index: 900;
}
.portrait-tip button {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
@media (orientation: portrait) and (max-width: 680px) {
  .portrait-tip {
    display: flex;
  }
}

.hidden {
  display: none !important;
}

.view {
  display: none;
  width: 100%;
  height: 100%;
}
.view.active {
  display: flex;
  flex-direction: column;
}

/* Toast 轻提示 */
.toast-container {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  background: rgba(12, 24, 20, 0.95);
  border: 1px solid var(--gold);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: fadeSlideIn 0.2s ease-out;
}
.toast-item.warn {
  border-color: #ff7043;
  color: #ffccbc;
}
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== 大厅样式 ==================== */
#lobby-view {
  overflow-y: auto;
  padding: 20px 16px 36px;
  align-items: center;
  justify-content: flex-start;
}

.lobby-shell {
  width: 100%;
  max-width: 920px;
  margin: auto;
}

.lobby-header {
  text-align: center;
  margin-bottom: 16px;
}
.brand-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(245, 196, 81, 0.16);
  border: 1px solid var(--border-subtle);
  color: var(--gold-bright);
  font-size: 12px;
  margin-bottom: 6px;
}
.lobby-header h1 {
  font-size: 30px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.sub-tag {
  font-size: 14px;
  vertical-align: middle;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1b1202;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
}
.lobby-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.nickname-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.nickname-bar label {
  font-size: 14px;
  color: var(--gold-bright);
  font-weight: 600;
}
.nickname-bar input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 15px;
  width: 180px;
  user-select: text;
}

.invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.28), rgba(16, 185, 129, 0.25));
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 16px;
}
.invite-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.invite-icon {
  font-size: 28px;
}
.highlight-code {
  color: var(--gold-bright);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
}

.lobby-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .lobby-cards {
    grid-template-columns: 1fr;
  }
}

.lobby-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-head h2 {
  font-size: 18px;
}
.pill-green,
.pill-blue {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.pill-green {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
.pill-blue {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}
.card-note {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.form-row input {
  width: 140px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  letter-spacing: 2px;
  user-select: text;
}

.rule-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 10px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
}

.card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-code-display input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(245, 196, 81, 0.45);
  color: var(--gold-bright);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 10px;
  padding: 8px;
  border-radius: 10px;
  user-select: text;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.numpad button {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 7px 0;
  border-radius: 8px;
  cursor: pointer;
}
.numpad button:active {
  background: rgba(245, 196, 81, 0.3);
}
.numpad button.num-fn {
  font-size: 13px;
  color: var(--gold-bright);
}

/* 通用按钮 */
button {
  font-family: inherit;
  transition: transform 0.08s ease, filter 0.12s ease;
}
button:active {
  transform: scale(0.97);
}
.btn-block {
  width: 100%;
}
.btn-lg {
  padding: 11px 22px !important;
  font-size: 15px !important;
}
.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1f1300;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.btn-accent {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-warn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn-fire {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: 1px solid #fde047;
  padding: 9px 18px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65);
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-light);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

/* ==================== 牌桌顶部栏 ==================== */
.topbar {
  height: 42px;
  flex-shrink: 0;
  background: rgba(5, 20, 15, 0.88);
  border-bottom: 1px solid rgba(245, 196, 81, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 8px;
  z-index: 50;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.room-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 196, 81, 0.15);
  border: 1px solid rgba(245, 196, 81, 0.45);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.room-chip strong {
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: 1px;
}
.chip-btn {
  background: var(--gold);
  color: #1f1300;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
}
.round-chip,
.score-chip {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
}
.team-red-dot {
  color: #ff8a80;
}
.team-blue-dot {
  color: #82b1ff;
}
.vs-sep {
  margin: 0 4px;
  opacity: 0.6;
}
.top-status-tags {
  display: flex;
  gap: 5px;
}
.phase-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(90deg, #dc2626, #ea580c);
  color: #fff;
}

.top-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2f1ec;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}
.top-btn.active-toggle {
  background: rgba(245, 196, 81, 0.28);
  border-color: var(--gold);
  color: var(--gold-bright);
}
.btn-danger-soft {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

/* ==================== 绿绒牌桌主舞台 ==================== */
.table-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.table-center-felt {
  position: absolute;
  inset: 14% 20% 18% 20%;
  border: 2px dashed rgba(245, 196, 81, 0.14);
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.felt-watermark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.07);
}
.center-phase-banner {
  margin-top: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
}

/* 5 个远端玩家方位 */
.remote-seat {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
}
.pos-top {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
}
.pos-left-top {
  top: 14px;
  left: 12px;
}
.pos-right-top {
  top: 14px;
  right: 12px;
  flex-direction: row-reverse;
}
.pos-left-bottom {
  bottom: 16px;
  left: 12px;
}
.pos-right-bottom {
  bottom: 16px;
  right: 12px;
  flex-direction: row-reverse;
}

.seat-badge-box {
  position: relative;
  min-width: 118px;
  background: rgba(8, 28, 22, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  padding: 6px 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.seat-badge-box.team-0 {
  border-left: 4px solid var(--red-team);
}
.seat-badge-box.team-1 {
  border-left: 4px solid var(--blue-team);
}
.seat-badge-box.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 196, 81, 0.65);
}
.seat-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 12px;
}
.seat-name {
  font-weight: 700;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rel-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}
.rel-opp {
  background: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}
.rel-ally {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
.rel-enemy {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.seat-sub-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
}
.rem-count {
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.rem-count.danger {
  background: #dc2626;
  color: #fff;
  animation: pulseWarn 1s infinite alternate;
}
@keyframes pulseWarn {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}
.open-tag {
  color: var(--gold-bright);
  font-weight: 700;
}
.burn-tag {
  background: #dc2626;
  color: #fde047;
  padding: 0 5px;
  border-radius: 4px;
  font-weight: 800;
}
.rank-medal {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
}

/* 玩家桌面打出的牌缩略展示 */
.played-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.played-cards-row {
  display: flex;
  align-items: center;
}
.mini-card {
  width: 30px;
  height: 42px;
  background: var(--card-bg);
  border: 1px solid #94a3b8;
  border-radius: 5px;
  margin-left: -12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #1e293b;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.mini-card:first-child {
  margin-left: 0;
}
.mini-card.red {
  color: #dc2626;
}
.mini-card.joker-big {
  background: #fef2f2;
  color: #dc2626;
  border-color: #ef4444;
  font-size: 10px;
}
.mini-card.joker-small {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 10px;
}
.played-caption {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #e2e8f0;
  white-space: nowrap;
}
.played-caption.gouji {
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-weight: 700;
}
.played-caption.burn {
  background: rgba(185, 28, 28, 0.88);
  color: #fef08a;
  font-weight: 800;
}
.pass-bubble {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}

.my-played-zone {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
}

/* 聊天发言气泡 */
.chat-bubble {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffbeb;
  color: #1e293b;
  border: 1.5px solid #f59e0b;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 80;
}

/* ==================== 候机室选座面板 ==================== */
.waiting-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 94vw);
  max-height: 92%;
  overflow-y: auto;
  background: rgba(8, 30, 23, 0.96);
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  padding: 16px 18px;
  z-index: 60;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.waiting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.gold-code {
  color: var(--gold-bright);
  letter-spacing: 3px;
  font-size: 26px;
}
.invite-url-text {
  font-size: 12px;
  color: var(--text-muted);
  user-select: text;
}
.seat-guide {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.waiting-seats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.wait-seat-card {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.wait-seat-card.team-0 {
  border-color: rgba(239, 83, 80, 0.6);
  background: rgba(239, 83, 80, 0.08);
}
.wait-seat-card.team-1 {
  border-color: rgba(66, 165, 245, 0.6);
  background: rgba(66, 165, 245, 0.08);
}
.wait-seat-card.is-me {
  box-shadow: 0 0 0 2px var(--gold);
}
.ws-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.ws-body {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ws-mini-btn {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  cursor: pointer;
}

.waiting-rule-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  margin-bottom: 12px;
}
.waiting-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.guest-wait-tag {
  font-size: 13px;
  color: var(--gold-bright);
}

/* 开局进贡快报框 */
.pregame-toast-box {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 90vw);
  background: rgba(10, 28, 22, 0.95);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.pregame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--gold-bright);
  margin-bottom: 6px;
}
.pregame-head button {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}
#pregame-list {
  list-style: none;
  max-height: 92px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
}

/* ==================== 底部本家操作栏 + 多乐同款竖列叠牌区 ==================== */
.bottom-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 8px 8px;
  background: linear-gradient(180deg, rgba(7, 31, 24, 0) 0%, rgba(5, 20, 15, 0.82) 28%);
  z-index: 30;
}

.quick-adjust-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 26, 20, 0.92);
  border: 1px solid rgba(245, 196, 81, 0.45);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 5px;
}
.sel-preview {
  font-size: 12px;
  color: var(--gold-bright);
  font-weight: 700;
}
.adjust-btns {
  display: flex;
  gap: 5px;
}
.chip-action {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.chip-two {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.45);
}
.chip-sj {
  color: #e2e8f0;
}
.chip-bj {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.5);
}

.action-bar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  min-height: 38px;
}

.my-meta-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(8, 28, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.team-pill {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.team-pill.team-0 {
  background: var(--red-team);
  color: #fff;
}
.team-pill.team-1 {
  background: var(--blue-team);
  color: #fff;
}
.status-mini {
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
}
.count-mini {
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
}

.turn-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-play-main {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  border: 1.5px solid #bbf7d0;
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45);
}
.btn-play-main.disabled-look {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.burn-alert-text {
  font-size: 12px;
  color: #fde047;
  font-weight: 700;
}

.waiting-turn-indicator {
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--gold-bright);
}

.quick-chat-wrap {
  position: relative;
}
.btn-chat-trigger {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.quick-chat-menu {
  position: absolute;
  bottom: 38px;
  right: 0;
  width: 220px;
  background: rgba(9, 28, 22, 0.97);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 90;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.quick-chat-menu button {
  background: transparent;
  border: none;
  color: #f1f5f9;
  text-align: left;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}
.quick-chat-menu button:hover {
  background: rgba(245, 196, 81, 0.2);
}

/* ==================== 多乐经典：同点数竖列叠放手牌 ==================== */
.hand-columns-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  padding: 18px 4px 2px;
  overflow-x: auto;
  min-height: 158px;
}

.rank-column {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* 列顶张数角标 */
.col-count-badge {
  margin-bottom: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.55);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.col-count-badge.gouji-col {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #fff;
  border-color: #fde68a;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.45);
}
.col-count-badge.selected-col {
  background: #22c55e;
  color: #fff;
  border-color: #bbf7d0;
}

.col-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.poker-card {
  width: 56px;
  height: 80px;
  background: var(--card-bg);
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.22);
  position: relative;
  margin-top: -56px; /* 纵向叠放：上方每张露出 24px 头部 */
  padding: 3px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #0f172a;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.poker-card:first-child {
  margin-top: 0;
}
.poker-card.red-suit {
  color: #dc2626;
}
.poker-card.joker-small-card {
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  color: #1e293b;
}
.poker-card.joker-big-card {
  background: linear-gradient(180deg, #fff5f5, #fee2e2);
  color: #dc2626;
  border-color: #fca5a5;
}

.poker-card.selected {
  background: var(--card-selected);
  border: 2px solid #f59e0b;
  transform: translateY(-12px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.55);
  z-index: 5;
}

.poker-card.locked-card {
  opacity: 0.62;
  filter: grayscale(0.25);
}

.card-corner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  line-height: 1;
}
.card-rank {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.card-rank.joker-text {
  font-size: 12px;
}
.card-suit {
  font-size: 13px;
}
.card-center-big {
  align-self: center;
  font-size: 24px;
  opacity: 0.88;
  margin-bottom: 2px;
}
.lock-hint {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 10px;
}

/* ==================== 手机横屏紧凑适配 ==================== */
@media (max-height: 500px), (max-width: 900px) {
  .topbar {
    height: 34px;
    padding: 0 6px;
  }
  .top-btn,
  .room-chip,
  .round-chip,
  .score-chip {
    font-size: 11px;
    padding: 2px 6px;
  }
  .seat-badge-box {
    min-width: 96px;
    padding: 4px 6px;
  }
  .seat-top-line {
    font-size: 11px;
  }
  .mini-card {
    width: 24px;
    height: 34px;
    font-size: 10px;
    margin-left: -10px;
  }
  .hand-columns-wrap {
    gap: 3px;
    min-height: 116px;
    padding-top: 12px;
  }
  .poker-card {
    width: 44px;
    height: 64px;
    margin-top: -47px; /* 每张露出 17px */
    padding: 2px 4px;
    border-radius: 6px;
  }
  .poker-card.selected {
    transform: translateY(-9px);
  }
  .card-rank {
    font-size: 13px;
  }
  .card-rank.joker-text {
    font-size: 10px;
  }
  .card-suit {
    font-size: 11px;
  }
  .card-center-big {
    font-size: 18px;
  }
  .action-bar {
    min-height: 30px;
    margin-bottom: 3px;
  }
  .btn-play-main {
    padding: 5px 16px;
    font-size: 13px;
  }
}

/* ==================== 弹窗通用样式 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 14px;
}
.modal-panel {
  width: min(600px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #0b2920;
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}
.btn-close {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 18px;
  cursor: pointer;
}

.settle-rankings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.settle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.settle-row.team-0 {
  border-left: 4px solid var(--red-team);
}
.settle-row.team-1 {
  border-left: 4px solid var(--blue-team);
}
.settle-tribute-preview {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 14px;
  line-height: 1.6;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.logs-body h4 {
  color: var(--gold-bright);
  font-size: 13px;
  margin: 8px 0 5px;
}
.log-list {
  list-style: none;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
}
.rules-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
}
.rules-body code {
  background: rgba(245, 196, 81, 0.2);
  color: var(--gold-bright);
  padding: 1px 5px;
  border-radius: 4px;
}
