:root {
  color-scheme: dark;
  --bg: #0a100e;
  --panel: #111b16e8;
  --surface: #16221b;
  --line: #2b3b30;
  --text: #f1f5eb;
  --muted: #a9b8aa;
  --dim: #899e8e;
  --signal: #b8f36f;
  --signal-dim: #253920;
  --gold: #ffd093;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, #080e0de6, #0a100e82 42%, #0a100e32 76%),
    linear-gradient(0deg, #080e0dc4, #0a100e16 60%, #0a100e3a),
    url("/assets/enginewars-arena.png");
  background-size: cover;
  background-position: center;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; text-decoration: none; }
button, select { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
[hidden] { display: none !important; }
section[id] { scroll-margin-top: 24px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; top: 10px; left: 10px; padding: 10px 16px; border-radius: 6px; background: var(--signal); color: #10190c; }
.icon { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(1240px, calc(100% - 84px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid #27352c; background: #0c1410e8; }
.header-inner, .header-tools, .main-nav, .brand { display: flex; align-items: center; }
.header-inner { min-height: 70px; gap: 24px; justify-content: space-between; }
.brand { color: #f4f5ee; gap: 8px; white-space: nowrap; font-size: 1.13rem; font-weight: 850; letter-spacing: .075em; }
.brand svg { width: 31px; height: 34px; color: var(--signal); }
.brand strong { color: var(--signal); }
.main-nav { flex-wrap: wrap; gap: clamp(12px, 2vw, 29px); font-size: .9rem; color: var(--muted); font-weight: 600; }
.main-nav a { transition: color .15s; }
.main-nav a:hover, .main-nav .nav-download { color: var(--signal); }
.header-tools { gap: 10px; }
.status, .language { display: inline-flex; align-items: center; gap: 8px; min-height: 35px; border: 1px solid var(--line); background: #121d16; border-radius: 7px; }
.status { padding: 5px 10px; color: var(--muted); font-size: .79rem; white-space: nowrap; font-weight: 700; }
.status:hover { border-color: var(--dim); }
.status-dot { width: 7px; height: 7px; background: var(--dim); border-radius: 50%; flex-shrink: 0; }
.status[data-state="online"] { color: var(--signal); }
.status[data-state="online"] .status-dot { background: var(--signal); box-shadow: 0 0 10px #b8f36770; }
.status:is([data-state="paused"], [data-state="updating"]) { color: var(--gold); }
.status:is([data-state="paused"], [data-state="updating"]) .status-dot { background: var(--gold); }
.status[data-state="offline"] { color: #ffd3c9; }
.status[data-state="offline"] .status-dot { background: #ed9d8d; }
.language { padding: 4px 7px; gap: 4px; color: var(--muted); }
.language .icon { width: 16px; height: 16px; }
.language select { width: 44px; border: 0; background: transparent; font: 700 .75rem var(--mono); }
.language option { background: var(--surface); color: var(--text); }

.hero-inner { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; align-items: end; min-height: 635px; padding-top: 58px; padding-bottom: 28px; gap: 43px 22px; }
.hero-copy { max-width: 660px; align-self: center; }
.eyebrow { display: flex; align-items: center; gap: 9px; font: 700 .74rem/1.4 var(--mono); letter-spacing: .115em; text-transform: uppercase; color: var(--signal); }
.eyebrow > span:first-child:not([data-i18n]) { color: var(--dim); }
.hero-kicker::before { content: ""; width: 25px; height: 1px; background: currentColor; }
.hero h1 { margin: 13px 0 17px; font-size: clamp(3.65rem, 8.1vw, 7.25rem); line-height: .94; letter-spacing: -.072em; font-weight: 890; }
.hero h1 span, .hero h1 strong { display: block; overflow-wrap: anywhere; }
.hero h1 strong { color: var(--signal); font-weight: inherit; }
.hero-lead { max-width: 500px; font-size: clamp(1rem, 2vw, 1.29rem); line-height: 1.4; font-weight: 650; }
.hero-description { max-width: 455px; margin-top: 8px; color: #c2cec1; font-size: .98rem; }
.hero-actions, .download-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 49px; border: 1px solid transparent; border-radius: 8px; padding: 11px 16px; font-weight: 750; line-height: 1.22; transition: background-color .15s, border-color .15s; }
.button.primary { background: var(--signal); color: #14200c; box-shadow: 0 8px 28px #0810086b; }
.button.primary:hover { background: #ccff94; }
.button.secondary { background: #101a14df; border-color: #46564a; }
.button.secondary:hover { border-color: var(--signal); }
.button[aria-disabled="true"] { opacity: .54; cursor: default; }
.hero-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; color: #b5c3b6; font-size: .83rem; }
.arena-label { position: relative; display: grid; justify-items: end; gap: 5px; align-self: end; text-align: right; padding-bottom: 3px; }
.arena-label .eyebrow { text-shadow: 0 1px 8px #000; color: #e2eadd; }
.address { display: inline-flex; gap: 8px; align-items: center; border: 1px solid #58604f; border-radius: 7px; background: #0d1611ee; padding: 7px 11px; font-size: .83rem; }
.address:hover { color: var(--signal); }
.address .icon { width: 15px; height: 15px; }
.copy-feedback { position: absolute; top: 100%; right: 0; color: var(--signal); font-size: .78rem; background: #0c1510; border-radius: 4px; }
.copy-feedback:not(:empty) { padding: 2px 6px; }
.score-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #38483a; border-radius: 12px; overflow: hidden; background: #111b15f2; box-shadow: 0 14px 44px #070b08a0; }
.score { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1px 12px; padding: 17px 18px; }
.score + .score { border-left: 1px solid #344338; }
.score .icon { grid-row: span 2; width: 33px; height: 33px; color: var(--signal); padding: 6px; border-radius: 8px; background: var(--signal-dim); }
.score strong { font: 740 clamp(1.3rem, 3.1vw, 2.2rem)/1.12 var(--mono); letter-spacing: -.05em; overflow-wrap: anywhere; }
.score span { color: var(--muted); font-size: .86rem; line-height: 1.24; }
.score.total .icon { color: var(--gold); background: #342b1e; }
.score.total strong { color: var(--gold); }

.section { padding-block: 57px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.75rem); font-weight: 790; line-height: 1.04; letter-spacing: -.045em; margin-top: 6px; overflow-wrap: anywhere; }
.section-head, .section-intro, .rank-copy { text-shadow: 0 1px 12px #050907; }
.section-intro { margin-top: 11px; max-width: 68ch; color: #c2cec1; }
.sample { color: var(--muted); background: #101a15e8; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: .72rem/1.4 var(--mono); text-align: right; }
.activity-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 22px 0 13px; }
.activity-stats div { display: flex; gap: 7px 13px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #101912e8; min-width: 0; }
.activity-stats span { color: var(--muted); font-size: .86rem; }
.activity-stats strong { color: var(--signal); font: 720 1.25rem/1 var(--mono); overflow-wrap: anywhere; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 13px; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.panel-head h3 { font-size: 1.14rem; line-height: 1.2; }
.panel-head p { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.panel-icon { color: var(--signal); }
.segment { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #0c1510; }
.segment button { border: 0; border-radius: 4px; padding: 4px 8px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 680; }
.segment button:hover { color: var(--text); }
.segment [aria-pressed="true"] { background: var(--signal-dim); color: var(--signal); }
.chart { min-height: 168px; }
.chart .empty { display: grid; min-height: 166px; place-items: center; border: 1px dashed var(--line); border-radius: 8px; }
.chart-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 8px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding-right: 3px; color: var(--dim); font: .71rem var(--mono); }
.chart-bars { min-width: 0; height: 144px; display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: clamp(2px, .38vw, 5px); border-bottom: 1px solid #4b5f4d; background: repeating-linear-gradient(0deg, transparent, transparent calc(25% - 1px), #293a2f calc(25% - 1px), #293a2f 25%); }
.chart-bars button { display: flex; align-items: flex-end; justify-content: center; padding: 0; min-width: 0; border: 0; border-radius: 3px 3px 0 0; background: transparent; }
.chart-bars button span { display: block; width: 100%; height: max(2px, var(--bar)); background: linear-gradient(0deg, #47753b, #96ce5e); border-radius: 4px 4px 0 0; }
.chart-bars button:hover, .chart-bars button[aria-pressed="true"] { background: #a9eb6410; }
.chart-bars button:is(:hover, :focus-visible, [aria-pressed="true"]) span { background: var(--signal); }
.chart-axis { grid-column: 2; display: flex; justify-content: space-between; gap: 4px; color: var(--dim); font: .67rem var(--mono); }
.chart-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 10px; color: var(--muted); font-size: .82rem; }
.chart-latest { color: var(--gold); }
.result-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .79rem; }
.result-summary > span { color: var(--dim); }
.result-summary strong, .queue-count strong { color: var(--signal); font-family: var(--mono); }
.lobby-panel { display: flex; flex-direction: column; }
.queue-count { margin-top: auto; padding-top: 10px; color: var(--muted); font-size: .79rem; }
.pill { display: inline-flex; flex-wrap: wrap; gap: 5px; padding: 3px 8px; border: 1px solid #344a35; border-radius: 30px; color: var(--signal); background: #1a2b1c; font-size: .78rem; font-weight: 680; }
.lobby-list, .game-list { list-style: none; }
.lobby-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: start; }
.lobby-list li:not(.empty) { display: flex; gap: 7px; align-items: center; min-width: 0; padding: 5px 7px; background: #16231a; border-radius: 6px; }
.lobby-list li.empty { grid-column: 1 / -1; }
.lobby-list span { min-width: 0; }
.player-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.player-dot.reconnecting { background: var(--gold); }
.player-name { font-weight: 650; overflow-wrap: anywhere; }
.lobby-list .player-name { font-size: .81rem; }
.panel-foot { margin-top: 9px; color: var(--dim); font-size: .78rem; }
.panel-foot:empty { display: none; }
.match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 13px; }
.game-list li:not(.empty) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 9px 0; border-top: 1px solid #28382e; }
.match-names { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.match-names .player-name { min-width: 0; }
.match-separator { color: var(--dim); font: .69rem var(--mono); }
.match-meta { color: var(--muted); font: .73rem var(--mono); text-align: right; white-space: nowrap; }
.match-result { color: var(--gold); font-weight: 750; }
.empty { color: var(--muted); padding: 9px 0; font-size: .9rem; }

.rank-band { border-block: 1px solid var(--line); background: radial-gradient(ellipse at 18% 60%, #1a2c1a91 0%, transparent 48%), #0e1711ac; }
.rank-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr); gap: 20px 44px; align-items: start; }
.rank-copy .section-intro { max-width: 34ch; }
.rank-mark { margin: 20px 0 0 10px; color: #b8f36829; }
.rank-mark svg { display: block; width: clamp(72px, 12vw, 152px); height: auto; transform: rotate(-9deg); }
.rank-table { width: 100%; border-collapse: collapse; text-align: left; }
.rank-table td, .rank-table th { padding: 8px 7px; border-top: 1px solid var(--line); }
.rank-table th { color: var(--muted); font-size: .8rem; font-weight: 630; }
.rank-table td:first-child { width: 15%; color: var(--muted); font: .83rem var(--mono); }
.rank-table tr:nth-child(-n+3) td:first-child { color: var(--gold); }
.rank-table td:last-child, .rank-table th:last-child { text-align: right; }
.rank-table td:last-child:not(.empty) { font: 740 .96rem var(--mono); color: var(--signal); }
.rank-table .empty { text-align: left !important; }
.rank-piece { margin-inline-end: 6px; font-size: 1.1rem; line-height: 1; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.feature { display: flex; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.feature .icon { width: 34px; height: 34px; padding: 6px; border-radius: 7px; background: var(--signal-dim); color: var(--signal); }
.feature:nth-child(2) .icon { color: var(--gold); background: #342b1e; }
.feature h3, .steps h3 { font-size: 1.06rem; line-height: 1.22; }
.feature p, .steps p { margin-top: 5px; color: var(--muted); font-size: .92rem; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 18px; list-style: none; }
.steps li { padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.steps span { color: var(--signal); font: .78rem var(--mono); }
.steps h3 { margin-top: 6px; }

.download-section { padding-bottom: 58px; }
.download-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: clamp(20px, 4vw, 42px); border: 1px solid #40583c; border-radius: 14px; background: radial-gradient(ellipse at 91% 75%, #30441f, transparent 52%), #152018; }
.download-panel > div:first-child > p:not(.eyebrow) { margin-top: 10px; max-width: 58ch; color: #becdbd; }
.download-total { display: grid; justify-items: center; gap: 4px; text-align: center; padding-inline: 15px; }
.download-total .icon { width: 27px; height: 27px; color: var(--gold); }
.download-total strong { color: var(--gold); font: 750 clamp(1.65rem, 4.2vw, 3.3rem)/1.08 var(--mono); }
.download-total span { color: #e3c9a5; font-size: .86rem; }
.download-panel .release-meta { color: var(--dim); font: .8rem/1.5 var(--mono); }
.site-footer { border-top: 1px solid var(--line); background: #0d1510e8; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 9px 16px; padding-block: 18px; color: var(--muted); font-size: .85rem; }
.footer-inner .brand { font-size: .96rem; }
.footer-inner .brand svg { width: 23px; height: 26px; }
.footer-inner p strong { color: var(--gold); font-family: var(--mono); }

@media (max-width: 1040px) {
  .wrap { width: calc(100% - 48px); }
  .header-inner { gap: 13px; }
  .hero-inner { min-height: 580px; }
  .hero h1 { font-size: clamp(3.5rem, 9vw, 6rem); }
  .score { padding: 14px; gap: 1px 8px; }
  .score span { font-size: .8rem; }
  .lobby-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 770px) {
  .header-inner { flex-wrap: wrap; min-height: 0; padding-block: 10px; }
  .main-nav { order: 3; flex-basis: 100%; gap: 8px 14px; }
  body::before { background-position: 60% center; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 50px; padding-bottom: 14px; }
  .hero h1 { font-size: clamp(3.1rem, 12vw, 5.6rem); }
  .hero-copy { max-width: 560px; }
  .arena-label { justify-items: start; text-align: left; }
  .arena-label .eyebrow { display: none; }
  .copy-feedback { right: auto; left: 0; z-index: 1; }
  .score-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score:nth-child(odd) { border-left: 0; }
  .score:nth-child(n+3) { border-top: 1px solid #344338; }
  .section { padding-block: 39px; }
  .dashboard-grid, .rank-layout { grid-template-columns: minmax(0, 1fr); }
  .rank-mark { display: none; }
  .lobby-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-section { padding-bottom: 38px; }
}
@media (max-width: 500px) {
  .wrap { width: calc(100% - 28px); }
  .header-inner { gap: 8px; }
  .brand { font-size: 1rem; letter-spacing: .04em; gap: 5px; }
  .brand svg { width: 24px; height: 27px; }
  .status { font-size: .68rem; padding-inline: 6px; gap: 5px; white-space: normal; max-width: 105px; text-align: left; }
  .language .icon { display: none; }
  .language { padding-inline: 4px; }
  .header-tools { gap: 6px; }
  .main-nav { font-size: .79rem; }
  body::before {
    background-image:
      linear-gradient(0deg, #080e0dd2, #0a100e8a 42%, #0a100eb5 76%, #0a100e91),
      url("/assets/enginewars-arena.png");
    background-position: 64% center;
  }
  .hero-inner { min-height: 0; padding-top: 37px; }
  .hero h1 { font-size: clamp(2.9rem, 13.5vw, 4.55rem); }
  .hero-actions, .download-actions { gap: 8px; margin-top: 17px; }
  .button { min-height: 44px; padding: 8px 11px; font-size: .9rem; }
  .score { padding: 9px 8px; }
  .score .icon { width: 24px; height: 24px; padding: 4px; }
  .score strong { font-size: clamp(1.08rem, 5vw, 1.4rem); }
  .score span, .activity-stats span { font-size: .76rem; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .sample { text-align: left; }
  .panel { padding: 13px; }
  .chart-bars { height: 125px; }
  .chart-axis { font-size: .61rem; }
  .features, .steps, .download-panel { grid-template-columns: minmax(0, 1fr); }
  .download-total { justify-items: start; text-align: left; padding: 12px 0 0; border-top: 1px solid #3a5038; }
  .download-total .icon { display: none; }
  .match-meta { font-size: .64rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
