.bg-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.bloom--a {
  top: -20vh;
  left: -10vw;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, var(--brand-glow), transparent 68%);
  opacity: 0.55;
  animation: drift-a 26s var(--ease-in-out) infinite;
}

.bloom--b {
  top: 12vh;
  right: -16vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 66%);
  opacity: 0.5;
  animation: drift-b 34s var(--ease-in-out) infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(5vw, 5vh) scale(1.1); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-5vw, 4vh) scale(1.12); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 76%);
}


.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity var(--t-slow) var(--ease-out), visibility var(--t-slow);
}

.loader.is-done { opacity: 0; visibility: hidden; }

.loader__panel {
  width: min(340px, 100%);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  animation: loader-in var(--t-slow) var(--ease-spring) both;
}

@keyframes loader-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
}

.loader__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto var(--sp-4);
}

.loader__mark img {
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  animation: breathe 2.6s var(--ease-in-out) infinite;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-3px) scale(1.05); }
}

.loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--brand);
  border-right-color: var(--border-strong);
  animation: spin 1.15s linear infinite;
}

.loader__ring::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-bottom-color: var(--brand-ring);
  animation: spin 1.8s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader__eyebrow { margin-bottom: var(--sp-1); }

.loader__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

.loader__status {
  min-height: 18px;
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-2);
  transition: opacity var(--t-base) var(--ease-out);
}

.loader__status.is-swapping { opacity: 0; }

.loader__track {
  height: 5px;
  margin-top: var(--sp-4);
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: var(--r-pill);
}

.loader__fill {
  position: relative;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffa04d, var(--brand));
  border-radius: var(--r-pill);
  transition: width var(--t-slow) var(--ease-out);
}

.loader__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: sheen 1.3s var(--ease-in-out) infinite;
}

@keyframes sheen {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.loader__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}

.loader__dot {
  width: 3px;
  height: 3px;
  background: var(--brand);
  border-radius: 50%;
}


.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t-base) var(--ease-out);
}

.site-header.is-stuck { box-shadow: var(--shadow-sm); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  max-width: var(--shell-max);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  transition: transform var(--t-base) var(--ease-spring);
}

.brand:hover { transform: translateY(-1px); }

/* The animated MMC server logo. */
.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand__text em {
  font-style: normal;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--brand);
}

.site-foot__mark { border-radius: var(--r-xs); }

.site-nav {
  display: flex;
  gap: 2px;
  margin-right: auto;
}

.site-nav__link {
  position: relative;
  padding: 7px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: color var(--t-base) var(--ease-out), background var(--t-base);
}

.site-nav__link:hover { color: var(--text); background: var(--surface-3); }
.site-nav__link.is-active { color: var(--brand); }

.site-nav__link.is-active::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 14px;
  height: 2px;
  background: var(--brand);
  border-radius: var(--r-pill);
  transform: translateX(-50%);
  animation: nav-underline var(--t-slow) var(--ease-spring) both;
}

@keyframes nav-underline { from { width: 0; opacity: 0; } }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.site-header .site-header__burger { display: none; }

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: var(--r-pill);
}

.live-chip__pulse {
  position: relative;
  width: 6px;
  height: 6px;
  background: var(--ok);
  border-radius: 50%;
}

.live-chip__pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1.5px solid var(--ok);
  border-radius: 50%;
  animation: ping 2s var(--ease-out) infinite;
}

@keyframes ping {
  0%   { transform: scale(0.6); opacity: 0.8; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { opacity: 0; }
}

.site-header__progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ffa04d, var(--brand));
  opacity: 0;
  transition: width var(--t-slow) var(--ease-out), opacity var(--t-base);
}

.site-header__progress.is-active { opacity: 1; }


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  border-radius: var(--r-pill);
  transition:
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-base) var(--ease-out),
    background var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out);
}

.btn:active { transform: translateY(1px) scale(0.985); }
.btn--sm { padding: 7px var(--sp-3); font-size: var(--fs-micro); }
.btn--block { width: 100%; }

