.archive-open, .archive-open body { overflow: visible; }
/* The league is the home surface. Scoring is a contextual action, not another app. */
.app-shell .top-header { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.app-shell .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
.app-shell .brand-copy { margin-left: 10px; padding-left: 10px; }
.app-shell .brand, .app-shell .brand-copy { min-width: 0; }
.app-shell .brand-mark { flex-shrink: 0; }
.app-shell .eyebrow { font-size: clamp(14px, 3.3vw, 20px); }
.app-shell .brand-sub { display: none; }
.app-shell .league-nav { position: static; display: flex; padding: 0; gap: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
.app-shell .league-nav a { min-height: 42px; padding: 10px 14px; font-size: 14px; white-space: nowrap; border: 1px solid var(--border); color: var(--gold); background: var(--gold-soft); }
.app-shell .league-nav a { color: var(--text-muted); background: transparent; border-color: transparent; }
.app-shell .league-nav a.active { color: var(--gold); background: var(--gold-soft); }
.app-shell .top-header { position: sticky; top: 0; z-index: 30; padding: 8px 0; background: var(--bg); margin-bottom: 12px; }
.app-shell .league-nav { gap: 2px; }
.app-shell .league-nav a { padding: 10px 12px; }
@media (max-width: 759px) { .app-shell .brand-copy { display: none; } }
.app-shell .league-heading > a { display: none; }
.app-shell .stage-panel { border-radius: 16px; box-shadow: none; }
.app-shell .section-tag { display: none; }
.app-shell { padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-shell .archive-kicker { display: none; }
.app-shell .archive-page-head h1, .app-shell .profile-hero h1, .app-shell .match-hero h1 { font-size: 28px; margin: 0; }
.app-shell .archive-page-head { margin: 12px 0 10px; padding: 4px 0 8px; }
.app-shell .archive-section-head { margin-bottom: 12px; gap: 12px; }
.app-shell .archive-section-head h2 { font-size: 20px; }
.app-shell .league-report > summary { padding: 16px 0; font-size: 20px; }
.app-shell .league-report { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.app-shell .league-report-head { margin-bottom: 4px; }
.app-shell .league-report-section > summary { padding: 16px 0; font-size: 16px; }
.app-shell .league-report-section .archive-section { border: 0; background: transparent; border-radius: 0; padding: 0; margin: 0 0 16px; }
.app-shell .league-report-section .archive-section-head h2 { display: none; }
.app-shell .award-grid { gap: 0 28px; }
.app-shell .award-grid article { display: block; min-height: 0; padding: 20px 0; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; }
.award-heading { display: flex; gap: 12px; align-items: center; }
.award-heading > span { font-size: 28px; }
.award-heading small, .award-heading strong { display: block; }
.app-shell .award-heading small { font-size: 14px; }
.app-shell .award-heading strong { font-size: 22px; margin: 3px 0 0; }
.app-shell .award-grid .award-message { padding: 0; margin: 14px 0; border: 0; border-radius: 0; background: none; font-size: 16px; line-height: 1.85; }
.app-shell .award-grid .award-stats { display: none; }
.app-shell .award-grid article > button { margin-top: 0; font-size: 14px; }
.app-shell .league-games { padding: 16px 0; border: 0; border-radius: 0; background: transparent; }
.app-shell .profile-scope { display: inline-flex; gap: 4px; margin: 18px 0 12px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.app-shell .profile-scope button { min-width: 72px; padding: 9px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font: inherit; font-size: 14px; cursor: pointer; }
.app-shell .profile-scope button.is-active { background: var(--gold-soft, rgba(212, 168, 83, .14)); color: var(--gold); font-weight: 700; }
.app-shell .league-heading { padding: 8px 0 18px; }
.app-shell .league-heading h1 { font-size: 28px; margin: 12px 0 6px; }
.league-player-scope { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; }
.league-initial-load { padding: 20px 0; color: var(--text-muted); font-size: 14px; }
.league-initial-load > div { height: 48px; background: #ffffff05; margin-top: 8px; border-radius: 8px; }
.league-sync-status { border: 0; background: transparent; color: var(--gold); font-size: 13px; padding: 8px 0; }
.league-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0 24px; }
.league-heading h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -.04em; margin: 18px 0 8px; }
.league-heading p { color: var(--text-muted); margin: 0; font-size: 14px; line-height: 1.6; }
.league-heading > a { white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.league-season-picker select { border: 1px solid var(--border); background: #17281d; color: var(--gold); padding: 10px 34px 10px 14px; border-radius: 10px; font-size: 14px; }
.league-standings { border: 1px solid var(--border-soft); border-radius: 16px; overflow: hidden; background: var(--surface); }
.league-standings .archive-table th { background: #ffffff04; }
.league-report-entry { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; padding: 20px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 14px; background: #d4a8530c; color: var(--text); }
.league-report-entry small, .league-report-entry strong { display: block; }
.league-report-entry small { color: var(--gold); font-size: 13px; margin-bottom: 6px; }
.league-report-entry > span:last-child { font-size: 14px; color: var(--text-muted); }
.league-report-entry b { margin-left: 12px; color: var(--gold); }
.league-empty-season { padding: 44px 24px; text-align: center; }
.league-empty-season h2 { font-size: 20px; margin: 0 0 12px; }
.league-empty-season p, .league-muted { color: var(--text-muted); font-size: 14px; }
.league-empty-season a, .league-footer a, .league-games a, .archive-page-head > a { color: var(--gold); text-decoration: none; font-size: 14px; }
.league-disclosure { border-top: 1px solid var(--border-soft); margin-top: 16px; }
.league-disclosure > summary, .league-report-section > summary { cursor: pointer; padding: 20px 0; font-size: 16px; font-weight: 650; }
.league-report > summary { font-size: 20px; }
.league-report > summary span { float: right; color: var(--text-muted); font-size: 13px; font-weight: 400; padding-top: 5px; }
.league-report-section { border-top: 1px solid var(--border-soft); }
.league-report-section .archive-section { margin-top: 0; }
.league-report { scroll-margin-top: 20px; }
.league-footer { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px 0; border-top: 1px solid var(--border-soft); margin-top: 24px; }
.league-footer a:last-child { margin-left: auto; color: var(--text-muted); }
.league-learning-frame { display: block; width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--bg); }
.archive-table .league-player-link { border: 0; padding: 6px 0; background: transparent; color: inherit; font-weight: 700; text-align: left; }
@media (max-width: 759px) {
  .app-shell .profile-scope { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .app-shell .profile-scope::-webkit-scrollbar { display: none; }
  .app-shell .profile-scope button { flex: 0 0 auto; }
  .league-heading { align-items: flex-end; gap: 10px; }
  .league-heading > a { padding: 10px 14px; min-height: 44px; font-size: 14px; }
  .league-report-entry { padding: 16px; }
  .league-report > summary span { display: block; float: none; margin-left: 22px; }
  .league-standings .archive-table th:nth-child(n+5), .league-standings .archive-table td:nth-child(n+5) { display: none; }
}

/* One application shell for the table, careers and seasons. */
.app-shell .desktop-tabs, .app-shell .mobile-tabs { display: none !important; }
.league-content-open .tab-panels, .league-content-open .install-card { display: none; }
.league-table-tabs { display: none; }
.league-table-open .league-table-tabs { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.league-table-context { color: var(--text-muted); font-size: 14px; }
.league-table-tabs .league-chip-link { margin-left: auto; }
.league-scoring .league-table-back, html:not(.league-scoring) .league-chip-link { display: none; }
.league-nav { display: flex; gap: 6px; border-bottom: 1px solid var(--border-soft); padding: 0 0 12px; }
.league-nav a { display: flex; gap: 9px; align-items: center; justify-content: center; padding: 12px 24px; color: var(--text-muted); text-decoration: none; border-radius: 12px; font-size: 14px; }
.league-nav a.active, .league-table-tabs a.active { color: var(--gold); background: var(--gold-soft); }
.league-table-tabs a { padding: 12px 16px; color: var(--text-muted); text-decoration: none; white-space: nowrap; border-radius: 12px; font-size: 14px; }
.app-shell .wpt-archive-portal { background: none; overflow: visible; }
.app-shell .archive-main { width: 100%; padding: 0 0 24px; }
.app-shell .archive-hero { padding: 28px; border-radius: 20px; min-height: 0; }
.app-shell .archive-hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 14px 0 8px; }
.league-start { display: inline-flex; align-items: center; text-decoration: none; margin-top: 16px; }
.league-season-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 16px; color: var(--text); text-decoration: none; background: linear-gradient(110deg, #d4a85314, transparent); }
.league-season-link strong, .league-season-link small { display: block; }
.league-season-link small { color: var(--text-muted); margin-bottom: 6px; font-size: 13px; }
.league-season-link b { color: var(--gold); margin-left: 20px; }
.archive-main > .archive-season-banner { display: none; }
.league-learning { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
.league-learning a { display: grid; gap: 12px; padding: 28px; border: 1px solid var(--border); border-radius: 16px; color: var(--gold); text-decoration: none; }
.league-learning span { color: var(--text-muted); font-size: 14px; }
.league-nav a:focus-visible, .league-table-tabs a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 759px) {
  .app-shell { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .league-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #102017f5; backdrop-filter: blur(20px); border-top: 1px solid var(--border); border-bottom: 0; }
  .league-nav a { flex-direction: column; gap: 5px; padding: 8px 2px; min-height: 52px; font-size: 14px; }
  .league-nav a > span { font-size: 20px; line-height: 1; }
  .app-shell .archive-hero { padding: 22px; gap: 22px; }
  .league-season-link { padding: 18px; }
  .league-learning { grid-template-columns: 1fr; }
}

.mobile-tabs.has-gto-entry.has-archive-entry {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.wpt-archive-portal {
  position: relative;
  z-index: 1;
  display: none;
  overflow: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(212, 168, 83, .1), transparent 29rem),
    radial-gradient(circle at 94% 18%, rgba(120, 221, 154, .06), transparent 26rem),
    var(--bg);
}

.wpt-archive-portal.is-open {
  display: block;
}

.archive-shell {
  min-height: 100%;
}

.archive-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 10px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 18, 13, .9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.archive-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.archive-brand > span:last-child,
.archive-brand strong,
.archive-brand small {
  display: block;
}

.archive-brand strong {
  font-size: 1rem;
}

.archive-brand small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.archive-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(212, 168, 83, .28);
  border-radius: 13px;
  color: var(--gold);
  background: linear-gradient(145deg, #213224, #101b15);
  font-size: 1.3rem;
}

.archive-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}

.archive-tabs button,
.season-subtabs button {
  border: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
}

.archive-tabs button {
  min-height: 38px;
  padding: 0 16px;
}

.archive-tabs button.active,
.season-subtabs button.active {
  color: #1d160a;
  background: var(--gold);
  font-weight: 800;
}

.archive-close {
  justify-self: end;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  font-size: 1.25rem;
}

.archive-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 60px;
}

.archive-hero,
.profile-hero,
.season-hero,
.match-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  border: 1px solid rgba(212, 168, 83, .2);
  border-radius: 28px;
  background: linear-gradient(135deg, #17251b 0%, #152019 56%, #251d12 100%);
  box-shadow: var(--shadow);
}

.archive-hero {
  min-height: 230px;
  padding: clamp(28px, 5vw, 48px);
}

.season-hero::after,
.profile-hero::after {
  position: absolute;
  right: 2%;
  top: -7rem;
  color: rgba(212, 168, 83, .045);
  content: "♠";
  font-family: Georgia, serif;
  font-size: 28rem;
  line-height: 1;
  pointer-events: none;
  transform: rotate(8deg);
}

.archive-hero > *,
.season-hero > *,
.profile-hero > *,
.match-hero > * {
  position: relative;
  z-index: 1;
}

.archive-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.archive-hero h1,
.archive-page-head h1,
.profile-hero h1,
.season-hero h1,
.match-hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(2.05rem, 6vw, 4.7rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.archive-lead,
.archive-page-head > p:last-child,
.season-hero p,
.match-hero p {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.archive-season-status {
  display: grid;
  min-width: 230px;
  gap: 7px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 13, 9, .6);
}

.archive-season-status strong {
  font-size: 1.15rem;
}

.archive-season-status small,
.archive-season-status button {
  color: var(--text-muted);
}

.archive-season-status button {
  border: 0;
  padding: 8px 0 0;
  color: var(--gold);
  background: transparent;
  text-align: left;
}

.archive-live {
  color: var(--green);
  font-size: .78rem;
  font-weight: 800;
}

.archive-sealed {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: .76rem;
  font-weight: 800;
}

.archive-section {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}

.archive-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.archive-section-head h2,
.archive-season-banner h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.archive-section-head > button,
.award-grid button {
  border: 0;
  padding: 4px;
  color: var(--gold);
  background: transparent;
}

.archive-latest-grid {
  display: grid;
  grid-template-columns: .9fr 1.25fr;
  gap: 13px;
}

.archive-match-winner {
  display: grid;
  gap: 5px;
  min-height: 170px;
  align-content: center;
  padding: 22px;
  border: 1px solid rgba(212, 168, 83, .18);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(212, 168, 83, .11), rgba(255, 255, 255, .025));
}

.archive-match-winner > span,
.archive-match-winner small {
  color: var(--text-muted);
}

.archive-match-winner h3 {
  margin: 5px 0 0;
  font-size: 1.45rem;
}

.archive-match-winner strong {
  font-size: 2rem;
}

.archive-event-list {
  display: grid;
  gap: 9px;
}

.archive-event {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
}

.archive-event > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  font-size: 1.15rem;
}

.archive-event strong,
.archive-event small {
  display: block;
}

.archive-event small {
  margin-top: 3px;
  color: var(--text-muted);
}

.archive-record-strip,
.archive-player-strip,
.archive-record-grid,
.archive-player-grid,
.award-grid,
.achievement-grid,
.season-card-grid {
  display: grid;
  gap: 12px;
}

.archive-record-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archive-player-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.archive-record-card,
.archive-player-card,
.season-card {
  min-width: 0;
  border: 1px solid var(--border-soft);
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.archive-record-card:hover,
.archive-player-card:hover,
.season-card:hover {
  border-color: rgba(212, 168, 83, .35);
  background: rgba(212, 168, 83, .07);
  transform: translateY(-2px);
}

.archive-record-card {
  display: grid;
  gap: 5px;
  min-height: 155px;
  align-content: end;
  padding: 17px;
  border-radius: 17px;
}

.archive-record-icon {
  margin-bottom: auto;
  font-size: 1.55rem;
}

.archive-record-card small,
.archive-record-card > span:last-child,
.archive-player-card small {
  color: var(--text-muted);
}

.archive-record-card strong {
  font-size: 1.32rem;
  font-variant-numeric: tabular-nums;
}

.archive-player-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 142px;
  align-content: end;
  padding: 15px;
  border-radius: 17px;
}

.archive-player-card > strong {
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
}

.archive-player-card > span:not(.archive-rank) {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.archive-rank {
  position: absolute;
  right: 13px;
  top: 12px;
  color: var(--text-dim);
  font-size: .74rem;
  font-weight: 850;
}

.archive-mini-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  overflow: hidden;
}

.archive-mini-tags i,
.profile-tags span {
  width: fit-content;
  border: 1px solid rgba(212, 168, 83, .16);
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-soft);
  font-style: normal;
  white-space: nowrap;
}

.archive-mini-tags i {
  overflow: hidden;
  padding: 3px 6px;
  font-size: .62rem;
  text-overflow: ellipsis;
}

.archive-season-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  padding: 25px;
  border: 1px solid rgba(212, 168, 83, .28);
  border-radius: 22px;
  background: linear-gradient(125deg, rgba(212, 168, 83, .12), rgba(255, 255, 255, .035));
}

.archive-season-banner h2 {
  margin-top: 10px;
}

.archive-season-banner p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.archive-champion {
  display: grid;
  gap: 4px;
}

.archive-champion span,
.archive-champion small {
  color: var(--text-muted);
}

.archive-champion strong {
  font-size: 1.18rem;
}

.archive-primary {
  min-height: 45px;
  border: 1px solid rgba(212, 168, 83, .44);
  border-radius: 999px;
  padding: 0 18px;
  color: #1e170a;
  background: var(--gold);
  font-weight: 850;
}

.archive-page-head {
  padding: 30px 0 24px;
}

.archive-page-head h1,
.profile-hero h1,
.season-hero h1,
.match-hero h1 {
  font-size: clamp(2.25rem, 6vw, 4.2rem);
}

.archive-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  min-height: 50px;
  margin-bottom: 18px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.archive-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.archive-player-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archive-player-grid .archive-player-card {
  min-height: 175px;
}

.archive-back {
  margin: 2px 0 15px;
  border: 0;
  color: var(--text-muted);
  background: transparent;
}

.profile-hero,
.season-hero,
.match-hero {
  min-height: 250px;
  padding: clamp(25px, 5vw, 48px);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.profile-tags span {
  padding: 6px 10px;
  font-size: .76rem;
}

.profile-tags button { padding: 6px 10px; border: 1px dashed var(--border); border-radius: 999px; background: transparent; color: var(--gold); font: inherit; font-size: .76rem; }
.profile-tag-editor { width: min(460px, 100%); margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(7,13,9,.45); }
.profile-tag-editor[hidden] { display: none; }
.profile-tag-editor label { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 13px; }
.profile-tag-editor input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.profile-tag-editor > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.profile-tag-editor button { min-height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-muted); }
.profile-tag-editor button[type="submit"] { border-color: var(--gold); color: var(--gold); }
.profile-tag-editor p { min-height: 18px; margin: 7px 0 0; color: var(--text-muted); font-size: 13px; }

.profile-career-mark,
.season-trophy,
.match-hero > div:last-child {
  display: grid;
  min-width: 220px;
  gap: 5px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 13, 9, .58);
}

.profile-career-mark small,
.profile-career-mark span,
.season-trophy span,
.season-trophy small,
.match-hero > div:last-child span {
  color: var(--text-muted);
}

.profile-career-mark strong,
.season-trophy strong,
.match-hero > div:last-child strong {
  font-size: 1.42rem;
}

.archive-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-top: 18px;
}

.archive-metric {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.archive-metric span,
.archive-metric strong {
  display: block;
}

.archive-metric span {
  color: var(--text-muted);
  font-size: .78rem;
}

.archive-metric strong {
  margin-top: 6px;
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
}

.archive-chart {
  overflow: hidden;
  min-height: 220px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .025);
}

.archive-chart svg,
.season-curves svg {
  display: block;
  width: 100%;
  height: 245px;
}

.archive-chart-zero {
  stroke: rgba(236, 230, 216, .14);
  stroke-width: 1;
}

.archive-chart-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.archive-chart circle,
.season-curves circle {
  fill: var(--surface);
  stroke: var(--gold);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.archive-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.achievement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.achievement-card {
  position: relative;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  text-align: left;
}

.achievement-main { display: grid; width: 100%; grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 14px 42px 14px 14px; border: 0; background: transparent; color: inherit; text-align: left; }
.achievement-main > span:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .06);
  font-size: 1.3rem;
}

.achievement-info { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; width: 26px; height: 26px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--gold); font: 700 13px/1 Georgia, serif; cursor: help; }
.achievement-info:hover, .achievement-info:focus-visible { border-color: var(--gold); background: rgba(212,168,83,.14); outline: none; }
.achievement-popover { position: absolute; right: 8px; bottom: calc(100% - 6px); z-index: 20; width: min(290px, calc(100vw - 48px)); padding: 14px; border: 1px solid var(--gold); border-radius: 12px; background: #132219; box-shadow: 0 18px 45px rgba(0,0,0,.48); color: var(--text); }
.achievement-popover[hidden] { display: none; }
.achievement-popover > strong { padding-right: 22px; font-size: 15px; }
.achievement-popover p { display: grid; grid-template-columns: 58px 1fr; gap: 8px; margin: 9px 0 0; font-size: 13px; line-height: 1.5; }
.achievement-popover b { color: var(--gold); font-weight: 650; }

.achievement-card small,
.achievement-card strong,
.achievement-card time {
  display: block;
}

.achievement-card small {
  color: var(--gold);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.achievement-card strong {
  margin-top: 2px;
}

.achievement-card p,
.achievement-card time {
  color: var(--text-muted);
  font-size: .74rem;
}

.achievement-card p {
  margin: 4px 0;
}

.rarity-legendary {
  border-color: rgba(212, 168, 83, .42);
  background: linear-gradient(145deg, rgba(212, 168, 83, .13), rgba(255, 255, 255, .035));
}

.season-split-list,
.season-highlights,
.archive-match-list,
.match-results {
  display: grid;
  gap: 8px;
}

.season-split-list button,
.season-highlights button,
.archive-match-list > button,
.match-results button {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .035);
}

.season-split-list button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  text-align: left;
}

.season-split-list button span {
  color: var(--text-muted);
}

.archive-timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.archive-timeline::before {
  position: absolute;
  left: 139px;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: var(--border);
  content: "";
}

.archive-timeline button {
  position: relative;
  display: grid;
  grid-template-columns: 116px 40px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 0;
  padding: 12px 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.archive-timeline time {
  padding-top: 8px;
  color: var(--text-muted);
  font-size: .76rem;
  text-align: right;
}

.archive-timeline button > span {
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.archive-timeline strong,
.archive-timeline small {
  display: block;
}

.archive-timeline small {
  margin-top: 3px;
  color: var(--text-muted);
}

.trigger-event-list { display: grid; gap: 10px; }
.trigger-event { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; width: 100%; padding: 14px 44px 14px 14px; border: 1px solid var(--border-soft); border-left: 3px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--text); text-align: left; }
.trigger-event > span { font-size: 24px; }
.trigger-event small, .trigger-event strong { display: block; }
.trigger-event small { color: var(--text-muted); font-size: 12px; }
.trigger-event strong { margin-top: 3px; font-size: 15px; }
.trigger-event p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.trigger-event.rarity-rare { border-left-color: #5ba7ff; }
.trigger-event.rarity-legendary { border-left-color: var(--gold); background: rgba(212,168,83,.06); }

/* History management keeps deletion visible; swiping remains an optional shortcut. */
.league-table-open .history-list .swipe-row { padding-right: 72px; }
.league-table-open .history-list .swipe-row-action { z-index: 2; width: 72px; pointer-events: auto; }

.archive-record-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.record-history {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: none;
  width: min(520px, 100%);
  height: 100%;
  margin-left: auto;
  overflow: auto;
  padding: 18px;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -30px 0 70px rgba(0, 0, 0, .45);
}

.record-history.is-open {
  display: block;
}

.record-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.record-history-head button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
}

.record-history > button {
  display: grid;
  width: 100%;
  grid-template-columns: 75px 1fr auto;
  gap: 6px 10px;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.record-history > button > span {
  color: var(--gold);
  font-size: .65rem;
  font-weight: 850;
}

.record-history > button > small {
  grid-column: 2 / -1;
  color: var(--text-muted);
}

.record-detail-back { margin-top: 10px; }
.record-detail-head { display: flex; align-items: center; gap: 18px; padding: 12px 0 24px; border-bottom: 1px solid var(--border-soft); }
.record-detail-head > span { font-size: 38px; }
.record-detail-head small, .record-detail-head p { color: var(--text-muted); }
.record-detail-head h1 { margin: 4px 0; font-size: clamp(30px, 6vw, 48px); }
.record-detail-head p { margin: 0; }
.record-history-page { max-width: 720px; }
.record-history-page > button { display: grid; width: 100%; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 6px 12px; padding: 18px 0; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; color: var(--text); text-align: left; }
.record-history-page > button > span { color: var(--gold); font-size: 11px; font-weight: 800; }
.record-history-page > button > small { grid-column: 2 / -1; color: var(--text-muted); }

.season-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.season-card {
  display: grid;
  gap: 14px;
  min-height: 270px;
  align-content: space-between;
  padding: 24px;
  border-radius: 22px;
}

.season-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.season-card > div:first-child small,
.season-card p {
  color: var(--text-muted);
}

.season-card h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 2rem;
}

.season-card p {
  margin: -8px 0 0;
}

.season-card-champion {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border-soft);
}

.season-card-champion span,
.season-card-empty {
  color: var(--text-muted);
}

.season-hero.sealed {
  background: linear-gradient(135deg, #172038, #251a30 56%, #2e2515);
}

.season-subtabs {
  position: sticky;
  top: 82px;
  z-index: 3;
  display: flex;
  gap: 5px;
  margin-top: 16px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 18, 13, .91);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.season-subtabs button {
  min-height: 39px;
  flex: 1 0 auto;
  padding: 0 17px;
}

.award-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.award-grid article {
  display: grid;
  min-height: 330px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(212, 168, 83, .075), rgba(255, 255, 255, .025));
}

.award-grid article > span {
  margin-bottom: 14px;
  font-size: 2rem;
}

.award-grid small {
  color: var(--gold);
  font-weight: 800;
}

.award-grid strong {
  margin-top: 5px;
  font-size: 1.3rem;
}

.award-grid p {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: .88rem;
}

.award-grid .award-stats {
  min-height: 42px;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.55;
}

.award-grid .award-message {
  margin: 7px 0 16px;
  padding: 13px 14px;
  border-left: 2px solid var(--gold);
  border-radius: 0 10px 10px 0;
  color: var(--text);
  background: rgba(212, 168, 83, .075);
  font-size: .88rem;
  line-height: 1.7;
}

.award-grid article > button {
  margin-top: auto;
}

.award-grid button {
  padding: 0;
  text-align: left;
}

.season-curves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.season-curves article {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.season-curves article > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px 0;
}

.season-curves svg {
  height: 170px;
}

.archive-chart-note {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: .82rem;
}

.archive-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.archive-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .76rem;
}

