:root {
  --ink: #0d1315;
  --surface: #121a1c;
  --surface-raised: #172225;
  --line: rgba(205, 184, 121, .24);
  --line-strong: rgba(226, 197, 112, .64);
  --paper: #e8e5d8;
  --muted: #9da6a0;
  --gold: #e7c66f;
  --gold-soft: #a98b45;
  --teal: #54c2bb;
  --teal-dark: #17635f;
  --danger: #d36e63;
  --max-width: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button { cursor: pointer; }

.site-shell { min-height: 100vh; overflow: hidden; }
.topbar { width: min(calc(100% - 48px), var(--max-width)); height: 86px; margin: auto; display: flex; align-items: center; gap: 32px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); background: var(--gold); clip-path: polygon(50% 0, 100% 82%, 50% 100%, 0 82%); font-weight: 900; }
.brand strong { display: block; letter-spacing: .14em; font-size: 17px; line-height: 1; }
.brand small { display: block; margin-top: 5px; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.site-nav { display: flex; height: 100%; align-items: center; gap: 24px; margin-left: auto; }
.site-nav a { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: var(--paper); border-color: var(--gold); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; padding: 0 18px; border: 1px solid transparent; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #101413; background: var(--gold); box-shadow: 0 6px 22px rgba(231, 198, 111, .12); }
.button-outline { color: var(--paper); background: transparent; border-color: var(--line-strong); }
.account-button { margin-left: 12px; }
.nav-toggle { display: none; }

.section { width: min(calc(100% - 48px), var(--max-width)); margin: auto; }
.hero { position: relative; min-height: 570px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 80px; }
.hero::after { content: ""; position: absolute; width: 820px; height: 820px; right: -450px; top: -190px; border: 1px solid rgba(231,198,111,.11); border-radius: 50%; box-shadow: 0 0 0 42px rgba(231,198,111,.028), 0 0 0 84px rgba(231,198,111,.018); }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 800; }
.eyebrow span { width: 24px; height: 1px; background: var(--gold); }
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { max-width: 680px; font-size: clamp(50px, 7vw, 86px); line-height: .94; letter-spacing: -.045em; }
h1 em { color: var(--gold); font-style: normal; }
h2 { font-size: clamp(34px, 4vw, 49px); letter-spacing: -.035em; }
.hero-text, .section-text { max-width: 575px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 25px; margin-top: 31px; }
.text-link { color: var(--paper); font-size: 13px; font-weight: 700; }
.text-link span { color: var(--gold); margin-left: 4px; }
.text-link:hover { color: var(--gold); }

.live-card { position: relative; z-index: 1; align-self: center; background: linear-gradient(145deg, rgba(30, 44, 46, .92), rgba(16, 25, 27, .98)); border: 1px solid var(--line-strong); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.card-heading { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 0 22px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .13em; font-weight: 800; }
.live-dot { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(84,194,187,.12); }
.data-mode { margin-left: auto; font-size: 9px; color: var(--gold-soft); }
.live-numbers { display: grid; grid-template-columns: repeat(3, 1fr); padding: 30px 12px; }
.live-numbers div { min-width: 0; padding: 0 12px; border-right: 1px solid var(--line); }
.live-numbers div:last-child { border: 0; }
.live-numbers strong { display: block; color: var(--gold); font-family: Georgia, serif; font-size: 39px; font-weight: 400; }
.live-numbers span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; line-height: 1.3; letter-spacing: .06em; }
.live-footer { display: flex; justify-content: space-between; gap: 15px; padding: 16px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.live-footer strong { color: var(--paper); font-weight: 600; }

.game-strip { width: min(calc(100% - 48px), var(--max-width)); margin: -10px auto 0; padding: 22px 0; display: flex; align-items: center; gap: 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.game-strip > p { margin: 0; color: var(--muted); letter-spacing: .13em; font-size: 10px; font-weight: 800; }
.game-pills { display: flex; gap: 9px; flex-wrap: wrap; }
.game-pill { padding: 7px 10px; border: 1px solid rgba(255,255,255,.1); color: var(--muted); font-size: 11px; }
.game-pill.active { color: var(--paper); border-color: var(--teal-dark); background: rgba(38,111,105,.14); }
.game-pill b { margin-left: 6px; color: var(--gold-soft); font-size: 8px; letter-spacing: .07em; }
.game-pill.active b { color: var(--teal); }

.content-section { padding: 120px 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.filters { display: flex; gap: 12px; margin-bottom: 18px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
select { min-width: 175px; padding: 10px 30px 10px 12px; color: var(--paper); background: var(--surface-raised); border: 1px solid var(--line); outline: none; }
select:focus { border-color: var(--gold); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: rgba(18,26,28,.84); }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th { padding: 14px 18px; color: var(--muted); background: rgba(255,255,255,.015); border-bottom: 1px solid var(--line); font-size: 10px; text-transform: uppercase; letter-spacing: .11em; text-align: left; }
td { padding: 17px 18px; border-bottom: 1px solid rgba(205,184,121,.11); color: var(--muted); font-size: 13px; }
tbody tr:last-child td { border: 0; }
tbody tr:hover td { background: rgba(231,198,111,.035); }
td:first-child { color: var(--gold); font-family: Georgia, serif; font-size: 17px; }
.runner { color: var(--paper); font-weight: 700; }
.time { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.loading-row td, .empty-row td { text-align: center; padding: 38px; color: var(--muted); }
.fine-print { margin: 13px 0 0; color: #707976; font-size: 11px; }

.split-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 100px; align-items: center; padding-bottom: 120px; }
.player-panel { border: 1px solid var(--line); background: rgba(18,26,28,.84); }
.panel-header { display: flex; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 12px; }
.panel-header span { color: var(--muted); font-size: 10px; }
.player-list { padding: 0; margin: 0; list-style: none; }
.player-list li { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 58px; padding: 10px 18px; border-bottom: 1px solid rgba(205,184,121,.1); }
.player-list li:last-child { border: 0; }
.player-name { color: var(--paper); font-size: 13px; font-weight: 700; }
.player-game { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.state { padding: 5px 7px; color: var(--teal); background: rgba(84,194,187,.08); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.state.queue { color: var(--gold); background: rgba(231,198,111,.08); }
.state.racing { color: #cf8ddb; background: rgba(207,141,219,.08); }
.loading-player { color: var(--muted); font-size: 12px; }

.download-section { padding: 100px 0; display: grid; grid-template-columns: .8fr 1.2fr; gap: 100px; align-items: center; border-top: 1px solid var(--line); }
.download-card { display: flex; justify-content: space-between; gap: 25px; padding: 28px; background: linear-gradient(110deg, rgba(30,56,55,.72), rgba(29,32,29,.78)); border: 1px solid rgba(84,194,187,.36); }
.version-tag { color: var(--teal); font-size: 9px; letter-spacing: .14em; font-weight: 800; }
.download-card h3 { margin-top: 8px; font-size: 28px; }
.download-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.download-actions { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 14px; }

.about-section { display: grid; grid-template-columns: 180px 1fr; gap: 70px; align-items: center; padding: 90px 0 115px; border-top: 1px solid var(--line); }
.about-mark { color: var(--gold); font-size: 140px; text-align: center; text-shadow: 0 0 50px rgba(231,198,111,.18); }
.about-links { display: flex; gap: 22px; margin-top: 25px; }
.about-links a { color: var(--gold); font-size: 12px; font-weight: 700; }
footer { width: min(calc(100% - 48px), var(--max-width)); display: flex; justify-content: space-between; gap: 25px; margin: auto; padding: 24px 0 30px; color: #68716d; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.5; }

.login-dialog { width: min(calc(100% - 32px), 470px); padding: 0; color: var(--paper); background: var(--surface-raised); border: 1px solid var(--line-strong); box-shadow: 0 28px 90px rgba(0,0,0,.6); }
.login-dialog::backdrop { background: rgba(4,8,9,.77); backdrop-filter: blur(4px); }
.login-dialog form { padding: 38px; }
.login-dialog h2 { margin-bottom: 15px; font-size: 36px; }
.login-dialog p:not(.eyebrow):not(.login-message) { color: var(--muted); font-size: 13px; line-height: 1.65; }
.login-dialog label { display: block; margin-top: 23px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.login-dialog input { width: 100%; margin: 8px 0 14px; padding: 13px; color: var(--paper); background: var(--ink); border: 1px solid var(--line); outline: none; }
.login-dialog input:focus { border-color: var(--gold); }
.login-dialog .text-link { display: inline-block; margin-left: 16px; }
.dialog-close { position: absolute; top: 13px; right: 17px; border: 0; color: var(--muted); background: transparent; font-size: 27px; }
.login-message { min-height: 18px; color: var(--danger); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 800px) {
  .topbar { width: min(calc(100% - 32px), var(--max-width)); height: 70px; gap: 14px; }
  .nav-toggle { display: grid; width: 38px; height: 38px; gap: 4px; place-content: center; margin-left: auto; color: var(--paper); background: transparent; border: 1px solid var(--line); }
  .nav-toggle span:not(.sr-only) { display: block; width: 15px; height: 1px; background: currentColor; }
  .site-nav { display: none; position: absolute; z-index: 5; top: 69px; left: 0; right: 0; height: auto; padding: 13px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: grid; }
  .site-nav a { height: 39px; justify-content: start; }
  .account-button { display: none; }
  .section, .game-strip, footer { width: min(calc(100% - 32px), var(--max-width)); }
  .hero { grid-template-columns: 1fr; gap: 35px; padding: 82px 0 60px; min-height: auto; }
  .hero::after { right: -580px; top: -360px; }
  h1 { font-size: clamp(48px, 14vw, 74px); }
  .live-card { max-width: 510px; width: 100%; }
  .game-strip { align-items: flex-start; flex-direction: column; gap: 12px; }
  .filters { overflow-x: auto; padding-bottom: 3px; }
  .split-section, .download-section { grid-template-columns: 1fr; gap: 40px; }
  .content-section { padding-top: 85px; }
  .split-section { padding-bottom: 85px; }
  .download-section { padding: 75px 0; }
  .download-card { align-items: flex-start; flex-direction: column; }
  .download-actions { align-items: flex-start; }
  .about-section { grid-template-columns: 1fr; gap: 20px; padding: 70px 0 85px; }
  .about-mark { font-size: 90px; text-align: left; }
  footer { flex-direction: column; gap: 7px; }
}

@media (max-width: 450px) {
  .hero-actions, .live-numbers { align-items: stretch; flex-direction: column; }
  .hero-actions { gap: 18px; }
  .live-numbers { display: flex; gap: 17px; }
  .live-numbers div { border: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .login-dialog form { padding: 29px 22px; }
}

.profile-actions { display: flex; gap: 10px; padding: 18px; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }
