/* ========================================
   同桌游 · 多人在线棋牌平台 · 视觉设计
   ======================================== */

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --felt-dark: #0d3d26;
  --felt-mid:  #145c38;
  --felt-light:#1d7a4a;
  --gold:      #d4a843;
  --gold-light:#f0c869;
  --gold-dark: #9b7830;
  --red:       #c62828;
  --red-bright:#ef5350;
  --blue-team: #1565c0;
  --card-bg:   #fffef8;
  --card-red:  #d32f2f;
  --card-black:#1a1a1a;
  --shadow-deep: 0 20px 60px rgba(0,0,0,0.6);
  --shadow-card: 2px 3px 12px rgba(0,0,0,0.4);
  --glow-gold:  0 0 20px rgba(212,168,67,0.5);
  --glow-turn:  0 0 30px rgba(255,215,0,0.8);
  --radius-card: 8px;
  --radius-panel: 20px;
  --font-zh: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-zh);
  background: #0a1f0f;
  color: #fff;
  user-select: none;
}

/* =================== 页面框架 =================== */
.page {
  display: none;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0; left: 0;
}
.page.active { display: block; }

/* =================== 登录页 =================== */
.login-bg {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(30, 100, 50, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(50, 30, 80, 0.3) 0%, transparent 60%),
    linear-gradient(160deg, #071512 0%, #0e2d1a 40%, #071512 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.login-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-particles .particle {
  position: absolute;
  font-size: 24px;
  opacity: 0;
  animation: floatParticle var(--dur, 8s) var(--delay, 0s) infinite ease-in-out;
}
@keyframes floatParticle {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  20%  { opacity: 0.15; }
  80%  { opacity: 0.1; }
  100% { opacity: 0; transform: translateY(-100vh) rotate(360deg); }
}

.login-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: var(--radius-panel);
  padding: 50px 45px 40px;
  width: 420px;
  max-width: 95vw;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
  z-index: 10;
}

.login-logo {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.logo-suit {
  font-size: 28px;
  color: rgba(255,255,255,0.5);
  transition: all 0.3s;
}
.logo-suit.heart { color: rgba(210,70,70,0.7); }
.login-card:hover .logo-suit { opacity: 1; color: rgba(255,255,255,0.8); }
.login-card:hover .logo-suit.heart { color: rgba(240,80,80,0.9); }

.game-title {
  font-size: 52px;
  font-weight: 700;
  background: linear-gradient(135deg, #d4a843, #f0c869, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 16px;
  margin-bottom: 8px;
  text-shadow: none;
}
.game-subtitle {
  font-size: 13px;
  color: rgba(212,168,67,0.6);
  letter-spacing: 4px;
  margin-bottom: 36px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.input-group {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 12px;
  padding: 0 16px;
  transition: border-color 0.3s;
}
.input-group:focus-within {
  border-color: rgba(212,168,67,0.6);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.1);
}
.input-icon { font-size: 18px; margin-right: 10px; opacity: 0.6; }
.input-group input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 14px 0;
  color: #fff;
  font-size: 15px;
  font-family: var(--font-zh);
}
.input-group input::placeholder { color: rgba(255,255,255,0.3); }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-zh);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  padding: 14px 28px;
  letter-spacing: 1px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-icon { font-size: 17px; }

.btn-gold {
  background: linear-gradient(135deg, #c8962e 0%, #e8be55 50%, #c8962e 100%);
  color: #3d2000;
  box-shadow: 0 6px 20px rgba(212,168,67,0.4);
}
.btn-gold:hover { box-shadow: 0 10px 30px rgba(212,168,67,0.6); }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(212,168,67,0.4);
  color: rgba(212,168,67,0.9);
}
.btn-outline:hover {
  background: rgba(212,168,67,0.1);
  border-color: rgba(212,168,67,0.8);
}

.btn-large { padding: 16px; font-size: 16px; }

.login-features {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.lf-item {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* =================== 大厅页 =================== */
.lobby-bg {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at top, rgba(30,100,50,0.2) 0%, transparent 50%),
    linear-gradient(180deg, #071512 0%, #0e2d1a 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(212,168,67,0.15);
}
.lh-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}
.lh-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lh-avatar {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.lh-info { line-height: 1.3; }
.lh-name { font-size: 14px; font-weight: 600; color: #fff; }
.lh-level { font-size: 11px; color: rgba(212,168,67,0.7); }
.lh-coins {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(212,168,67,0.1);
  border: 1px solid rgba(212,168,67,0.25);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-light);
}

.lobby-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* 段位卡片 */
.rank-card {
  background: linear-gradient(135deg, rgba(212,168,67,0.08) 0%, rgba(212,168,67,0.03) 100%);
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.rank-icon { font-size: 44px; filter: drop-shadow(0 0 10px rgba(212,168,67,0.5)); }
.rank-info { flex: 1; }
.rank-title { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 1px; }
.rank-name { font-size: 20px; font-weight: 600; color: var(--gold-light); margin: 4px 0 10px; }
.rank-progress { display: flex; align-items: center; gap: 10px; }
.rank-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.rank-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); border-radius: 3px; transition: width 0.5s ease; }
.rank-score { font-size: 11px; color: rgba(255,255,255,0.4); white-space: nowrap; }
.rank-winrate { text-align: center; }
.wr-value { font-size: 26px; font-weight: 700; color: var(--gold); }
.wr-label { font-size: 11px; color: rgba(255,255,255,0.4); }

/* 大厅按钮 */
.lobby-actions { display: flex; flex-direction: column; gap: 12px; }
.lobby-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  border: none;
  border-radius: 16px;
  padding: 18px 24px;
  cursor: pointer;
  font-family: var(--font-zh);
  text-align: left;
  transition: all 0.2s;
}
.lobby-btn:hover { transform: translateY(-2px); }
.lobby-btn:active { transform: scale(0.98); }
.lobby-btn-primary {
  background: linear-gradient(135deg, #0d5c32 0%, #147840 100%);
  border: 1px solid rgba(212,168,67,0.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lobby-btn-secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
}
.lb-icon { font-size: 36px; }
.lb-title { font-size: 16px; font-weight: 600; color: #fff; }
.lb-sub { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 3px; }

/* 统计 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stat-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}
.stat-val { font-size: 22px; font-weight: 700; color: var(--gold-light); }
.stat-lab { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; }

.lobby-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.text-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-zh);
  padding: 4px 8px;
  transition: color 0.2s;
}
.text-btn:hover { color: rgba(255,255,255,0.7); }

/* =================== 游戏页 =================== */
.game-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(255,255,255,0.02)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at center, var(--felt-mid) 0%, var(--felt-dark) 70%, #071512 100%);
  position: relative;
}

/* 顶栏 */
.gtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
  flex-shrink: 0;
}
.gtop-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-zh);
  transition: all 0.2s;
}
.gtop-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.gtop-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.gtop-label { color: rgba(255,255,255,0.4); font-size: 11px; }
.gtop-val { color: var(--gold-light); font-weight: 700; font-size: 15px; margin: 0 2px; }
.gtop-suit { color: var(--red-bright); font-size: 14px; }
.gtop-sep { color: rgba(255,255,255,0.15); }