.archive-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.archive-chart-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.archive-chart-scroll svg {
  display: block;
  min-width: 760px;
  width: 100%;
}

.season-overlay-chart {
  height: 470px;
}

.season-scatter-chart {
  height: 460px;
}

.season-overlay-chart text,
.season-scatter-chart text {
  fill: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
}

.season-scatter-chart g text {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.chart-grid {
  stroke: rgba(236, 230, 216, .08);
  stroke-width: 1;
}

.scatter-frame {
  fill: rgba(255, 255, 255, .018);
  stroke: rgba(236, 230, 216, .1);
}

.scatter-median {
  stroke: rgba(212, 168, 83, .24);
  stroke-width: 1;
  stroke-dasharray: 7 7;
}

.season-scatter-chart .chart-axis-title {
  fill: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.volatility-bars {
  display: grid;
  gap: 9px;
}

.volatility-bars button {
  display: grid;
  grid-template-columns: 110px minmax(120px, 1fr) 110px;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 8px 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.volatility-bars button > span {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
}

.volatility-bars button > span i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--red));
}

.volatility-bars button > b {
  color: var(--text-muted);
  text-align: right;
}

.archive-table-wrap {
  overflow-x: auto;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.archive-table th,
.archive-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: right;
  white-space: nowrap;
}

