/* Borders at War website. Tokens match src/client/styles.css. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2-variations");
}

:root {
  --bg: #0d0e11;
  --surface: #16171b;
  --surface-2: #1c1d22;
  --surface-3: #24262c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eef0f3;
  --muted: #959ba6;
  --dim: #626873;
  --primary: #2f6bff;
  --primary-2: #4b80ff;
  --warn: #e7b443;
  --warn-bg: rgba(231, 180, 67, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: block; width: 200px; }
.brand svg { width: 100%; height: auto; }

/* buttons, tabs and cards: same shapes as the game (src/client/styles.css) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.15s, transform 0.08s; }
.btn:hover { background: #2c2e35; }
.btn:active { transform: scale(0.97); }
/* the game's #2f6bff with white text is 4.499:1, just under WCAG AA; this is the same blue a hair darker (4.75:1) */
.btn.primary { background: #2b67fa; border-color: transparent; color: #fff; }
.btn.primary:hover { background: #2560f0; }
.btn.big { height: 52px; padding: 0 26px; font-size: 16px; font-weight: 700; }
.btn.big svg { width: 18px; height: 18px; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[aria-pressed="true"] { background: #18213a; border-color: rgba(47, 107, 255, 0.45); color: #dfe7ff; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabs { display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; height: 46px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--primary-2); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }

/* hero: a rendered battle with the game's own units behind the header and hero text */

.top.over { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.hero-band { position: relative; padding-top: 76px; background: var(--bg) url("/hero-battle-1000.jpg") 62% 40% / cover no-repeat; }
.hero-band::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(to bottom, rgba(13, 14, 17, 0.7) 0, rgba(13, 14, 17, 0.25) 120px, rgba(13, 14, 17, 0.35) 55%, var(--bg) 100%),
  linear-gradient(to right, rgba(13, 14, 17, 0.85) 0, rgba(13, 14, 17, 0.55) 45%, rgba(13, 14, 17, 0.15) 100%); }
.hero-band > .hero { position: relative; }
.hero-text { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55); }
.hero { display: grid; gap: 36px; padding-top: 36px; padding-bottom: 56px; }
h1 { margin: 0; max-width: 12ch; font-size: clamp(40px, 10vw, 68px); line-height: 1.03; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.lead { margin: 20px 0 0; max-width: 50ch; font-size: clamp(17px, 2vw, 19px); line-height: 1.55; color: #c9ced6; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 30px; }
.cta-note { font-size: 14px; color: var(--muted); }

/* unit viewer */
.viewer-stage { position: relative; aspect-ratio: 4 / 3; }
.viewer-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewer canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: var(--surface); touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 0.3s; }
.viewer.static .tabs, .viewer.static .viewer-pick, .viewer.static .viewer-hint { display: none; }
.viewer.ready canvas { opacity: 1; }
.viewer canvas:active { cursor: grabbing; }
.viewer-info { padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.viewer-info h2 { margin: 0; font-size: 17px; font-weight: 700; }
.viewer-info p { margin: 2px 0 0; font-size: 14px; color: var(--muted); min-height: 3em; }
.viewer-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.viewer-info .viewer-hint { margin-top: 14px; min-height: 0; font-size: 12px; color: var(--muted); }

/* what kind of game */
.about { display: grid; gap: 28px; padding-top: 56px; padding-bottom: 56px; }
.about h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.about-text p { margin: 14px 0 0; max-width: 56ch; color: #c9ced6; text-wrap: pretty; }
.about-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.about-steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.about-steps li:first-child { padding-top: 0; }
.about-steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.about-steps li::before { content: counter(step); grid-row: span 2; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary-2); line-height: 1.5; }
.about-steps h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.5; }
.about-steps p { margin: 2px 0 0; font-size: 15px; color: var(--muted); text-wrap: pretty; }

/* the world */
.world { border-top: 1px solid var(--line); padding-top: 56px; padding-bottom: 56px; }
.world h2, .more h2, .closing h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.world-text { max-width: 640px; }
.world-text p { margin: 14px 0 0; color: #c9ced6; text-wrap: pretty; }
.world-map { margin: 32px 0 0; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.world-map img { width: 100%; height: auto; }

/* more */
.more { border-top: 1px solid var(--line); padding-top: 56px; padding-bottom: 24px; }
.more-list { margin-top: 12px; }
.more-list > div { padding: 22px 0; border-bottom: 1px solid var(--line); }
.more-list > div:last-child { border-bottom: 0; }
.more-list h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.more-list p { margin: 0; max-width: 60ch; font-size: 15px; color: var(--muted); text-wrap: pretty; }

/* closing call */
.closing { border-top: 1px solid var(--line); }
.closing-in { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding-top: 48px; padding-bottom: 52px; }
.closing p { margin: 8px 0 0; color: var(--muted); }

/* footer */
.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-direction: column; gap: 14px; padding-top: 26px; padding-bottom: 34px; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a, .foot button { padding: 10px 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.foot a:hover, .foot button:hover { color: var(--text); }
.foot small { font-size: 13px; color: var(--muted); }

/* cookie notice (only shown when a Google Analytics ID is set in site.js) */
.consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 20; max-width: 560px; margin: 0 auto; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.consent p { margin: 0; font-size: 14px; color: #c9ced6; }
.consent a { color: var(--primary-2); }
.consent-actions { display: flex; gap: 10px; margin-top: 14px; }
.consent-actions .btn { flex: 1; }
.back { margin-top: 28px; }
.doc code { font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }

/* legal draft pages */
.doc { max-width: 760px; padding-top: 36px; padding-bottom: 72px; }
.doc h1 { max-width: none; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; }
.doc .updated { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.doc h2 { margin: 40px 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.doc p, .doc li { color: #c9ced6; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--primary-2); }
.draft { margin: 0 0 32px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--warn-bg); border: 1px solid rgba(231, 180, 67, 0.45); color: #f3dca3; font-size: 15px; }
.draft b { color: var(--warn); }
.todo { padding: 1px 6px; border-radius: 5px; background: var(--warn-bg); color: var(--warn); font-weight: 600; white-space: nowrap; }
.note { margin: 0 0 14px; padding: 12px 14px; border-left: 3px solid var(--warn); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; color: var(--muted); }
.note b { color: var(--warn); }

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .brand { width: 224px; }
  .foot-in { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 1000px) {
  .hero-band { background-image: url("/hero-battle.jpg"); }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: center; gap: 56px; padding-top: 64px; padding-bottom: 88px; }
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; padding-top: 80px; padding-bottom: 80px; }
  .world { padding-top: 80px; padding-bottom: 80px; }
  .more { padding-top: 80px; padding-bottom: 56px; }
  .more-list { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 28px; }
  .more-list > div { padding: 0 28px; border-bottom: 0; border-left: 1px solid var(--line); }
  .more-list > div:first-child { padding-left: 0; border-left: 0; }
  .closing-in { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .viewer canvas { transition: none; }
}