.btn--primary {
  color: var(--brand-ink);
  background: var(--brand);
  box-shadow: var(--shadow-brand);
}

.btn--primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 115, 0, 0.32), 0 14px 30px rgba(255, 115, 0, 0.3);
}

.btn--ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  color: var(--brand);
  border-color: var(--brand-ring);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--danger { color: var(--danger); background: var(--danger-soft); }
.btn--danger:hover { filter: brightness(0.96); }

.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn__icon { display: grid; place-items: center; width: 14px; height: 14px; }
.btn__icon svg { width: 100%; height: 100%; }

.icon-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  transition:
    color var(--t-base) var(--ease-out),
    border-color var(--t-base),
    transform var(--t-fast) var(--ease-spring),
    box-shadow var(--t-base);
}

.icon-btn:hover {
  color: var(--brand);
  border-color: var(--brand-ring);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.is-spinning svg { animation: spin 0.7s var(--ease-in-out); }


.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--sp-7) var(--sp-5) var(--sp-9);
}

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { animation: reveal-up var(--t-slower) var(--ease-out) forwards; }

@keyframes reveal-up { to { opacity: 1; transform: none; } }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.section-head__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

.section-head__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--r-sm);
}

.section-head__icon svg { width: 17px; height: 17px; }

/* Icon slots inside table headers and the tools row */
.lb__th-icon {
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  margin-right: 5px;
  vertical-align: -1px;
  color: var(--brand);
}

.lb__th-icon svg { width: 100%; height: 100%; }

.tools__label {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--r-pill);
}

.tools__label svg { width: 14px; height: 14px; }

.tierkey__help {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-right: 5px;
  vertical-align: -2px;
  color: var(--brand);
}

.tierkey__help svg { width: 100%; height: 100%; }


.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: var(--sp-3);
}

.hero__eyebrow-dot {
  width: 5px;
  height: 5px;
  background: var(--brand);
  border-radius: 50%;
  animation: ping 2.4s var(--ease-out) infinite;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5.4vw, var(--fs-4xl));
  font-weight: var(--fw-black);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero__title-accent {
  background: linear-gradient(100deg, var(--brand) 10%, #ffb066 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  max-width: 46ch;
  margin-top: var(--sp-3);
  font-size: var(--fs-md);
  color: var(--text-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: var(--sp-2);
}

.stat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-3) var(--sp-4);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-spring), box-shadow var(--t-base), border-color var(--t-base);
}

.stat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-md);
}

.stat-tile__icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-3);
  transition: color var(--t-base) var(--ease-out);
}

.stat-tile:hover .stat-tile__icon { color: var(--brand); }
.stat-tile__icon svg { width: 100%; height: 100%; }

.stat-tile__value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.stat-tile__label { font-size: var(--fs-micro); }


.promos { margin-bottom: var(--sp-7); }
.promos__nav { display: flex; gap: 6px; }
#promoPrev svg { transform: rotate(90deg); }
#promoNext svg { transform: rotate(-90deg); }

.promos__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(272px, 1fr);
  gap: var(--sp-3);
  padding: 4px;
  margin: -4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.promos__rail::-webkit-scrollbar { display: none; }

.promo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 146px;
  padding: var(--sp-4);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-spring), box-shadow var(--t-base), border-color var(--t-base);
}

.promo-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-lg);
}

.promo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--promo-accent, var(--brand)), transparent);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform var(--t-slow) var(--ease-out);
}

.promo-card:hover::before { transform: scaleX(1); }

.promo-card__glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle, var(--promo-accent, var(--brand)), transparent 68%);
  opacity: 0.09;
  border-radius: 50%;
  transition: opacity var(--t-slow) var(--ease-out);
}

.promo-card:hover .promo-card__glow { opacity: 0.18; }

.promo-card__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--sp-2);
}

.promo-card__kind {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--promo-accent, var(--brand));
  background: color-mix(in srgb, var(--promo-accent, var(--brand)) 12%, transparent);
  border-radius: var(--r-pill);
}

