/* shootyshoot.com: the holler, as the game's HUD draws it
   (crates/render/src/hud_style.rs; decision 0048 §1). Dark stained wood,
   tin trim and rivets, stencilled paint. Dark only.

   The palette is the HUD's, colour for colour; change it there first.
   The wood is the HUD's own recipe (`wood_pixels`), drawn by
   site/art/wood.py into web/wood.png as grey and multiplied by its brown
   here (--wood-brown), which is exactly the HUD's colour.
   No inline style anywhere (the CSP refuses it): every look is here. */

@font-face {
  font-family: "Stardos Stencil";
  src: url("/fonts/StardosStencil-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* hud_style.rs, sRGB 0-1 to 0-255. */
  --plate: rgb(41 26 15 / 0.80);       /* PLATE: a dark stained board */
  --plate-edge: rgb(168 179 189 / 0.55); /* PLATE_EDGE: a line of tin */
  --tin: rgb(158 166 173);             /* TIN: trim, a rivet's head */
  --tin-dark: rgb(77 79 84);           /* TIN_DARK: the line inside the trim */
  --paint: rgb(242 232 204);           /* PAINT: stencilled labels */
  --ready: rgb(140 235 115);           /* READY: good to go */
  --shadow: rgb(0 0 0 / 0.85);         /* SHADOW: the edge behind words */
  --ink: rgb(255 255 255 / 0.95);      /* INK: words */
  --ink-dim: rgb(204 214 230 / 0.80);  /* INK_DIM: the quieter words */
  --accent: rgb(255 204 92);           /* ACCENT: what is yours or lit */
  --gold: rgb(255 219 89);             /* GOLD */
  --alert: rgb(255 107 82);            /* ALERT: a warning */
  --wood: rgb(69 46 26 / 0.94);        /* WOOD_BASE: a panel's brown */
  /* wood_pixels' brown, (0.44, 0.29, 0.17): the grey wood times this. */
  --wood-brown: rgb(112 74 43);
  /* The page behind the boards: the wood in the shade. */
  --night: rgb(22 15 9);
  --radius: 2px;                       /* RADIUS_PX: a board's corners */
  --stencil: "Stardos Stencil", Impact, "Arial Narrow", sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* A rivet: a tin head with a glint, a dark rim. */
  --rivet: radial-gradient(circle at 40% 38%, rgb(226 230 234) 0 0.9px, var(--tin) 1.5px 2.4px,
    var(--tin-dark) 2.8px 3.3px, transparent 3.7px);
}

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

[hidden] {
  display: none !important;
}

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 17px/1.55 var(--font);
  overflow-wrap: break-word;
  /* Boards of the HUD's wood in the shade, their grain running across. */
  background-color: var(--wood-brown);
  background-image:
    linear-gradient(180deg, rgb(14 9 5 / 0.70), rgb(10 6 3 / 0.86) 60%, rgb(8 5 2 / 0.92)),
    url("/wood.png");
  background-size: auto, 720px 256px;
  background-blend-mode: normal, multiply;
  background-attachment: fixed, scroll;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--gold);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
.stencil {
  font-family: var(--stencil);
  font-weight: 700;
  color: var(--paint);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 var(--shadow), 0 0 6px var(--shadow);
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.6rem);
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  margin: 0 0 0.6em;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 0.4em;
}

strong {
  color: var(--paint);
}

em {
  color: var(--paint);
}

/* ------------------------------------------------------------ the header */

header.holler {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.6rem;
  padding: 0.85rem max(1.25rem, calc((100% - 960px) / 2 + 1.25rem));
  background-color: var(--wood-brown);
  background-image:
    linear-gradient(180deg, rgb(255 240 210 / 0.06), rgb(0 0 0 / 0.30)),
    url("/wood.png");
  background-size: auto, 720px 256px;
  background-blend-mode: normal, multiply;
  border-bottom: 3px solid var(--tin);
  box-shadow: 0 1px 0 var(--tin-dark), 0 8px 22px rgb(0 0 0 / 0.55);
}

header.holler::before,
header.holler::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 8px;
  height: 8px;
  background: var(--rivet);
}

