:root {
  --site-width: 1320px;
  --site-gutter: clamp(16px, 3.2vw, 48px);
  --site-bg: #080808;
  --site-panel: #141414;
  --site-line: #2e2e2e;
  --site-muted: #b2b2b2;
  --site-accent: #f5f5f5;
  --site-accent-ink: #121212;
  --site-hover: #222;
  --site-display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
}

html {
  background: var(--site-bg);
}

body {
  background: none;
  isolation: isolate;
}

html::before,
body::before,
body::after {
  content: none !important;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 68% -16%, #272727 0, #111 44%, transparent 75%),
    repeating-linear-gradient(115deg, transparent 0 84px, #ffffff08 84px 85px, transparent 85px 170px),
    radial-gradient(ellipse at 96% 92%, #1d1d1d 0, transparent 54%),
    var(--site-bg);
}

#siteHeader {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 clamp(10px, 1.4vw, 20px);
  align-items: center;
  min-height: 0;
  padding: 0 max(var(--site-gutter), calc((100% - var(--site-width)) / 2));
  border-bottom: 1px solid var(--site-line);
  background: #0a0a0a;
}

#siteHeader::before,
#siteHeader::after {
  content: none;
}

.site-identity {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 34px);
  min-width: 0;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  min-height: 68px;
  color: #fff;
  font: italic 800 1.65rem/1 'Inter', system-ui, sans-serif;
  letter-spacing: -.065em;
}

.site-brand-mark {
  width: 48px;
  height: 38px;
  background: var(--logo-url) center / contain no-repeat;
}

#siteHeader .site-account {
  --account-gap: 6px;
  display: flex;
  align-items: center;
  justify-self: end;
  grid-column: 2;
  grid-row: 1;
  gap: var(--account-gap);
  min-width: 0;
}

#siteHeader #authArea {
  margin: 0;
  min-width: 0;
}

#siteHeader #authArea:has(> .header-coins) {
  --nav-h: 40px;
  --seg-h: 40px;
  gap: var(--account-gap);
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#siteHeader #authArea :is(.header-hours, .header-coins, .notif-bell-btn, .user-chip) {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  margin: 0;
  border: 1px solid var(--site-line) !important;
  border-radius: 8px;
  background: var(--site-panel) !important;
  color: #f1f1f1;
  letter-spacing: 0;
  box-shadow: none;
}

#siteHeader #authArea :is(.header-hours, .header-coins),
#siteHeader #authArea .user-chip .uname {
  font-size: .8125rem;
  font-weight: 650;
}

#siteHeader #authArea :is(.header-hours svg, .header-coins img) {
  width: 16px;
  height: 16px;
}

#siteHeader #authArea :is(.user-chip, .notif-bell-btn):hover {
  background: var(--site-hover) !important;
}

#siteHeader #authArea .user-chip {
  padding: 0 10px 0 5px;
  gap: 8px;
}

#siteHeader #authArea .user-chip-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 1px;
  border: 1px solid #555;
  background: #272727;
}

#siteHeader #authArea .user-chip img {
  width: 24px;
  height: 24px;
  box-shadow: none;
}

#siteHeader #authArea .user-chip-online {
  display: none;
}

#siteHeader #authArea .notif-bell-wrap {
  position: relative;
  margin: 0;
}

#siteHeader #authArea .notif-bell-btn {
  justify-content: center;
  width: 40px;
  padding: 0;
}

#siteHeader #authArea .notif-bell-badge {
  left: auto;
  right: -3px;
}

@media (min-width: 761px) {
  #siteHeader #authArea .notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
  }
}

#siteHeader .btn-login {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--site-accent);
  border-radius: 8px;
  background: var(--site-accent) !important;
  color: var(--site-accent-ink);
  font-size: .875rem;
  font-weight: 750;
}

#siteHeader .btn-login:hover {
  background: #ffffff !important;
}

#siteHeader #sideDock {
  position: static;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--site-line);
  transform: none;
}

