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

.header-action-btn {
  background: linear-gradient(180deg, #334155 0%, #1e3a8a 100%);
  border-color: rgba(191, 219, 254, 0.6);
}
.header-action-btn:nth-child(1) {
  background: linear-gradient(180deg, #0ea5e9 0%, #2563eb 100%);
}
.header-action-btn:nth-child(2) {
  background: linear-gradient(180deg, #22c55e 0%, #0d9488 100%);
}
.asset-item {
  background: linear-gradient(180deg, #ecfeff 0%, #cffafe 100%);
  border-color: rgba(14, 116, 144, 0.26);
}
.asset-item:nth-child(2) {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border-color: rgba(180, 83, 9, 0.28);
}
.asset-item .asset-info span:first-child {
  color: #0f172a;
}
.asset-item .asset-info span:last-child {
  color: #7c2d12;
}
.small-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
}
.small-btn.primary {
  background: linear-gradient(180deg, #fb923c 0%, #ef4444 100%);
}
.hall-footer-nav {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
  border-top-color: rgba(147, 197, 253, 0.45);
}
.nav-item.active {
  background: rgba(56, 189, 248, 0.24);
}
.shop-page {
  background: linear-gradient(180deg, #e0f2fe 0%, #bfdbfe 100%);
}
.shop-header-nav {
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  border-bottom-color: rgba(147, 197, 253, 0.52);
}
.shop-tab {
  color: #dbeafe;
}
.shop-tab.active {
  color: #fef3c7;
  border-bottom-color: #fef08a;
}
.shop-grid .shop-item {
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: rgba(2, 132, 199, 0.26);
}
.shop-grid .shop-item:nth-child(2n) {
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%);
  border-color: rgba(245, 158, 11, 0.3);
}
.shop-grid .shop-item:nth-child(3n) {
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: rgba(22, 163, 74, 0.32);
}
.shop-grid .shop-item-amount {
  color: #b45309;
}
.shop-footer-tip {
  color: #475569;
  border-top-color: rgba(71, 85, 105, 0.28);
}
.popup-panel,
.create-room-panel {
  background: linear-gradient(180deg, #ecfeff 0%, #e0f2fe 100%);
  border-color: rgba(2, 132, 199, 0.28);
}
.popup-header,
.panel-header,
.popup-footer,
.panel-footer {
  border-color: rgba(2, 132, 199, 0.2);
}
.popup-header h3,
.panel-header h2 {
  color: #0f172a;
}
.setting-item .label,
.cost-info,
.empty-tip {
  color: #475569;
}
.toggle-label,
.value.fixed {
  color: #1e293b;
}
.stat-item {
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%);
  border: 1px solid rgba(180, 83, 9, 0.2);
}
.stat-item:nth-child(2n) {
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: rgba(21, 128, 61, 0.25);
}
.welfare-item {
  background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid rgba(37, 99, 235, 0.24);
}
.join-room-group input,
.chat-box input {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(14, 116, 144, 0.36);
  color: #0f172a;
}
.room-list,
.leaderboard-panel,
.shop-panel {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(59, 130, 246, 0.26);
}
.shop-content .shop-item {
  background: linear-gradient(180deg, #f0f9ff 0%, #dbeafe 100%);
}
.leaderboard-item {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
}
.room-item {
  background: linear-gradient(90deg, #e0f2fe 0%, #bfdbfe 100%);
  border-color: rgba(37, 99, 235, 0.22);
}
.room-player-item {
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.9) 0%, rgba(186, 230, 253, 0.88) 100%);
  border-color: rgba(2, 132, 199, 0.2);
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f172a;
  color: #fff;
}
.app-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  transform-origin: left top;
}
@media screen and (orientation: portrait) {
  .app-container {
    width: 100vh;
    height: 100vw;
    transform: rotate(90deg) translateY(-100vh);
  }
  .portrait-mask {
    display: flex !important;
  }
}
@media screen and (orientation: landscape) {
  .app-container {
    width: 100vw;
    height: 100vh;
    transform: none;
  }
  .portrait-mask {
    display: none !important;
  }
}
.portrait-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.mask-content p {
  font-size: 18px;
  color: #fff;
  text-align: center;
}
.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(3px);
}
.global-loading-card {
  width: min(420px, 72vw);
  padding: 16px 20px 14px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
}
.global-loading-title {
  font-size: 14px;
  font-weight: 700;
  color: #dbeafe;
  margin-bottom: 10px;
}
.global-loading-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  overflow: visible;
}
.global-loading-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 56%, #fb7185 100%);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
  transition: width .24s ease;
}
.global-loading-flame {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -56%);
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.9));
  transition: left .24s ease;
}
.global-loading-percent {
  margin-top: 8px;
  font-size: 12px;
  color: #cbd5e1;
  text-align: right;
}
.page {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}
.history-page,
.hall-page,
.room-page,
.settle-page {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.primary-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.primary-btn:active {
  transform: scale(0.98);
  opacity: 0.8;
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.large-btn {
  padding: 15px 40px;
  font-size: 18px;
}
.danger-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.danger-btn:active {
  transform: scale(0.98);
  opacity: 0.8;
}
.normal-btn {
  background: #64748b;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.normal-btn:active {
  transform: scale(0.98);
  opacity: 0.8;
}
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #3b82f6;
  object-fit: cover;
}
/* History Page */
.history-page {
  background: #0f172a;
  display: flex;
  flex-direction: column;
}
.history-header {
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.history-header h2 {
  font-size: 18px;
  color: #fff;
  margin: 0;
}
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-item {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-item.win {
  border-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), rgba(30, 41, 59, 0.8));
}
.history-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
  color: #e2e8f0;
}
.history-info p {
  font-size: 12px;
  color: #94a3b8;
}
.history-score {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}
.history-score.pos { color: #10b981; }
.history-score.neg { color: #ef4444; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/static/lobby/bg/lobby_bg_main_1920x1080.png') center/cover no-repeat;
}
.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
}
.login-box {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 90%;
  max-width: 400px;
}
.game-title {
  font-size: 48px;
  font-weight: bold;
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
  margin-bottom: 40px;
}
.input-group {
  margin-bottom: 30px;
}
.input-group input {
  width: 100%;
  height: 50px;
  border-radius: 8px;
  border: 2px solid #334155;
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  font-size: 16px;
  padding: 0 15px;
  outline: none;
}
.input-group input:focus {
  border-color: #3b82f6;
}
.hall-page {
  padding: 20px;
  background: url('/static/lobby/bg/lobby_bg_main_1920x1080.png') center/cover no-repeat;
}
.hall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}
.user-detail .nickname {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
}
.user-detail .diamond {
  font-size: 12px;
  color: #fbbf24;
}
/* 首页新布局样式 */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.header-action-btn {
  min-width: 64px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(186, 230, 253, 0.45);
  background: rgba(15, 23, 42, 0.56);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  backdrop-filter: blur(4px);
}
.header-action-btn:active {
  transform: scale(0.98);
  border-color: rgba(125, 211, 252, 0.8);
}
.assets-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 10px;
}
.asset-item {
  flex: 1;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #475569;
}
.asset-item.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
.asset-item.music-entry {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-color: rgba(147, 197, 253, 0.88);
}
.music-info span:first-child {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.music-info span:last-child {
  color: #fef3c7;
  max-width: 116px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(15, 23, 42, 0.9);
}
.music-switch-btn {
  background: linear-gradient(180deg, #22d3ee 0%, #2563eb 100%);
  border-color: rgba(186, 230, 253, 0.95);
  color: #eff6ff;
}
.text-entry-btn {
  border: 1px solid rgba(186, 230, 253, 0.55);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  min-height: 42px;
}
.text-entry-btn.detail {
  color: #bae6fd;
}
.text-entry-btn.replay {
  color: #fde68a;
}
.asset-icon {
  width: 36px;
  height: 36px;
}
.asset-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.asset-info span:first-child {
  font-size: 11px;
  color: #94a3b8;
}
.asset-info span:last-child {
  font-size: 14px;
  font-weight: bold;
  color: #fbbf24;
}
.small-btn {
  padding: 5px 11px;
  border-radius: 16px;
  background: linear-gradient(180deg, #0ea5e9 0%, #2563eb 100%);
  color: #fff;
  border: 1px solid rgba(186, 230, 253, 0.7);
  font-size: 11px;
  font-weight: 700;
}
.small-btn.primary {
  background: linear-gradient(180deg, #fb923c 0%, #ef4444 100%);
  border-color: rgba(254, 215, 170, 0.8);
}
.shop-entry {
  flex: 0.6;
  justify-content: center;
  background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
  cursor: pointer;
}
.shop-entry span {
  font-weight: bold;
  font-size: 14px;
}

.create-room-entry {
  width: 100%;
  margin-bottom: 15px;
}
.create-room-entry.split {
  display: flex;
  gap: 12px;
}
.create-room-entry.split .create-room-btn {
  width: 50%;
}
.create-room-btn {
  width: 100%;
  height: 80px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
  border-radius: 16px;
  border: 2px solid #fcd34d;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  position: relative;
  overflow: hidden;
}
.create-room-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9"100%"><rect width="100%" height="100%" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="4" rx="16"/></svg>');
  pointer-events: none;
}
.btn-content {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.btn-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.btn-tag {
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #fcd34d;
  border: 1px solid #fcd34d;
}
.btn-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.9);
}
.join-friend-btn {
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
  border: 2px solid #7dd3fc;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}
.join-friend-btn .btn-tag {
  color: #bae6fd;
  border-color: #bae6fd;
}

.game-modes-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.mode-card {
  min-width: 120px;
  height: 80px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.92) 100%);
  border-radius: 12px;
  border: 1px solid rgba(100, 116, 139, 0.46);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
.mode-card:active {
  transform: scale(0.98);
  border-color: #38bdf8;
}
.mode-title {
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 4px;
}
.mode-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1;
}
.mode-card {
  background: linear-gradient(180deg, rgba(199, 252, 220, 0.95) 0%, rgba(165, 243, 204, 0.95) 100%);
  border-color: rgba(74, 222, 128, 0.55);
}
.mode-card .mode-title {
  color: #14532d;
}
.mode-card .mode-desc {
  color: #166534;
}

/* 商城页面样式 */
.shop-page {
  background: #0f172a;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.shop-header-nav {
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.shop-tabs {
  display: flex;
  gap: 15px;
  height: 100%;
}
.shop-tab {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  font-weight: bold;
  height: 100%;
  padding: 0 10px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.shop-tab.active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}
.icon-btn {
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
}
.icon-btn img {
  width: 100%;
  height: 100%;
}
.text-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
}
.shop-balance-card {
  margin: 10px 12px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.26);
}
.shop-balance-card .label {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}
.shop-balance-card .value {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-balance-card .value span {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  line-height: 1;
}
.shop-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}
.shop-grid .shop-item {
  background: #1e293b;
  border-radius: 8px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #334155;
  position: relative;
}
.shop-grid .shop-item-tag {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  transform: rotate(15deg);
}
.shop-grid .shop-item-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}
.shop-grid .shop-item-amount {
  font-size: 12px;
  font-weight: bold;
  color: #fbbf24;
  margin-bottom: 2px;
}
.shop-grid .shop-item-bonus {
  font-size: 9px;
  color: #10b981;
  margin-bottom: 5px;
  height: 10px;
}
.shop-grid .shop-item-btn {
  width: 100%;
  padding: 4px 0;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-weight: bold;
  font-size: 11px;
}
.shop-footer-tip {
  padding: 12px 14px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
  line-height: 1.5;
  border-top: 1px solid #1e293b;
}
.shop-footer-tip p {
  margin: 4px 0;
}
/* 弹窗通用样式 */
.popup-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}
.popup-panel {
  width: 500px;
  max-width: 90%;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #334155;
}
.popup-header h3 {
  color: #fff;
  font-size: 18px;
  margin: 0;
}
.popup-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.popup-footer {
  padding: 15px 20px;
  border-top: 1px solid #334155;
  text-align: center;
}
.empty-tip {
  text-align: center;
  color: #64748b;
  margin-top: 30px;
}