header.holler::before {
  left: 8px;
}

header.holler::after {
  right: 8px;
}

header.holler .title {
  font-family: var(--stencil);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--paint);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 0 var(--shadow), 0 0 10px rgb(0 0 0 / 0.6);
}

header.holler nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
}

header.holler nav a {
  font-family: var(--stencil);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paint);
  opacity: 0.82;
  text-decoration: none;
  letter-spacing: 0.05em;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
  text-shadow: 0 1px 0 var(--shadow);
}

header.holler nav a:hover {
  opacity: 1;
}

header.holler nav a[aria-current="page"] {
  opacity: 1;
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* -------------------------------------------------------------- the page */

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* A board: a stained plate in a tin frame, riveted at its four corners. */
.board {
  position: relative;
  background: var(--plate);
  border: 2px solid var(--tin);
  border-radius: var(--radius);
  outline: 1px solid var(--tin-dark);
  padding: 1.6rem 1.8rem;
  margin: 0 0 1.5rem;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.55), inset 0 12px 30px rgb(0 0 0 / 0.25),
    0 10px 26px rgb(0 0 0 / 0.5);
}

.board::before {
  content: "";
  position: absolute;
  inset: 3px;
  pointer-events: none;
  background:
    var(--rivet) left top / 8px 8px no-repeat,
    var(--rivet) right top / 8px 8px no-repeat,
    var(--rivet) left bottom / 8px 8px no-repeat,
    var(--rivet) right bottom / 8px 8px no-repeat;
}

/* A board of the wood itself, a little lit: the big panels. */
.board.wood {
  background-color: var(--wood-brown);
  background-image:
    linear-gradient(180deg, rgb(20 12 6 / 0.50), rgb(16 10 5 / 0.70)),
    url("/wood.png");
  background-size: auto, 720px 256px;
  background-blend-mode: normal, multiply;
}

.board > :last-child {
  margin-bottom: 0;
}

.board p {
  margin: 0 0 0.9em;
}

.dim {
  color: var(--ink-dim);
}

.small {
  font-size: 0.88rem;
}

.good {
  color: var(--ready);
}

.warn {
  color: var(--alert);
}

.gold {
  color: var(--gold);
}

code,
.mono {
  font-family: var(--mono);
}

.lead {
  font-size: 1.15rem;
  color: var(--ink);
}

.kicker {
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.2rem 0 0;
}

/* ------------------------------------------------------ buttons, fields */

.button,
button {
  display: inline-block;
  font-family: var(--stencil);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: rgb(30 19 8);
  background: linear-gradient(180deg, var(--gold), var(--accent));
  border: 2px solid var(--tin);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--tin-dark), 0 3px 0 rgb(0 0 0 / 0.5);
  padding: 0.5rem 1.15rem 0.45rem;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  color: rgb(30 19 8);
  background: var(--gold);
}

.button:active,
button:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 1px var(--tin-dark), 0 2px 0 rgb(0 0 0 / 0.5);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.button.quiet,
button.quiet {
  color: var(--paint);
  background: rgb(0 0 0 / 0.3);
}

.button.quiet:hover,
button.quiet:hover {
  color: var(--accent);
  background: rgb(0 0 0 / 0.45);
}

label {
  display: block;
  margin: 0 0 0.9rem;
  color: var(--ink-dim);
}

input,
textarea,
select {
  display: block;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.25rem;
  font: inherit;
  color: var(--ink);
  background: rgb(0 0 0 / 0.4);
  border: 1px solid var(--plate-edge);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
}

/* ----------------------------------------------------------------- tables */

.fit {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgb(77 79 84 / 0.7);
  vertical-align: top;
}

th {
  font-family: var(--stencil);
  font-weight: 700;
  color: var(--paint);
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--tin-dark);
  white-space: nowrap;
}

tbody tr:hover td {
  background: rgb(255 255 255 / 0.03);
}

tr.you td {
  background: rgb(255 204 92 / 0.10);
}

tr.you td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td .when {
  display: block;
}