.promo-card__pin {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--gold);
}

.promo-card__pin svg { width: 100%; height: 100%; }

.promo-card__image {
  width: 100%;
  height: 82px;
  margin-bottom: var(--sp-3);
  object-fit: cover;
  border-radius: var(--r-sm);
}

.promo-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

.promo-card__body {
  margin-top: 5px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--brand);
}

.promo-card__cta svg {
  width: 12px;
  height: 12px;
  transition: transform var(--t-base) var(--ease-spring);
}

.promo-card:hover .promo-card__cta svg { transform: translateX(3px); }

.promo-card--skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s var(--ease-in-out) infinite;
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}


.filters { margin-bottom: var(--sp-3); }

.filters__track {
  display: flex;
  gap: 5px;
  padding: 5px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  scrollbar-width: none;
}

.filters__track::-webkit-scrollbar { display: none; }

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  color: var(--text-3);
  border-radius: var(--r-pill);
  transition:
    color var(--t-base) var(--ease-out),
    background var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    transform var(--t-fast) var(--ease-spring);
}

.pill:hover:not(.is-active) { color: var(--text); background: var(--surface); }
.pill:active { transform: scale(0.97); }

/* Active gamemode — the one crisp accent against the muted rest. */
.pill.is-active {
  color: var(--brand-ink);
  background: var(--brand);
  box-shadow: var(--shadow-brand);
}

.pill__icon {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-spring);
}

.pill__icon svg { width: 100%; height: 100%; }
.pill:hover .pill__icon { opacity: 0.85; }
.pill.is-active .pill__icon { opacity: 1; transform: scale(1.06); }

.pill__count {
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-3);
  background: var(--surface-3);
  border-radius: var(--r-pill);
  transition: color var(--t-base), background var(--t-base);
}

.pill.is-active .pill__count {
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.22);
}


.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.tools__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  max-width: 270px;
}

.tools__search-icon {
  position: absolute;
  left: 12px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--text-3);
  pointer-events: none;
}

.tools__search-icon svg { width: 100%; height: 100%; }

.tools__search input {
  width: 100%;
  padding: 9px 32px 9px 33px;
  font-size: var(--fs-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}

.tools__search input::placeholder { color: var(--text-3); }

.tools__search input:focus {
  outline: none;
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-md), var(--shadow-focus);
}

.tools__search input::-webkit-search-cancel-button { display: none; }

.tools__clear {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--text-3);
  border-radius: 50%;
  transition: color var(--t-base), background var(--t-base);
}

.tools__clear:hover { color: var(--text); background: var(--surface-3); }
.tools__clear svg { width: 11px; height: 11px; }

.tools__group {
  display: flex;
  gap: 3px;
  padding: 3px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  scrollbar-width: none;
}

.tools__group::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 6px 11px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.03em;
  color: var(--text-3);
  border-radius: var(--r-pill);
  transition: color var(--t-base) var(--ease-out), background var(--t-base), box-shadow var(--t-base);
}

.chip:hover:not(.is-active) { color: var(--text); background: var(--surface); }

.chip.is-active {
  color: var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.chip__icon { display: grid; place-items: center; width: 12px; height: 12px; opacity: 0.65; }
.chip__icon svg { width: 100%; height: 100%; }
.chip.is-active .chip__icon { opacity: 1; }

.select-shell {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.select-shell select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 30px 9px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}

.select-shell select:hover { border-color: var(--brand-ring); box-shadow: var(--shadow-md); }

.select-shell__chevron {
  position: absolute;
  right: 11px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  color: var(--text-3);
  pointer-events: none;
}

.select-shell__chevron svg { width: 100%; height: 100%; }


.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.podium-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  animation: podium-in var(--t-slower) var(--ease-spring) both;
  transition: transform var(--t-base) var(--ease-spring), box-shadow var(--t-base), border-color var(--t-base);
}

