/* Seasonal rank badge: icon with a radial progress ring. */
.llc-menu-screen .hub-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  font-size: 18px;
  line-height: 1.2;
  padding: 2px 0;
}

.llc-menu-screen .hub-user-label {
  min-width: 0;
}

.llc-menu-screen .hub-user b {
  font-size: 1.2em;
  font-weight: 800;
}

.llc-menu-screen .hub-top {
  overflow: visible;
}

.season-badge {
  --pct: 0;
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.season-badge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#ffe08a calc(var(--pct) * 1%), rgba(255, 255, 255, 0.22) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 2.5px));
}

.hub-user .season-badge,
.season-userline .season-badge {
  width: 54px;
  height: 54px;
}

.hub-user .season-badge img,
.season-userline .season-badge img {
  width: 42px;
  height: 42px;
}

.season-badge img {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.season-badge--sm {
  width: 30px;
  height: 30px;
}

.season-badge--sm img {
  width: 22px;
  height: 22px;
}

.season-userline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 2px 0;
  overflow: visible;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.season-userline[hidden] {
  display: none;
}

.season-countdown {
  margin: 2px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255, 236, 210, .95);
  text-shadow: 0 1px 0 rgba(40, 12, 28, .35);
}

.season-countdown[hidden] {
  display: none;
}

#hub-ranked-sub {
  white-space: normal;
}

.leaderboard-boards {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
}

#leaderboard-season-meta {
  margin-top: 0;
  margin-bottom: 12px;
}

.leaderboard-boards button {
  width: auto;
  flex: 1 1 0;
}

.leaderboard-boards button.is-on {
  box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.85);
}

.rank-name-row .season-badge {
  margin-right: 2px;
}

.season-history {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.season-history li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.social-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

button.season-badge {
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  line-height: 0;
  appearance: none;
}

button.season-badge:hover:not(:disabled),
button.season-badge:focus-visible {
  transform: none !important;
  filter: none !important;
  outline: none;
}

button.season-badge:hover img,
button.season-badge:focus-visible img {
  transform: scale(1.06);
}

body.season-ladder-open {
  overflow: hidden;
}

.season-ladder-overlay {
  position: fixed;
  inset: 0;
  z-index: 8800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
  background: rgba(4, 10, 24, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.season-ladder-overlay.open {
  display: flex;
}

.season-ladder-shell {
  width: min(440px, 100%);
  max-height: min(86dvh, 720px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: url("../../bg/ptn.png") top center / 200px 200px repeat, rgba(38, 132, 210, 0.92);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.45), 0 0 32px rgba(52, 163, 243, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: 'Zen Kaku Gothic New', 'Nunito', sans-serif;
}

.season-ladder-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
}

.season-ladder-shell .account-screen-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}

.season-ladder-shell .account-screen-head .btn-ghost {
  width: auto;
  flex: 0 0 auto;
}

.season-ladder-title {
  flex: 1 1 auto;
  margin: 0;
  text-align: center;
  font-family: Kalnia, serif;
  font-weight: 500;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.15;
  background: linear-gradient(45deg, #ffcbe1 0%, #fff 18%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.season-ladder-lead {
  margin: 0 0 12px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.season-ladder-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 179, 209, 0.75) rgba(255, 255, 255, 0.12);
}

.season-ladder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.season-ladder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(52, 163, 243, 0.28);
}

.season-ladder-row img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.season-ladder-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.season-ladder-you,
.season-ladder-pts {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffe08a;
}

.season-ladder-row.is-current {
  border-color: rgba(255, 224, 138, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 224, 138, 0.45);
  background: rgba(255, 224, 138, 0.16);
}

.season-ladder-row.is-green {
  background: rgba(72, 168, 120, 0.28);
}

.season-ladder-row.is-pink {
  background: rgba(214, 92, 154, 0.28);
}

.season-ladder-row.is-current.is-green,
.season-ladder-row.is-current.is-pink {
  background: rgba(255, 224, 138, 0.16);
}

@media (max-width: 640px) {
  .season-ladder-shell {
    padding: 12px 10px 10px;
    border-radius: 14px;
  }

  .season-ladder-row {
    min-height: 48px;
    padding: 6px 10px;
    gap: 10px;
  }

  .season-ladder-row img {
    width: 34px;
    height: 34px;
  }

  .season-ladder-name {
    font-size: 14px;
  }
}

/* Match-end season radial */
#overlay-win .win-season {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  min-height: 0;
}

