* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}
body {
  min-height: 100%;
}
body {
  -webkit-tap-highlight-color:rgba(0,0,0,0);
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: #0d1f0d;
  background-image:
    /* 噪点纹理 - 用 repeating-conic-gradient 模拟 */
    repeating-conic-gradient(rgba(255,255,255,0.015) 0% 25%, transparent 0% 50%);
  background-size: 4px 4px;
  background-repeat: repeat;
  color: #fff;
  overflow-x: hidden;
  position: relative;
}

/* 径向光晕 + 网格纹理 - 固定定位不随 body 高度变化 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(76,175,80,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(46,125,50,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(34,75,34,0.08) 0%, transparent 70%),
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 100% 100vh, 100% 100vh, 100% 100vh, 120px 120px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  pointer-events: none;
  z-index: 0;
}

/* 顶部光晕装饰 - 固定定位不随 body 高度变化 */
body::after {
  content: '';
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(76,175,80,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body.game-active {
  overflow: hidden;
  height: 100%;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
body.game-active .container {
  overflow: hidden;
  height: 100vh;
}

/* ========== 大厅 ========== */
#lobby { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
#lobby h1 { font-size: 28px; margin-bottom: 8px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
#lobby .subtitle { font-size: 14px; color: #a0c8a0; }
.nickname-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 10px 0 14px;
  backdrop-filter: blur(4px);
  transition: all 0.3s;
}
.nickname-bar:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.12);
}
.nickname-label {
  font-size: 12px;
  letter-spacing: 1px;
}
.nickname-value {
  color: #fff;
  font-weight: bold;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.nickname-edit {
  color: #4CAF50;
  cursor: pointer;
  font-size: 11px;
  background: rgba(76,175,80,0.2);
  padding: 2px 8px;
  border-radius: 10px;
  border: none;
  transition: all 0.2s;
  margin-left: 2px;
}
.nickname-edit:hover {
  background: rgba(76,175,80,0.25);
  color: #a5d6a7;
}
.btn-record {
  color: #FF9800;
  cursor: pointer;
  font-size: 11px;
  background: rgba(255,152,0,0.15);
  padding: 2px 8px;
  border-radius: 10px;
  border: none;
  transition: all 0.2s;
  margin-left: 4px;
}
.btn-record:hover {
  background: rgba(255,152,0,0.3);
  color: #ffe0b2;
}
.lobby-card {
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(76,175,80,0.08) 0%, transparent 60%),
    rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 30px 24px;
  width: 100%;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
}
.lobby-card h3 { font-size: 18px; margin-bottom: 20px; }
.btn {
  display: inline-block;
  padding: 12px 32px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: linear-gradient(135deg, #4CAF50, #2E7D32); color: #fff; width: 100%; flex: 1;
    padding: 12px 0;
    font-size: 15px;}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(76,175,80,0.4); }
.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-danger { background: linear-gradient(135deg, #f44336, #c62828); color: #fff; }

.create-buttons-row { display: flex; gap: 10px; margin-bottom: 12px; }
.create-buttons-row .btn { flex: 1; }
.create-buttons-row .btn-quick-join {
  flex: 1;
  padding: 12px 0;
  font-size: 15px;
}
.input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 16px;
  margin-bottom: 16px;
  text-align: center;
  outline: none;
}
.input:focus { border-color: #4CAF50; }
.input::placeholder { color: rgba(255,255,255,0.3); }
.input.error {
  border-color: #f44336;
  box-shadow: 0 0 10px rgba(244,67,54,0.5);
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.divider-text {
  display: flex; align-items: center; margin: 24px 0; color: rgba(255,255,255,0.4);
  font-size: 13px;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.15);
}
.divider-text span { padding: 0 12px; }
.room-info {
  margin-top: 16px;
  padding: 0;
  display: none;
}
.room-info.show { display: block; }
.room-num-card {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.room-num-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
}
.room-num-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  display: block;
}
.room-num-value {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 6px;
  font-family: 'Courier New', monospace;
}
.room-num-info {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 8px 12px;
}
.room-waiting {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  animation: pulse-text 1.5s infinite;
  text-shadow: 0 0 12px rgba(255,255,255,0.3);
}
@keyframes pulse-text {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.room-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.room-actions-row .btn-copy,
.room-actions-row .btn-share-invite {
  flex: 1;
}
.btn-share-invite {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: 2px solid rgba(255,152,0,0.4);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,152,0,0.2), rgba(255,87,34,0.15));
  color: #ffe0b2;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
}
.btn-share-invite:hover {
  background: linear-gradient(135deg, rgba(255,152,0,0.35), rgba(255,87,34,0.25));
  border-color: rgba(255,152,0,0.6);
}
.btn-copy {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
}
.btn-copy:hover {
  background: rgba(255,255,255,0.3);
  border-color: #fff;
}