.podium-card:nth-child(1) { animation-delay: 40ms; }
.podium-card:nth-child(2) { animation-delay: 90ms; }
.podium-card:nth-child(3) { animation-delay: 140ms; }

@keyframes podium-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

.podium-card:hover {
  transform: translateY(-3px);
  border-color: var(--metal, var(--brand));
  box-shadow: var(--shadow-lg);
}

.podium-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, var(--metal, var(--brand)), transparent 44%);
  opacity: 0.09;
  pointer-events: none;
}

.podium-card__place {
  position: absolute;
  top: 6px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--metal, var(--brand));
  opacity: 0.2;
}

.podium-card__avatar {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 2px var(--metal-soft, transparent);
}

.podium-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}

.podium-card__avatar img.is-loaded { opacity: 1; }

.podium-card__meta { min-width: 0; }

.podium-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-card__sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: var(--fs-micro);
  color: var(--text-3);
}

.podium-card__pts {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--brand);
}

.podium-card__pts span {
  font-size: var(--fs-micro);
  font-weight: var(--fw-medium);
  color: var(--text-3);
}


.table-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.table-card__bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--surface-inset);
  opacity: 0;
  transition: opacity var(--t-base);
  z-index: 3;
}

.table-card__bar.is-active { opacity: 1; }

.table-card__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: indeterminate 1.05s var(--ease-in-out) infinite;
}

@keyframes indeterminate {
  from { transform: translateX(-100%); }
  to   { transform: translateX(320%); }
}

.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }

.lb { width: 100%; min-width: 660px; font-size: var(--fs-xs); }

.lb__th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  color: var(--text-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.lb__th--player { padding-left: var(--sp-4); }
.lb__th--modes, .lb__th--pts { text-align: right; }
.lb__th--pts { padding-right: var(--sp-4); color: var(--brand); }

.lb__row {
  position: relative;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  animation: row-in var(--t-slow) var(--ease-out) both;
  transition: background var(--t-base) var(--ease-out);
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
}

.lb__row:hover { background: var(--brand-softer); }
.lb__row:last-child { border-bottom: none; }

.lb__row td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--brand);
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  transform: scaleY(0);
  transition: transform var(--t-base) var(--ease-out);
}

.lb__row:hover td:first-child::before { transform: scaleY(1); }

.lb__td {
  padding: 6px var(--sp-3);
  height: var(--row-h);
  vertical-align: middle;
  color: var(--text-2);
}

.lb__td--player { padding-left: var(--sp-4); }
.lb__td--num { text-align: right; }

/* Avatar-first identity cluster: face, rank, name. */
.player-cell {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.player-cell__avatar {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: var(--r-xs);
  transition: transform var(--t-base) var(--ease-spring), box-shadow var(--t-base);
}

.lb__row:hover .player-cell__avatar {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.player-cell__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}

.player-cell__avatar img.is-loaded { opacity: 1; }

.player-cell__rank {
  flex-shrink: 0;
  width: 26px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-align: right;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.player-cell__rank.is-medal { font-weight: var(--fw-bold); color: var(--medal); }

.player-cell__name {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t-base) var(--ease-out);
}

.lb__row:hover .player-cell__name { color: var(--brand); }

.region-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--r-pill);
}

.region-cell__icon { display: grid; place-items: center; width: 11px; height: 11px; color: var(--brand); }
.region-cell__icon svg { width: 100%; height: 100%; }

/* Role tags — the admin/staff badge shown beside a name. */
.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  border-radius: var(--r-pill);
}

.role-tag__icon { display: grid; place-items: center; width: 10px; height: 10px; }
.role-tag__icon svg { width: 100%; height: 100%; }

