/* Road Brawl legal pages (terms, privacy, refunds): the game's own kit art and fonts ("junkyard premium",
   docs/DESIGN.md section 13). Static files: they work without the game's code and read well on phones.
   Art: public/assets/ui (generated by tools/optimize-assets.mjs); slice insets from public/assets/ui/manifest.json. */
@import url('../assets/ui/fonts/fonts.css');

:root {
  --ink: #0b0c0e; --gun: #1b1d21; --steel: #4a515b; --off: #efe9df; --warm: #b8b0a4; --orange: #ff6a13; --yellow: #ffc21a;
  --disp: 'RB Display', Impact, 'Arial Narrow Bold', sans-serif;
  --label: 'RB Label', 'RB Display', 'Arial Narrow', sans-serif;
  --body: 'RB Body', 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --k: 1;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; min-height: 100vh; color: var(--off); background: var(--ink) url(../assets/ui/panels/bg_metal_tile.webp) 0 0 / 256px;
  font-family: var(--body); font-weight: 500; font-size: 19px; line-height: 1.55; overflow-x: hidden;
}
/* warm low sun from the top left, dark edges (as the boot screen) */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 75% 55% at 18% -5%, rgba(255, 150, 60, 0.2), transparent 70%), radial-gradient(ellipse 110% 90% at 50% 35%, transparent 45%, rgba(11, 12, 14, 0.88));
}
.lg { position: relative; z-index: 1; width: min(100% - 32px, 980px); margin: 0 auto; padding: 22px 0 40px; }

/* ---------------------------------------------------------------- top bar: logo + page buttons */
.lg-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
  border-style: solid; border-width: 28px 64px 24.5px; border-image: url(../assets/ui/panels/header_bar.webp) 56 128 49 128 fill / 28px 64px 24.5px stretch;
  margin: 0 -10px; padding: 0 0 2px; min-height: 104px;
}
.lg-logo { display: flex; flex-direction: column; align-items: center; line-height: 0.8; transform: rotate(-4deg); text-decoration: none; margin: -14px 0 -12px -22px; }
.lg-logo span {
  font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 40px; letter-spacing: 0.01em; color: #ffb52e;
  -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 3px 4px 0 var(--ink);
}
.lg-logo:hover span, .lg-logo:focus-visible span { color: #ffd166; }
.lg-nav { display: flex; gap: 6px 4px; flex-wrap: wrap; justify-content: flex-end; margin-right: -30px; }

/* kit buttons: btn_secondary plate, btn_primary for the page you are on, hover and pressed art */
.lg-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 116px;
  border-style: solid; border-width: 9.5px 17.5px 10px 28px; border-image: url(../assets/ui/buttons/btn_secondary.webp) 19 35 20 56 fill / 9.5px 17.5px 10px 28px stretch;
  padding: 0 4px 0 0; text-decoration: none; transition: transform 0.12s cubic-bezier(0.3, 1.6, 0.5, 1), filter 0.12s;
  font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 21px; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--off); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 1.5px 2px 0 var(--ink); white-space: nowrap;
}
.lg-btn:hover, .lg-btn:focus-visible { border-image-source: url(../assets/ui/buttons/btn_secondary__hover.webp); transform: translateY(-1px) scale(1.03); outline: none; }
.lg-btn:focus-visible { filter: drop-shadow(0 0 6px rgba(239, 233, 223, 0.55)); }
.lg-btn:active { border-image-source: url(../assets/ui/buttons/btn_secondary__pressed.webp); transform: translateY(1px) scale(0.97); }
.lg-btn[aria-current='page'], .lg-btn--play {
  border-image: url(../assets/ui/buttons/btn_primary.webp) 23 41 23 63 fill / 11.5px 20.5px 11.5px 31.5px stretch; border-width: 11.5px 20.5px 11.5px 31.5px;
  color: var(--ink); -webkit-text-stroke: 0; text-shadow: 0 1.5px 0 rgba(255, 255, 255, 0.35);
}
.lg-btn[aria-current='page']:hover, .lg-btn--play:hover, .lg-btn--play:focus-visible { border-image-source: url(../assets/ui/buttons/btn_primary__hover.webp); }
.lg-btn--play:active { border-image-source: url(../assets/ui/buttons/btn_primary__pressed.webp); }
.lg-btn[aria-current='page'] { pointer-events: none; }