/* 掉线重连提示 */
.offline-prefix {
  color: #ff9800;
  font-size: 12px;
  margin-right: 4px;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.btn-copy.copied {
  background: #fff;
  color: #2E7D32;
  border-color: #fff;
}
.btn-cancel {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: rgba(244,67,54,0.2);
  color: #ff8a80;
  border: 1px solid rgba(244,67,54,0.35);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover {
  background: rgba(244,67,54,0.4);
  border-color: #f44336;
  color: #fff;
}
.error-msg {
  color: #f44336;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.error-msg.show { display: block; }

/* 随机匹配按钮 */
.btn-quick-join {
  display: inline-block;
  padding: 12px 32px;
  border: 2px solid rgba(76, 175, 80, 0.4);
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  background: linear-gradient(135deg, rgba(76,175,80,0.25), rgba(46,125,50,0.2));
  color: #c8e6c9;
}
.btn-quick-join:hover {
  background: linear-gradient(135deg, rgba(76,175,80,0.4), rgba(46,125,50,0.35));
  border-color: rgba(76, 175, 80, 0.6);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76,175,80,0.3);
}
.join-buttons-row {
  display: flex;
  gap: 10px;
}
.join-buttons-row .btn {
  flex: 1;
  padding: 12px 8px;
  font-size: 15px;
}

/* ========== 游戏界面 ========== */
#game { flex: 1; display: none; flex-direction: column; height: 100vh; overflow: hidden; }
#game.show { display: flex; }
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background-color: rgba(0,0,0,0.08);
  background-image:
    /* 微妙的径向光晕 */
    radial-gradient(ellipse at 30% 0%, rgba(76,175,80,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 100%, rgba(46,125,50,0.05) 0%, transparent 55%);
  position: relative;
}

/* 游戏主区域叠加微妙的线条纹理 */
.game-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.008) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.008) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