.role-tag--owner   { color: #a16207; background: var(--gold-soft); }
.role-tag--leader  { color: #7c3aed; background: rgba(124, 58, 237, 0.12); }
.role-tag--admin   { color: var(--danger); background: var(--danger-soft); }
.role-tag--mod     { color: var(--info); background: var(--info-soft); }
.role-tag--tester  { color: var(--brand); background: var(--brand-soft); }
.role-tag--pro     { color: var(--ok); background: var(--ok-soft); }
.role-tag--famous  { color: #be185d; background: rgba(190, 24, 93, 0.12); }
.role-tag--og      { color: #0e7490; background: rgba(14, 116, 144, 0.12); }
.role-tag--member  { color: var(--text-3); background: var(--surface-2); }

/* Tier badges — HT S, MT B, LT C … */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  border-radius: var(--r-xs);
  border: 1px solid transparent;
}

.tier-badge--S { color: var(--tier-s); background: var(--tier-s-soft); border-color: color-mix(in srgb, var(--tier-s) 26%, transparent); }
.tier-badge--A { color: var(--tier-a); background: var(--tier-a-soft); border-color: color-mix(in srgb, var(--tier-a) 26%, transparent); }
.tier-badge--B { color: var(--tier-b); background: var(--tier-b-soft); border-color: color-mix(in srgb, var(--tier-b) 26%, transparent); }
.tier-badge--C { color: var(--tier-c); background: var(--tier-c-soft); border-color: color-mix(in srgb, var(--tier-c) 26%, transparent); }
.tier-badge--D { color: var(--tier-d); background: var(--tier-d-soft); border-color: color-mix(in srgb, var(--tier-d) 26%, transparent); }

.tier-badge--none { color: var(--text-3); background: var(--surface-2); }

/* The numeric shorthand (HT4, LT3) sits quietly beside the letter tier. */
.tier-badge__code {
  margin-left: 5px;
  padding-left: 5px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-medium);
  opacity: 0.62;
  border-left: 1px solid currentColor;
}

.tier-badge__code:empty { display: none; }

/* Modes-played mini bar */
.modes-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.modes-cell__dots { display: flex; gap: 2px; }

.modes-cell__dot {
  width: 4px;
  height: 12px;
  background: var(--surface-inset);
  border-radius: 1px;
  transition: background var(--t-base) var(--ease-out);
}

.modes-cell__dot.is-on { background: var(--brand); }

.modes-cell__value {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  min-width: 12px;
  text-align: right;
}

.pts-cell { padding-right: var(--sp-4); text-align: right; white-space: nowrap; }

.pts-cell__value {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: color var(--t-base) var(--ease-out);
}

.lb__row:hover .pts-cell__value { color: var(--brand); }

.pts-cell__unit {
  margin-left: 3px;
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  color: var(--text-3);
}

/* Skeletons */
.lb__row--skeleton td { padding: 10px var(--sp-3); }

.skeleton-bar {
  height: 9px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  border-radius: var(--r-pill);
  animation: shimmer 1.5s var(--ease-in-out) infinite;
}

.skeleton-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  animation: shimmer 1.5s var(--ease-in-out) infinite;
}

/* Empty + footer */
.table-card__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  animation: reveal-up var(--t-slow) var(--ease-out) both;
}

.table-card__empty-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 2px;
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: 50%;
}

.table-card__empty-icon svg { width: 17px; height: 17px; }

.table-card__empty-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.table-card__empty-copy { margin-bottom: var(--sp-2); font-size: var(--fs-xs); color: var(--text-2); }

.table-card__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.table-card__foot-sep { width: 3px; height: 3px; background: var(--text-3); border-radius: 50%; }
.table-card__more { margin-left: auto; }

.board__sync { display: flex; align-items: center; gap: var(--sp-2); }

.board__sync-label {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}


.tierkey { margin-top: var(--sp-7); }

.tierkey__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}

.tierkey__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-spring), border-color var(--t-base);
}

.tierkey__item:hover { transform: translateY(-2px); border-color: var(--brand-ring); }

.tierkey__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--r-xs);
}

.tierkey__icon svg { width: 14px; height: 14px; }

/* A strip of every ranked gamemode, so the icon set reads as one family. */
.tierkey__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--sp-3) 0;
}

.tierkey__mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: color var(--t-base) var(--ease-out), border-color var(--t-base), transform var(--t-base) var(--ease-spring);
}