/* ---------------------------------------------------------------- page title on the hazard ribbon */
.lg-head { margin: 34px 0 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.lg-title {
  margin: 0; display: inline-flex; align-items: center; justify-content: center; min-height: 102px; max-width: 100%;
  border-style: solid; border-width: 24.5px 44px 17.5px 44.5px; border-image: url(../assets/ui/ribbons/ribbon_title.webp) 49 88 35 89 fill / 24.5px 44px 17.5px 44.5px stretch;
  padding: 0 34px 4px;
  font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 46px; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--off); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 2px 3px 0 var(--ink);
}
.lg-meta { font-family: var(--label); font-weight: 700; font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--warm); }

/* ---------------------------------------------------------------- plates */
.lg-panel {
  margin-top: 22px; border-style: solid; border-width: 28px 38px 25.5px; border-image: url(../assets/ui/panels/panel_main.webp) 56 76 51 76 / 28px 38px 25.5px stretch;
  padding: 4px 6px 10px;
  /* long pages: the plate's own centre would stretch into streaks, so the interior is the tiled metal in its colour */
  background: url(../assets/ui/panels/bg_metal_tile.webp) 0 0 / 256px, #232628; background-clip: padding-box;
}
.lg-short {
  margin-top: 22px; border-style: solid; border-width: 25px 28.5px 19px; border-image: url(../assets/ui/panels/panel_inset.webp) 50 57 38 57 fill / 25px 28.5px 19px stretch;
  padding: 2px 6px 8px; display: grid; grid-template-columns: 52px 1fr; gap: 0 14px; align-items: start;
}
.lg-short > img { width: 52px; height: 52px; margin-top: 6px; filter: drop-shadow(2px 3px 0 var(--ink)); }
.lg-short h2 { margin: 6px 0 6px; font-family: var(--label); font-weight: 800; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); line-height: 1.1; }
.lg-short ul { margin: 0; }

/* section headers on the section ribbon */
.lg-panel h2 {
  display: flex; align-items: center; width: fit-content; max-width: 100%; min-height: 42px; margin: 34px 0 12px -14px;
  border-style: solid; border-width: 17.5px 75px 16.5px 53px; border-image: url(../assets/ui/ribbons/ribbon_section.webp) 35 150 33 106 fill / 17.5px 75px 16.5px 53px stretch;
  padding: 0 4px 0 2px; font-family: var(--label); font-weight: 800; font-size: 20px; line-height: 1.05; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--off); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
}
.lg-panel > h2:first-child, .lg-panel > section:first-child > h2:first-child { margin-top: 6px; }
.lg-panel h3 { margin: 22px 0 6px; font-family: var(--label); font-weight: 800; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); }
p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding: 0; list-style: none; }
li { position: relative; padding-left: 26px; margin: 0 0 7px; }
/* hazard chevron bullets */
li::before {
  content: ''; position: absolute; left: 2px; top: 0.52em; width: 12px; height: 12px;
  background: linear-gradient(135deg, var(--yellow), var(--orange)); clip-path: polygon(0 0, 55% 0, 100% 50%, 55% 100%, 0 100%, 45% 50%);
}
strong { font-weight: 600; color: #fff7ec; }
a { color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--yellow); }
.lg-panel a { overflow-wrap: anywhere; }
.lg-note { color: var(--warm); font-size: 17px; }

/* placeholders the operators must fill before relying on the page */
.lg-ph {
  display: inline; padding: 0 5px; border: 2px dashed var(--yellow); border-radius: 2px; background: rgba(255, 194, 26, 0.12);
  color: var(--yellow); font-family: var(--label); font-weight: 700; letter-spacing: 0.04em; font-size: 0.92em; white-space: normal;
}