/* 个人中心样式 */
.profile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.profile-body .avatar.large {
  width: 80px;
  height: 80px;
}
.profile-stats {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.5);
  padding: 15px;
  border-radius: 10px;
  min-width: 100px;
}
.stat-item .label {
  font-size: 12px;
  color: #94a3b8;
}
.stat-item .val {
  font-size: 20px;
  font-weight: bold;
  color: #fbbf24;
}

/* 福利样式 */
.welfare-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.8);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.create-room-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 14px 0;
  z-index: 2000;
}
.create-room-panel {
  width: 600px;
  max-width: 90%;
  max-height: calc(100vh - 28px);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  border: 2px solid #334155;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #334155;
}
.panel-header h2 {
  color: #fbbf24;
  margin: 0;
}
.close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}
.panel-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel-body input[type="text"] {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.85);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 16px;
  padding: 0 12px;
}
.setting-item .label {
  color: #94a3b8;
  font-size: 14px;
}
.value.fixed {
  color: #e2e8f0;
  font-weight: bold;
}
.range-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-box input {
  flex: 1;
}
.range-box span {
  width: 40px;
  text-align: right;
  color: #fbbf24;
}
.toggles {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-size: 14px;
  cursor: pointer;
}
.panel-footer {
  padding: 15px 20px;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
}
.cost-info {
  color: #94a3b8;
}
.cost-info .highlight {
  color: #ef4444;
  font-weight: bold;
  font-size: 18px;
}
.create-confirm-btn {
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
  color: #fff;
  border: none;
  padding: 10px 30px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.hall-footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.48) 0%, rgba(15, 23, 42, 0.52) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 10px;
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: calc(20% - 8px);
  height: 100%;
  opacity: 0.8;
  transition: all 0.2s ease;
  border-radius: 12px 12px 0 0;
  margin: 0 4px;
}
.nav-item:nth-child(1) { background: rgba(59, 130, 246, 0.24); }
.nav-item:nth-child(2) { background: rgba(16, 185, 129, 0.22); }
.nav-item:nth-child(3) { background: rgba(168, 85, 247, 0.22); }
.nav-item:nth-child(4) { background: rgba(245, 158, 11, 0.22); }
.nav-item:nth-child(5) { background: rgba(236, 72, 153, 0.22); }
.nav-item.active {
  opacity: 1;
  transform: none;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.75);
}
.nav-item img {
  display: none;
}
.nav-item span {
  font-size: 15px;
  font-weight: 700;
  color: #dbeafe;
  letter-spacing: 1px;
  line-height: 1;
}
.nav-item.active span {
  color: #fff;
  text-shadow: 0 0 12px rgba(125, 211, 252, 0.5);
}
.replay-panel {
  width: min(760px, 94vw);
}
.replay-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.replay-meta {
  color: #93c5fd;
  font-size: 13px;
}
.replay-timeline {
  min-height: 220px;
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  padding: 10px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;
}
.replay-line {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
}
.replay-line:last-child {
  border-bottom: none;
}
.replay-line.system {
  color: #93c5fd;
}
.replay-line.player {
  color: #fde68a;
}
.replay-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.speed-btn.active {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
}
.bgm-select-panel {
  width: min(560px, 94vw);
}
.bgm-select-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bgm-select-tip {
  color: #93c5fd;
  font-size: 13px;
}
.bgm-track-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
}
.bgm-track-item {
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}
.bgm-track-item.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.42) 0%, rgba(30, 64, 175, 0.42) 100%);
  border-color: rgba(191, 219, 254, 0.88);
  color: #fef3c7;
  box-shadow: inset 0 0 0 1px rgba(219, 234, 254, 0.7);
}
@media screen and (max-width: 1500px) and (orientation: landscape) {
  .hall-page {
    padding: 14px;
  }
  .hall-header {
    margin-bottom: 14px;
  }
  .user-info {
    gap: 10px;
  }
  .user-detail .nickname {
    font-size: 14px;
  }
  .user-detail .diamond {
    font-size: 11px;
  }
  .header-right {
    gap: 10px;
  }
  .header-action-btn {
    min-width: 56px;
    height: 30px;
    font-size: 12px;
  }
  #logoutBtn {
    font-size: 12px;
    padding: 8px 12px;
  }
  .assets-bar {
    gap: 8px;
    margin-bottom: 8px;
  }
  .asset-item {
    padding: 8px;
    border-radius: 10px;
  }
  .asset-item.action-grid {
    padding: 6px;
    gap: 6px;
  }
  .text-entry-btn {
    min-height: 36px;
    font-size: 12px;
  }
  .music-info span:last-child {
    font-size: 14px;
    max-width: 94px;
  }
  .asset-icon {
    width: 30px;
    height: 30px;
  }
  .create-room-entry.split {
    gap: 10px;
  }
  .create-room-btn {
    height: 72px;
  }
  .btn-title {
    font-size: 18px;
  }
  .btn-tag,
  .btn-desc {
    font-size: 10px;
  }
  .game-modes-scroll {
    gap: 10px;
    margin-bottom: 14px;
  }
  .mode-card {
    min-width: 108px;
    height: 70px;
    border-radius: 10px;
  }
  .mode-title {
    font-size: 15px;
  }
  .mode-desc {
    font-size: 10px;
  }
  .hall-footer-nav {
    height: 64px;
  }
  .nav-item span {
    font-size: 13px;
  }
  .create-room-page {
    padding: 10px 0;
  }
  .create-room-panel {
    width: min(560px, 96vw);
    max-height: calc(100vh - 20px);
  }
  .panel-header {
    padding: 12px 16px;
  }
  .panel-header h2 {
    font-size: 22px;
  }
  .panel-body {
    padding: 14px;
    gap: 10px;
  }
  .setting-item .label,
  .toggle-label {
    font-size: 13px;
  }
  .panel-body input[type="text"] {
    min-height: 42px;
    font-size: 15px;
  }
  .panel-footer {
    padding: 12px 16px;
  }
  .create-confirm-btn {
    min-height: 40px;
    padding: 10px 20px;
    font-size: 15px;
  }
  .room-page,
  .game-page,
  .settle-page {
    padding: 12px;
  }
  .room-player-list {
    gap: 12px;
  }
  .room-player-item {
    padding: 12px;
  }
  .player-item-info .nickname {
    font-size: 15px;
  }
  .chat-box input {
    height: 38px;
    font-size: 13px;
  }
  #readyBtn,
  #startGameBtn {
    min-width: 130px;
    height: 38px;
    font-size: 15px;
  }
}
.hall-main {
  padding-bottom: 80px; /* 为底部导航栏留出空间 */
}
.hall-btn-group {
  width: 30%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.join-room-group {
  display: flex;
  gap: 10px;
}
.join-room-group input {
  flex: 1;
  height: 45px;
  border-radius: 8px;
  border: 2px solid #334155;
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  font-size: 16px;
  padding: 0 15px;
  outline: none;
}
.join-room-group input:focus {
  border-color: #3b82f6;
}
.room-list {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 20px;
  overflow: hidden;
}
.room-list h3 {
  margin-bottom: 15px;
  font-size: 20px;
}
.room-list-content {
  height: calc(100% - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leaderboard-panel {
  margin-top: 20px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 20px;
}
.shop-panel {
  margin-top: 20px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 20px;
}
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.shop-content {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
}
.shop-item .icon {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #3b82f6;
}
.shop-item .name {
  font-size: 16px;
  font-weight: bold;
}
.shop-item .price {
  margin-left: auto;
  color: #fbbf24;
  font-size: 14px;
}
.shop-item .buy-btn {
  margin-left: 10px;
}
@media screen and (max-width: 1366px) and (orientation: landscape) {
  .shop-balance-card {
    margin: 8px 10px;
    padding: 7px 9px;
  }
  .shop-balance-card .value span {
    font-size: 17px;
  }
  .shop-grid {
    padding: 0 10px;
    gap: 6px;
  }
  .shop-grid .shop-item {
    padding: 6px 7px;
  }
  .shop-grid .shop-item-icon {
    width: 26px;
    height: 26px;
    margin-bottom: 4px;
  }
  .shop-grid .shop-item-amount {
    font-size: 12px;
  }
  .shop-grid .shop-item-bonus {
    font-size: 9px;
    height: 10px;
    margin-bottom: 5px;
  }
  .shop-grid .shop-item-btn {
    font-size: 11px;
    padding: 4px 0;
  }
}
@media screen and (max-width: 1100px) and (orientation: landscape) {
  .shop-balance-card {
    margin: 7px 9px;
    padding: 6px 8px;
  }
  .shop-balance-card .value span {
    font-size: 16px;
  }
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .shop-grid .shop-item {
    padding: 6px 7px;
  }
  .shop-grid .shop-item-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
  }
  .shop-grid .shop-item-amount {
    font-size: 11px;
  }
  .shop-grid .shop-item-bonus {
    font-size: 8px;
    margin-bottom: 4px;
    height: 9px;
  }
  .shop-grid .shop-item-btn {
    font-size: 10px;
    padding: 3px 0;
  }
}
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.leaderboard-content {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
}
.leaderboard-item .avatar {
  width: 40px;
  height: 40px;
  border: 1px solid #3b82f6;
}
.leaderboard-item .nickname {
  font-size: 16px;
  font-weight: bold;
}
.leaderboard-item .stat {
  margin-left: auto;
  color: #fbbf24;
  font-size: 14px;
}
.btn-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 4px;
}
.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: rgba(30, 41, 59, 0.8);
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 8px;
}
.room-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.room-icon {
  width: 40px;
  height: 40px;
}
.room-text {
  display: flex;
  flex-direction: column;
}
.room-page {
  padding: 20px;
  padding-bottom: 24px;
  background: url('/static/lobby/bg/lobby_bg_room_list_1920x1080.png') center/cover no-repeat;
}
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.room-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-info h2 {
  font-size: 24px;
  color: #3b82f6;
}
.room-info p {
  font-size: 14px;
  color: #94a3b8;
  margin-top: 5px;
}
.room-player-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 260px;
  height: auto;
  margin-bottom: 20px;
}
.room-player-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  border: 2px solid transparent;
}
.room-player-item.ready {
  border-color: #10b981;
}
.room-player-item.own {
  border-color: #3b82f6;
}
.player-item-info .nickname {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}
.player-item-info .team {
  font-size: 14px;
  padding: 3px 8px;
  border-radius: 4px;
}
.team-0 {
  background: #3b82f6;
}
.team-1 {
  background: #ef4444;
}
.room-footer {
  display: flex;
  align-items: center;
  gap: 20px;
}
.chat-box {
  display: flex;
  gap: 10px;
  flex: 1;
}
.chat-box input {
  flex: 1;
  height: 45px;
  border-radius: 8px;
  border: 2px solid #334155;
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  font-size: 16px;
  padding: 0 15px;
  outline: none;
}
.chat-record {
  position: absolute;
  bottom: 80px;
  left: 20px;
  max-width: 400px;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.chat-item {
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  font-size: 14px;
}
.chat-item .chat-nickname {
  color: #3b82f6;
  margin-right: 5px;
}
.game-page {
  background: #0f172a;
}
.game-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/static/game/bg/game_bg_table_1920x1080.png') center/100% 100% no-repeat;
  opacity: 0.9;
  z-index: 0;
}