#siteHeader #sideDock :is(#updatesFab, .dock-btn) {
  position: relative;
  inset: auto;
  flex-direction: row;
  gap: 7px;
  width: auto;
  min-width: 36px;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #d3d3d3;
  font: 650 .8125rem/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0;
  transform: none;
}

#siteHeader #sideDock :is(#updatesFab, .dock-btn):hover {
  border-color: var(--site-line);
  background: var(--site-panel);
  color: #fff;
}

#siteHeader #sideDock :is(.dock-ks-txt, .site-updates-label) {
  writing-mode: horizontal-tb;
  transform: none;
  color: inherit;
  font: 650 .8125rem/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

#siteHeader #sideDock :is(.dock-ks-logo, .dock-dre-logo) {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#siteHeader #sideDock #updatesFab svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.5px;
  stroke-linecap: round;
}

#siteHeader #updatesFab.has-new { animation: none; }
#siteHeader #updatesFab .upd-count { inset: -4px -4px auto auto; }
body.ks-mode #siteHeader #ksFab { border-color: var(--site-line); }

#siteHeader #onlineBadge {
  position: static;
  flex: none;
  gap: 8px;
  width: max-content;
  padding: 0 11px;
  min-height: 40px;
  border: 1px solid var(--site-line);
  border-radius: 8px;
  background: var(--site-panel);
  backdrop-filter: none;
  box-shadow: none;
  transform: none;
}

#siteHeader #onlineBadge .online-float-dot {
  width: 6px;
  height: 6px;
  background: var(--live, #42d88b);
  box-shadow: none;
}

#siteHeader #onlineBadge .online-float-count,
#siteHeader #onlineBadge .online-float-label {
  font-size: .75rem;
  color: var(--site-muted);
}

#siteHeader #onlineBadge .online-float-count {
  color: #fff;
}

#siteHeader :is(#topNav, #ksNav) {
  grid-column: 1 / -1;
  order: 3;
  width: 100%;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0 !important;
  border-top: 1px solid var(--site-line) !important;
  border-radius: 0 !important;
  background: none !important;
  -webkit-mask-image: none;
  mask-image: none;
  scrollbar-width: thin;
  scrollbar-color: #4d4d4d transparent;
}

#siteHeader :is(#topNav, #ksNav)::-webkit-scrollbar {
  display: initial;
  height: 4px;
}

#siteHeader :is(#topNav, #ksNav)::-webkit-scrollbar-thumb {
  background: #4d4d4d;
}

#siteHeader .top-nav a {
  flex: 0 0 auto;
  height: 44px !important;
  padding: 0 clamp(8px, 1vw, 15px) !important;
  border-radius: 0 !important;
  background: none !important;
  color: var(--site-muted) !important;
  font-size: .875rem !important;
  box-shadow: none !important;
  transform: none;
}

#siteHeader .top-nav a:hover {
  background: var(--site-panel) !important;
  color: #fff !important;
}

#siteHeader .top-nav a.active {
  color: var(--site-accent) !important;
  box-shadow: inset 0 -2px var(--site-accent) !important;
}

#siteHeader .top-nav a.panel-link {
  font-weight: 750;
}

.site-menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--site-line);
  border-radius: 7px;
  background: var(--site-panel);
  color: #fff;
  font: 650 .875rem/1 'Inter', system-ui, sans-serif;
}

#siteHeader :focus-visible,
.site-main :is(a, button):focus-visible,
footer a:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 3px;
}

#siteHeader .top-nav a:focus-visible {
  outline-offset: -3px;
}

.site-main {
  width: min(100%, calc(var(--site-width) + 2 * var(--site-gutter)));
  max-width: none;
  margin-inline: auto;
  padding: clamp(22px, 3vw, 38px) var(--site-gutter) clamp(48px, 6vw, 88px);
  animation: none;
}

