/* 허브 전용 스타일 */
html, body { overflow-y: auto; }

#hub {
  max-width: 520px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: center;
  color: #eef2ff;
}

header { text-align: center; }

header h1 {
  font-size: clamp(34px, 10vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #22d3a7, #4aa8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline { font-size: 15px; color: #aab4d4; margin-top: 6px; }

/* ── 게임 카드 그리드 ── */
#games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #1a2238;
  border: 2px solid #2e3a5e;
  border-radius: 20px;
  padding: 22px 12px 18px;
  text-decoration: none;
  color: #eef2ff;
  transition: transform 0.08s ease, border-color 0.08s ease;
}

.game-card:active { transform: scale(0.96); border-color: #22d3a7; }

.game-card .icon { font-size: 44px; line-height: 1; }
.game-card .name { font-size: 17px; font-weight: 800; margin-top: 4px; }
.game-card .desc { font-size: 12px; color: #8b96b8; }
.game-card .record { font-size: 12px; color: #ffd54a; font-weight: 700; margin-top: 4px; min-height: 15px; }

/* ── 랭킹 ── */
#ranking {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #141b30;
  border-radius: 20px;
  padding: 18px 20px;
  width: 100%;
}

.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-head h2 { font-size: 18px; font-weight: 800; }

#rank-board {
  background: #232c47;
  color: #eef2ff;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
}

#rank-periods { display: flex; gap: 6px; }

#rank-periods button {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
  border-radius: 10px;
  background: #1a2238;
  color: #8b96b8;
}

#rank-periods button.on { background: #22d3a7; color: #06281f; }

#rank-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 60px;
  max-height: 320px;
  overflow-y: auto;
}

#rank-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  background: #1a2238;
}

#rank-list li .r-rank { color: #8b96b8; min-width: 34px; }
#rank-list li .r-nick { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rank-list li .r-val { font-weight: 800; color: #ffd54a; }
#rank-list li.top3 { background: #232c47; }
#rank-list .rank-loading, #rank-list .rank-empty { color: #5b6788; justify-content: center; }

#rank-me {
  font-size: 14px;
  font-weight: 700;
  color: #22d3a7;
  text-align: center;
  min-height: 18px;
}

#btn-nick {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── 프로필 (누적 + 스킨) ── */
#profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: #141b30;
  border-radius: 20px;
  padding: 18px 24px;
  width: 100%;
}

.total-label { font-size: 16px; font-weight: 700; }
.total-label span { color: #ffd54a; }

#skins-row { display: flex; gap: 12px; }

.skin-swatch {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid transparent;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.skin-swatch.sel { border-color: #eef2ff; }
.skin-swatch.locked { filter: grayscale(0.75); opacity: 0.55; }

.skin-hint { font-size: 12px; color: #5b6788; }
