:root {
  color-scheme: dark;
  --bg: #060604;
  --ink: #fff4d7;
  --muted: #b9a77d;
  --gold: #f5c65b;
  --gold-2: #a97519;
  --amber: #ff9d21;
  --panel: rgba(18, 14, 9, .78);
  --panel-2: rgba(43, 31, 16, .78);
  --line: rgba(245, 198, 91, .24);
  --shadow: 0 30px 80px rgba(0, 0, 0, .55);
  font-family: "Cinzel", "Trajan Pro", "Marcellus", "Segoe UI", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 8%, rgba(250, 187, 74, .2), transparent 28rem),
    radial-gradient(circle at 14% 0%, rgba(255, 124, 26, .15), transparent 22rem),
    linear-gradient(145deg, #050404, #131009 48%, #050404);
  color: var(--ink);
  overflow-x: hidden;
}

button, input, a { font: inherit; }
button, a { transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease; }
button:hover, a:hover { transform: translateY(-1px); }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: .15;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mix-blend-mode: overlay;
}

.nav {
  position: fixed;
  z-index: 10;
  top: 18px;
  left: 50%;
  width: min(1180px, calc(100% - 28px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 6, 4, .74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand, .nav a {
  color: var(--ink);
  text-decoration: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 227, 150, .55);
  clip-path: polygon(50% 0, 100% 22%, 86% 100%, 14% 100%, 0 22%);
  background: linear-gradient(180deg, #ffdd7c, #8b5512);
  color: #100902;
  font-weight: 1000;
  letter-spacing: -.08em;
}
.brand strong { display: block; letter-spacing: .16em; text-transform: uppercase; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.nav nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav nav a {
  color: #e9d7a8;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

.player-pill {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 223, 136, .42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(64, 45, 18, .78), rgba(11, 9, 6, .72));
  color: var(--ink);
  text-decoration: none;
  line-height: 1.05;
}
.player-pill span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.player-pill strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gold);
  font-size: 13px;
}

button, .outline, .gold, .ghost {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  cursor: pointer;
}
.gold {
  border-color: rgba(255, 223, 136, .78);
  background: linear-gradient(180deg, #ffe293, #b77718 70%, #5d3509);
  color: #140b02;
  font-weight: 900;
  box-shadow: 0 12px 36px rgba(245, 165, 43, .22);
}
.outline, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 7, .46);
  color: var(--ink);
  text-decoration: none;
}
.ghost { color: #e6d1a0; }
.xl { min-height: 52px; padding-inline: 24px; }

main { position: relative; z-index: 1; }
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 28px;
  padding: 136px max(24px, calc((100vw - 1180px) / 2)) 74px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 4, 3, .92) 0%, rgba(5,4,3,.54) 42%, rgba(5,4,3,.24) 72%, rgba(5,4,3,.86) 100%),
    url("/assets/hero-optimized.jpg") center/cover no-repeat;
  transform: scale(1.04);
  animation: drift 18s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% -10%;
  height: 38%;
  background: linear-gradient(0deg, var(--bg), transparent);
  z-index: -1;
}
.hero-copy { max-width: 790px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-size: 12px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 20px;
  max-width: 820px;
  font-size: clamp(46px, 7vw, 96px);
  line-height: .88;
  letter-spacing: -.06em;
  text-transform: uppercase;
  text-shadow: 0 0 42px rgba(244, 183, 59, .22);
}
h2 {
  font-size: clamp(30px, 4vw, 58px);
  line-height: .94;
  letter-spacing: -.045em;
}
.lead {
  max-width: 650px;
  color: #d6c49a;
  font: 500 18px/1.7 "Bahnschrift", "Segoe UI", sans-serif;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 10px;
}
.status-grid div, .hero-card, .profile-panel, .shop-card, .season-card, .leaderboard, .download-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.status-grid div {
  padding: 14px;
  border-radius: 20px;
}
.status-grid strong { display: block; font-size: 26px; color: var(--gold); }
.status-grid span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .13em; }

.hero-card {
  position: relative;
  border-radius: 30px;
  padding: 30px;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 202, 91, .24), transparent 15rem);
  pointer-events: none;
}
.seal {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  clip-path: polygon(50% 0, 100% 27%, 84% 100%, 16% 100%, 0 27%);
  background: #f2c75f;
  color: #130b02;
  font-weight: 1000;
  font-size: 28px;
}
.countdown {
  margin-top: 20px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0,0,0,.28);
  color: var(--gold);
  font-weight: 900;
}

