/* ==========================================
   Leaderboard Module — 排行榜样式
   ========================================== */

/* 排行榜外层容器, 套游戏同款毛玻璃 */
.leaderboard-wrapper {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 24px 16px;
  min-width: 320px;
  max-width: 380px;
  box-shadow:
    0 0 40px rgba(0, 200, 255, 0.08),
    0 0 80px rgba(0, 100, 255, 0.05),
    inset 0 0 40px rgba(255, 255, 255, 0.02);
  user-select: none;
}

/* 标题栏 */
.lb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.lb-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #00ccff;
  text-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
  letter-spacing: 3px;
}

/* 刷新倒计时提示 */
.lb-refresh-hint {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 1px;
}

/* 表头: # | 玩家 | 最高分 | 当前分 | 状态 */
.lb-table-header {
  display: grid;
  grid-template-columns: 36px 1fr 72px 72px 64px;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 单行条目 */
.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr 72px 72px 64px;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  color: #ddd;
  transition: background 0.2s;
  border-radius: 4px;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* 当前用户行高亮 */
.lb-row.is-me {
  background: rgba(0, 255, 255, 0.08);
  border-radius: 4px;
}

.lb-row.is-me:hover {
  background: rgba(0, 255, 255, 0.12);
}

.lb-rank {
  font-weight: bold;
  text-align: center;
}

/* 前三名颜色 */
.lb-row:nth-child(1) .lb-rank { color: #ffd700; font-size: 1.1rem; }  /* 金 */
.lb-row:nth-child(2) .lb-rank { color: #c0c0c0; font-size: 1rem; }    /* 银 */
.lb-row:nth-child(3) .lb-rank { color: #cd7f32; font-size: 0.95rem; }  /* 铜 */

.lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
}

.lb-score {
  text-align: right;
  font-weight: bold;
  color: #ffaa44;
  text-shadow: 0 0 6px rgba(255, 170, 68, 0.3);
}

/* Current game score (real-time, from heartbeat) */
.lb-cur-score {
  text-align: right;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Online / offline indicator dots */
.lb-online-dot {
  color: #44ff44;
  font-size: 0.7rem;
  text-shadow: 0 0 6px rgba(68, 255, 68, 0.6);
  margin-right: 2px;
}

.lb-offline-dot {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.7rem;
  margin-right: 2px;
}

/* Status column: online dot + WIN tag together */
.lb-status-col {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.lb-won-tag {
  font-size: 0.7rem;
}

/* 达成 2048 的标记 */
.lb-won-tag .won {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 221, 0, 0.5);
}

/* 空状态 */
.lb-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  padding: 24px 0;
  font-size: 0.85rem;
  letter-spacing: 2px;
}

/* 用户名列容器 (用于滚动选择) */
.lb-name-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* 用户名输入框 (在排行榜底部) */
.lb-username-area {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: border-color 0.2s;
}

.lb-input:focus {
  border-color: rgba(0, 255, 255, 0.4);
}

.lb-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.lb-save-btn {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.25);
  color: #00ddff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  cursor: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.lb-save-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
}