.archive-table th {
  color: var(--text-muted);
  font-size: .74rem;
}

.archive-table th:first-child,
.archive-table td:first-child,
.archive-table th:nth-child(2),
.archive-table td:nth-child(2) {
  text-align: left;
}

.archive-table tbody tr {
  cursor: pointer;
}

.archive-table tbody tr:hover {
  background: rgba(212, 168, 83, .05);
}

.season-highlights button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  text-align: left;
}

.season-highlights button > span {
  font-size: 1.25rem;
}

.season-highlights strong,
.season-highlights small {
  display: block;
}

.season-highlights small {
  color: var(--text-muted);
}

.archive-match-list > button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  text-align: left;
}

.archive-match-list > button > span:last-child {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  justify-items: end;
}

.archive-match-list small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
}

.archive-match-list > button > span:last-child small {
  grid-column: 1 / -1;
}

.match-hero {
  background: linear-gradient(135deg, #18271c, #171f1a 55%, #202a3e);
}

.match-layout {
  grid-template-columns: 1.15fr .85fr;
}

.match-results button {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
}

.match-results button > span {
  color: var(--text-muted);
}

.match-results button > small {
  color: var(--text-muted);
}

.achievement-grid.compact {
  grid-template-columns: 1fr;
}

.archive-state,
.archive-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--text-muted);
  text-align: center;
}