@media screen and (min-width: 2000px) and (orientation: landscape) {
  .login-page {
    background-image: url('/static/lobby/bg/lobby_bg_main_2560x1440.png');
  }
  .hall-page {
    background-image: url('/static/lobby/bg/lobby_bg_main_2560x1440.png');
  }
  .game-bg {
    background-image: url('/static/game/bg/game_bg_table_2560x1440.png');
  }
}
.game-score {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
  z-index: 10;
  display: none;
}
.game-score-side {
  position: absolute;
  top: 10px;
  left: 64px;
  z-index: 13;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  overflow: hidden;
}
.side-score-item {
  color: #e2e8f0;
  font-size: 17px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  background: rgba(15, 23, 42, 0.32);
  padding: 6px 10px;
}
.side-score-item span {
  color: #f59e0b;
}
.table-score {
  position: absolute;
  top: 97px;
  left: 64px;
  transform: none;
  z-index: 13;
  font-size: 16px;
  font-weight: 800;
  color: #f59e0b;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.table-score.score-bump {
  animation: scoreBump 0.28s ease-out;
}
@keyframes scoreBump {
  0% { transform: scale(1); filter: brightness(1); }
  60% { transform: scale(1.12); filter: brightness(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}
.first-lead-tip {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  font-size: 14px;
}
.waiting-room-layout {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 88vw);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 18px 20px 16px;
  z-index: 12;
  text-align: center;
}
.waiting-room-title {
  margin: 0;
  color: #e2e8f0;
  font-size: 24px;
  font-weight: 800;
}
.waiting-room-meta {
  margin: 8px 0 14px;
  color: #f8fafc;
  opacity: 0.9;
  font-size: 14px;
}
.waiting-room-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.waiting-room-item {
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
}
.waiting-room-item .name {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
}
.waiting-room-item .state {
  color: #fbbf24;
  font-size: 12px;
  margin-top: 4px;
}
.waiting-room-btn {
  min-width: 180px;
}
.team-score {
  font-size: 20px;
  font-weight: bold;
}
.team-score:first-child span {
  color: #3b82f6;
}
.team-score:last-child span {
  color: #ef4444;
}
.game-seat {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 5;
}
.game-menu-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 22px;
  z-index: 16;
}
.game-menu-panel {
  position: absolute;
  top: 64px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  z-index: 16;
}
.game-menu-item {
  min-width: 82px;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  font-size: 14px;
}
.game-menu-item.danger {
  background: rgba(220, 38, 38, 0.9);
}
.seat {
  position: absolute;
}
.seat-top {
  top: 9%;
  left: 50%;
  transform: translateX(-50%);
}
.seat-left {
  top: 52%;
  left: 1.2%;
  transform: translateY(-50%);
}
.seat-right {
  top: 52%;
  right: 1.2%;
  transform: translateY(-50%);
}
.seat-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  padding-left: 0;
}
.seat-avatar {
  text-align: center;
  position: relative;
}
.seat-avatar.turn-active .avatar {
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.85);
  border-radius: 999px;
}
.seat-turn-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 4px;
}
.seat-turn-timer.danger {
  background: rgba(127, 29, 29, 0.78);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fecaca;
  animation: blink 0.8s ease-in-out infinite;
}
.seat-badges {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
#gamePage.battle-ready .seat-bottom .seat-badges {
  justify-content: flex-start;
}
.seat-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.seat-badge.badge-offline {
  background: rgba(220, 38, 38, 0.78);
  border-color: rgba(248, 113, 113, 0.8);
}
.seat-badge.badge-trustee {
  background: rgba(37, 99, 235, 0.78);
  border-color: rgba(147, 197, 253, 0.7);
}
.seat-badge.badge-finish {
  background: rgba(16, 185, 129, 0.75);
  border-color: rgba(110, 231, 183, 0.7);
}
#gamePage.battle-ready .seat-bottom .seat-avatar {
  position: absolute;
  left: 6px;
  bottom: 0;
  z-index: 13;
  text-align: left;
  background: rgba(15, 23, 42, 0.35);
  border-radius: 10px;
  padding: 2px 5px;
}
#gamePage.battle-ready .seat-bottom .seat-avatar .seat-nickname,
#gamePage.battle-ready .seat-bottom .seat-avatar .seat-badges,
#gamePage.battle-ready .seat-bottom .seat-avatar .card-count,
#gamePage.battle-ready .seat-bottom .seat-avatar .seat-assets {
  display: none;
}
.seat-avatar .avatar {
  width: 42px;
  height: 42px;
}
.seat-nickname {
  font-size: 14px;
  margin: 5px 0;
  white-space: nowrap;
}
.card-count {
  font-size: 12px;
  color: #fbbf24;
}
.seat-assets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.58);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
.asset-chip img {
  width: 12px;
  height: 12px;
}
.asset-chip em {
  font-style: normal;
}
.asset-chip.score em {
  color: #fbbf24;
}
.asset-chip.diamond em {
  color: #7dd3fc;
}
.asset-chip.beans em {
  color: #fde68a;
}
#gamePage {
  --hand-area-h: 126px;
  --hand-gap: 6px;
  --hand-card-w: 56px;
  --hand-card-h: 78px;
  --hand-lift: 18px;
}
.hand-cards {
  display: block;
  margin: 6px 0 10px;
  height: var(--hand-area-h);
  padding: 0 14px;
}
#gamePage.battle-ready .seat-bottom .hand-cards {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
}
#gamePage.battle-ready .seat-bottom .game-operate {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--hand-area-h) + 16px);
  margin: 0;
  width: auto;
  z-index: 14;
}
#gamePage.battle-ready .seat-bottom .game-side-action {
  width: auto;
  height: auto;
  bottom: calc(var(--hand-area-h) + 10px);
}
#gamePage.battle-ready .seat-bottom .game-extra-actions {
  position: absolute;
  right: 10px;
  bottom: calc(var(--hand-area-h) + 8px);
  padding-right: 0;
  margin: 0;
  z-index: 14;
}
#gamePage:not(.battle-ready) .game-score-side,
#gamePage:not(.battle-ready) .table-score,
#gamePage:not(.battle-ready) .first-lead-tip,
#gamePage:not(.battle-ready) .game-operate,
#gamePage:not(.battle-ready) .game-side-action,
#gamePage:not(.battle-ready) .game-extra-actions,
#gamePage:not(.battle-ready) .trustee-status,
#gamePage:not(.battle-ready) .play-tip,
#gamePage:not(.battle-ready) .last-play {
  display: none !important;
}
#gamePage:not(.battle-ready) #waitingRoomLayout {
  display: block !important;
}
#gamePage.battle-ready #waitingRoomLayout {
  display: none !important;
}
#gamePage:not(.battle-ready) .hand-cards {
  height: 0;
  margin: 0;
  padding: 0;
}
.hand-track {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  gap: var(--hand-gap);
}
.hand-track-dual {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}
.hand-track-dual .hand-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: calc(50% - 2px);
}
.hand-track-dual .hand-row.top .card-item {
  margin-left: calc(var(--hand-overlap-top, 18px) * -1);
}
.hand-track-dual .hand-row.bottom .card-item {
  margin-left: calc(var(--hand-overlap-bottom, 18px) * -1);
}
.hand-track-dual .hand-row .card-item:first-child {
  margin-left: 0;
}
@media screen and (max-width: 900px) and (orientation: landscape) {
  .game-score-side {
    left: 56px;
    top: 8px;
  }
  .side-score-item {
    font-size: 14px;
  }
  .waiting-room-layout {
    top: 14%;
    width: min(560px, 92vw);
    padding: 14px 14px 12px;
  }
  .waiting-room-title {
    font-size: 20px;
  }
  .waiting-room-list {
    grid-template-columns: 1fr;
  }
  #gamePage.battle-ready .seat-bottom .seat-avatar {
    left: 12px;
    bottom: 2px;
    padding: 4px 8px;
  }
  #gamePage {
    --hand-area-h: 102px;
    --hand-gap: 4px;
  }
  .hand-cards {
    padding: 0 12px;
  }
  .game-operate .large-btn {
    padding: 10px 24px;
    font-size: 16px;
  }
  .seat-avatar .avatar {
    width: 34px;
    height: 34px;
  }
}
.card-item {
  width: var(--hand-card-w);
  height: var(--hand-card-h);
  border-radius: 8px;
  background: #fff;
  color: #000;
  border: 2px solid #333;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
  margin-left: 0;
  transition: transform 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
  user-select: none;
}
.hand-track .card-item:first-child {
  margin-left: 0;
}
.card-item.selected {
  transform: translateY(calc(var(--hand-lift) * -1));
  z-index: 2;
  border-color: #3b82f6;
}
.card-item .card-top {
  font-size: 14px;
  font-weight: bold;
  text-align: left;
}
.card-item .card-bottom {
  font-size: 14px;
  font-weight: bold;
  text-align: right;
  transform: rotate(180deg);
}
.card-item.red {
  color: #ef4444;
}
.card-item.black {
  color: #000;
}
.game-operate {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}
#gamePage.battle-ready .turn-countdown {
  display: none;
}
#passBtn {
  min-width: 132px;
  height: 62px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.48), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #61b8ff 0%, #2d8ef0 52%, #1c68ca 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.48),
    inset 0 -4px 0 rgba(10, 56, 120, 0.35),
    0 6px 14px rgba(0, 42, 92, 0.35);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