.section, .season {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 96px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, .72fr);
  gap: 24px;
  align-items: stretch;
}
.section p, .season p, .profile-panel p {
  color: #cdbb91;
  font: 500 16px/1.65 "Bahnschrift", "Segoe UI", sans-serif;
}
.profile-panel {
  border-radius: 30px;
  min-height: 260px;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(19, 14, 8, .82), rgba(54, 35, 14, .64)),
    url("/assets/squad-optimized.jpg") center/cover no-repeat;
}
.profile-panel.logged {
  background: linear-gradient(145deg, rgba(19, 14, 8, .9), rgba(54, 35, 14, .75));
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.profile-stats span {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0,0,0,.25);
}
.profile-stats strong { display: block; color: var(--gold); font-size: 22px; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  padding-inline: 14px;
  color: #d9c89d;
  background: rgba(13, 11, 8, .78);
}
.chip.active {
  color: #160d03;
  background: linear-gradient(180deg, #ffe293, #b77718);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.shop-card {
  position: relative;
  min-height: 198px;
  border-radius: 26px;
  padding: 20px;
  overflow: hidden;
}
.shop-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -38px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(245,198,91,.2);
  transform: rotate(45deg);
}
.shop-card .tag {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--gold);
  font-size: 12px;
}
.shop-card h3 { margin: 18px 0 12px; min-height: 52px; }
.prices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.prices span {
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(0,0,0,.26);
  color: #f0ddb0;
  font-size: 13px;
}

.season {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr);
  gap: 20px;
}
.season-card, .leaderboard, .download-card {
  border-radius: 30px;
  padding: 28px;
}
.leaderboard ol {
  margin: 16px 0 0;
  padding-left: 22px;
}
.leaderboard li {
  margin: 10px 0;
  color: #e5d2a0;
}
.muted { color: var(--muted); }
.launcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: center;
}
.download-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
}
.download-card span { color: var(--muted); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; }
.download-card strong { font-size: 28px; }

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 30px;
  padding: 26px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

dialog {
  width: min(470px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 0;
  color: var(--ink);
  background: rgba(10, 8, 5, .95);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.auth-shell { position: relative; padding: 24px; }
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 34px;
  width: 34px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 24px;
}
.auth-tabs button {
  min-height: 36px;
  padding: 0 8px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  color: #e2cfa0;
}
.auth-tabs button.active {
  background: linear-gradient(180deg, #ffe293, #b77718);
  color: #150b02;
}
.auth-view { display: none; gap: 10px; }
.auth-view.active { display: grid; }
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(245,198,91,.24);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(0,0,0,.26);
  outline: none;
}
input:focus { border-color: var(--gold); }
.auth-message { min-height: 22px; margin: 14px 0 0; color: var(--gold); }
.auth-message.error { color: #ff9b7c; }
.reset-inline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.battle-pass-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  border: 1px solid rgba(88, 255, 78, .22);
  border-radius: 34px;
  padding: 30px;
  background:
    radial-gradient(circle at 88% 18%, rgba(67, 255, 67, .18), transparent 16rem),
    linear-gradient(145deg, rgba(9, 24, 8, .76), rgba(33, 23, 8, .72));
  box-shadow: 0 30px 90px rgba(26, 255, 57, .08);
}

.page-body,
.bp-body {
  padding-top: 116px;
}

.page-hero,
.bp-hero {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 26px;
  min-height: 420px;
  display: grid;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 38px;
  overflow: hidden;
  background: rgba(10, 8, 5, .7);
  box-shadow: var(--shadow);
}

.page-hero {
  padding: 54px;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5,4,3,.86), rgba(5,4,3,.38), rgba(5,4,3,.78)),
    url("/assets/squad-optimized.jpg") center/cover no-repeat;
  transform: scale(1.04);
}

.profile-page {
  min-height: 100vh;
}

.profile-page.logged-out .profile-dashboard,
.profile-page.logged-out .profile-grid {
  display: none;
}

.profile-dashboard {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.profile-dashboard article,
.profile-section-card,
.bp-status-card,
.bp-board,
.bp-details {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.profile-dashboard article {
  min-height: 116px;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.profile-dashboard span,
.bp-status-card span,
.bp-track {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.profile-dashboard strong {
  color: var(--gold);
  font-size: clamp(22px, 3vw, 34px);
}

.profile-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-section-card {
  border-radius: 30px;
  padding: 28px;
  min-height: 240px;
}

.profile-section-card p {
  color: #cdbb91;
  font: 500 16px/1.65 "Bahnschrift", "Segoe UI", sans-serif;
}

.profile-stats.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bp-mini-bar,
.bp-progress-shell {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(72, 255, 80, .34);
  border-radius: 999px;
  background: rgba(0,0,0,.35);
}

.bp-mini-bar span,
.bp-progress-shell span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2cff44, #e5ff62);
  box-shadow: 0 0 28px rgba(60, 255, 75, .58);
}

.bp-body {
  background:
    radial-gradient(circle at 8% 12%, rgba(63, 255, 66, .17), transparent 20rem),
    radial-gradient(circle at 92% 22%, rgba(68, 255, 83, .2), transparent 18rem),
    linear-gradient(145deg, #020603, #071507 42%, #050404);
}

.bp-nav {
  border-color: rgba(71, 255, 79, .3);
}

.bp-page {
  position: relative;
}

.bp-hero {
  padding: 42px;
  gap: 22px;
  min-height: 380px;
  align-items: stretch;
  background:
    radial-gradient(circle at 84% 10%, rgba(67, 255, 73, .22), transparent 19rem),
    linear-gradient(145deg, rgba(9, 28, 7, .86), rgba(10, 8, 5, .78));
}

.bp-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0,0,0,.78), rgba(0,0,0,.3)),
    url("/assets/squad-optimized.jpg") center/cover no-repeat;
  opacity: .34;
}

.bp-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: end;
}

.bp-summary.locked {
  display: block;
  max-width: 760px;
  align-self: end;
}

.bp-summary.locked h1 {
  max-width: 760px;
  font-size: clamp(42px, 6vw, 82px);
}

.bp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.bp-status-card {
  border-color: rgba(67, 255, 73, .28);
  border-radius: 28px;
  padding: 24px;
  display: grid;
  gap: 10px;
  background: linear-gradient(145deg, rgba(8, 37, 8, .82), rgba(5, 7, 4, .74));
}

.bp-status-card strong {
  color: #70ff62;
  font-size: 42px;
}

.bp-status-card small {
  color: #bcdfad;
  font: 600 13px/1.5 "Bahnschrift", "Segoe UI", sans-serif;
}

.bp-message {
  min-height: 24px;
  margin: 0;
  color: #dfff80;
  font: 700 14px/1.5 "Bahnschrift", "Segoe UI", sans-serif;
}

.bp-message.error {
  color: #ff9b7c;
}

.bp-board,
.bp-details {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 26px;
  border-radius: 34px;
  padding: 28px;
  border-color: rgba(67, 255, 73, .2);
  background:
    radial-gradient(circle at 10% 0, rgba(54, 255, 59, .12), transparent 18rem),
    rgba(5, 12, 4, .78);
}

.bp-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bdd7ad;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.free-dot,
.premium-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.free-dot { background: #4ea8ff; }
.premium-dot { background: #ffc43b; }

.bp-reward-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 284px;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 2px 18px;
  scrollbar-color: #37ff4c rgba(0,0,0,.35);
}

.bp-tier {
  display: grid;
  grid-template-rows: auto 1fr 1fr;
  gap: 10px;
}

.bp-tier-number {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(72,255,80,.32);
  border-radius: 50%;
  color: #cfffbd;
  background: rgba(0,0,0,.34);
  font-weight: 900;
}

.bp-tier.reached .bp-tier-number {
  color: #071507;
  background: linear-gradient(180deg, #a5ff6f, #24d83a);
}

.bp-reward {
  min-height: 184px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  background: linear-gradient(145deg, rgba(8, 18, 7, .92), rgba(8, 8, 5, .82));
}

.bp-reward.premium {
  border-color: rgba(255, 196, 59, .36);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 196, 59, .18), transparent 9rem),
    linear-gradient(145deg, rgba(32, 23, 6, .92), rgba(8, 8, 5, .82));
}

.bp-reward.free {
  border-color: rgba(84, 169, 255, .26);
}

.bp-reward.claimable {
  box-shadow: 0 0 34px rgba(51, 255, 63, .16);
}

.bp-reward.claimed {
  opacity: .68;
}

.bp-reward strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}

.bp-reward p {
  margin: 0;
  color: #bcd7b2;
  font: 600 13px/1.45 "Bahnschrift", "Segoe UI", sans-serif;
}

.reward-action {
  width: 100%;
  min-height: 38px;
  border-radius: 14px;
  padding: 0 10px;
}

.reward-action.locked,
.reward-action.claimed {
  cursor: default;
  color: #87977e;
  background: rgba(255,255,255,.04);
}

.bp-history-item {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}

.bp-history-item strong {
  color: #dfff80;
}

.bp-history-item span {
  color: #c6d8b8;
  font: 600 14px/1.5 "Bahnschrift", "Segoe UI", sans-serif;
}

.reveal {
  animation: rise .8s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drift {
  from { transform: scale(1.04) translateX(-8px); }
  to { transform: scale(1.08) translateX(12px); }
}

@media (max-width: 920px) {
  .nav { position: sticky; top: 0; transform: none; left: auto; width: 100%; border-radius: 0; flex-wrap: wrap; }
  .nav nav { order: 3; width: 100%; overflow: auto; padding: 4px 0; }
  .nav-actions { margin-left: auto; }
  .hero, .split, .season, .launcher, .battle-pass-teaser, .profile-grid, .bp-summary { grid-template-columns: 1fr; }
  .hero { padding-top: 96px; min-height: auto; }
  .hero-card { max-width: none; }
  .status-grid, .shop-grid, .profile-dashboard, .profile-stats.wide { grid-template-columns: 1fr; }
  .page-body, .bp-body { padding-top: 0; }
  .page-hero, .bp-hero { min-height: auto; padding: 28px; border-radius: 28px; }
  .bp-reward-grid { grid-auto-columns: minmax(230px, 78vw); }
  .section-head { align-items: start; flex-direction: column; }
  footer { flex-direction: column; }
}