/* table of contents chips */
.lg-toc { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 4px; padding: 0; }
.lg-toc li { padding: 0; margin: 0; }
.lg-toc li::before { display: none; }
.lg-toc a {
  display: inline-flex; align-items: center; min-height: 26.5px; border-style: solid; border-width: 11px 10.5px 11px 25.5px;
  border-image: url(../assets/ui/panels/plate_chip.webp) 22 21 22 51 fill / 11px 10.5px 11px 25.5px stretch;
  font-family: var(--label); font-weight: 700; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--off); text-decoration: none; line-height: 1;
  padding: 0 2px; margin-top: -6px;
}
.lg-toc a:hover, .lg-toc a:focus-visible { color: var(--yellow); }

/* the index page: three big plates */
.lg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.lg-card {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--off);
  border-style: solid; border-width: 28px 38px 25.5px; border-image: url(../assets/ui/panels/panel_main.webp) 56 76 51 76 fill / 28px 38px 25.5px stretch;
  padding: 0 0 6px; transition: transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1), filter 0.14s;
}
.lg-card:hover, .lg-card:focus-visible { transform: translateY(-3px); filter: drop-shadow(0 0 10px rgba(255, 106, 19, 0.35)); outline: none; color: var(--off); }
.lg-card img { width: 48px; height: 48px; filter: drop-shadow(2px 3px 0 var(--ink)); }
.lg-card b { font-family: var(--disp); font-weight: 900; font-style: italic; font-size: 30px; line-height: 1; text-transform: uppercase; color: #ffb52e; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 2px 3px 0 var(--ink); }
.lg-card span { color: var(--warm); font-size: 17px; line-height: 1.4; }

/* ---------------------------------------------------------------- footer */
.lg-foot {
  margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  font-family: var(--label); font-weight: 700; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--warm);
}
.lg-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.lg-foot a { color: var(--off); text-decoration: none; }
.lg-foot a:hover, .lg-foot a:focus-visible { color: var(--yellow); }
.lg-stripe { height: 10px; margin-top: 26px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px); opacity: 0.85; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
  body { font-size: 17.5px; line-height: 1.5; }
  .lg { padding-top: 12px; }
  .lg-top { justify-content: center; border-width: 22px 40px 19px; border-image-width: 22px 40px 19px; margin: 0 -8px; min-height: 0; padding-bottom: 4px; }
  .lg-logo { margin: -6px 0 2px; }
  .lg-logo span { font-size: 32px; -webkit-text-stroke: 6px var(--ink); }
  .lg-nav { justify-content: center; margin: 0 -24px; }
  .lg-btn { min-width: 0; min-height: 44px; font-size: 18px; padding: 0 2px 0 0; }
  .lg-head { margin-top: 24px; }
  .lg-title { font-size: clamp(26px, 8.4vw, 40px); min-height: 80px; border-width: 19px 30px 14px; border-image-width: 19px 30px 14px; padding: 0 16px 3px; -webkit-text-stroke: 5px var(--ink); }
  .lg-panel { border-width: 20px 18px 18px; border-image-width: 20px 26px 18px; padding: 2px 0 6px; margin-left: -6px; margin-right: -6px; }
  .lg-short { grid-template-columns: 1fr; border-width: 20px 18px 15px; border-image-width: 20px 22px 15px; margin-left: -6px; margin-right: -6px; }
  .lg-short > img { width: 40px; height: 40px; margin: 0; }
  .lg-panel h2 { font-size: 17px; margin-left: -6px; border-width: 15px 40px 14px 42px; border-image-width: 15px 40px 14px 42px; min-height: 36px; }
  .lg-cards { grid-template-columns: 1fr; }
  .lg-foot { justify-content: center; text-align: center; }
  .lg-foot nav { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  body::before, .lg-top, .lg-stripe, .lg-toc { display: none; }
  .lg-panel, .lg-short, .lg-title, .lg-panel h2 { border: 0; border-image: none; padding: 0; color: #000; -webkit-text-stroke: 0; text-shadow: none; }
  a { color: #000; }
}