.tierkey__mode:hover {
  color: var(--brand);
  border-color: var(--brand-ring);
  transform: translateY(-2px);
}

.tierkey__mode span {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.tierkey__mode svg { width: 100%; height: 100%; }

.tierkey__points {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-3);
}

.tierkey__note {
  max-width: 70ch;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.tierkey__note strong { color: var(--brand); font-weight: var(--fw-semibold); }


.cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-top: var(--sp-7);
  padding: var(--sp-6);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

.cta__glow {
  position: absolute;
  top: -60%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--brand-glow), transparent 66%);
  border-radius: 50%;
  animation: drift-b 24s var(--ease-in-out) infinite;
}

.cta__title {
  max-width: 22ch;
  margin-top: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

.cta__lede { max-width: 44ch; margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-2); }
.cta__actions { display: flex; gap: var(--sp-2); position: relative; }


.site-foot { border-top: 1px solid var(--border); background: var(--surface-2); }

.site-foot__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--sp-5);
}

.site-foot__mark { opacity: 0.7; }
.site-foot__copy { font-size: var(--fs-xs); color: var(--text-2); }

.site-foot__meta {
  margin-left: auto;
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}


.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }

.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in var(--t-base) var(--ease-out) both;
}

@keyframes fade-in { from { opacity: 0; } }

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(390px, 100vw);
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  animation: drawer-in var(--t-slow) var(--ease-out) both;
}

@keyframes drawer-in { from { transform: translateX(100%); } }

.drawer__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: color var(--t-base), transform var(--t-fast) var(--ease-spring);
}

.drawer__close:hover { color: var(--text); transform: rotate(90deg); }
.drawer__close svg { width: 13px; height: 13px; }

.drawer__body { padding: var(--sp-6) var(--sp-5) var(--sp-7); }

.drawer__hero {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.drawer__avatar {
  width: 64px;
  height: 64px;
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.drawer__avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

.drawer__name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  word-break: break-word;
}

.drawer__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.drawer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}

.drawer__stat {
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.drawer__stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.drawer__stat-label {
  margin-top: 1px;
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}

.drawer__modes { display: flex; flex-direction: column; gap: 5px; }

.drawer__mode {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  animation: row-in var(--t-slow) var(--ease-out) both;
}

.drawer__mode-icon { display: grid; place-items: center; width: 15px; height: 15px; color: var(--brand); }
.drawer__mode-icon svg { width: 100%; height: 100%; }
.drawer__mode-name { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text); }
.drawer__mode-rank { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }


.toasts {
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 210px;
  max-width: 320px;
  padding: 10px var(--sp-4);
  font-size: var(--fs-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--t-slow) var(--ease-spring) both;
}

.toast.is-leaving { animation: toast-out var(--t-base) var(--ease-out) forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(0.96); } }

.toast__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.toast__icon svg { width: 11px; height: 11px; }
.toast--ok .toast__icon { color: var(--ok); background: var(--ok-soft); }
.toast--error .toast__icon { color: var(--danger); background: var(--danger-soft); }
.toast--info .toast__icon { color: var(--brand); background: var(--brand-soft); }


@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
  .podium { grid-template-columns: 1fr; }
  .podium-card:nth-child(n + 2) { display: none; }
}