.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-height: clamp(322px, 31vw, 440px);
  overflow: hidden;
  border: 1px solid #3a3a3a;
  border-radius: 16px;
  background: #131313;
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 4.5vw, 66px);
}

.home-hero h1 {
  color: #fff;
  font: 900 clamp(3.1rem, 6.8vw, 7rem)/.85 var(--site-display);
  letter-spacing: -.015em;
  text-transform: uppercase;
}

.home-hero h1 span {
  display: block;
  color: #c7c7c7;
}

.home-hero-copy p {
  max-width: 33ch;
  margin-top: 20px;
  color: #c7c7c7;
  font-size: 1rem;
  line-height: 1.55;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.home-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid #555555;
  border-radius: 8px;
  color: #f4f4f4;
  font-size: .875rem;
  font-weight: 700;
  background: #222222;
  transition: background-color .15s ease, border-color .15s ease;
}

.home-action:hover {
  background: #333333;
  border-color: #8b8b8b;
}

.home-action-primary {
  border-color: var(--site-accent);
  background: var(--site-accent);
  color: var(--site-accent-ink);
}

.home-action-primary:hover {
  border-color: #ffffff;
  background: #ffffff;
}

#homeView .md-livetag,
#homeView .md-live-score {
  color: #fff;
}

#homeView .md-livetag::before {
  background: #e2e2e2;
  box-shadow: 0 0 0 3px #ffffff22;
  animation: none;
}

#homeView .md-live-score {
  border-color: #5c5c5c;
}

.home-pitch {
  position: absolute;
  inset: 0 0 0 37%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(88deg, #131313, transparent 37%),
    radial-gradient(ellipse at 64% 43%, #505050 0%, #282828 50%, #101010 100%);
}

.home-pitch::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(122deg, transparent 0 46px, #ffffff0c 46px 92px);
  mask-image: linear-gradient(90deg, transparent, #000 46%);
}

.home-pitch-lines {
  position: absolute;
  inset: 11% -8% 11% 15%;
  border: 1px solid #ffffff47;
  transform: rotate(-18deg) skew(-13deg);
  mask-image: linear-gradient(90deg, transparent, #000 24%);
}

.home-pitch-lines::before,
.home-pitch-lines::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.home-pitch-lines::before {
  width: 1px;
  height: 100%;
  background: #ffffff47;
}

.home-pitch-lines::after {
  width: min(22%, 116px);
  aspect-ratio: 1;
  border: 1px solid #ffffff47;
  border-radius: 50%;
}

.home-pitch-box {
  position: absolute;
  top: 25%;
  right: -1px;
  width: 17%;
  height: 50%;
  border: 1px solid #ffffff47;
}

.home-pitch-mark {
  position: relative;
  width: min(54%, 350px);
  aspect-ratio: 1.6;
  margin-left: 18%;
  background: var(--logo-url) center / contain no-repeat;
  filter: drop-shadow(0 16px 18px #000000aa);
}

.home-section {
  margin-top: clamp(26px, 3.3vw, 46px);
}

.home-section > .home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.home-section-head h2 {
  color: #fff;
  font: 800 clamp(1.75rem, 3vw, 2.65rem)/1 var(--site-display);
  text-transform: uppercase;
}

.home-section-head a {
  padding-block: 8px;
  color: var(--site-muted);
  font-size: .875rem;
  font-weight: 650;
}

.home-section-head a:hover {
  color: var(--site-accent);
}

.home-my-match {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(0, 1.25fr) auto;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 12px;
  padding: 14px 17px;
  border: 1px solid var(--site-line);
  border-radius: 9px;
  background: linear-gradient(120deg, #202020, #121212 65%);
}
.home-my-match[hidden] { display:none; }
.home-my-match h3 { margin:0; color:#fff; font:800 1rem/1.2 'Inter', system-ui, sans-serif; }
.home-my-match p { margin:3px 0 0; color:var(--site-muted); font-size:.78rem; overflow-wrap:anywhere; }
.home-my-match > p { grid-column:2 / -1; }
.home-my-match-opponent { display:flex; align-items:center; gap:10px; min-width:0; }
.home-my-match-opponent img { flex:none; object-fit:contain; width:42px; height:42px; }
.home-my-match-opponent b { display:block; overflow-wrap:anywhere; }
.home-my-match-opponent span { color:var(--site-muted); font-size:.78rem; }
.home-my-match-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px 11px; }
.home-my-match-status { color:#dadada; font-size:.76rem; }
@media (max-width: 660px) {
  .home-my-match { grid-template-columns:minmax(0,1fr) auto; }
  .home-my-match-heading, .home-my-match > p { grid-column:1 / -1; }
}
@media (max-width: 390px) {
  .home-my-match { grid-template-columns:minmax(0,1fr); }
  .home-my-match-actions { justify-content:space-between; }
}

#homeView .md-wrap {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0;
}

#homeView .md-panel {
  min-width: 0;
  padding: clamp(16px, 2vw, 25px);
  border: 1px solid var(--site-line);
  border-radius: 12px;
  background: var(--site-panel);
  box-shadow: none;
}

#homeView .md-next {
  background: radial-gradient(ellipse at 50% 35%, #222222, var(--site-panel) 78%);
}

#homeView .md-next.md-live {
  border-color: #555;
}

#homeView .md-next:hover,
#homeView .md-next:focus-within {
  border-color: #666666;
}

.md-detail,
.home-tournament-card h3 button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.md-detail {
  display: block;
  padding: 6px 0;
  margin: 12px auto 0;
  color: var(--site-accent);
  font-size: .875rem;
  font-weight: 650;
}

.md-detail::after,
.home-tournament-card h3 button::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

#homeView .md-eyebrow {
  padding-bottom: 12px;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--site-line);
  color: #eeeeee;
  font-size: .875rem;
  letter-spacing: 0;
  text-transform: none;
}

#homeView .md-eyebrow b {
  color: var(--site-muted);
  text-align: right;
  overflow-wrap: anywhere;
}

#homeView .md-logo {
  border-radius: 12px;
  background-color: #101010;
  background-size: contain;
}

#homeView .md-count {
  gap: 3px;
}

#homeView .md-unit {
  min-width: clamp(33px, 4vw, 53px);
  padding-inline: 4px;
  background: #111111;
  border-radius: 6px;
}

#homeView .md-unit small {
  color: var(--site-muted);
  font-size: .65rem;
  letter-spacing: .02em;
}

#homeView .md-when,
#homeView .md-empty {
  font-size: .875rem;
  color: var(--site-muted);
}

#homeView .md-res {
  width: 100%;
  margin: 0;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--site-line);
  border-radius: 0;
  background: none;
  text-align: left;
}

#homeView .md-res:hover {
  background: #ffffff09;
}

#homeView .md-rt {
  color: var(--site-muted);
  font-size: .875rem;
}

#homeView .md-rt.win {
  color: #fff;
}

#homeView .md-rs {
  background: #101010;
  border-color: var(--site-line);
}

#homeView #homeTransferBanner {
  margin: 16px 0 0;
  border-color: var(--site-line);
  border-radius: 12px;
  background: var(--site-panel);
}

#homeView .season-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--site-line);
  border-radius: 12px;
  background: var(--site-panel);
}

#homeView .snap-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 18px);
  padding: clamp(12px, 1.75vw, 22px);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  animation: none;
}

#homeView .snap-card + .snap-card {
  border-left: 1px solid var(--site-line);
}

#homeView .snap-ic {
  width: 36px;
  height: 36px;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  background: #252525;
  color: var(--site-accent);
}

#homeView .snap-ic svg {
  width: 19px;
  height: 19px;
}

#homeView .snap-n {
  color: #fff;
  font: 800 2rem/.95 var(--site-display);
}

#homeView .snap-l {
  margin-top: 4px;
  color: var(--site-muted);
  font-size: .8125rem;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

#homeTournamentsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
  gap: 12px;
}

#homeTournamentsGrid .home-tournament-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--site-line);
  border-radius: 12px;
  background: var(--site-panel);
  color: #fff;
  text-align: left;
}

#homeTournamentsGrid .home-tournament-card:hover {
  background: #1e1e1e;
  border-color: #666666;
}

#homeTournamentsGrid .home-tournament-card:focus-within {
  border-color: var(--site-accent);
}

.home-tournament-card h3 {
  font: 750 1.5rem/1.05 var(--site-display);
  overflow-wrap: anywhere;
}

.home-tournament-category {
  color: var(--site-muted);
  font-size: .8125rem;
  line-height: 1.3;
}

.site-main .page-section .stats-header h2 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -.01em;
}

.site-main .page-section .stats-header {
  margin-bottom: clamp(16px, 2.2vw, 26px);
}

.site-main .page-section :is(.t-card, .profile-card, .lcard, .transfer-card, .stat-tile) {
  border-color: var(--site-line);
  background: var(--site-panel);
}

.site-main .page-section :is(.t-card, .profile-card, .lcard, .transfer-card):hover {
  border-color: #626262;
}

@media (max-width: 900px) {
  #homeView .md-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  #siteHeader {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 8px;
  }

  .site-brand {
    min-height: 56px;
    gap: 4px;
    font-size: 1.25rem;
  }

  .site-brand-mark {
    width: 33px;
    height: 29px;
  }

  #siteHeader .site-account {
    --account-gap: 4px;
  }

  #siteHeader #authArea :is(.header-hours, .header-coins) {
    gap: 5px;
    padding-inline: 7px;
    font-size: .75rem;
  }

  #siteHeader #authArea .user-chip {
    width: 36px;
    justify-content: center;
    padding: 0;
  }

  .site-identity { display: contents; }

  #siteHeader #sideDock {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    padding-inline-start: 0;
    border-inline-start: 0;
    margin-bottom: 8px;
  }

  #siteHeader .site-updates-label {
    display: none;
  }

  #siteHeader .site-menu-btn {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-bottom: 8px;
  }

  #siteHeader.mobile-menu-ready .site-menu-btn {
    display: flex;
  }

  body.ks-mode #siteHeader .site-menu-btn {
    display: none;
  }

  #siteHeader.mobile-menu-ready #topNav {
    display: none;
  }

  #siteHeader.mobile-menu-ready.mobile-menu-open #topNav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 56vh;
    overflow: auto;
    padding-block: 8px !important;
  }

  #siteHeader.mobile-menu-open #topNav a {
    justify-content: flex-start;
    border-radius: 6px !important;
  }

  #siteHeader.mobile-menu-open #topNav a.active {
    background: #272727 !important;
    box-shadow: none !important;
  }

  #siteHeader #authArea .user-chip :is(.uname, .chev) {
    display: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: 300px;
  }

  .home-pitch {
    inset: 0 0 0 30%;
    opacity: .48;
  }

  .home-pitch-mark {
    margin: 0 0 26% 42%;
  }

  .home-hero-copy p {
    max-width: 31ch;
  }

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

  #homeView .snap-card:nth-child(3) {
    border-left: 0;
  }

  #homeView .snap-card:nth-child(n+3) {
    border-top: 1px solid var(--site-line);
  }
}

@media (max-width: 420px) {
  #siteHeader .site-account:has(.header-coins) {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-bottom: 8px;
  }

  #siteHeader #sideDock {
    gap: 0;
  }

  #siteHeader #sideDock :is(#updatesFab, .dock-btn) {
    min-width: 34px;
    padding-inline: 5px;
  }

  #siteHeader #onlineBadge {
    gap: 6px;
    padding-inline: 8px;
  }

  #homeView .md-teams,
  #homeView .md-res {
    gap: 5px;
  }

  #homeView .md-rt {
    gap: 4px;
    font-size: .8125rem;
  }

  #homeView .md-rl {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