.game-header {
  display: flex; justify-content: space-between; align-items: center;position: relative;
  padding: 10px 16px;
  background: 
    linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.15)),
    rgba(0,0,0,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 1;
}
.room-id-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(76,175,80,0.2);
  border: 1px solid rgba(76,175,80,0.35);
  border-radius: 8px;
  padding: 5px 10px;
}
.room-id-text {
  font-size: 14px; font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
}
.room-id-text span {
  color: #4CAF50; font-size: 16px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;font-weight: bold;
}
.btn-copy-mini {
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.btn-copy-mini:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}
.btn-copy-mini.copied {
  background: #4CAF50;
  border-color: #4CAF50;
}
.deck-info { font-size: 13px; color: #a0c8a0; }

.header-right {
  display: flex; align-items: center; gap: 10px;
}
.btn-music {
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.btn-music:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}
.btn-music.off {
  opacity: 0.4;
  background: rgba(255,255,255,0.04);
}
.btn-music.playing {
  animation: music-spin 6s linear infinite;
}
@keyframes music-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.btn-watch-share {
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.btn-watch-share:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}
.watch-banner {
  text-align: center;
  padding: 6px;
  background: rgba(76,175,80,0.15);
  border-bottom: 1px solid rgba(76,175,80,0.3);
  color: #a5d6a7;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
}

/* 对手区域 */
.opponent-area {
  padding: 12px 16px;
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.opponent-name-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 8px;
}
.opponent-name {
  font-size: 14px; color: rgba(255,255,255,0.7);
}
.btn-emoji {
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-emoji:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }
.emoji-panel {
  position: absolute;
  top: 38px; left: 50%;
  transform: translateX(-50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
  z-index: 20;
}
.emoji-panel.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.emoji-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.emoji-panel button {
  width: 40px; height: 40px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.emoji-panel button:hover { background: rgba(255,255,255,0.2); transform: scale(1.15); }

/* 表情气泡 */
.emoji-bubbles {
  position: fixed;
  top: 40%; left: 0; right: 0;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.emoji-bubble {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 32px;
  animation: emojiPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), emojiFadeOut 0.5s ease 2s forwards;
}
.emoji-bubble.self {
  align-self: flex-end;
  margin-right: 16px;
  background: rgba(76,175,80,0.25);
  border: 1px solid rgba(76,175,80,0.4);
}
.emoji-bubble.opp {
  align-self: flex-start;
  margin-left: 16px;
  background: rgba(255,152,0,0.25);
  border: 1px solid rgba(255,152,0,0.4);
}
@keyframes emojiPopIn {
  from { opacity: 0; transform: scale(0.3) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes emojiFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.8); }
}

.opponent-cards {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
}
.opponent-card {
  width: 32px; height: 44px;
  background: linear-gradient(135deg, #2c5f2c, #1a3a1a);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: rgba(255,255,255,0.4);
}
.turn-indicator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto;
  width: fit-content;
  transition: all 0.3s;
}

.turn-indicator-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 0.5px;
  overflow: hidden;
}

.turn-active .turn-indicator-inner {
  background: linear-gradient(135deg, #2E7D32, #1B5E20);
  color: #fff;
  box-shadow: 0 4px 20px rgba(76,175,80,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.turn-active .turn-indicator-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shimmer 2s infinite;
  pointer-events: none;
}

.turn-waiting {
  display: none;
}
.turn-waiting .turn-indicator-inner {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35);
}

/* ========== 倒计时圆环 ========== */
.countdown-ring {
  width: 26px;
  height: 26px;
  transform: rotate(-90deg);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.countdown-ring .bg {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 2.5;
}

.countdown-ring .progress {
  fill: none;
  stroke: #66BB6A;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 3px rgba(102,187,106,0.4));
}

.turn-text {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.turn-time {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: center;
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.turn-active .turn-time {
  color: rgba(255,255,255,0.85);
}

/* 脉冲光晕动画 - 活跃回合时 */
.turn-active {
  animation: turn-glow 1.8s infinite;
}

@keyframes turn-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(76,175,80,0.3)); }
  50% { filter: drop-shadow(0 0 16px rgba(76,175,80,0.5)); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 牌堆徽章 */
.game-deck-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 8px;
  padding: 3px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  width: fit-content;
}
.game-deck-badge .deck-icon {
  font-size: 13px;
}
.game-deck-badge .deck-count {
  color: #a0c8a0;
  font-size: 14px;
  min-width: 18px;
  text-align: center;
}

/* 出牌区域 */
.play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  background: 
    radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.015) 0%, transparent 70%);
}
.play-zone {
  min-height: 110px;
  width: calc(100% - 32px);
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.07);
  background: rgba(20,35,20,0.35);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative;
}
/* 自己出牌：绿晶光效 */
.play-zone.self-play {
  border-color: rgba(76,175,80,0.35);
  background: radial-gradient(ellipse at 50% 50%, rgba(76,175,80,0.06) 0%, rgba(76,175,80,0.02) 100%);
  box-shadow: 0 0 28px rgba(76,175,80,0.10), inset 0 0 30px rgba(76,175,80,0.04);
}
/* 对手出牌：琥珀光效 */
.play-zone.opp-play {
  border-color: rgba(255,152,0,0.35);
  background: radial-gradient(ellipse at 50% 50%, rgba(255,152,0,0.06) 0%, rgba(255,152,0,0.02) 100%);
  box-shadow: 0 0 28px rgba(255,152,0,0.10), inset 0 0 30px rgba(255,152,0,0.04);
}

/* 出牌人指示标签 */
.play-owner-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  animation: labelPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 2px;
  user-select: none;
}
.play-owner-label.self {
  color: #81C784;
  background: rgba(76,175,80,0.15);
  border: 1px solid rgba(76,175,80,0.25);
  box-shadow: 0 2px 8px rgba(76,175,80,0.08);
}
.play-owner-label.opp {
  color: #FFB74D;
  background: rgba(255,152,0,0.15);
  border: 1px solid rgba(255,152,0,0.25);
  box-shadow: 0 2px 8px rgba(255,152,0,0.08);
}

@keyframes labelPopIn {
  from { opacity: 0; transform: scale(0.8) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.play-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  letter-spacing: 1px;
  animation: playLabelPulse 2.5s ease-in-out infinite;
  user-select: none;
}

@keyframes playLabelPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity:1; }
}
.play-cards-display {
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: center;
}
.play-card {
  width: 44px; height: 62px;
  border-radius: 6px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-evenly;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
  padding: 2px;
  border: 1px solid rgba(255,255,255,0.15);
  animation: cardPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.play-card .card-icon { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1)); }
.play-card .card-name { font-size: 10px; text-align: center; line-height: 1.1; white-space: nowrap; }
/* 牌面类型主题 */
.play-card.normal {
  background: linear-gradient(160deg, #fff8e1 0%, #f5e6c8 50%, #e8d5a8 100%);
  color: #5a4a2a;
  border-color: rgba(200,170,100,0.3);
}
.play-card.engineer {
  background: linear-gradient(160deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
  color: #1b5e20;
  border-color: rgba(100,180,100,0.3);
}
.play-card.landmine {
  background: linear-gradient(160deg, #4e342e 0%, #3e2723 50%, #2c1a15 100%);
  color: #ffab91;
  border-color: rgba(255,150,100,0.2);
}
.play-card.bomb_piece {
  background: linear-gradient(160deg, #ef5350 0%, #e53935 50%, #c62828 100%);
  color: #fff;
  border-color: rgba(255,200,200,0.3);
}
.play-card.flag {
  background: linear-gradient(160deg, #fff9c4 0%, #ffeb3b 60%, #f9a825 100%);
  color: #4e342e;
  border-color: rgba(255,200,50,0.3);
}
@keyframes cardPopIn {
  from { opacity: 0; transform: scale(0.85) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pass-text {
  font-size: 18px; color: rgba(255,255,255,0.5); display: none;
}
.pass-text.show { display: block; }

/* 回合光带（位于操作栏底部） */
.action-bar {
  position: relative;
  overflow: hidden;
}
.turn-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  background: transparent;
  z-index: 5;
  transition: background 0.4s;
}
.turn-bar.my-turn {
  background: linear-gradient(90deg, transparent, #4CAF50, transparent);
  box-shadow: 0 -4px 16px rgba(76,175,80,0.6), 0 -10px 30px rgba(76,175,80,0.15);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
  animation: bar-glow 2s infinite;
}
@keyframes bar-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 手牌区域 */
.my-hand-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px;
  background: 
    radial-gradient(ellipse at 50% 100%, rgba(76,175,80,0.06) 0%, transparent 65%),
    rgba(0,0,0,0.12);
  transition: background 0.4s, box-shadow 0.4s;
  position: relative;
  z-index: 1;
}
.my-hand-area.my-turn {
  background: rgba(76,175,80,0.08);
  box-shadow: inset 0 4px 20px rgba(76,175,80,0.12);
}
.my-hand {
  display: flex; gap: 4px; justify-content: center;
  flex-wrap: wrap; padding: 8px 0;
  min-height: 80px;
}
.hand-card {
  width: 54px; height: 80px;
  border-radius: 7px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-evenly;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  user-select: none;
  border: 1.5px solid rgba(255,255,255,0.12);
  padding: 4px 2px;
}
.hand-card:hover { transform: translateY(-6px); box-shadow: 0 6px 16px rgba(0,0,0,0.4); }
.hand-card.selected {
  transform: translateY(-12px);
  box-shadow: 0 0 16px rgba(76,175,80,0.5), 0 8px 20px rgba(76,175,80,0.4);
  border-color: #66BB6A;
  animation: selectedGlow 1.2s ease-in-out infinite;
}
.hand-card.selected::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 5px;
  background: #4CAF50;
  border-radius: 3px;
}

@keyframes selectedGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(76,175,80,0.5), 0 8px 20px rgba(76,175,80,0.4); }
  50% { box-shadow: 0 0 28px rgba(76,175,80,0.7), 0 8px 24px rgba(76,175,80,0.5); }
}
@keyframes newDrawnGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.4), 0 0 16px rgba(255,215,0,0.2); }
  50% { box-shadow: 0 0 18px rgba(255,215,0,0.7), 0 0 30px rgba(255,215,0,0.3); }
}
.hand-card.new-drawn {
  animation: newDrawnGlow 1s ease-in-out infinite;
  border-color: #FF9800;
}
.hand-card.new-drawn::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 5px;
  background: #FF9800;
  border-radius: 3px;
}
.hand-card .card-icon {
  font-size: 22px; line-height: 1; text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.hand-card .card-name {
  font-size: 12px; text-align: center; line-height: 1.1;
  white-space: nowrap;
}
.card-rank-dot {
  position: absolute; top: 2px; right: 3px;
  font-size: 9px; font-weight: bold;
  background: rgba(0,0,0,0.08); border-radius: 10px;
  padding: 0 4px; line-height: 14px;
  opacity: 0.75;
}
.hand-card.normal { background: linear-gradient(165deg, #fff8e1 0%, #f5e6c8 50%, #e8d5a8 100%); color: #5a4a2a; border-color: rgba(200,170,100,0.25); }
.hand-card.engineer { background: linear-gradient(165deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%); color: #1b5e20; border-color: rgba(100,180,100,0.25); }
.hand-card.landmine { background: linear-gradient(165deg, #4e342e 0%, #3e2723 50%, #2c1a15 100%); color: #ffab91; border-color: rgba(255,150,100,0.15); }
.hand-card.bomb_piece { background: linear-gradient(165deg, #ef5350 0%, #e53935 50%, #c62828 100%); color: #fff; border-color: rgba(255,200,200,0.25); }
.hand-card.flag { background: linear-gradient(165deg, #fff9c4 0%, #ffeb3b 60%, #f9a825 100%); color: #4e342e; border-color: rgba(255,200,50,0.25); }

/* 观战模式迷你手牌 */
.watch-hand {
  padding: 6px 10px;
  flex: none;
  margin-top: auto;
  background: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.mini-hand-label {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
  padding: 2px 0;
}
.mini-hand {
  display: flex;
  gap: 3px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.mini-card {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}
.mini-card-icon {
  font-size: 16px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}
.mini-card-name {
  font-size: 9px;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  margin-top: 2px;
}
.mini-card.normal { background: linear-gradient(160deg, #fff8e1, #f5e6c8); color: #5a4a2a; border-color: rgba(200,170,100,0.2); }
.mini-card.engineer { background: linear-gradient(160deg, #e8f5e9, #c8e6c9); color: #1b5e20; border-color: rgba(100,180,100,0.2); }
.mini-card.landmine { background: linear-gradient(160deg, #4e342e, #3e2723); color: #ffab91; border-color: rgba(255,150,100,0.12); }
.mini-card.bomb_piece { background: linear-gradient(160deg, #ef5350, #e53935); color: #fff; border-color: rgba(255,200,200,0.2); }
.mini-card.flag { background: linear-gradient(160deg, #fff9c4, #ffeb3b); color: #4e342e; border-color: rgba(255,200,50,0.2); }

/* ========== 牌背样式 ========== */
/* 基础牌背样式 */
.opponent-card {
  width: 28px; height: 38px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* 牌背悬停效果 */
.opponent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* 牌背纹理叠加 */
.opponent-card::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: none;
}

/* 牌背中心装饰 */
.opponent-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}

/* 主题1：经典绿（默认） */
.opponent-card.theme-classic,
body.card-theme-classic .opponent-card {
  background: linear-gradient(135deg, #3d7a3d, #2a5a2a);
  border-color: rgba(255,255,255,0.18);
}

body.card-theme-classic .opponent-card::after {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}

/* 主题2：深蓝 */
body.card-theme-blue .opponent-card {
  background: linear-gradient(135deg, #1a5276, #0d3b5e);
  border-color: rgba(100,180,255,0.2);
}

body.card-theme-blue .opponent-card::after {
  background: rgba(100,180,255,0.08);
  border-color: rgba(100,180,255,0.15);
}

/* 主题3：暗红 */
body.card-theme-red .opponent-card {
  background: linear-gradient(135deg, #7b241c, #5b160f);
  border-color: rgba(255,120,100,0.2);
}

body.card-theme-red .opponent-card::after {
  background: rgba(255,120,100,0.08);
  border-color: rgba(255,120,100,0.15);
}

/* 主题4：迷彩 */
body.card-theme-camo .opponent-card {
  background: 
    linear-gradient(135deg, #2d5016, #1a3a0a),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,0.08) 3px,
      rgba(0,0,0,0.08) 6px
    );
  background-blend-mode: overlay;
  border-color: rgba(255,255,255,0.12);
}

body.card-theme-camo .opponent-card::after {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

/* 主题5：简约黑 */
body.card-theme-dark .opponent-card {
  background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
  border-color: rgba(255,255,255,0.1);
}

body.card-theme-dark .opponent-card::after {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

/* 主题6：琥珀金 */
body.card-theme-amber .opponent-card {
  background: linear-gradient(135deg, #7d6608, #5a4a06);
  border-color: rgba(255,200,50,0.2);
}

body.card-theme-amber .opponent-card::after {
  background: rgba(255,200,50,0.08);
  border-color: rgba(255,200,50,0.15);
}

/* 主题7：翠绿波纹 */
body.card-theme-green-wave .opponent-card {
  background: 
    linear-gradient(135deg, #1b7a3a, #0d5a2a),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 4px,
      rgba(255,255,255,0.03) 4px,
      rgba(255,255,255,0.03) 5px
    );
  background-blend-mode: overlay;
  border-color: rgba(100,255,160,0.2);
}

body.card-theme-green-wave .opponent-card::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(100,255,160,0.06);
  border-color: rgba(100,255,160,0.12);
}

/* 主题8：墨绿格纹 */
body.card-theme-green-plaid .opponent-card {
  background: 
    linear-gradient(135deg, #1a4a2a, #0f3020),
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(255,255,255,0.04) 50%,
      transparent 100%
    ),
    linear-gradient(
      0deg,
      transparent 0%,
      rgba(255,255,255,0.04) 50%,
      transparent 100%
    );
  background-size: 100% 100%, 6px 100%, 100% 6px;
  background-blend-mode: overlay;
  border-color: rgba(255,255,255,0.15);
}

body.card-theme-green-plaid .opponent-card::after {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

/* 牌背选择弹窗中的预览牌背 - 独立样式，不受 body 主题影响 */
.preview-card {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  pointer-events: none;
  transition: all 0.2s;
  background: linear-gradient(135deg, #3d7a3d, #2a5a2a);
}

.preview-card::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
}

.preview-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.preview-card.theme-classic {
  background: linear-gradient(135deg, #3d7a3d, #2a5a2a) !important;
  border-color: rgba(255,255,255,0.18) !important;
}
.preview-card.theme-classic::after {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

.preview-card.theme-green-wave {
  background:
    linear-gradient(135deg, #1b7a3a, #0d5a2a),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 4px,
      rgba(255,255,255,0.03) 4px,
      rgba(255,255,255,0.03) 5px
    ) !important;
  background-blend-mode: overlay !important;
  border-color: rgba(100,255,160,0.2) !important;
}
.preview-card.theme-green-wave::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(100,255,160,0.06) !important;
  border-color: rgba(100,255,160,0.12) !important;
}

.preview-card.theme-green-plaid {
  background:
    linear-gradient(135deg, #1a4a2a, #0f3020),
    linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%),
    linear-gradient(0deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%) !important;
  background-size: 100% 100%, 6px 100%, 100% 6px !important;
  background-blend-mode: overlay !important;
  border-color: rgba(255,255,255,0.15) !important;
}
.preview-card.theme-green-plaid::after {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

.preview-card.theme-camo {
  background:
    linear-gradient(135deg, #2d5016, #1a3a0a),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,0.08) 3px,
      rgba(0,0,0,0.08) 6px
    ) !important;
  background-blend-mode: overlay !important;
  border-color: rgba(255,255,255,0.12) !important;
}
.preview-card.theme-camo::after {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

.preview-card.theme-blue {
  background: linear-gradient(135deg, #1a5276, #0d3b5e) !important;
  border-color: rgba(100,180,255,0.2) !important;
}
.preview-card.theme-blue::after {
  background: rgba(100,180,255,0.08) !important;
  border-color: rgba(100,180,255,0.15) !important;
}

.preview-card.theme-red {
  background: linear-gradient(135deg, #7b241c, #5b160f) !important;
  border-color: rgba(255,120,100,0.2) !important;
}
.preview-card.theme-red::after {
  background: rgba(255,120,100,0.08) !important;
  border-color: rgba(255,120,100,0.15) !important;
}

.preview-card.theme-dark {
  background: linear-gradient(135deg, #2c2c2c, #1a1a1a) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.preview-card.theme-dark::after {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

.preview-card.theme-amber {
  background: linear-gradient(135deg, #7d6608, #5a4a06) !important;
  border-color: rgba(255,200,50,0.2) !important;
}
.preview-card.theme-amber::after {
  background: rgba(255,200,50,0.08) !important;
  border-color: rgba(255,200,50,0.15) !important;
}

.cardback-option:hover .preview-card {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.cardback-option.active .preview-card {
  border-color: #4CAF50 !important;
  box-shadow: 0 0 8px rgba(76,175,80,0.4) !important;
}

/* 大厅预览用牌背 */
.cardback-preview {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.cardback-preview:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.cardback-preview.active {
  border-color: #4CAF50;
  box-shadow: 0 0 8px rgba(76,175,80,0.4);
}

.cardback-preview::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
}

.cardback-preview::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

/* 预览牌背主题色 */
.cardback-preview.theme-classic { background: linear-gradient(135deg, #3d7a3d, #2a5a2a); }
.cardback-preview.theme-blue { background: linear-gradient(135deg, #1a5276, #0d3b5e); }
.cardback-preview.theme-red { background: linear-gradient(135deg, #7b241c, #5b160f); }
.cardback-preview.theme-camo { background: linear-gradient(135deg, #2d5016, #1a3a0a); }
.cardback-preview.theme-dark { background: linear-gradient(135deg, #2c2c2c, #1a1a1a); }
.cardback-preview.theme-amber { background: linear-gradient(135deg, #7d6608, #5a4a06); }

/* 牌背选择弹窗 */
.cardback-modal {
  max-width: 400px;
}

.cardback-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  justify-items: center;
  margin: 20px 0;
}

.cardback-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.cardback-option:hover {
  background: rgba(255,255,255,0.05);
}

.cardback-option.active {
  border-color: #4CAF50;
  background: rgba(76,175,80,0.08);
}

.cardback-option-name {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.cardback-option.active .cardback-option-name {
  color: #4CAF50;
}

/* 操作按钮 */
.action-bar {
  display: flex; gap: 10px; padding: 10px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  position: relative;
  z-index: 1;
}
.action-bar .btn { flex: 1; padding: 14px; font-size: 16px; }
.btn-play { background: linear-gradient(135deg, #4CAF50, #2E7D32); color: #fff; }
.btn-play:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-pass { background: rgba(255,255,255,0.12); color: #fff; }
.btn-pass:disabled { opacity: 0.3; cursor: not-allowed; }

/* RPS弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #2a4a2a; border-radius: 16px; padding: 30px; text-align: center;
  width: 90%; max-width: 360px;
}
.modal h3 { font-size: 20px; margin-bottom: 24px; }
.rps-buttons { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.rps-btn {
  width: 70px; height: 70px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: #fff; font-size: 14px; cursor: pointer;
  transition: all 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.rps-btn:hover { background: rgba(76,175,80,0.3); border-color: #4CAF50; transform: scale(1.1); }
.rps-btn .rps-icon { font-size: 28px; }

/* 游戏结束弹窗 */
.game-over-modal .modal {
  background: #2a4a2a;
  padding: 36px 28px;
}
.game-result { font-size: 28px; font-weight: bold; margin-bottom: 16px; }
.game-result.win { color: #4CAF50; }
.game-result.lose { color: #f44336; }

/* 玩法说明按钮 */
.btn-rules {
  margin: 8px 0 16px 0;
  padding: 0;
  background: none;
  color: rgba(255,255,255,0.45);
  border: none;
  border-radius: 0;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  letter-spacing: 1px;
}
.btn-rules:hover {
  color: rgba(255,255,255,0.8);
}

/* 玩法说明弹窗 */
.rules-content {
  max-width: 480px;
  max-height: 78vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 24px 20px;
}
.rules-content h3 {
  text-align: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.rules-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
}
.rules-body::-webkit-scrollbar { width: 4px; }
.rules-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.rules-body h4 {
  font-size: 15px;
  color: #4CAF50;
  margin: 16px 0 8px;
  border-bottom: 1px solid rgba(76,175,80,0.2);
  padding-bottom: 4px;
}
.rules-body h4:first-child { margin-top: 0; }
.rules-body p {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 8px;
}
.rules-body strong { color: #fff; }
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 6px 0 10px;
}
.rules-table th, .rules-table td {
  padding: 5px 6px;
  border: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  color: rgba(255,255,255,0.8);
}
.rules-table th {
  background: rgba(76,175,80,0.15);
  color: #4CAF50;
}
.rules-chain {
  text-align: center;
  font-size: 12px;
  color: #a0c8a0;
  background: rgba(76,175,80,0.1);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 8px 0;
}
.rules-list {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  padding-left: 20px;
  line-height: 1.8;
}
.rules-list li { margin-bottom: 4px; }

/* Toast */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 10px 28px;
  border-radius: 20px; font-size: 14px; z-index: 200;
  white-space: nowrap;
  animation: fadeInOut 1.8s forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========== 海报分享弹窗 ========== */
.modal-overlay.poster-modal {
  z-index: 200;
}
.poster-modal .modal {
  background: #1f3a1f;
  border: 1px solid rgba(76,175,80,0.2);
  padding: 18px 16px 20px;
  width: 96%;
  max-width: 460px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.poster-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.poster-img-wrap {
  background: #0f2a0f;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.poster-img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 10px;
  display: block;
  object-fit: contain;
}
.poster-tip {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.poster-close {
  width: 100%;
  padding: 14px;
  flex-shrink: 0;
}

/* 游戏结果弹窗按钮增强 */
.game-result {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 8px;
}
.game-result.win { color: #4CAF50; }
.game-result.lose { color: #ff9800; }

/* ========== 战绩弹窗 ========== */
.records-modal {
  max-width: 380px;
  width: 92%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.records-modal h3 {
  margin-bottom: 16px;
  flex-shrink: 0;
}
.records-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin-bottom: 16px;
}
.records-list::-webkit-scrollbar { width: 4px; }
.records-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.records-empty {
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  padding: 30px 0;
}
.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  gap: 8px;
}
.record-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.record-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}
.record-result.win {
  background: rgba(76,175,80,0.25);
  color: #a5d6a7;
  border: 1px solid rgba(76,175,80,0.35);
}
.record-result.lose {
  background: rgba(255,152,0,0.15);
  color: #ffe0b2;
  border: 1px solid rgba(255,152,0,0.3);
}
.record-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.record-opponent {
  font-size: 14px;
  color: #fff;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.record-mode {
  display: inline-block;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: normal;
  vertical-align: middle;
}
.record-time {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.record-highlight {
  font-size: 11px;
  color: #FF9800;
  background: rgba(255,152,0,0.1);
  border: 1px solid rgba(255,152,0,0.2);
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.records-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.records-actions .btn {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
}

/* ========== 新手引导弹窗 ========== */
.guide-modal {
  max-width: 360px;
  width: 80%;
  padding: 24px 20px;
  text-align: left;
}
.guide-modal h3 {
  text-align: center;
  margin-bottom: 4px;
}
.guide-body {
  margin: 16px 0;
}
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.guide-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}
.guide-step-text strong {
  color: #fff;
  font-size: 15px;
}
.guide-step-text p {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-top: 2px;
}
.guide-tips {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 4px;
}

.guide-tips p {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
  line-height: 1.5;
}
.guide-tips p:last-child {
  margin-bottom: 0;
}
.guide-actions {
  display: flex;
  gap: 10px;
}
.guide-actions .btn {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
}



















