/* ==========================================================================
   BattleStats - base: tokens, fonts, reset, typography, layout primitives
   ========================================================================== */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;

  /* surfaces */
  --bg-0: #0b0d0f;
  --bg-1: #111519;
  --bg-2: #171c21;
  --bg-3: #1e252b;
  --bg-4: #28313a;
  --line: #262e36;
  --line-2: #36414b;

  /* text (all pass WCAG AA on --bg-0..--bg-2) */
  --text: #ece8dc;
  --text-2: #b9bcb9;
  --text-3: #8f969b;

  /* PUBG amber + tactical palette */
  --amber: #f2a900;
  --amber-2: #ffc02e;
  --amber-3: #c98a00;
  --amber-ink: #1a1304;
  --amber-a: rgba(242, 169, 0, 0.12);
  --amber-b: rgba(242, 169, 0, 0.3);
  --khaki: #bfae78;
  --olive: #7f9440;
  --olive-2: #a4bb5c;
  --red: #e5484d;
  --blue: #4aa3ff;
  --green: #58c27d;

  /* geometry */
  --radius: 6px;
  --radius-lg: 10px;
  --header-h: 64px;
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 32px);

  /* type */
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-head: 'Barlow Condensed', 'Barlow', system-ui, 'Arial Narrow', sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 28px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg-0);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg-0);
  background-image: radial-gradient(1200px 520px at 85% -120px, rgba(242, 169, 0, 0.07), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* The decorative contour-line texture is added after the page has loaded (see main.js), so it never competes with real content. */
body.has-topo {
  background-image: radial-gradient(1200px 520px at 85% -120px, rgba(242, 169, 0, 0.07), transparent 70%), url('/assets/img/topo.svg');
  background-repeat: no-repeat, repeat;
  background-size: auto, 640px;
  background-attachment: scroll, fixed;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--amber); color: var(--amber-ink); }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; letter-spacing: 0.04em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
small { font-size: 0.85em; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.amber { color: var(--amber); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 1000;
  background: var(--amber); color: var(--amber-ink); font-weight: 700;
  padding: 10px 16px; border-radius: var(--radius);
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Scrollbars (subtle, tactical) */
* { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-track { background: transparent; }