.archive-state {
  min-height: 70vh;
}

.archive-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: archive-spin .8s linear infinite;
}

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

@media (max-width: 980px) {
  .archive-record-strip,
  .archive-record-grid,
  .award-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-player-strip,
  .archive-player-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .archive-season-banner {
    grid-template-columns: 1fr auto;
  }

  .archive-season-banner > button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 759px) {
  .mobile-tabs.has-gto-entry.has-archive-entry {
    gap: 1px;
    padding-inline: 5px;
  }

  .mobile-tabs.has-gto-entry.has-archive-entry .nav-tab {
    min-width: 0;
    padding-inline: 1px;
  }

  .archive-topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
  }

  .archive-tabs {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 8;
    justify-content: stretch;
    padding: 5px;
    border-radius: 16px;
    background: rgba(15, 26, 20, .95);
    box-shadow: var(--shadow);
  }

  .archive-tabs button {
    min-width: 0;
    flex: 1;
    padding: 0 7px;
  }

  .archive-main {
    width: min(100% - 24px, 1180px);
    padding: 18px 0 90px;
  }

  .archive-hero,
  .profile-hero,
  .season-hero,
  .match-hero {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    padding: 25px 20px;
    border-radius: 21px;
  }

  .archive-hero h1,
  .archive-page-head h1,
  .profile-hero h1,
  .season-hero h1,
  .match-hero h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .archive-season-status,
  .profile-career-mark,
  .season-trophy,
  .match-hero > div:last-child {
    min-width: 0;
  }

  .archive-section {
    padding: 16px;
    border-radius: 18px;
  }

  .archive-section-head {
    align-items: flex-start;
  }

  .archive-latest-grid,
  .archive-two-col,
  .match-layout,
  .season-card-grid,
  .season-curves {
    grid-template-columns: 1fr;
  }

  .archive-record-strip,
  .archive-record-grid,
  .award-grid,
  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-player-strip,
  .archive-player-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-player-strip .archive-player-card:nth-child(n + 5) {
    display: none;
  }

  .archive-season-banner {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .archive-season-banner > button {
    grid-column: auto;
    justify-self: stretch;
  }

  .archive-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .season-subtabs {
    top: 72px;
    border-radius: 15px;
  }

  .archive-table th:nth-child(5),
  .archive-table td:nth-child(5),
  .archive-table th:nth-child(7),
  .archive-table td:nth-child(7) {
    display: none;
  }

  .archive-timeline::before {
    left: 15px;
  }

  .archive-timeline button {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .archive-timeline time {
    grid-column: 2;
    padding: 0;
    text-align: left;
  }

  .archive-timeline button > span {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .archive-match-list > button {
    grid-template-columns: 1fr;
  }

  .archive-match-list > button > span:last-child {
    grid-template-columns: auto 1fr auto;
    justify-items: start;
  }

  .archive-match-list > button > span:last-child small {
    grid-column: auto;
    margin: 0;
  }
}

@media (max-width: 430px) {
  .archive-brand small {
    display: none;
  }

  .archive-record-strip,
  .archive-record-grid,
  .award-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .archive-player-card {
    min-height: 150px;
  }

  .archive-record-card {
    min-height: 145px;
  }

  .match-results button {
    grid-template-columns: 25px 1fr auto;
  }

  .match-results button > small {
    display: none;
  }
}