/* 牌桌 */
.gtable {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* 玩家区域 */
.parea {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* 玩家信息框 */
.pinfo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px 12px;
  transition: all 0.3s;
  position: relative;
}
.pinfo.active-turn {
  border-color: rgba(255,215,0,0.7);
  background: rgba(255,215,0,0.08);
  box-shadow: var(--glow-turn);
  animation: turnPulse 1.5s ease-in-out infinite;
}
@keyframes turnPulse {
  0%,100% { box-shadow: 0 0 15px rgba(255,215,0,0.4); }
  50%      { box-shadow: 0 0 35px rgba(255,215,0,0.8); }
}
.pinfo.team1 { border-color: rgba(30,150,255,0.2); }
.pinfo.team2 { border-color: rgba(255,80,80,0.2); }

.pavatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.pname-wrap { line-height: 1.3; }
.pname { font-size: 13px; font-weight: 600; color: #fff; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pteam { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 1px; }
.team1-badge { color: #64b5f6; }
.team2-badge { color: #ef9a9a; }
.pcards-count { font-size: 12px; color: var(--gold); white-space: nowrap; }
.pfinish {
  position: absolute;
  top: -10px; right: -10px;
  background: var(--gold);
  color: #3d2000;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.pfinish.hidden { display: none; }

/* 最近出的牌标注 */
.plast {
  display: flex;
  gap: 3px;
  align-items: center;
  min-height: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.plast-label {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 2px 6px;
}
.pass-badge {
  font-size: 11px;
  color: rgba(255,150,150,0.8);
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.2);
  border-radius: 8px;
  padding: 2px 8px;
  font-style: italic;
}

/* 手牌（对方背面） */
.phand {
  display: flex;
  position: relative;
}
.phand-top { flex-direction: row; }
.phand-left { flex-direction: column; }
.phand-right { flex-direction: column; }

.card-back-small {
  width: 28px;
  height: 38px;
  border-radius: 5px;
  background: var(--cb-bg, linear-gradient(135deg, #1a237e, #0d47a1));
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 1px 2px 6px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  margin-left: -12px;
  flex-shrink: 0;
}
.card-back-small:first-child { margin-left: 0; }
.card-back-small::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
}

.phand-left .card-back-small,
.phand-right .card-back-small {
  width: 38px; height: 28px;
  margin-left: 0;
  margin-top: -10px;
}
.phand-left .card-back-small:first-child,
.phand-right .card-back-small:first-child { margin-top: 0; }

/* 玩家位置 */
.parea-top {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}
.parea-left {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-start;
}
.parea-right {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-end;
}
.parea-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 20px);
  max-width: 800px;
  align-items: center;
}

/* 中央出牌区 */
.gcenter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  min-height: 110px;
  padding: 16px 20px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  backdrop-filter: blur(4px);
}
.gcenter-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
}
.gcenter-cards {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 70px;
}
.gcenter-type {
  font-size: 11px;
  color: var(--gold);
  min-height: 14px;
}

/* 我的手牌区 */
.phand-self {
  display: flex;
  gap: 0;
  justify-content: center;
  flex-wrap: nowrap;
  position: relative;
  padding: 8px 0 4px;
  min-height: 100px;
  overflow: visible;
}

/* =================== 卡牌样式 =================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, z-index 0s;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
}

/* 我的手牌 */
.card-self {
  width: 62px;
  height: 88px;
  margin-left: -22px;
  z-index: 1;
}
.card-self:first-child { margin-left: 0; }

.card-self:hover {
  transform: translateY(-16px) scale(1.05);
  z-index: 50;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.card-self.selected {
  transform: translateY(-26px) scale(1.05);
  z-index: 80;
  box-shadow: 0 16px 32px rgba(255,215,0,0.5);
  border: 2px solid var(--gold);
}
.card-self.hint-highlight {
  animation: hintBounce 0.5s ease 2;
}
@keyframes hintBounce {
  0%,100% { transform: translateY(-26px) scale(1.05); }
  50%      { transform: translateY(-35px) scale(1.1); }
}

/* 中央/历史牌 */
.card-play {
  width: 52px;
  height: 72px;
  margin-left: -16px;
  cursor: default;
}
.card-play:first-child { margin-left: 0; }

/* 预出牌区 */
.card-preview {
  width: 56px;
  height: 78px;
  margin-left: -18px;
  cursor: default;
}
.card-preview:first-child { margin-left: 0; }

/* 卡牌内容 — 已迁移到精灵图渲染,旧文字样式已移除 */

/* 级牌/王牌旧文字样式 — 已迁移到精灵图渲染,已移除 */

/* =================== 底部操作区 =================== */
.gbottom {
  flex-shrink: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.preview-area {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  gap: 0;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.preview-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
}
.preview-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 1;
}
.preview-type {
  font-size: 12px;
  color: var(--gold);
  position: absolute;
  bottom: 4px;
  right: 12px;
  letter-spacing: 1px;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
}

.abtn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-zh);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 0;
  min-width: 80px;
  transition: all 0.2s;
  letter-spacing: 2px;
}
.abtn:hover:not(:disabled) { transform: translateY(-2px); }
.abtn:active:not(:disabled) { transform: scale(0.97); }
.abtn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }

.abtn-pass {
  background: rgba(120,120,120,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  min-width: 80px;
}
.abtn-pass:hover:not(:disabled) {
  background: rgba(200,80,80,0.3);
  border-color: rgba(255,100,100,0.4);
  color: #ff9999;
}

.abtn-hint {
  background: rgba(30,120,200,0.25);
  border: 1px solid rgba(100,180,255,0.2);
  color: #80c8ff;
}
.abtn-hint:hover { background: rgba(30,120,200,0.4); }

.abtn-play {
  background: linear-gradient(135deg, #c8962e, #e8be55, #c8962e);
  color: #3d2000;
  box-shadow: 0 4px 16px rgba(212,168,67,0.4);
  min-width: 110px;
  font-size: 16px;
}
.abtn-play:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(212,168,67,0.6); }

.abtn-auto {
  background: rgba(150,100,200,0.2);
  border: 1px solid rgba(200,150,255,0.2);
  color: #d0aaff;
}
.abtn-auto.active {
  background: linear-gradient(135deg, rgba(100,50,180,0.5), rgba(150,80,220,0.5));
  border-color: rgba(200,100,255,0.5);
  color: #e0c0ff;
  animation: autoGlow 2s ease-in-out infinite;
}
@keyframes autoGlow {
  0%,100% { box-shadow: 0 0 8px rgba(200,100,255,0.3); }
  50%      { box-shadow: 0 0 20px rgba(200,100,255,0.6); }
}

/* =================== 飘字特效 =================== */
#floatEffects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
.float-text {
  position: absolute;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(212,168,67,0.8);
  animation: floatUp 1.8s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}
.float-text.bomb { color: #ff4444; text-shadow: 0 0 20px rgba(255,80,80,0.9); font-size: 28px; }
.float-text.rocket { color: #ff88ff; text-shadow: 0 0 25px rgba(255,100,255,0.9); font-size: 32px; }
.float-text.pass { color: rgba(255,150,150,0.8); font-size: 16px; }
.float-text.win  { color: #69f0ae; font-size: 30px; }
.float-text.lose { color: #ff8a65; font-size: 24px; }
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  70%  { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* =================== 出牌动画 =================== */
.card-fly {
  position: fixed;
  z-index: 9990;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.2, 0, 0.3, 1);
}

/* =================== 弹窗通用 =================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}
.close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}
.close-btn:hover { color: rgba(255,255,255,0.8); }

/* =================== 结算弹窗 =================== */
.result-panel {
  background: linear-gradient(160deg, #0d2c1a 0%, #071512 100%);
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: var(--radius-panel);
  width: 480px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-deep);
  position: relative;
  z-index: 1;
  animation: panelIn 0.3s ease;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.result-header {
  padding: 30px 30px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.result-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.result-sub { font-size: 14px; color: rgba(255,255,255,0.5); }
.result-panel.win-panel .result-header { background: radial-gradient(ellipse at center, rgba(105,240,174,0.1) 0%, transparent 70%); }
.result-panel.lose-panel .result-header { background: radial-gradient(ellipse at center, rgba(255,138,101,0.1) 0%, transparent 70%); }

.result-body { padding: 20px 30px; }
.result-rank-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.result-rank-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  transition: all 0.3s;
}
.result-rank-item.rank-1 {
  background: rgba(212,168,67,0.1);
  border-color: rgba(212,168,67,0.4);
  box-shadow: 0 0 15px rgba(212,168,67,0.2);
}
.result-rank-item.rank-2 {
  background: rgba(180,180,180,0.08);
  border-color: rgba(180,180,180,0.3);
}
.result-rank-item.rank-3 {
  background: rgba(180,120,60,0.08);
  border-color: rgba(180,120,60,0.3);
}
.rri-place { font-size: 20px; margin-bottom: 4px; }
.rri-name { font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 600; }
.rri-team { font-size: 10px; margin-top: 2px; }

.result-level-change {
  background: rgba(212,168,67,0.07);
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  text-align: center;
}
.rlc-title { font-size: 12px; color: rgba(255,255,255,0.4); letter-spacing: 1px; margin-bottom: 8px; }
.rlc-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
}
.rlc-from { color: rgba(255,255,255,0.5); }
.rlc-arrow { color: var(--gold); font-size: 14px; }
.rlc-to { color: var(--gold-light); }
.rlc-change { font-size: 14px; color: #69f0ae; background: rgba(105,240,174,0.1); border-radius: 8px; padding: 3px 10px; }
.rlc-change.down { color: #ff8a65; background: rgba(255,138,101,0.1); }

.result-score-row {
  background: rgba(100,181,246,0.07);
  border: 1px solid rgba(100,181,246,0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  text-align: center;
  display: none; /* 默认隐藏，排位赛时显示 */
}
.rank-name-display {
  font-size: 14px;
  color: var(--gold-light);
  margin-top: 8px;
  font-weight: 600;
}

/* ---- 计分明细（结算弹窗内） ---- */
.result-score-detail {
  display: none;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.rsd-header {
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}
.rsd-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 12px;
}
.rsd-info span {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 3px 10px;
  color: rgba(255,255,255,0.7);
}
.rsd-info .badge-bomb {
  color: #ff8a65;
  font-weight: 600;
}
.rsd-info .badge-spring {
  color: #f48fb1;
  font-weight: 600;
}
.rsd-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.rsd-player-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
}
.rsd-player-card.is-me {
  border-color: rgba(212,168,67,0.3);
  background: rgba(212,168,67,0.06);
}
.rsd-pname {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,0.85);
}
.rsd-pname .score-up {
  color: #69f0ae;
  font-size: 15px;
}
.rsd-pname .score-down {
  color: #ff8a65;
  font-size: 15px;
}
.rsd-pname .score-zero {
  color: rgba(255,255,255,0.3);
  font-size: 15px;
}
.rsd-pline {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  padding: 2px 0;
  border-bottom: 1px dotted rgba(255,255,255,0.04);
}
.rsd-pline:last-child { border-bottom: none; }
.rsd-pline.up { color: rgba(105,240,174,0.7); }
.rsd-pline.down { color: rgba(255,138,101,0.7); }
.rsd-pline.penalty { color: rgba(244,143,177,0.8); font-weight: 500; }
.rsd-formula {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ---- 设置面板：计分模式 + 底分 ---- */
.setting-col { flex-direction: column; align-items: flex-start; gap: 10px; }
.score-mode-select {
  display: flex;
  gap: 6px;
  width: 100%;
}
.sm-opt {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.sm-opt:hover { border-color: rgba(212,168,67,0.4); color: rgba(255,255,255,0.8); }
.sm-opt.active {
  border-color: var(--gold);
  background: rgba(212,168,67,0.15);
  color: var(--gold-light);
  font-weight: 600;
}
.base-score-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.base-score-slider input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  outline: none;
}
.base-score-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.3);
}
.bs-value {
  min-width: 40px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
}

.result-actions {
  display: flex;
  gap: 12px;
  padding: 20px 30px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.result-actions .btn { flex: 1; }

/* =================== 菜单弹窗 =================== */
.menu-panel {
  background: linear-gradient(160deg, #0d2c1a 0%, #071512 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 24px;
  width: 280px;
  position: relative;
  z-index: 1;
  animation: panelIn 0.2s ease;
}
.menu-panel h3 {
  text-align: center;
  color: var(--gold);
  font-size: 18px;
  margin-bottom: 20px;
  letter-spacing: 2px;
}
.menu-item {
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-zh);
  font-size: 14px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}
.menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.15); }
.menu-item.danger { color: rgba(255,120,120,0.8); border-color: rgba(255,80,80,0.15); }
.menu-item.danger:hover { background: rgba(255,80,80,0.1); color: #ff8888; border-color: rgba(255,80,80,0.3); }

/* =================== 规则弹窗 =================== */
.rules-panel {
  background: linear-gradient(160deg, #0d2c1a 0%, #071512 100%);
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: var(--radius-panel);
  width: 560px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  animation: panelIn 0.3s ease;
}
.rules-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.rules-head h2 { font-size: 20px; color: var(--gold-light); }
.rules-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rules-body section { }
.rules-body h3 { font-size: 15px; color: var(--gold); margin-bottom: 10px; }
.rules-body p { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.8; }
.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.rule-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}
.rule-card b { color: rgba(255,255,255,0.9); display: block; margin-bottom: 2px; }
.rule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.rule-list div {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.rules-footer {
  padding: 16px 28px;
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: right;
}

/* =================== 设置弹窗 =================== */
.settings-panel {
  background: linear-gradient(160deg, #0d2c1a 0%, #071512 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-panel);
  width: 440px;
  max-width: 96vw;
  position: relative;
  z-index: 1;
  animation: panelIn 0.3s ease;
}
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.settings-head h2 { font-size: 18px; color: var(--gold-light); }
.settings-body { padding: 16px 26px; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.setting-row:last-child { border-bottom: none; }
.setting-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}
.setting-icon { font-size: 18px; }

/* 开关 */
.toggle {
  width: 52px; height: 28px;
  background: rgba(255,255,255,0.1);
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  border: 1px solid rgba(255,255,255,0.1);
}
.toggle[data-on="true"] {
  background: linear-gradient(135deg, var(--felt-mid), var(--felt-light));
  border-color: rgba(212,168,67,0.3);
}
.toggle::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle[data-on="true"]::after { transform: translateX(24px); }

/* 速度选择 */
.speed-select { display: flex; gap: 6px; }
.speed-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-zh);
  transition: all 0.2s;
}
.speed-btn.active {
  background: rgba(212,168,67,0.15);
  border-color: rgba(212,168,67,0.4);
  color: var(--gold-light);
}

/* 牌背选择 */
.card-back-select { display: flex; gap: 8px; }
.cb-opt {
  width: 48px; height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.cb-opt.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(212,168,67,0.4); }

.settings-footer {
  padding: 16px 26px;
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: right;
}

/* =================== 响应式 =================== */
@media (max-width: 640px) {
  .parea-top { top: 6px; }
  .parea-left { left: 4px; }
  .parea-right { right: 4px; }
  .pinfo { padding: 6px 8px; }
  .pname { max-width: 55px; font-size: 12px; }
  .pteam { display: none; }
  .card-self { width: 52px; height: 74px; margin-left: -19px; }
  .card-back-small { width: 24px; height: 32px; }
  .gtop-sep, .gtop-round { display: none; }
  .result-rank-row { grid-template-columns: repeat(2, 1fr); }
  .rule-grid { grid-template-columns: 1fr; }
  .abtn { min-width: 70px; font-size: 14px; padding: 11px 0; }
  .abtn-play { min-width: 90px; }
}

@media (max-width: 400px) {
  .card-self { width: 46px; height: 66px; margin-left: -17px; }
  .action-bar { gap: 8px; }
  .abtn { min-width: 60px; font-size: 13px; }
}

/* =================== 网络版游戏桌面布局 =================== */
.game-bg {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at center, #0a4d2a 0%, #073d20 70%, #042815 100%);
  position: relative;
}

/* 桌面区域 */
.table-area {
  flex: 1; position: relative; min-height: 0; overflow: hidden;
}

/* 对手区域定位 */
.opponent-area { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.opponent-area.top { top: 8px; left: 50%; transform: translateX(-50%); }
.opponent-area.left { left: 8px; top: 50%; transform: translateY(-50%); align-items: flex-start; }
.opponent-area.right { right: 8px; top: 50%; transform: translateY(-50%); align-items: flex-end; }
.opponent-area.bottom { bottom: 4px; left: 50%; transform: translateX(-50%); align-items: center; }

/* 玩家信息卡片 */
.opp-card {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 8px 12px; transition: all 0.3s; position: relative;
}
.opponent-area.top .opp-card.active,
.opponent-area.left .opp-card.active,
.opponent-area.right .opp-card.active,
.opponent-area.bottom .opp-card.active {
  border-color: rgba(255,215,0,0.7); background: rgba(255,215,0,0.08);
  box-shadow: 0 0 15px rgba(255,215,0,0.4); animation: turnPulse 1.5s ease-in-out infinite;
}
@keyframes turnPulse {
  0%,100% { box-shadow: 0 0 15px rgba(255,215,0,0.4); }
  50% { box-shadow: 0 0 35px rgba(255,215,0,0.8); }
}

.opp-avatar {
  width: 36px; height: 36px; background: rgba(255,255,255,0.1);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.opp-name { font-size: 13px; font-weight: 600; color: #fff; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-cards { display: flex; align-items: center; gap: 4px; }
.opp-count { font-size: 12px; color: #FFD700; white-space: nowrap; }
.opp-finish {
  position: absolute; top: -10px; right: -10px;
  background: #FFD700; color: #3d2000; border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 牌背小图 */
.card-back-small {
  width: 28px; height: 38px; border-radius: 5px;
  background: linear-gradient(135deg, #1a237e, #0d47a1);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 1px 2px 6px rgba(0,0,0,0.5);
  margin-left: -12px; flex-shrink: 0; position: relative; overflow: hidden;
}
.card-back-small:first-child { margin-left: 0; }
.card-back-small::after {
  content: ''; position: absolute; inset: 3px;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 3px;
}

/* 出牌区 */
.played-area {
  display: flex; gap: 3px; align-items: center; justify-content: center;
  flex-wrap: wrap; min-height: 30px; max-width: 180px;
}
.played-type-tag { font-size: 11px; color: #FFD700; text-align: center; margin-bottom: 4px; }

/* 上一手牌信息 */
.last-play-info {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px; padding: 16px 20px; backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: 200px; min-height: 110px;
}

/* 手牌区 */
.hand-area {
  flex-shrink: 0; padding: 8px 16px; background: rgba(0,0,0,0.3);
}
.hand-cards {
  display: flex; gap: 0; justify-content: center; flex-wrap: nowrap;
  position: relative; padding: 8px 0 4px; min-height: 100px; overflow-x: auto;
  scrollbar-width: none;
}
.hand-cards::-webkit-scrollbar { display: none; }

/* 操作按钮 */
.action-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 20px; }
.action-btns { display: flex; gap: 10px; }
.btn-action {
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8); border-radius: 10px; padding: 10px 18px;
  font-size: 14px; cursor: pointer; font-family: var(--font-zh); transition: all 0.2s;
}
.btn-action:hover { background: rgba(255,255,255,0.14); color: #fff; }
.btn-action.primary { background: linear-gradient(135deg, #FFD700, #FFA500); color: #1a1a1a; border-color: #FFD700; font-weight: 700; }
.btn-action.primary:hover { box-shadow: 0 4px 12px rgba(255,215,0,0.4); }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; }

/* 卡牌迷你样式（出牌区用） */
.card-mini {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 36px; height: 50px; background: transparent;
  border-radius: 4px; border: 1px solid #ddd; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}


/* 滚动条美化 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(212,168,67,0.3); border-radius: 3px; }

/* 工具类 */
.hidden { display: none !important; }

/* ===================================================
   商业化系统样式
   =================================================== */

/* 游戏模式选择 */
.game-modes {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.gm-btn {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(20,60,40,0.8), rgba(10,40,25,0.9));
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}
.gm-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,168,67,0.25);
}
.gm-icon { font-size: 28px; }
.gm-label { font-size: 15px; font-weight: 700; }
.gm-sub { font-size: 11px; color: rgba(255,255,255,0.5); }
.gm-ranked { border-color: rgba(239,83,80,0.3); }
.gm-casual { border-color: rgba(100,181,246,0.3); }
.gm-friend { border-color: rgba(129,199,132,0.3); }
.gm-tournament {
  border-color: rgba(255,215,0,0.4);
  background: linear-gradient(160deg, rgba(60,50,20,0.8), rgba(40,30,10,0.9));
}

/* 商业化入口条 */
.commerce-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.cb-btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(20,50,35,0.7);
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
  position: relative;
}
.cb-btn:hover {
  border-color: var(--gold);
  background: rgba(30,70,50,0.8);
}
.cb-icon { font-size: 20px; }
.cb-text { font-size: 13px; font-weight: 600; }
.cb-daily { border-color: rgba(129,199,132,0.3); }
.cb-shop { border-color: rgba(255,193,7,0.3); }
.cb-ach { border-color: rgba(149,117,205,0.3); }
.cb-season { border-color: rgba(0,229,255,0.3); }
.cb-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef5350;
  border-radius: 50%;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* VIP状态条 */
.vip-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,193,7,0.15), rgba(255,143,0,0.1));
  border: 1px solid rgba(255,193,7,0.3);
  margin: 8px 0;
}
.vip-crown { font-size: 22px; }
.vip-text { font-weight: 700; color: var(--gold-light); font-size: 14px; }
.vip-days { font-size: 12px; color: rgba(255,255,255,0.6); }
.vip-claim-btn {
  margin-left: auto;
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffc107, #ff8f00);
  color: #3e2700;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.vip-claim-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(255,193,7,0.4); }

/* =================== 商店 =================== */
.shop-panel {
  background: linear-gradient(160deg, #1a3d2a, #0d2818);
  border-radius: 20px;
  width: 92%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(212,168,67,0.3);
  box-shadow: var(--shadow-deep);
}
.shop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.shop-head h2 { flex: 1; font-size: 20px; color: var(--gold-light); }
.shop-coins {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,193,7,0.15);
  border-radius: 20px;
  border: 1px solid rgba(255,193,7,0.3);
  font-weight: 700;
  color: var(--gold-light);
}
.shop-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.shop-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--font-zh);
}
.shop-tab.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}
.shop-tab:hover { color: #fff; }
.shop-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.shop-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}
.shop-item:hover {
  border-color: var(--gold);
  background: rgba(255,255,255,0.07);
  transform: translateY(-2px);
}
.shop-item.owned { border-color: rgba(129,199,132,0.4); }
.si-icon { font-size: 36px; text-align: center; }
.si-name { font-size: 15px; font-weight: 700; text-align: center; }
.si-desc { font-size: 12px; color: rgba(255,255,255,0.5); text-align: center; min-height: 32px; }
.si-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffc107, #ff8f00);
  color: #3e2700;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: var(--font-zh);
}
.si-price:hover { transform: scale(1.03); }
.si-price.real-money { background: linear-gradient(135deg, #42a5f5, #1976d2); color: #fff; }
.si-price.owned-btn { background: rgba(129,199,132,0.2); color: #81c784; cursor: default; }
.si-price.owned-btn:hover { transform: none; }
.shop-ad {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(66,165,245,0.1);
  border-top: 1px solid rgba(66,165,245,0.2);
}
.ad-label {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(66,165,245,0.2);
  border-radius: 4px;
  color: #64b5f6;
}
.ad-text { flex: 1; font-size: 13px; color: rgba(255,255,255,0.7); }
.ad-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  background: #42a5f5;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-zh);
}
.ad-btn:hover { background: #1976d2; }

/* =================== 每日签到 =================== */
.checkin-panel {
  background: linear-gradient(160deg, #1a3d2a, #0d2818);
  border-radius: 20px;
  width: 92%;
  max-width: 520px;
  overflow: hidden;
  border: 1px solid rgba(129,199,132,0.3);
  box-shadow: var(--shadow-deep);
}
.checkin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.checkin-head h2 { color: #81c784; font-size: 20px; }
.checkin-body { padding: 20px; text-align: center; }
.checkin-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.ci-cell {
  padding: 10px 4px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  transition: all 0.2s;
}
.ci-cell.claimed {
  background: rgba(129,199,132,0.15);
  border-color: rgba(129,199,132,0.4);
}
.ci-cell.today {
  border-color: var(--gold);
  background: rgba(255,193,7,0.1);
  animation: glow-today 1.5s infinite alternate;
}
@keyframes glow-today {
  from { box-shadow: 0 0 5px rgba(255,193,7,0.2); }
  to { box-shadow: 0 0 20px rgba(255,193,7,0.5); }
}
.ci-day { font-size: 11px; color: rgba(255,255,255,0.5); }
.ci-reward { font-size: 12px; font-weight: 600; margin-top: 4px; }
.ci-cell.claimed .ci-reward { color: #81c784; }
.ci-cell.today .ci-reward { color: var(--gold-light); }
.checkin-info { margin-bottom: 16px; font-size: 13px; color: rgba(255,255,255,0.6); }
.vip-bonus-hint { color: var(--gold-light) !important; margin-top: 4px; }

/* =================== 成就 =================== */
.ach-panel {
  background: linear-gradient(160deg, #2a1a3d, #1a0d28);
  border-radius: 20px;
  width: 92%;
  max-width: 680px;
  max-height: 85vh;
  overflow: hidden;
  border: 1px solid rgba(149,117,205,0.3);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-deep);
}
.ach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ach-head h2 { color: #b39ddb; font-size: 20px; }
.ach-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}
.ach-item.unlocked {
  background: rgba(149,117,205,0.1);
  border-color: rgba(149,117,205,0.4);
}
.ach-item:hover { border-color: rgba(149,117,205,0.6); }
.ach-icon { font-size: 32px; }
.ach-icon.locked { filter: grayscale(1); opacity: 0.4; }
.ach-info { flex: 1; }
.ach-name { font-size: 14px; font-weight: 700; }
.ach-item.unlocked .ach-name { color: #b39ddb; }
.ach-desc { font-size: 12px; color: rgba(255,255,255,0.5); }
.ach-reward { font-size: 11px; color: var(--gold-light); margin-top: 2px; }
.ach-status { font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.ach-status.locked { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }
.ach-status.unlocked { background: rgba(129,199,132,0.2); color: #81c784; }

/* =================== 赛季通行证 =================== */
.season-panel {
  background: linear-gradient(160deg, #0d2a3d, #061521);
  border-radius: 20px;
  width: 92%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  border: 1px solid rgba(0,229,255,0.3);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-deep);
}
.season-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.season-head h2 { color: #00e5ff; font-size: 20px; }
.season-body { padding: 20px; overflow-y: auto; }
.season-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sp-level {
  font-size: 18px;
  font-weight: 900;
  color: #00e5ff;
  white-space: nowrap;
}
.sp-bar-wrap {
  flex: 1;
  height: 24px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.sp-bar {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #18ffff);
  border-radius: 12px;
  transition: width 0.5s;
}
.sp-xp {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.season-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
}
.ss-free { font-size: 14px; color: #81c784; font-weight: 600; }
.ss-premium { font-size: 14px; color: var(--gold-light); font-weight: 600; }
.season-rewards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.sr-tier {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,229,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #00e5ff;
}
.sr-row.claimed .sr-tier { background: rgba(129,199,132,0.15); color: #81c784; }
.sr-rewards {
  flex: 1;
  display: flex;
  gap: 12px;
}
.sr-reward {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
}
.sr-reward.free { background: rgba(129,199,132,0.1); color: #81c784; }
.sr-reward.premium { background: rgba(255,193,7,0.1); color: var(--gold-light); }
.sr-reward.locked { opacity: 0.3; }

/* =================== 成就解锁通知 =================== */
.ach-notify {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #4a148c, #6a1b9a);
  border-radius: 16px;
  border: 2px solid #b39ddb;
  box-shadow: 0 8px 32px rgba(74,20,140,0.5);
  z-index: 10000;
  animation: slideInRight 0.5s ease, slideOutRight 0.5s ease 3.5s forwards;
  max-width: 320px;
}
@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  to { transform: translateX(400px); opacity: 0; }
}
.ach-notify-icon { font-size: 36px; }
.ach-notify-title { font-size: 12px; color: #ce93d8; font-weight: 600; }
.ach-notify-name { font-size: 16px; font-weight: 700; color: #fff; }
.ach-notify-reward { font-size: 12px; color: var(--gold-light); }

/* =================== 购买提示 =================== */
.purchase-toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(20,50,35,0.95);
  border: 1px solid var(--gold);
  border-radius: 30px;
  z-index: 10000;
  animation: toastFade 3s ease forwards;
  font-size: 14px;
}
@keyframes toastFade {
  0% { opacity: 0; transform: translate(-50%, 20px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}
.pt-icon { font-size: 20px; }

/* ==================== 战绩档案弹窗 ==================== */
.record-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid var(--gold);
  border-radius: 16px;
  width: 460px; max-height: 70vh;
  overflow: hidden;
  z-index: 1002;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.record-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(212,175,55,0.2), transparent);
  border-bottom: 1px solid rgba(212,175,55,0.3);
}
.record-head h2 { color: var(--gold); font-size: 20px; margin: 0; }
.record-body { padding: 20px 24px; overflow-y: auto; max-height: 55vh; }
.record-overview {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 20px;
}
.rov-item {
  background: rgba(255,255,255,0.05);
  border-radius: 12px; padding: 14px 8px;
  text-align: center;
}
.rov-val { font-size: 24px; font-weight: 700; }
.rov-val.win { color: #4caf50; }
.rov-val.lose { color: #f44336; }
.rov-val.streak { color: #ff9800; }
.rov-val.rate { color: var(--gold); }
.rov-label { font-size: 12px; color: #8892b0; margin-top: 4px; }
.record-list-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
  font-weight: 600;
}
.record-count { font-size: 12px; color: #8892b0; }
.record-list { display: flex; flex-direction: column; gap: 8px; }
.record-empty { text-align: center; color: #8892b0; padding: 40px 0; font-size: 14px; }
.record-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 12px 16px; transition: background 0.2s;
}
.record-item:hover { background: rgba(255,255,255,0.08); }
.record-item.win { border-left: 3px solid #4caf50; }
.record-item.lose { border-left: 3px solid #f44336; }
.ri-icon { font-size: 28px; flex-shrink: 0; }
.ri-info { flex: 1; min-width: 0; }
.ri-title { font-weight: 600; font-size: 14px; }
.ri-title.win { color: #4caf50; }
.ri-title.lose { color: #f44336; }
.ri-detail { font-size: 11px; color: #8892b0; margin-top: 2px; }
.ri-score { text-align: right; flex-shrink: 0; }
.ri-score-change { font-size: 16px; font-weight: 700; }
.ri-score-change.up { color: #4caf50; }
.ri-score-change.down { color: #f44336; }
.ri-date { font-size: 10px; color: #555; margin-top: 2px; }

/* ==================== 好友房弹窗 ==================== */
.friendroom-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid var(--gold);
  border-radius: 16px;
  width: 480px; max-height: 78vh;
  overflow: hidden;
  z-index: 1002;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.friendroom-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(212,175,55,0.2), transparent);
  border-bottom: 1px solid rgba(212,175,55,0.3);
}
.friendroom-head h2 { color: var(--gold); font-size: 20px; margin: 0; }
.friendroom-body { padding: 20px 24px; overflow-y: auto; max-height: 60vh; }

/* 好友房入口 */
.fr-action-btns { display: flex; gap: 14px; margin-bottom: 20px; }
.fr-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 20px 12px; border: 2px solid rgba(212,175,55,0.3);
  border-radius: 14px; background: rgba(255,255,255,0.03);
  cursor: pointer; transition: all 0.25s; color: inherit; font-family: inherit;
}
.fr-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.08);
  transform: translateY(-2px);
}
.fr-btn-icon { font-size: 32px; margin-bottom: 8px; }
.fr-btn-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.fr-btn-sub { font-size: 11px; color: #8892b0; }

/* 好友列表 */
.fr-friends {
  background: rgba(255,255,255,0.03); border-radius: 12px;
  padding: 16px; border: 1px solid rgba(255,255,255,0.06);
}
.fr-friends-title { font-weight: 600; margin-bottom: 10px; font-size: 14px; }
.fr-friends-list { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.fr-empty { text-align: center; color: #555; padding: 12px; font-size: 13px; }
.fr-friend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: rgba(255,255,255,0.05);
  border-radius: 8px;
}
.fr-friend-avatar { font-size: 24px; }
.fr-friend-name { flex: 1; font-size: 14px; }
.fr-friend-status { font-size: 11px; color: #4caf50; }
.fr-add-friend { display: flex; gap: 8px; }
.fr-add-friend input {
  flex: 1; padding: 8px 12px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  color: #e0e0e0; outline: none; font-size: 13px;
}
.fr-add-friend input:focus { border-color: var(--gold); }
.fr-add-friend button {
  padding: 8px 16px; background: var(--gold); color: #1a1a2e;
  border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
  font-size: 13px;
}

/* 加入房间 */
.fr-join-box { text-align: center; }
.fr-join-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.fr-code-input {
  width: 200px; padding: 14px; font-size: 28px; text-align: center;
  letter-spacing: 8px; background: rgba(255,255,255,0.06);
  border: 2px solid rgba(212,175,55,0.3); border-radius: 12px;
  color: var(--gold); outline: none; font-weight: 700;
  margin-bottom: 16px;
}
.fr-code-input:focus { border-color: var(--gold); }
.fr-join-btns { display: flex; gap: 12px; justify-content: center; }
.btn-gray {
  padding: 10px 24px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 8px;
  color: #aaa; cursor: pointer; font-size: 14px;
}

/* 房间内 */
.fr-room-info {
  text-align: center; padding: 20px; background: rgba(212,175,55,0.05);
  border-radius: 12px; border: 1px solid rgba(212,175,55,0.15);
  margin-bottom: 16px;
}
.fr-room-code-label { font-size: 12px; color: #8892b0; margin-bottom: 4px; }
.fr-room-code {
  font-size: 36px; font-weight: 900; letter-spacing: 6px;
  color: var(--gold); margin-bottom: 6px;
}
.fr-room-tip { font-size: 12px; color: #888; margin-bottom: 10px; }
.fr-copy-btn {
  padding: 6px 16px; background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.3); border-radius: 20px;
  color: var(--gold); cursor: pointer; font-size: 12px;
  transition: background 0.2s;
}
.fr-copy-btn:hover { background: rgba(212,175,55,0.3); }
.fr-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fr-slot {
  padding: 14px; border-radius: 10px; text-align: center;
  border: 2px dashed rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
}
.fr-slot.occupied {
  border-style: solid; border-color: rgba(212,175,55,0.3);
  background: rgba(255,255,255,0.05);
}
.fr-slot.you { border-color: var(--gold); background: rgba(212,175,55,0.08); }
.fr-slot-avatar { font-size: 28px; margin-bottom: 6px; }
.fr-slot-name { font-weight: 600; font-size: 14px; }
.fr-slot-tag { font-size: 10px; color: var(--gold); margin-top: 2px; }
.fr-slot-empty { color: #666; font-size: 13px; }
.fr-room-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.1);
}
.fr-room-status { font-size: 13px; color: #8892b0; }
.fr-leave-btn {
  padding: 6px 16px; background: rgba(244,67,54,0.15);
  border: 1px solid rgba(244,67,54,0.3); border-radius: 8px;
  color: #f44336; cursor: pointer; font-size: 12px;
}
.fr-leave-btn:hover { background: rgba(244,67,54,0.3); }

/* 房间开始按钮 */
.fr-start-btn {
  margin-top: 12px; width: 100%; padding: 14px;
  background: linear-gradient(90deg, var(--gold), #b8942f);
  border: none; border-radius: 12px; color: #1a1a2e;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all 0.25s;
}
.fr-start-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(212,175,55,0.3); }

/* 好友房模式标识 */
.fr-mode-select {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.fr-mode-opt {
  flex: 1; padding: 12px; text-align: center;
  border-radius: 10px; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  transition: all 0.2s; color: inherit; font-family: inherit; font-size: 14px;
}
.fr-mode-opt:hover { border-color: rgba(212,175,55,0.3); }
.fr-mode-opt.selected { border-color: var(--gold); background: rgba(212,175,55,0.1); }
.fr-mode-opt .fr-mode-icon { font-size: 24px; display: block; margin-bottom: 4px; }
.fr-mode-opt .fr-mode-name { font-weight: 600; }
.fr-mode-opt .fr-mode-desc { font-size: 10px; color: #8892b0; margin-top: 2px; }