/* A stencilled tag: "Bot", "Left early", "Abandoned". */
.tag {
  display: inline-block;
  font-family: var(--stencil);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  padding: 0.05rem 0.4rem 0;
  border: 1px solid currentcolor;
  border-radius: var(--radius);
  vertical-align: 0.12em;
  white-space: nowrap;
}

.tag.bot {
  color: var(--tin);
}

.tag.left {
  color: var(--accent);
}

.tag.abandoned {
  color: var(--alert);
}

.tag.won {
  color: var(--ready);
}

@media (min-width: 681px) {
  table.scores {
    table-layout: fixed;
  }

  table.scores th:first-child {
    width: 30%;
  }
}

/* A team's board wears its side's tape along its top. */
.board.team-blue {
  border-top: 4px solid rgb(92 156 255);
}

.board.team-red {
  border-top: 4px solid rgb(255 92 82);
}

/* -------------------------------------------------------------- the home */

.hero {
  padding: 0;
  overflow: hidden;
}

.hero::before {
  z-index: 1;
}

.hero-art {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 2px solid var(--tin);
}

.hero-words {
  padding: 1.5rem 1.8rem 1.8rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 1.1rem + 3.4vw, 3rem);
  max-width: 24ch;
}

.story {
  counter-reset: chapter;
}

.chapter h2::before {
  counter-increment: chapter;
  content: counter(chapter, decimal-leading-zero);
  display: inline-block;
  min-width: 2.2em;
  color: var(--accent);
  opacity: 0.8;
}

.chapter p {
  max-width: 44rem;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}

.side {
  background: rgb(0 0 0 / 0.25);
  border: 1px solid var(--tin-dark);
  border-left: 6px solid;
  padding: 0.9rem 1rem 0.2rem;
}

.side-hail {
  border-left-color: var(--accent);
}

.side-hush {
  border-left-color: var(--tin);
}

.facts,
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgb(77 79 84 / 0.7);
}

.facts li:last-child {
  border-bottom: 0;
}

.facts .stencil {
  display: block;
  color: var(--accent);
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.steps {
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 1rem 3.2rem;
  min-height: 2.6rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 2.3rem;
  height: 2.3rem;
  font-family: var(--stencil);
  font-size: 1.4rem;
  line-height: 2.45rem;
  text-align: center;
  color: rgb(30 19 8);
  background: var(--accent);
  border: 2px solid var(--tin);
  border-radius: 50%;
}

/* ------------------------------------------------------------ the status */

.board .status-word {
  font-family: var(--stencil);
  font-size: clamp(3rem, 2rem + 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0.05em;
  margin: 0.2rem 0 0.4rem;
  text-shadow: 0 2px 0 var(--shadow), 0 0 18px rgb(0 0 0 / 0.6);
}

.board .status-line {
  font-size: 1.25rem;
  margin-bottom: 1.1rem;
  color: var(--paint);
}

.is-online {
  color: var(--paint);
}

.is-starting,
.is-stopping {
  color: var(--accent);
}

.is-up {
  color: var(--ready);
}

.is-down {
  color: var(--alert);
}

.is-unknown {
  color: var(--ink-dim);
}

.banner {
  background: rgb(255 219 89 / 0.08);
  border: 1px solid rgb(255 219 89 / 0.5);
  border-left: 5px solid var(--gold);
  padding: 0.7rem 0.9rem;
}

.banner .stencil {
  color: var(--gold);
  margin-right: 0.3rem;
}

table.modes {
  margin: 0 0 1rem;
}

dl.words {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.2rem;
  margin: 0;
}

dl.words dt {
  font-family: var(--stencil);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

dl.words dd {
  margin: 0;
  color: var(--ink-dim);
}

.graph-box {
  margin: 1.2rem 0 0.3rem;
  padding: 0.8rem 0.8rem 0.4rem;
  background: rgb(0 0 0 / 0.35);
  border: 1px solid var(--tin-dark);
}

svg.graph {
  display: block;
  width: 100%;
  height: 130px;
}

.graph .bar {
  fill: var(--tin);
}

.graph .bar.hot {
  fill: var(--alert);
}

.graph .bar:hover {
  fill: var(--accent);
}

.graph .grid {
  stroke: var(--tin-dark);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.graph .base {
  stroke: var(--tin);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.graph-box figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-top: 0.3rem;
}

.report {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tin-dark);
}

.report .stencil {
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
}

.reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

button.reason {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--paint);
  background: rgb(0 0 0 / 0.3);
  box-shadow: none;
  padding: 0.4rem 0.8rem;
}

button.reason:hover {
  color: var(--accent);
  background: rgb(0 0 0 / 0.45);
}

button.reason[aria-pressed="true"] {
  color: rgb(30 19 8);
  background: var(--accent);
}

.said {
  min-height: 1.5em;
  margin: 0.8rem 0 0;
  color: var(--paint);
}

/* ---------------------------------------------------------- the downloads */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 1.2rem;
}

.card {
  display: flex;
  flex-direction: column;
}

.card p:last-child {
  margin-top: auto;
}

/* ------------------------------------------------------------ the profile */

.player-name {
  font-size: clamp(2rem, 1.3rem + 3vw, 3rem);
  margin-bottom: 0.2rem;
}

.rank {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.rank > div {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-size: 1.8rem;
  color: var(--gold);
  margin: 0 0 0.2rem;
}

svg.insignia {
  flex: none;
  width: 84px;
  height: 84px;
  padding: 8px;
  background: rgb(0 0 0 / 0.4);
  border: 2px solid var(--tin);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--tin-dark);
}

.insignia .stripe {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linejoin: miter;
}

.insignia .bar {
  fill: var(--tin);
}

.insignia .star {
  fill: var(--gold);
}

svg.meter {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: 10px;
  margin: 0.2rem 0 0.4rem;
  border: 1px solid var(--tin-dark);
}

.meter .track {
  fill: rgb(0 0 0 / 0.5);
}

.meter .fill {
  fill: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.7rem;
  background: rgb(0 0 0 / 0.28);
  border: 1px solid var(--tin-dark);
}

.stat .value {
  font-family: var(--stencil);
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--paint);
  font-variant-numeric: tabular-nums;
}