@media (max-width: 760px) {
  .shell { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
  .site-header__inner { gap: var(--sp-2); padding: 0 var(--sp-4); }
  .site-header .site-header__burger { display: grid; }
  .live-chip { display: none; }
  .btn__label { display: none; }
  .site-header__actions .btn--primary { width: 32px; padding: 0; height: 32px; }

  /* Slide-down mobile nav */
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: var(--sp-3);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), visibility var(--t-base);
  }

  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav__link { padding: 10px var(--sp-4); font-size: var(--fs-sm); }
  .site-nav__link.is-active::after { display: none; }

  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .tools__search { max-width: none; flex-basis: 100%; }
  .select-shell { margin-left: 0; flex: 1; }
  .select-shell select { width: 100%; }
  .cta { padding: var(--sp-5); }
  .cta__actions { width: 100%; }
  .cta__actions .btn { flex: 1; }
  .toasts { left: var(--sp-4); right: var(--sp-4); }
  .toast { max-width: none; }
  .drawer__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .brand__mark { width: 30px; height: 30px; }
  .brand__text { font-size: var(--fs-md); }
  .brand__text em { display: none; }
  .site-foot__inner { flex-wrap: wrap; }
  .site-foot__meta { margin-left: 0; width: 100%; }
  .hero__actions .btn { flex: 1; }

  .lb { min-width: 0; display: block; }
  .lb thead { display: none; }
  .lb tbody { display: block; }

  .lb__row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      'player player player pts'
      'region role   tier   pts';
    gap: var(--sp-1) var(--sp-2);
    align-items: center;
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border);
  }
  .lb__row:last-child { border-bottom: 0; }

  /* The base rule pins every cell to --row-h, which doubles up once the row
     wraps onto two lines. Let the content decide the height instead. */
  .lb__td {
    display: flex;
    align-items: center;
    height: auto;
    padding: 0;
    border: 0;
    min-width: 0;
  }
  .lb__td--player { grid-area: player; }
  .lb__row .lb__td:nth-child(2) { grid-area: region; }
  .lb__row .lb__td:nth-child(3) { grid-area: role; }
  .lb__row .lb__td:nth-child(4) { grid-area: tier; }

  /* The modes column is the least useful thing on a small screen. */
  .lb__row .lb__td:nth-child(5) { display: none; }

  .lb__td.pts-cell { grid-area: pts; justify-content: flex-end; align-self: center; }
  .pts-cell__value { font-size: var(--fs-lg); }

  /* The second line is supporting detail, so let it sit smaller and quieter. */
  .lb__row .region-cell,
  .lb__row .role-tag,
  .lb__row .tier-badge { font-size: var(--fs-micro); }

  .player-cell__name { font-size: var(--fs-sm); }

  .podium { grid-template-columns: 1fr; gap: var(--sp-2); }
  .podium-card:nth-child(n + 2) { display: grid; }

  .tierkey__grid { grid-template-columns: repeat(2, 1fr); }
  .promo-card { min-width: 78vw; }
}

@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .btn { min-height: 44px; }
  .btn--sm { min-height: 40px; }
  .pill { min-height: 40px; }
  .site-nav__link { min-height: 44px; display: flex; align-items: center; }
  .site-header__actions .btn--primary { width: 44px; height: 44px; }
  .lb__row { min-height: 56px; }
  .tools__search input,
  .select-shell select { min-height: 44px; }

  /* iOS zooms the page in when a focused input is under 16px. */
  input, select, textarea { font-size: 16px; }
}

/* Respect the notch and the home indicator on modern phones. */
@supports (padding: max(0px)) {
  .site-header__inner { padding-left: max(var(--sp-4), env(safe-area-inset-left)); padding-right: max(var(--sp-4), env(safe-area-inset-right)); }
  .shell { padding-bottom: max(var(--sp-8), calc(env(safe-area-inset-bottom) + var(--sp-6))); }
  .toasts { bottom: max(var(--sp-4), calc(env(safe-area-inset-bottom) + var(--sp-2))); }
}

.getcard {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2) 60%);
  border: 1px solid var(--brand-ring);
  border-radius: var(--r-lg);
}

.getcard__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}
.getcard__copy { margin: var(--sp-2) 0 var(--sp-4); font-size: var(--fs-xs); color: var(--text-2); }

.getcard__steps {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding-left: var(--sp-5);
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.getcard__steps li::marker { color: var(--brand); font-weight: var(--fw-bold); }
.getcard__steps strong { color: var(--text); }
.getcard__steps em { font-style: normal; color: var(--brand); font-weight: var(--fw-semibold); }

.reg__split { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.reg__split::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.reg__split-label {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}

@media (max-width: 760px) {
  .getcard { grid-template-columns: 1fr; }
  .getcard__cta { width: 100%; }
}

.cotm { margin-bottom: var(--sp-7); }
.cotm__month { font-size: var(--fs-xs); color: var(--text-2); }

.cotm__body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.cotm__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.cotm__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.cotm__fallback { display: grid; place-items: center; height: 100%; color: var(--brand); font-weight: var(--fw-semibold); }

.cotm__meta { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }

.cotm__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--r-pill);
}
.cotm__badge svg { width: 13px; height: 13px; }

.cotm__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.cotm__player-name { font-size: var(--fs-sm); color: var(--text-2); }
.cotm__player-name strong { color: var(--brand); }
.cotm__copy { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.55; }

.cotm__past { margin-top: var(--sp-5); }
.cotm__past-label { margin-bottom: var(--sp-2); }

.cotm__past-rail {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: thin;
}

.cotm-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 170px;
  padding: var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.cotm-chip:hover { border-color: var(--brand); transform: translateY(-2px); }
.cotm-chip__month { font-size: var(--fs-micro); color: var(--brand); }
.cotm-chip__title { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text); }
.cotm-chip__by { font-size: var(--fs-micro); color: var(--text-3); }

@media (max-width: 860px) {
  .cotm__body { grid-template-columns: 1fr; }
}

/* Retirement badge — muted, so it reads as a status and not an achievement. */
.retired-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: middle;
  color: var(--muted);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.retired-tag--perm {
  color: #a1560f;
  background: rgba(210, 153, 34, 0.13);
  border-color: rgba(210, 153, 34, 0.3);
}

/* Retired is a filter, not a gamemode, so it sits slightly apart from the
   board tabs rather than reading as another board. */
.pill--retired {
  margin-left: auto;
  opacity: 0.85;
}

.pill--retired.is-active { opacity: 1; }

@media (max-width: 900px) {
  /* No room to push it to the end once the tabs scroll horizontally. */
  .pill--retired { margin-left: 0; }
}

/* ---- Launch celebration -------------------------------------------------- */

.celebrate__canvas {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}

.celebrate__banner {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  max-width: min(520px, calc(100vw - 32px));
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity 320ms ease, transform 320ms cubic-bezier(.2, .8, .25, 1);
}

.celebrate__banner.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.celebrate__spark {
  font-size: 1.5rem;
  line-height: 1;
  animation: celebrate-pop 1.6s ease-in-out infinite;
}

@keyframes celebrate-pop {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50%      { transform: rotate(8deg) scale(1.12); }
}

.celebrate__banner b {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.celebrate__banner i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
}

.celebrate__close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.celebrate__close:hover { color: var(--ink); background: var(--surface-inset); }
.celebrate__close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .celebrate__spark { animation: none; }
  .celebrate__banner { transition: none; }
}

/* The banner is content-sized, which leaves it cramped and heavily wrapped on
   a phone. Below the breakpoint it takes the width it needs. */
@media (max-width: 560px) {
  .celebrate__banner {
    width: calc(100vw - 24px);
    max-width: none;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    padding: 12px 14px;
    gap: 10px;
  }

  .celebrate__banner b { font-size: 0.9rem; }
  .celebrate__banner i { font-size: 0.78rem; }
  .celebrate__spark { font-size: 1.3rem; }
}

/* ---- Hive lookup badge --------------------------------------------------- */

.hive-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hive-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.hive-pill.is-checking { color: var(--muted); }
.hive-pill.is-checking .hive-pill__dot { animation: hive-pulse 1.1s ease-in-out infinite; }

@keyframes hive-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

.hive-pill.is-found   { color: var(--ok, #1f7a44); background: rgba(63, 185, 80, 0.12); }
.hive-pill.is-missing { color: #a1560f; background: rgba(210, 153, 34, 0.14); }
.hive-pill.is-unknown { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .hive-pill.is-checking .hive-pill__dot { animation: none; opacity: 0.6; }
}
