* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #dbeaf7;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #eef5fc 0%, #d4e3f3 60%, #b8d0ea 100%);
}

#canvas-container {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* UI Layer */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Score Board */
.score-board {
  position: absolute;
  top: max(28px, env(safe-area-inset-top));
  left: max(28px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 10;
}

.current-score {
  font-size: 72px;
  font-weight: 900;
  color: #2c3e50;
  line-height: 1;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.current-score.pop {
  transform: scale(1.25);
  color: #ff9800;
}

.best-score {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #7f8c8d;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Combo Badge */
.combo-badge {
  position: absolute;
  top: calc(max(28px, env(safe-area-inset-top)) + 115px);
  left: max(28px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff7675, #d63031);
  color: #fff;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(214, 48, 49, 0.35);
  opacity: 0;
  transform: translateY(-10px) scale(0.85);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-badge.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.combo-badge.laugh-ready {
  background: linear-gradient(135deg, #f1c40f, #e67e22);
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 4px 14px rgba(241, 196, 15, 0.5); }
  100% { transform: scale(1.08); box-shadow: 0 8px 24px rgba(230, 126, 34, 0.8); }
}

/* Floating Center Bonus Text */
.floating-text-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.floating-score {
  position: absolute;
  font-size: 32px;
  font-weight: 900;
  color: #ff4757;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(255, 71, 87, 0.4);
  transform: translate(-50%, -50%);
  animation: floatUp 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.3) forwards;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -30px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -80px) scale(1);
  }
}

/* Naiwa Laughing Full-Screen Alert Banner */
.laugh-banner {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background: rgba(255, 240, 100, 0.95);
  border: 4px solid #ff9f1a;
  border-radius: 40px;
  padding: 16px 36px;
  box-shadow: 0 12px 35px rgba(255, 159, 26, 0.45);
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
}

.laugh-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: shakeBanner 0.4s infinite alternate;
}

@keyframes shakeBanner {
  0% { transform: translate(-52%, -50%) rotate(-2deg) scale(1); }
  100% { transform: translate(-48%, -50%) rotate(2deg) scale(1.04); }
}

.laugh-banner-icon {
  font-size: 44px;
}

.laugh-banner-text {
  display: flex;
  flex-direction: column;
}

.laugh-banner-title {
  font-size: 24px;
  font-weight: 900;
  color: #d35400;
  letter-spacing: 1px;
}

.laugh-banner-subtitle {
  font-size: 15px;
  font-weight: 700;
  color: #7f5300;
}

/* Floating Laugh Dialogue Bubble over Naiwa */
.laugh-bubble {
  position: absolute;
  background: #ffffff;
  border: 3px solid #2c3e50;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 20px;
  font-weight: 900;
  color: #e74c3c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transform: translate(-50%, -100%) scale(0);
  pointer-events: none;
  animation: popBubble 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  z-index: 90;
}

.laugh-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 8px 0;
  border-style: solid;
  border-color: #2c3e50 transparent;
  display: block;
  width: 0;
}

@keyframes popBubble {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  25% { transform: translate(-50%, -120%) scale(1.2); opacity: 1; }
  80% { transform: translate(-50%, -140%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(0.8); opacity: 0; }
}

/* Control Helpers & Audio Button */
.top-actions {
  position: absolute;
  top: max(28px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  z-index: 10;
}

/* 2D / 3D 模式切换胶囊 */
.mode-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: auto;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 700;
  color: #57606f;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mode-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
  color: #2f3542;
}

.mode-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
  transform: scale(1.02);
}

.mode-btn-icon {
  font-size: 15px;
}

.model-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 700;
  color: #4b6584;
  cursor: default;
  transition: all 0.2s ease;
  user-select: none;
}

.model-badge.glb-active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s;
}

.icon-btn:hover {
  transform: scale(1.08);
  background: #ffffff;
}

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

/* Modals (Game Over / Start) */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 28px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-avatar {
  width: 104px;
  height: 104px;
  margin: 0 auto 16px;
  background: radial-gradient(circle, #fffbe6 0%, #feeaa7 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(254, 211, 48, 0.4);
  position: relative;
  overflow: hidden;
  border: 4px solid #ffffff;
}

.modal-avatar-img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  display: block;
  transform: translateY(5px);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
  animation: modalAvatarWobble 2.4s ease-in-out infinite alternate;
}

