/* The game's own fonts (addons/outpost_ui): Barlow Condensed for headings and plates, as its menus have (SemiBold for what
   heads, Medium for what's on a plate), Inter for paragraphs, which read better wide on a page. OFL: fonts/. */
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* The HUD's palette (SkirmishHudChrome, OutpostUIStyle). */
:root {
  --ground: #17140f;
  --panel: #2b211b;
  --chrome: #202522;
  --chrome-hover: #30352f;
  --edge: #83715a;
  --edge-dim: #4a4033;
  --cream: #f6e8cc;
  --quiet: #dccdb3;
  --gold: #f1b92e;
  --blue: #438fff;
  --rust: #a74328;
  --gutter: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* (even on what sets its own display: a flex row with nothing to show takes room) */
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--cream);
  font: 400 17px/1.55 "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.display { font-family: "Barlow Condensed", "Oswald", Impact, sans-serif; font-weight: 600; }

/* ---- The top bar: chips like the HUD's resource cards ---- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 2; display: flex; justify-content: space-between; gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 10px;
  background: linear-gradient(#2c2f2b, #1c1f1c); border: 2px solid var(--edge-dim); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.45);
  font-weight: 700; font-size: 15px; white-space: nowrap; text-decoration: none;
}
.chip img { width: 24px; height: 24px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #7a7468; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.dot.on { background: #49cf69; }
.dot.off { background: #ef4b43; }

/* ---- Hero: the home screen's landscape, the logo, the Start plate ---- */
.hero {
  position: relative; min-height: min(100svh, 860px); display: grid; place-items: center; text-align: center;
  padding: 96px var(--gutter) 72px; isolation: isolate; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("background.webp") center 40% / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(23,20,15,0) 30%, rgba(23,20,15,.45) 75%),
    linear-gradient(to bottom, rgba(23,20,15,.15) 0%, rgba(23,20,15,0) 35%, rgba(23,20,15,.55) 75%, var(--ground) 100%);
}
.hero > div { width: 100%; max-width: 900px; min-width: 0; }
.logo { width: min(640px, 92vw); height: auto; margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.55)); }
.tagline {
  margin: 18px auto 30px; max-width: 34ch; font-size: clamp(30px, 4.8vw, 46px); line-height: 1.05;
  text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 4px 18px rgba(0,0,0,.6);
}
.platforms { margin: 14px 0 0; color: var(--cream); font-weight: 700; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }

/* ---- Plates: the game's buttons, nine-sliced (plate_choice_on / _off: 85 px corners) ---- */
.plate {
  display: inline-grid; place-items: center; min-height: 64px; padding: 6px 40px 4px; min-width: 260px;
  border: 26px solid transparent; border-image: url("plate-on.webp") 85 fill / 26px stretch;
  color: var(--cream); text-decoration: none; font-family: "Barlow Condensed", Impact, sans-serif; font-weight: 500; font-size: 36px;
  text-shadow: 0 2px 0 rgba(0,0,0,.45); filter: drop-shadow(0 6px 10px rgba(0,0,0,.5));
  transition: transform .08s ease;
}
.plate > span { margin: -22px -10px; }
.plate:hover { border-image-source: url("plate-on-hover.webp"); }
.plate:active { border-image-source: url("plate-on-pressed.webp"); transform: translateY(1px); }
.plate:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.plate.plain { border-image-source: url("plate-off.webp"); font-size: 28px; min-width: 0; min-height: 52px; }
.plate.plain:hover { border-image-source: url("plate-off-hover.webp"); }
.plate[aria-disabled="true"] { filter: grayscale(.55) brightness(.75) drop-shadow(0 4px 8px rgba(0,0,0,.5)); cursor: default; pointer-events: none; }