#overlay-win .win-season[hidden] {
  display: none;
}

/* Spectator end screen: winner and loser rank changes side by side. */
#overlay-win .win-season.win-season--duo {
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(20px, 6vw, 48px);
}

.win-season--duo .win-season-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 44%;
}

#overlay-win .win-season--duo .win-season {
  margin: 0;
}

.win-season--duo .win-season-col > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#overlay-win .win-season--duo .win-season-msg {
  font-size: clamp(14px, 3.4vw, 20px);
  line-height: 1.2;
}

#overlay-win .win-season--duo .win-season-pts {
  font-size: 13px;
}

.win-season-name {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
}

.season-badge--win {
  width: 96px;
  height: 96px;
}

.season-badge--win img {
  width: 72px;
  height: 72px;
}

.season-badge--win .season-badge-ring {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 3.5px));
}

.season-badge--win.is-rank-up img {
  animation: season-rank-pop 0.55s ease;
}

.season-badge--win.is-rank-down img {
  animation: season-rank-drop 0.55s ease;
}

.win-season-msg {
  margin: 0;
  font-family: 'Fredoka One', cursive;
  font-size: clamp(18px, 4.2vw, 26px);
  letter-spacing: 0.02em;
  color: #ffe08a;
  text-align: center;
  text-shadow: 0 2px 0 rgba(40, 12, 28, 0.35);
}

.win-season-pts {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 236, 210, 0.9);
  text-align: center;
}

@keyframes season-rank-pop {
  0% { transform: scale(0.82); opacity: 0.55; }
  55% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes season-rank-drop {
  0% { transform: scale(1.08); opacity: 0.7; }
  45% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.season-ladder-stats { margin-top: 10px; align-self: stretch; padding: 10px; }
.season-stats-overlay { z-index: 8810; }
.season-stats-shell { width: min(560px, 100%); }
.season-stats-bar { margin: 6px 0; }
.season-stats-select { width: 100%; padding: 6px; border-radius: 8px; }
.social-bar.season-stats-row { grid-template-columns: 44px minmax(90px, 1.3fr) minmax(48px, 1fr) auto; }
.season-stats-art { width: 44px; height: 60px; overflow: hidden; }
.season-stats-face { width: 44px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(0, 0, 0, 0.25); display: block; }
.season-stats-face.is-live { width: 44px; height: 32px; }
.season-stats-heading { margin: 14px 0 6px; font-size: 0.95rem; letter-spacing: 0.03em; }
.season-stats-heading:first-child { margin-top: 4px; }
.season-stats-name { overflow: hidden; }
.season-stats-name > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-stats-name small { display: block; opacity: 0.75; font-size: 0.75rem; }
/* Card inspect must sit above the stats popup. */
body.season-stats-open #modal-card, body.season-stats-open #modal-card.open { z-index: 8950; }
.season-stats-feedback { margin-top: 16px; }
.season-stats-textarea { width: 100%; box-sizing: border-box; border-radius: 8px; padding: 8px; font: inherit; resize: vertical; }
.season-stats-msg { min-height: 1.2em; font-size: 0.85rem; }
.season-stats-inbox-item { padding: 8px; margin-bottom: 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.season-stats-inbox-item.is-new { outline: 1px solid #ffd54a; }
.season-stats-inbox-meta { font-size: 0.75rem; opacity: 0.75; }
.season-stats-inbox-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