@keyframes modalAvatarWobble {
  0% { transform: translateY(5px) rotate(-3deg); }
  100% { transform: translateY(5px) rotate(3deg); }
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 15px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-item {
  background: #f8fafc;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.stat-val {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
}

.stat-lbl {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.btn-primary {
  width: 100%;
  padding: 16px 0;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Charge power indicator bar below Naiwa */
.charge-indicator {
  position: absolute;
  width: 60px;
  height: 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  overflow: hidden;
  transform: translate(-50%, -50%);
  display: none;
  pointer-events: none;
  z-index: 50;
}

.charge-indicator-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
  border-radius: 4px;
  transition: width 0.05s linear;
}

/* Responsive adjustments for Mobile */
@media (max-width: 600px) {
  .score-board {
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
  }
  .current-score {
    font-size: 48px;
  }
  .best-score {
    font-size: 13px;
    padding: 3px 10px;
    margin-top: 4px;
  }
  .combo-badge {
    top: calc(max(16px, env(safe-area-inset-top)) + 84px);
    left: max(16px, env(safe-area-inset-left));
    padding: 6px 14px;
    font-size: 14px;
  }
  .top-actions {
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    gap: 8px;
  }

  /* 移动端顶栏紧凑设计：隐藏冗长徽章，避免与左侧比分冲突 */
  .model-badge {
    display: none !important;
  }
  .mode-toggle-group {
    padding: 3px;
    border-radius: 22px;
  }
  .mode-btn {
    padding: 6px 10px;
    font-size: 12px;
    gap: 4px;
    border-radius: 18px;
  }
  .mode-btn-icon {
    font-size: 13px;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  /* 结算弹窗移动端精致居中适配 */
  .modal-card {
    width: 88%;
    max-width: 320px;
    padding: 24px 18px;
    border-radius: 24px;
  }
  .modal-avatar-img {
    width: 76px;
    height: 76px;
  }
  .modal-title {
    font-size: 22px;
    margin-bottom: 6px;
  }
  .modal-desc {
    font-size: 13px;
    margin-bottom: 16px;
  }
  .stat-val {
    font-size: 28px;
  }
  .stat-lbl {
    font-size: 12px;
  }
  .btn-primary {
    padding: 13px 20px;
    font-size: 16px;
    border-radius: 20px;
  }
}

/* 极速开屏动画 */
.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #eef5fc 0%, #d4e3f3 60%, #b8d0ea 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.4s;
  pointer-events: auto;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-frog {
  font-size: 52px;
  animation: bounceFrog 0.65s infinite alternate cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
}

@keyframes bounceFrog {
  from {
    transform: translateY(0) scale(1.05, 0.95);
  }
  to {
    transform: translateY(-20px) scale(0.95, 1.05);
  }
}

.loading-text {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 800;
  color: #2c3e50;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.6);
}

.loading-bar {
  width: 160px;
  height: 6px;
  background: rgba(44, 62, 80, 0.1);
  border-radius: 99px;
  margin-top: 14px;
  overflow: hidden;
  position: relative;
}

.loading-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #2ed573, #7bed9f);
  border-radius: 99px;
  animation: loadSlide 1.1s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes loadSlide {
  0% { left: -40%; width: 40%; }
  50% { left: 25%; width: 60%; }
  100% { left: 100%; width: 30%; }
}

/* ==================== 顶部快捷操作胶囊 (排行榜 / 登录) ==================== */
.action-capsule-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #2c3e50;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.action-capsule-btn:active {
  transform: scale(0.95);
}
.action-capsule-btn .btn-icon {
  font-size: 15px;
}
.action-capsule-btn.logged-in {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #1b5e20;
  border-color: #a5d6a7;
}

/* ==================== 用户个人状态浮窗 ==================== */
.user-menu {
  position: absolute;
  top: calc(max(28px, env(safe-area-inset-top)) + 50px);
  right: max(28px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 18px;
  width: 240px;
  z-index: 1000;
  animation: popBubble 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
}
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f2f6;
}
.user-menu-avatar {
  font-size: 32px;
}
.user-menu-info {
  overflow: hidden;
  text-align: left;
}
.user-menu-name {
  font-weight: 800;
  font-size: 15px;
  color: #2c3e50;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.user-menu-email {
  font-size: 12px;
  color: #7f8c8d;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.user-menu-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-bottom: 1px solid #f1f2f6;
}
.user-stat-col {
  text-align: center;
}
.user-stat-val {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #ff9800;
}
.user-stat-lbl {
  font-size: 11px;
  color: #95a5a6;
}
.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.user-menu-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #f1f2f6;
  color: #2c3e50;
  transition: background 0.15s;
}
.user-menu-btn:hover {
  background: #e4e7eb;
}
.user-menu-btn.logout-btn {
  background: #ffeaa7;
  color: #d63031;
}
.user-menu-btn.logout-btn:hover {
  background: #ff7675;
  color: #fff;
}

/* ==================== 通用弹窗关闭按钮 ==================== */
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  color: #95a5a6;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
.modal-close-btn:hover {
  color: #2c3e50;
}

/* ==================== 登录 / 注册弹窗 ==================== */
.auth-card {
  max-width: 360px;
  width: 90%;
  padding: 28px 24px;
}
.auth-tabs {
  display: flex;
  background: #f1f2f6;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #7f8c8d;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: #ffffff;
  color: #2c3e50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: #34495e;
}
.form-group input {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #dcdde1;
  font-size: 14px;
  color: #2c3e50;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
  border-color: #2ed573;
  box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.2);
  background: #ffffff;
}
.auth-note {
  font-size: 12px;
  color: #d35400;
  background: rgba(230, 126, 34, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.4;
  text-align: center;
}
.auth-submit-btn {
  margin-top: 4px;
  padding: 12px;
  font-size: 15px;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: #7f8c8d;
  margin-top: 4px;
}
.auth-switch a {
  color: #0984e3;
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
.auth-msg {
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}
.auth-msg.error {
  display: block;
  background: #ffeaa7;
  color: #d63031;
}
.auth-msg.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
}

/* ==================== 全服排行榜弹窗 ==================== */
.leaderboard-card {
  max-width: 440px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 18px;
}
.leaderboard-header {
  margin-bottom: 12px;
}
.my-rank-banner {
  display: flex;
  justify-content: space-around;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #90caf9;
}
.my-rank-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.my-rank-label {
  font-size: 11px;
  font-weight: 700;
  color: #1976d2;
}
.my-rank-val {
  font-size: 17px;
  font-weight: 900;
  color: #0d47a1;
}
.leaderboard-list-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
  max-height: 320px;
  border-radius: 12px;
  background: #f8fafc;
  padding: 6px;
}
.leaderboard-status-text {
  padding: 30px 12px;
  text-align: center;
  color: #7f8c8d;
  font-size: 14px;
}
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s;
}
.leaderboard-item.is-me {
  background: #e8f5e9;
  border: 1.5px solid #81c784;
}
.lb-rank {
  width: 32px;
  font-size: 15px;
  font-weight: 900;
  color: #7f8c8d;
  text-align: center;
}
.lb-rank.gold { font-size: 22px; }
.lb-rank.silver { font-size: 20px; }
.lb-rank.bronze { font-size: 18px; }
.lb-player {
  flex: 1;
  margin-left: 8px;
  overflow: hidden;
  text-align: left;
}
.lb-nickname {
  font-weight: 800;
  font-size: 14px;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-masked-email {
  font-size: 11px;
  color: #95a5a6;
}
.lb-me-tag {
  display: inline-block;
  background: #2ecc71;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 4px;
}
.lb-score-col {
  text-align: right;
}
.lb-score {
  font-size: 18px;
  font-weight: 900;
  color: #e67e22;
}
.lb-combo {
  font-size: 11px;
  font-weight: 700;
  color: #ff7675;
}
.leaderboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #f1f2f6;
}
.leaderboard-count {
  font-size: 12px;
  color: #7f8c8d;
}
.btn-refresh {
  padding: 6px 14px;
  background: #f1f2f6;
  border: none;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  color: #2c3e50;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-refresh:hover {
  background: #e4e7eb;
}

/* ==================== 结算面板扩展 ==================== */
.modal-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.btn-secondary {
  flex: 1;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  border: 1.5px solid #dcdde1;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #f1f2f6;
}
.sync-status-badge {
  font-size: 12px;
  color: #4b6584;
  background: rgba(43, 80, 115, 0.08);
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-align: center;
}

/* ==================== 移动端媒体查询增强 ==================== */
@media (max-width: 600px) {
  .action-capsule-btn {
    padding: 5px 8px;
    font-size: 12px;
    gap: 3px;
  }
  .action-capsule-btn .btn-text {
    font-size: 12px;
  }
  .auth-card {
    padding: 22px 18px;
  }
  .leaderboard-card {
    padding: 20px 16px 14px;
    max-height: 88vh;
  }
  .my-rank-banner {
    padding: 8px 10px;
  }
  .my-rank-val {
    font-size: 15px;
  }
  .leaderboard-list-wrap {
    max-height: 250px;
  }
  .user-menu {
    right: 16px;
    top: calc(max(16px, env(safe-area-inset-top)) + 46px);
    width: 220px;
  }
}