/* ---- Panels: the HUD's painted metal panel (metal_panel: 133 px corners) ---- */
main { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.panel {
  border: 34px solid transparent; border-image: url("panel.webp") 133 fill / 34px stretch;
  padding: 6px 4px 8px; margin: 0 0 28px; filter: drop-shadow(0 10px 22px rgba(0,0,0,.5));
}
.panel h2 { margin: -8px 0 6px; font-size: 38px; color: var(--gold); }
.panel .lede { margin: 0 0 20px; color: var(--quiet); max-width: 60ch; }

/* Units: tiles like the production deck's */
.roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1040px) { .roster { grid-template-columns: repeat(2, 1fr); } }
.unit {
  background: linear-gradient(#232622, #1b1d1a); border: 1px solid #3a3a33; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05); padding: 14px 14px 16px; text-align: center;
}
.portrait { width: 148px; height: 148px; margin: -6px auto 0; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); }
.unit h3 { margin: 4px 0 0; font-size: 32px; line-height: 1; }
.meta { display: flex; justify-content: center; gap: 14px; margin: 6px 0 8px; color: var(--quiet); font-weight: 700; font-size: 14px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta img { width: 18px; height: 18px; }
.unit p { margin: 0; font-size: 15px; color: var(--quiet); line-height: 1.45; }

/* Features: cards like the Mentor's */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.features.pairs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.feature { background: rgba(0,0,0,.18); border: 1px solid #3a3027; border-radius: 6px; padding: 14px 16px; }
.feature h3 { margin: 0 0 4px; color: var(--gold); font-size: 27px; }
.feature h3 { display: flex; align-items: center; gap: 10px; }
.feature h3 img { flex: none; width: 28px; height: 28px; }
.watch-link img { display: inline-block; width: 20px; height: 20px; margin-right: 6px; vertical-align: -4px; }
.feature p { margin: 0; color: var(--cream); }

/* Download */
#download { text-align: center; scroll-margin-top: 24px; }
#download .lede { margin-inline: auto; }
.downloads { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; }
.soon { display: block; font-family: "Inter", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); margin-top: 2px; text-shadow: none; }

footer { text-align: center; color: #8d8270; font-size: 14px; padding: 0 var(--gutter) max(32px, env(safe-area-inset-bottom)); }
footer a { color: inherit; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding-top: 84px; }
  .hero::before { background-image: url("background-phone.webp"); background-position: 70% center; }
  .chip.wide { display: none; }
  .panel { border-width: 22px; border-image-width: 22px; padding: 4px 0 6px; }
  .panel h2 { font-size: 33px; }
  .plate { min-width: 0; width: 100%; max-width: 340px; }
  .roster { grid-template-columns: 1fr; }
  .portrait { width: 128px; height: 128px; }
  .unit { display: grid; grid-template-columns: 112px 1fr; text-align: left; column-gap: 12px; align-items: center; padding: 10px 12px; }
  .unit .portrait { width: 112px; height: 112px; margin: 0; grid-row: span 3; }
  .unit .meta { justify-content: flex-start; margin: 4px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .plate { transition: none; } }

/* ---- The leaderboard and player pages (assets/players.js) ---- */
.page-bar {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; max-width: 1100px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 16px;
}
.page-title { margin: 8px 0 18px; font-size: clamp(44px, 7.5vw, 70px); line-height: 1; overflow-wrap: anywhere; }
.page-title small { color: var(--quiet); font-size: .55em; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); gap: 10px; }
.card { background: rgba(0,0,0,.24); border: 1px solid #3a3027; border-radius: 6px; padding: 10px 8px 8px; text-align: center; }
.card b { display: block; font-family: "Barlow Condensed", Impact, sans-serif; font-weight: 600; font-size: 38px; line-height: 1; overflow-wrap: anywhere; }
.card span { color: var(--quiet); font-size: 14px; }
.table-scroll { overflow-x: auto; }
table.board { width: 100%; border-collapse: collapse; font-size: 16px; }
.board th { text-align: right; color: var(--quiet); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; }
.board td { text-align: right; padding: 9px 10px; border-top: 1px solid #3a3027; font-variant-numeric: tabular-nums; }
.board tbody tr:nth-child(odd) { background: rgba(0,0,0,.2); }
.board .left { text-align: left; }
.board a { font-weight: 700; text-decoration: none; }
.board a:hover, .board a:focus-visible { color: var(--gold); text-decoration: underline; }
.tag { color: var(--quiet); font-weight: 400; font-size: 14px; }
.place { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 5px; background: #3b3026; font-family: "Barlow Condensed", Impact, sans-serif; font-size: 21px; }
.place.p1 { background: #f1b92e; color: #241a13; }
.place.p2 { background: #c9ced6; color: #241a13; }
.place.p3 { background: #c98a4b; color: #241a13; }
.won { color: #66d77f; font-weight: 700; }
.lost { color: #ef7b6f; font-weight: 700; }
.form { display: flex; gap: 5px; margin: 0 0 12px; align-items: center; color: var(--quiet); font-size: 14px; flex-wrap: wrap; }
.pip { width: 24px; height: 24px; border-radius: 4px; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #17140f; }
.pip.w { background: #66d77f; }
.pip.l { background: #ef7b6f; }
.pages { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; color: var(--quiet); }
.say { color: var(--quiet); text-align: center; padding: 22px 0; margin: 0; }
.note { color: var(--quiet); font-size: 14px; margin: 14px 0 0; }
.note.under-panel { text-align: center; margin: 0 0 12px; }
.more { text-align: center; margin: 16px 0 0; }
.say p { margin: 0 0 14px; }
.search { display: flex; gap: 10px; margin: 0 0 14px; }
.search input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; color: var(--cream); background: rgba(0,0,0,.3); border: 2px solid var(--edge-dim); border-radius: 10px; font: inherit; }
.search input::placeholder { color: var(--quiet); }
.search input::-webkit-search-cancel-button { display: none; }  /* (Clear does it, and the results too) */
.search input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.search .chip { padding: 0 14px; color: inherit; font-family: inherit; cursor: pointer; }
.found:not(:empty) { margin: 0 0 18px; }
.found-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--quiet); min-height: 40px; margin-bottom: 6px; }
.found-line .chip { flex: none; height: 34px; padding: 0 12px; color: inherit; font-family: inherit; cursor: pointer; }
.nobody { text-align: center; padding: 28px 0 18px; }
.nobody h3 { margin: 0 0 6px; font-size: 32px; line-height: 1.1; }
.nobody p { margin: 0; color: var(--quiet); }
.nobody .plate { margin-top: 20px; }
.share { margin: 0 0 14px; }
.share .chip { padding: 0 14px; color: inherit; font-family: inherit; cursor: pointer; }
a.won, a.lost { text-decoration: underline; }
@media (max-width: 600px) {
  .wide-only { display: none; }
  .board th, .board td { padding: 8px 6px; }
}

/* ---- Gameplay videos (assets/videos.js) ---- */
.hero-loop { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.hero-loop.playing { opacity: 1; }
.watch-link { margin: 10px 0 0; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.watch-link a { color: var(--gold); }
#watch { scroll-margin-top: 24px; }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.player video { display: block; width: 100%; height: 100%; }
.shots h3 { margin: 22px 0 10px; color: var(--gold); font-size: 28px; }
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0; background: transparent; }
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgba(0,0,0,.88); }
.viewer img { display: block; max-width: min(100%, 1280px); max-height: 100%; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.7); }
.viewer-button { position: absolute; width: 48px; height: 48px; padding: 0; color: var(--cream); background: rgba(20,18,14,.8); border: 2px solid var(--edge-dim); border-radius: 10px; font: 700 30px/1 "Inter", sans-serif; cursor: pointer; }
.viewer-button:hover { background: rgba(60,52,40,.95); }
.viewer-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.viewer-button.close { top: 16px; right: 16px; }
.viewer-button.previous { left: 16px; top: calc(50% - 24px); }
.viewer-button.next { right: 16px; top: calc(50% - 24px); }
.stills:empty { aspect-ratio: 32 / 9; }
.stills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stills a { display: block; cursor: zoom-in; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.stills img { display: block; width: 100%; height: 100%; object-fit: cover; }
