/* Shared player growth controls and dedicated ranking page. */
body:not(.admin-page) .main-nav { min-width: 0; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
body:not(.admin-page) .main-nav::-webkit-scrollbar { display: none; }
body:not(.admin-page) .main-nav .nav-item { flex: 0 0 auto; min-width: 68px; padding: 0 10px; white-space: nowrap; }
#nav-checkin { border: 0; cursor: pointer; font-family: inherit; }
#nav-checkin:disabled { opacity: .65; cursor: default; }
.ranking-page > .shell { display: none; }
.ranking-shell {
  --rank-text: #f5effb; --rank-muted: #c2b6cf; --rank-line: rgba(220, 202, 241, .17);
  --rank-panel: rgba(48, 40, 63, .88); --rank-soft: rgba(168, 144, 218, .12);
  width: min(1160px, 100%); margin: 0 auto; padding: 20px clamp(14px, 3vw, 36px) 48px;
  color: var(--rank-text);
}
html[data-theme="light"] .ranking-shell {
  --rank-text: #352842; --rank-muted: #766783; --rank-line: rgba(93, 69, 126, .17);
  --rank-panel: rgba(255, 252, 255, .88); --rank-soft: rgba(137, 109, 190, .08);
}
.ranking-shell button { font-family: inherit; }
.ranking-shell button:focus-visible, #nav-checkin:focus-visible { outline: 3px solid #8b7bde; outline-offset: 3px; }
.ranking-shell button:disabled { opacity: .55; cursor: default; }
.ranking-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 29px 32px; border: 1px solid var(--rank-line); border-radius: 20px; background: linear-gradient(120deg, var(--rank-panel), var(--rank-soft)); box-shadow: 0 14px 40px rgba(61, 36, 84, .12); }
.ranking-hero .section-kicker { color: #b8a2f2; }
html[data-theme="light"] .ranking-hero .section-kicker { color: #7360ac; }
.ranking-hero h1 { margin: 6px 0 12px; color: var(--rank-text); font-size: clamp(26px, 4vw, 36px); }
.ranking-hero p:last-child { margin: 0; color: var(--rank-muted); font-size: 13px; line-height: 1.7; }
.ranking-hero-mark { color: #a996d9; font-size: 24px; font-weight: 800; line-height: 1.4; text-align: center; white-space: nowrap; }
.ranking-notice { min-height: 25px; padding: 8px 3px 0; color: #69c8a9; font-size: 12px; }
.ranking-notice.is-error { color: #e886a4; }
html[data-theme="light"] .ranking-notice { color: #256c56; }
html[data-theme="light"] .ranking-notice.is-error { color: #ac3760; }
.ranking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; align-items: start; gap: 20px; }
.ranking-main, .ranking-sidebar { min-width: 0; }
.ranking-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 5px 0 16px; color: var(--rank-muted); font-size: 12px; }
.ranking-quiet { padding: 8px 11px; border: 1px solid var(--rank-line); border-radius: 8px; color: var(--rank-text); background: var(--rank-panel); font-size: 11px; }
.ranking-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 12px; margin-bottom: 19px; }
.ranking-podium:empty { display: none; }
.ranking-winner { position: relative; min-width: 0; padding: 24px 9px 18px; border: 1px solid var(--rank-line); border-radius: 16px; background: var(--rank-panel); text-align: center; overflow: hidden; }
.ranking-winner-1 { border-top: 3px solid #dfb75b; }
.ranking-winner-2 { border-top: 3px solid #a3b4cb; }
.ranking-winner-3 { border-top: 3px solid #cb9983; }
.ranking-medal { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #805d19; background: #ffebba; font-size: 12px; font-weight: 800; }
.ranking-winner-2 .ranking-medal { color: #566b81; background: #dbe6f1; }
.ranking-winner-3 .ranking-medal { color: #94644d; background: #f5dfcf; }
.ranking-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--rank-line); border-radius: 50%; color: #fff; background: linear-gradient(140deg, #9b89d9, #d79bbd); font-size: 12px; font-weight: 700; }
.ranking-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ranking-winner .ranking-avatar { width: 59px; height: 59px; margin: 6px auto 12px; font-size: 16px; }
.ranking-winner h2 { margin: 0 0 8px; overflow: hidden; color: var(--rank-text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-level { color: var(--rank-muted); font-size: 10px; }
.ranking-winner > p { margin: 14px 0 0; color: var(--rank-muted); font-size: 10px; }
.ranking-winner > p strong { color: var(--rank-text); font-size: 23px; }
.ranking-list, .ranking-checkin-card, .ranking-rules { padding: 22px; border: 1px solid var(--rank-line); border-radius: 16px; background: var(--rank-panel); }
.ranking-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ranking-list h2, .ranking-sidebar h2 { margin: 0; font-size: 18px; }
.ranking-tabs { display: flex; flex-shrink: 0; gap: 3px; padding: 3px; border-radius: 8px; background: var(--rank-soft); }
.ranking-tabs button { min-height: 32px; padding: 0 9px; border: 0; border-radius: 6px; color: var(--rank-muted); background: transparent; font-size: 11px; }
.ranking-tabs button[aria-pressed="true"] { color: #fff; background: #8b7bd4; }
.ranking-tie { margin: 12px 0; color: var(--rank-muted); font-size: 10px; line-height: 1.6; }
.ranking-columns, .ranking-row { display: grid; grid-template-columns: 35px minmax(0, 1fr) 110px 66px; align-items: center; gap: 10px; }
.ranking-columns { padding: 12px 0; border-bottom: 1px solid var(--rank-line); color: var(--rank-muted); font-size: 10px; }
.ranking-columns > :last-child { text-align: right; }
.ranking-rows { margin: 0; padding: 0; list-style: none; }
.ranking-row { min-height: 72px; padding: 10px 0; border-bottom: 1px solid var(--rank-line); }
.ranking-row.is-me { background: var(--rank-soft); }
.ranking-position { color: var(--rank-muted); text-align: center; font-size: 13px; font-weight: 700; }
.ranking-player { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12px; }
.ranking-player > span { min-width: 0; overflow-wrap: anywhere; }
.ranking-xp { color: var(--rank-text); font-size: 17px; text-align: right; }
.ranking-xp small { display: block; margin-top: 3px; color: var(--rank-muted); font-size: 9px; font-weight: 400; }
.ranking-mobile-level { display: none; }
.ranking-me-tag { margin-left: 4px; color: #9a86d4; font-size: 10px; }
.ranking-empty { padding: 30px 0; color: var(--rank-muted); font-size: 13px; text-align: center; }
.ranking-pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 18px; color: var(--rank-muted); font-size: 12px; }
.ranking-sidebar { display: grid; gap: 16px; }
.ranking-checkin-card > .section-kicker { color: #a996d9; }
#ranking-my-growth > p { margin: 17px 0 12px; color: var(--rank-muted); font-size: 12px; line-height: 1.8; }
.ranking-my-level { margin-top: 18px; color: #a58fe4; font-size: 28px; font-weight: 800; }
.ranking-my-level > span { color: var(--rank-text); font-size: 12px; font-weight: 500; }
.ranking-progress { height: 7px; overflow: hidden; margin: 10px 0 6px; border-radius: 20px; background: rgba(148, 127, 190, .18); }
.ranking-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(100deg, #8e80d9, #d39bbe); }
#ranking-my-growth > small { color: var(--rank-muted); font-size: 10px; }
.ranking-my-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 18px 0; text-align: center; }
.ranking-my-points { margin-top: 16px; padding: 12px; border-radius: 10px; color: var(--rank-text); background: var(--rank-soft); font-size: 12px; }
.ranking-my-points strong { margin-right: 6px; color: #b091e2; font-size: 26px; }
html[data-theme="light"] .ranking-my-points strong { color: #7956b2; }
.ranking-my-points small { display: block; margin-top: 4px; color: var(--rank-muted); font-size: 10px; }
.ranking-my-stats span { color: var(--rank-muted); font-size: 10px; }
.ranking-my-stats b { display: block; margin-bottom: 5px; color: var(--rank-text); font-size: 19px; }
.ranking-primary { width: 100%; min-height: 43px; margin-top: 12px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(110deg, #8474d2, #a88bdb); font-weight: 700; }
#ranking-checkin-status { min-height: 28px; margin: 8px 0 0; color: var(--rank-muted); font-size: 10px; line-height: 1.6; }
.ranking-calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.ranking-calendar-heading h3 { margin: 0; font-size: 12px; }
.ranking-calendar-heading > span { color: var(--rank-muted); font-size: 9px; }
.ranking-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.ranking-day { padding: 7px 1px; border: 1px solid transparent; border-radius: 6px; color: var(--rank-muted); background: var(--rank-soft); text-align: center; }
.ranking-day > span { font-size: 8px; }
.ranking-day b { display: block; margin-top: 6px; font-size: 14px; }
.ranking-day.is-today { border-color: #a18dd5; }
.ranking-day.is-signed { color: #79d2b6; background: rgba(64, 172, 136, .12); }
html[data-theme="light"] .ranking-day.is-signed { color: #247458; }
.ranking-rules ul { margin: 15px 0; padding-left: 17px; color: var(--rank-muted); font-size: 11px; line-height: 2; }
.ranking-rules details { padding-top: 12px; border-top: 1px solid var(--rank-line); color: var(--rank-muted); font-size: 11px; }
.ranking-rules summary { cursor: pointer; }
#ranking-levels { margin: 12px 0 0; padding: 0; list-style: none; font-size: 10px; line-height: 2.4; }
#ranking-levels li { display: flex; justify-content: space-between; gap: 5px; }
.profile-growth { width: 100%; margin: 10px 0; padding: 10px; border-radius: 9px; background: rgba(145, 124, 198, .1); font-size: 11px; }
.profile-growth:empty { display: none; }
.profile-growth p { margin: 7px 0; font-size: 10px; }
.profile-growth a { display: block; margin-top: 10px; color: #ae98ee; }
html[data-theme="light"] .profile-growth a { color: #7358ad; }
@media (max-width: 900px) {
  .ranking-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 13px; }
  .ranking-list, .ranking-checkin-card, .ranking-rules { padding: 16px; }
  .ranking-columns, .ranking-row { grid-template-columns: 27px minmax(0, 1fr) 58px; gap: 7px; }
  .ranking-desktop-level, .ranking-columns > :nth-child(3) { display: none; }
  .ranking-mobile-level { display: block; margin-top: 4px; color: var(--rank-muted); font-size: 9px; }
}
@media (max-width: 680px) {
  body:not(.admin-page) .topbar { position: sticky; top: 0; z-index: 30; padding: 10px 13px 6px; }
  body:not(.admin-page) .topbar-inner {
    width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 7px 8px;
  }
  .topbar-inner .brand { min-width: 0; gap: 6px; padding-left: 0; }
  .topbar-inner .brand-mark { flex: 0 0 34px; }
  .topbar-inner .brand-text { min-width: 0; font-size: 11px; line-height: 1.3; }
  body:not(.admin-page) .topbar-meta { gap: 5px; }
  body:not(.admin-page) .main-nav {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; overflow: visible; border-radius: 11px;
  }
  body:not(.admin-page) .main-nav::before { display: none; }
  body:not(.admin-page) .main-nav .nav-item {
    min-width: 0; height: auto; min-height: 42px; padding: 0 2px; border-radius: 8px; font-size: 12px; line-height: 1.2;
  }
  body:not(.admin-page) .main-nav .nav-item.is-active { color: #fff; background: #6f60bc; }
  body:not(.admin-page) .main-nav .nav-item:focus-visible { outline: 2px solid #a38fe4; outline-offset: 1px; }
  body:not(.admin-page) > .shell { padding-top: 14px; }
  .ranking-shell { padding-top: 10px; }
  .ranking-hero { padding: 24px 21px; }
  .ranking-layout { display: flex; flex-direction: column; }
  .ranking-main, .ranking-sidebar { width: 100%; }
  .ranking-sidebar { display: contents; }
  .ranking-checkin-card { width: 100%; box-sizing: border-box; order: -1; }
  .ranking-main { order: 0; }
  .ranking-rules { width: 100%; box-sizing: border-box; order: 1; }
  .ranking-winner { padding: 23px 7px 15px; }
  .ranking-winner h2 { font-size: 12px; }
  .ranking-winner > .ranking-level { font-size: 9px; }
  .ranking-podium { gap: 7px; }
  .ranking-winner .ranking-avatar { width: 48px; height: 48px; }
  .ranking-list-heading { gap: 6px; }
  .ranking-list h2 { font-size: 16px; }
}
@media (max-width: 480px) {
  body:not(.admin-page) .main-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