#hintBtn {
  min-width: 132px;
  height: 62px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.52), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #6fd0ff 0%, #3aa7ff 52%, #1f79e0 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.48),
    inset 0 -4px 0 rgba(8, 66, 130, 0.35),
    0 6px 14px rgba(0, 54, 115, 0.35);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
#passBtn:active,
#hintBtn:active,
#playCardBtn:active,
#trusteeBtn:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}
#passBtn:disabled,
#hintBtn:disabled,
#playCardBtn:disabled,
#trusteeBtn:disabled {
  opacity: 0.55;
  box-shadow: none;
}
#playCardBtn {
  min-width: 132px;
  height: 62px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.52), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #6fd0ff 0%, #3aa7ff 52%, #1f79e0 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.48),
    inset 0 -4px 0 rgba(8, 66, 130, 0.35),
    0 6px 14px rgba(0, 54, 115, 0.35);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
#trusteeBtn {
  min-width: 132px;
  height: 62px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.52), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, #6fd0ff 0%, #3aa7ff 52%, #1f79e0 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.48),
    inset 0 -4px 0 rgba(8, 66, 130, 0.35),
    0 6px 14px rgba(0, 54, 115, 0.35);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.turn-countdown {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}
.turn-countdown img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.turn-countdown span {
  position: absolute;
  color: #f59e0b;
  font-weight: 700;
  font-size: 26px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.turn-countdown.no-bg {
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
}
.game-side-action {
  position: absolute;
  right: 18px;
  bottom: 86px;
  width: 96px;
  height: 64px;
  z-index: 14;
}
.game-extra-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-right: 0;
  flex-wrap: wrap;
}
.game-extra-actions .large-btn {
  height: 46px;
  padding: 0 14px;
}
.room-item {
  background: url('/static/lobby/room/lobby_room_item_400x150.png') center/contain no-repeat;
}
@media screen and (max-width: 1200px) and (orientation: landscape) {
  .turn-countdown {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }
  .turn-countdown img {
    width: 64px;
    height: 64px;
  }
  .turn-countdown span {
    font-size: 22px;
  }
  .game-side-action {
    width: 116px;
    height: 52px;
    bottom: 78px;
  }
  .game-extra-actions {
    padding-right: 110px;
  }
  .game-extra-actions .large-btn {
    height: 42px;
    font-size: 14px;
  }
  #passBtn,
  #hintBtn,
  #playCardBtn,
  #trusteeBtn {
    min-width: 116px;
    height: 52px;
    font-size: 20px;
  }
  .card-type-effect {
    top: 33%;
  }
  .card-type-effect-text {
    min-width: 128px;
    padding: 4px 14px;
    font-size: 56px;
    -webkit-text-stroke: 1.5px rgba(110, 44, 8, 0.95);
  }
}
.play-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 8px;
  z-index: 10;
  pointer-events: none;
}
.play-tip p {
  font-size: 18px;
  color: #fbbf24;
  animation: blink 1s infinite;
}
.card-type-effect {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 14;
  pointer-events: none;
  opacity: 0;
}
.card-type-effect-text {
  display: inline-block;
  min-width: 168px;
  padding: 6px 22px;
  font-size: 70px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  color: #ffe9a1;
  text-shadow:
    0 2px 0 rgba(95, 50, 10, 0.8),
    0 8px 22px rgba(255, 214, 102, 0.55),
    0 0 30px rgba(255, 234, 132, 0.45);
  -webkit-text-stroke: 2px rgba(110, 44, 8, 0.95);
  background: linear-gradient(180deg, rgba(255, 250, 213, 0.16) 0%, rgba(255, 193, 82, 0.18) 100%);
  border-radius: 16px;
}
.card-type-effect.show {
  animation: cardTypeBurst 1s ease-out forwards;
}
.card-type-effect.effect-bomb .card-type-effect-text {
  color: #ffd7d7;
  text-shadow:
    0 2px 0 rgba(96, 10, 10, 0.9),
    0 8px 22px rgba(254, 92, 92, 0.58),
    0 0 30px rgba(252, 165, 165, 0.5);
  -webkit-text-stroke: 2px rgba(110, 10, 10, 0.95);
  background: linear-gradient(180deg, rgba(255, 209, 209, 0.16) 0%, rgba(255, 121, 121, 0.18) 100%);
}
.card-type-effect.effect-fiftyK .card-type-effect-text {
  color: #e6f4ff;
  text-shadow:
    0 2px 0 rgba(9, 56, 108, 0.88),
    0 8px 24px rgba(96, 165, 250, 0.58),
    0 0 28px rgba(125, 211, 252, 0.48);
  -webkit-text-stroke: 2px rgba(10, 62, 121, 0.95);
  background: linear-gradient(180deg, rgba(186, 230, 253, 0.16) 0%, rgba(96, 165, 250, 0.18) 100%);
}
@keyframes cardTypeBurst {
  0% { opacity: 0; transform: translate(-50%, -36%) scale(0.68); filter: blur(2px) brightness(1.1); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); filter: blur(0) brightness(1.2); }
  56% { opacity: 1; transform: translate(-50%, -52%) scale(1); filter: brightness(1.05); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(0.94); filter: blur(1.5px) brightness(0.95); }
}
.trustee-status {
  position: absolute;
  bottom: 230px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 12;
  font-size: 14px;
  pointer-events: none;
}
#gamePage.battle-ready .last-play {
  display: none;
}
.table-play-areas {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}
.table-play-zone {
  position: absolute;
  min-width: 120px;
  text-align: center;
}
.table-play-zone.top {
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.table-play-zone.left {
  top: 52%;
  left: 12%;
  transform: translate(0, -50%);
}
.table-play-zone.right {
  top: 52%;
  right: 12%;
  left: auto;
  transform: translate(0, -50%);
}
.table-play-zone.self {
  left: 50%;
  transform: translate(-50%, 0);
  bottom: calc(var(--hand-area-h, 126px) + 88px);
}
.table-play-zone.is-last .table-play-cards {
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
}
.table-play-cards {
  display: flex;
  justify-content: center;
}
.table-play-cards .card-item {
  width: 48px;
  height: 68px;
  font-size: 11px;
  margin-left: 6px;
}
.table-play-cards .card-item:first-child {
  margin-left: 0;
}
.table-play-pass {
  display: none;
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.table-play-zone.is-pass .table-play-pass {
  display: block;
}
.turn-countdown.danger {
  animation: blink 0.8s ease-in-out infinite;
}
.turn-countdown.danger span {
  color: #ef4444;
  text-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.last-play {
  position: absolute;
  top: 41%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  text-align: center;
  pointer-events: none;
}
.last-play.seat-center {
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.last-play.seat-top {
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.last-play.seat-left {
  top: 52%;
  left: 24%;
  transform: translate(-50%, -50%);
}
.last-play.seat-right {
  top: 52%;
  left: 76%;
  transform: translate(-50%, -50%);
}
.last-play.seat-self {
  top: 67%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.last-play-title {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 10px;
}
.last-play-cards {
  display: flex;
  justify-content: center;
}
.last-play-cards .card-item {
  width: 48px;
  height: 68px;
  font-size: 11px;
  margin-left: -10px;
}
#seatTop .seat-avatar .avatar {
  width: 44px;
  height: 44px;
}
.lead-reveal-avatar {
  animation: leadAvatarFlash 2s ease-out;
}
.lead-reveal-card {
  animation: leadCardFloat 2s ease-out;
}
.bomb-reward-card {
  animation: bombRewardFlash 1.2s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.9);
  border-color: #fbbf24 !important;
}
@keyframes leadAvatarFlash {
  0% { box-shadow: 0 0 0 rgba(34, 211, 238, 0); transform: scale(1); }
  20% { box-shadow: 0 0 22px rgba(34, 211, 238, 0.95); transform: scale(1.06); }
  60% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.9); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 rgba(34, 211, 238, 0); transform: scale(1); }
}
@keyframes leadCardFloat {
  0% { transform: translateY(36px) scale(0.75); opacity: 0; }
  25% { transform: translateY(0) scale(1.06); opacity: 1; }
  70% { transform: translateY(-6px) scale(1); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes bombRewardFlash {
  0%, 100% { filter: brightness(1); transform: translateY(0) scale(1); }
  50% { filter: brightness(1.25); transform: translateY(-2px) scale(1.04); }
}
.bomb-reward-panel {
  width: min(560px, 92vw);
  text-align: center;
  border: 1px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.3);
}
.bomb-reward-panel h3 {
  color: #fbbf24;
  font-size: 28px;
  margin-bottom: 12px;
}
.bomb-reward-line {
  margin: 6px 0;
  color: #e2e8f0;
  font-size: 16px;
}
#bombRewardScoreNum {
  color: #fde047;
  font-size: 34px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 1px;
}
.settle-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 12px;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
}
.settle-box {
  width: min(920px, 96%);
  max-width: 920px;
  background: linear-gradient(180deg, rgba(19, 43, 76, 0.96) 0%, rgba(10, 24, 45, 0.96) 100%);
  border-radius: 18px;
  border: 1px solid rgba(168, 194, 230, 0.35);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.58);
  padding: 22px 22px 16px;
  text-align: center;
  margin: auto 0;
}
.settle-box.win-theme {
  border-color: rgba(249, 189, 79, 0.48);
}
.settle-box.lose-theme {
  border-color: rgba(153, 201, 255, 0.45);
}
.settle-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  height: 66px;
  padding: 0 44px;
  margin: 2px auto 14px;
  border-radius: 14px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(2, 6, 23, 0.55);
}
.settle-title::before,
.settle-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 44px;
  height: 24px;
  transform: translateY(-50%);
  border-radius: 24px;
}
.settle-title::before {
  left: -30px;
}
.settle-title::after {
  right: -30px;
}
.settle-title-win {
  color: #fff6d8;
  background: linear-gradient(180deg, #d88a2f 0%, #a44a19 100%);
}
.settle-title-win::before,
.settle-title-win::after {
  background: linear-gradient(180deg, #f0c15d 0%, #c97f27 100%);
}
.settle-title-lose {
  color: #e7f5ff;
  background: linear-gradient(180deg, #5db0ff 0%, #2b4f90 100%);
}
.settle-title-lose::before,
.settle-title-lose::after {
  background: linear-gradient(180deg, #9dd0ff 0%, #4d7fca 100%);
}
.settle-score {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 12px;
}
.settle-team h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.settle-team:first-child h3 {
  color: #3b82f6;
}
.settle-team:last-child h3 {
  color: #ef4444;
}
.settle-list {
  width: 100%;
  margin: 10px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 54vh;
  overflow-y: auto;
  padding-right: 3px;
}
.settle-head-row {
  display: grid;
  grid-template-columns: 64px minmax(160px, 1fr) 112px 112px 112px;
  align-items: center;
  min-height: 42px;
  border-radius: 10px;
  background: rgba(18, 51, 92, 0.72);
  border: 1px solid rgba(135, 189, 255, 0.32);
  color: #d8ecff;
  font-size: 14px;
  font-weight: 700;
}
.settle-item {
  display: grid;
  grid-template-columns: 64px minmax(160px, 1fr) 1fr;
  align-items: center;
  min-height: 66px;
  background: rgba(20, 46, 82, 0.72);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(106, 158, 221, 0.3);
}
.settle-item.win {
  border-color: rgba(245, 186, 80, 0.52);
  background: linear-gradient(90deg, rgba(209, 131, 42, 0.26), rgba(20, 46, 82, 0.72));
}
.settle-item.lose {
  border-color: rgba(146, 191, 248, 0.4);
}
.settle-rank {
  justify-self: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 24, 45, 0.88);
  border: 1px solid rgba(156, 207, 255, 0.42);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}
.settle-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settle-user .avatar {
  width: 42px;
  height: 42px;
}
.settle-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.settle-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}
.settle-team-chip {
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}
.settle-team-chip.blue {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.settle-team-chip.red {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.settle-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 112px));
  justify-content: end;
  gap: 6px;
}
.data-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 76px;
}
.data-label {
  font-size: 11px;
  color: #9cc7f7;
}
.data-val {
  font-size: 20px;
  font-weight: bold;
  line-height: 1.15;
}
.val-pos { color: #10b981; }
.val-neg { color: #ef4444; }

.settle-footer-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  color: #bfdbfe;
  border-top: 1px solid rgba(114, 162, 220, 0.35);
  font-size: 14px;
}
.countdown {
  color: #fde047;
  font-weight: bold;
}
.settle-operate {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.settle-operate .primary-btn {
  min-width: 220px;
  height: 56px;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(180deg, #f7b845 0%, #ea8e1c 100%);
}
@media screen and (max-width: 980px) and (orientation: landscape) {
  .room-header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
  }
  .room-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .room-player-list {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-height: 0;
  }
  .room-player-item {
    padding: 10px;
    min-height: 104px;
  }
  .room-footer {
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }
  .chat-record {
    position: static;
    order: 3;
    width: 100%;
    max-width: none;
    max-height: 120px;
  }
  .chat-box {
    width: 100%;
    order: 1;
  }
  #readyBtn,
  #startGameBtn {
    order: 2;
  }
  .settle-box {
    padding: 14px 12px 12px;
    width: min(96%, 860px);
  }
  .settle-title {
    min-width: 230px;
    height: 56px;
    font-size: 32px;
    margin-bottom: 10px;
  }
  .settle-head-row,
  .settle-item {
    grid-template-columns: 48px minmax(130px, 1fr) minmax(206px, 1fr);
  }
  .settle-rank {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  .settle-user .avatar {
    width: 34px;
    height: 34px;
  }
  .settle-name {
    max-width: 130px;
    font-size: 14px;
  }
  .data-label {
    font-size: 10px;
  }
  .data-val {
    font-size: 16px;
  }
}
@media screen and (max-width: 1366px) and (orientation: landscape) {
  .hall-page {
    padding: 8px;
  }
  .hall-header {
    margin-bottom: 8px;
  }
  .user-info {
    gap: 8px;
  }
  .user-avatar {
    width: 52px;
    height: 52px;
  }
  .user-detail .nickname {
    font-size: 15px;
  }
  .assets-bar {
    gap: 4px;
    margin-bottom: 4px;
  }
  .asset-item {
    padding: 5px;
    min-height: 46px;
  }
  .asset-info span:first-child {
    font-size: 10px;
  }
  .asset-info span:last-child {
    font-size: 13px;
  }
  .small-btn,
  .text-entry-btn {
    min-height: 30px;
    font-size: 11px;
  }
  .create-room-btn {
    height: 58px;
  }
  .btn-title {
    font-size: 16px;
  }
  .btn-tag,
  .btn-desc {
    font-size: 9px;
  }
  .mode-card {
    min-width: 86px;
    height: 56px;
  }
  .mode-title {
    font-size: 14px;
  }
  .mode-desc {
    font-size: 9px;
  }
  .hall-footer-nav {
    height: 52px;
  }
  .nav-item span {
    font-size: 11px;
  }
  #gamePage {
    --hand-area-h: 98px;
    --hand-gap: 4px;
  }
  .hand-cards {
    padding: 0 10px;
  }
  .card-item {
    border-width: 1px;
  }
  .card-item .card-top,
  .card-item .card-bottom {
    font-size: 12px;
  }
  #passBtn,
  #hintBtn,
  #playCardBtn,
  #trusteeBtn {
    min-width: 94px;
    height: 42px;
    font-size: 16px;
  }
  .turn-countdown,
  .turn-countdown img {
    width: 58px;
    height: 58px;
  }
  .turn-countdown {
    flex-basis: 58px;
  }
  .turn-countdown span {
    font-size: 20px;
  }
  .game-side-action {
    width: 94px;
    height: 42px;
    bottom: 58px;
    right: 10px;
  }
  .game-operate {
    gap: 8px;
    margin-bottom: 4px;
  }
  .game-extra-actions {
    padding-right: 0;
    gap: 6px;
  }
  .game-extra-actions .large-btn {
    height: 32px;
    font-size: 12px;
    padding: 0 12px;
  }
  #gamePage.battle-ready .seat-bottom .seat-avatar {
    padding: 2px 4px;
    left: 4px;
  }
  .asset-chip {
    font-size: 9px;
  }
}
@media screen and (max-width: 1100px) and (orientation: landscape) {
  #gamePage {
    --hand-area-h: 90px;
    --hand-gap: 3px;
  }
  .hand-cards {
    padding: 0 8px;
  }
  .card-item {
    padding: 3px;
  }
  #passBtn,
  #hintBtn,
  #playCardBtn,
  #trusteeBtn {
    min-width: 86px;
    height: 38px;
    font-size: 14px;
  }
  .game-extra-actions .large-btn {
    height: 30px;
    font-size: 11px;
  }
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 3px;
}