.stat .label {
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.favourite .stencil {
  color: var(--accent);
  margin-right: 0.3rem;
}

.achievements {
  list-style: none;
  margin: 0;
  padding: 0;
}

.achievements li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgb(77 79 84 / 0.7);
  color: var(--ink-dim);
}

.achievements li:last-child {
  border-bottom: 0;
}

.achievements .stencil {
  font-size: 1.15rem;
  color: var(--ink-dim);
}

.achievements .what {
  grid-column: 1;
  font-size: 0.92rem;
}

.achievements .when {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.9rem;
  text-align: right;
}

.achievements li.earned .stencil {
  color: var(--gold);
}

.achievements li.earned .when {
  color: var(--ready);
}

/* ------------------------------------------------------------- the footer */

footer.holler {
  padding: 1rem 1.5rem;
  color: var(--ink-dim);
  font-size: 0.9rem;
  text-align: center;
  border-top: 2px solid var(--tin-dark);
  background: rgb(0 0 0 / 0.45);
}

footer.holler p {
  margin: 0;
}

/* ---------------------------------------------------------- small screens */

@media (max-width: 680px) {
  .two {
    grid-template-columns: 1fr;
  }

  .wide {
    display: none;
  }

  dl.words {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  dl.words dd {
    margin-bottom: 0.6rem;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  header.holler {
    padding: 0.7rem 1rem;
    gap: 0.3rem 1rem;
  }

  header.holler .title {
    font-size: 1.75rem;
  }

  header.holler nav {
    gap: 0.15rem 0.85rem;
  }

  header.holler nav a {
    font-size: 0.98rem;
  }

  main {
    padding: 1.2rem 0.75rem 2rem;
  }

  .board {
    padding: 1.2rem 1rem;
  }

  .hero {
    padding: 0;
  }

  .hero-words {
    padding: 1.1rem 1rem 1.3rem;
  }

  th,
  td {
    padding: 0.4rem 0.35rem;
  }

  .rank {
    gap: 0.9rem;
  }

  svg.insignia {
    width: 64px;
    height: 64px;
    padding: 6px;
  }

  .rank-name {
    font-size: 1.45rem;
  }
}