/* Notice Content */
.notice-content {
  color: #e2e8f0;
  line-height: 1.6;
}
.notice-content h4 {
  color: #fbbf24;
  margin-bottom: 8px;
}

/* Small Popup Panel */
.popup-panel.small-panel {
  width: 400px;
}

/* Setting Row */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #334155;
}
.setting-row:last-child {
  border-bottom: none;
}
.lang-switch-btn {
  min-width: 78px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(52, 211, 153, 0.68);
  background: linear-gradient(135deg, #06b6d4 0%, #22c55e 100%);
  color: #f8fafc;
  font-weight: 700;
  border-radius: 10px;
}
.lang-switch-btn:hover {
  filter: brightness(1.06);
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: #3b82f6;
}
input:focus + .slider {
  box-shadow: 0 0 1px #3b82f6;
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}
@media screen and (max-width: 900px) and (orientation: landscape) {
  .login-box {
    max-width: 360px;
    padding: 18px 20px 20px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.64);
    border: 1px solid rgba(96, 165, 250, 0.38);
    backdrop-filter: blur(4px);
  }
  .game-title {
    font-size: 38px;
    margin-bottom: 20px;
  }
  .input-group {
    margin-bottom: 14px;
  }
  .input-group input {
    height: 44px;
    font-size: 15px;
  }
  #loginBtn {
    min-width: 160px;
    height: 46px;
    font-size: 18px;
    padding: 0 20px;
  }
  .room-page {
    padding: 10px;
    padding-bottom: 12px;
  }
  .room-header {
    margin-bottom: 10px;
    gap: 10px;
    align-items: flex-start;
  }
  .room-info h2 {
    font-size: 20px;
  }
  .room-info p {
    font-size: 13px;
  }
  .room-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .room-actions .primary-btn,
  .room-actions .normal-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
  }
  .room-player-list {
    gap: 10px;
    min-height: 0;
    margin-bottom: 10px;
  }
  .room-player-item {
    min-height: 96px;
    padding: 10px;
    gap: 10px;
    border-radius: 10px;
  }
  .room-player-item .avatar {
    width: 44px;
    height: 44px;
  }
  .player-item-info .nickname {
    font-size: 18px;
    margin-bottom: 4px;
    line-height: 1.1;
  }
  .player-item-info .team {
    font-size: 14px;
    padding: 2px 8px;
  }
  .room-footer {
    gap: 8px;
    align-items: stretch;
  }
  .chat-box input {
    height: 40px;
    font-size: 14px;
  }
  .chat-box .primary-btn {
    height: 40px;
    min-width: 72px;
    padding: 0 12px;
  }
  #readyBtn,
  #startGameBtn {
    min-width: 152px;
    height: 44px;
    padding: 0 16px;
    font-size: 18px;
  }
  .waiting-room-layout {
    top: 10%;
    width: min(660px, 94vw);
    padding: 12px;
    border-radius: 12px;
  }
  .waiting-room-title {
    font-size: 18px;
  }
  .waiting-room-meta {
    margin: 4px 0 10px;
    font-size: 12px;
  }
  .waiting-room-list {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .waiting-room-item {
    padding: 6px 8px;
    border-radius: 8px;
  }
  .waiting-room-item .name {
    font-size: 13px;
  }
  .waiting-room-item .state {
    font-size: 11px;
  }
  .waiting-room-btn {
    min-width: 150px;
    height: 40px;
    padding: 0 16px;
    font-size: 15px;
  }
}
