/* The Mods page (index.html here is written by tools/pages/build.mjs; this file is not).
   Colours, type and frames are the game's (src/pixel/pixel.css; docs/pixel-style-guide.md) and
   match the Pixel Update page, whose two fonts this page shares. */
:root {
  --surface-page: #171b2e;
  --surface-panel: #2b444b;
  --surface-panel-light: #43616a;
  --surface-panel-dark: #1d3037;
  --surface-well: #141829;
  --action-fill: #e6d5ae;
  --action-selected: #ddb555;
  --action-selected-light: #f1d78d;
  --action-selected-dark: #99732e;
  --text-primary: #ece8dc;
  --text-secondary: #aab8d0;
  --text-on-action: #2e2a30;
  --text-gold: #e8d488;
  --focus-ring: #e8d488;
  --frame-outline: #0f1220;
  --font-label: 'Silkscreen', ui-monospace, monospace;
  --font-body: 'Jersey 10', system-ui, sans-serif;
}

@font-face { font-family: Silkscreen; src: url('../pixel-update/fonts/silkscreen.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jersey 10'; src: url('../pixel-update/fonts/jersey-10.woff2') format('woff2'); font-weight: 400; font-display: swap; }

* { box-sizing: border-box; }
html { background: var(--surface-page); scroll-padding-top: 64px; }
body { margin: 0; color: var(--text-primary); background: var(--surface-page); font: 400 20px/24px var(--font-body); font-synthesis: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3, .brand, .button, .section-nav, .tag, .facts { font-family: var(--font-label); font-weight: 400; }
h1 { font-size: 64px; line-height: 72px; }
h2 { font-size: 48px; line-height: 56px; }
h3 { font-size: 16px; line-height: 24px; }
a { color: inherit; text-underline-offset: 4px; touch-action: manipulation; }
a:hover { color: var(--focus-ring); }
img { display: block; }
.pixel { image-rendering: pixelated; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.wrap { width: calc(100% - 64px); max-width: 1280px; margin-inline: auto; }

.skip { position: fixed; z-index: 100; top: -120px; left: 16px; background: var(--action-fill); color: var(--text-on-action); padding: 12px; }
.skip:focus { top: 16px; }

.button { display: inline-flex; align-items: center; justify-content: center; position: relative; min-width: 200px; min-height: 56px; padding: 12px 20px; border: 2px solid var(--frame-outline); background: var(--action-selected); color: var(--text-on-action); box-shadow: inset 2px 2px 0 var(--action-selected-light), inset -2px -4px 0 var(--action-selected-dark); font-size: 16px; line-height: 24px; text-decoration: none; }
.button:hover { background: var(--action-selected-light); color: var(--text-on-action); }
.button:active { top: 2px; box-shadow: inset 2px 2px var(--action-selected-dark); }

/* The top: the game's name, the page's, what mods are, and Play */
.top { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 48px 32px 40px; }
.brand { font-size: 16px; line-height: 24px; }
.lead { max-width: 880px; font-size: 40px; line-height: 44px; text-wrap: balance; }
.top .button { margin-top: 12px; }

.section-nav { position: sticky; top: 0; z-index: 30; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; background: var(--surface-well); padding: 0 16px; border-block: 2px solid var(--frame-outline); }
.section-nav a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; font-size: 12px; line-height: 20px; white-space: nowrap; text-decoration: none; }

/* One section for the mods every character can buy, then one for each character's own */
.band { padding-block: 48px; border-bottom: 2px solid var(--frame-outline); scroll-margin-top: 16px; }
.band h2 { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 28px; text-align: center; }

.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.mod { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px; background: var(--surface-panel); border: 2px solid var(--frame-outline); box-shadow: inset 2px 2px 0 var(--surface-panel-light), inset -2px -2px 0 var(--surface-panel-dark); scroll-margin-top: 64px; }
.mod:target { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.mod-text { display: grid; gap: 8px; }
/* A rule, as the shop shows it: its trigger on a tag, then what it does, its numbers picked out */
.tag { display: inline-block; margin-right: 2px; padding: 2px 6px; font-size: 12px; line-height: 14px; white-space: nowrap; vertical-align: 2px; color: var(--text-gold); background: rgba(8, 9, 12, 0.35); }
.rule b { font-weight: 400; color: var(--text-gold); }
.once { color: var(--text-secondary); }
/* What it costs, where it is sold and what opens it */
.facts { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 4px; font-size: 12px; line-height: 20px; color: var(--text-secondary); }

.ending { display: grid; gap: 20px; justify-items: center; padding: 32px 16px 48px; }
.ending .button { font-size: 24px; line-height: 32px; min-height: 72px; padding-inline: 32px; }
.ending > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; }

@media (max-width: 767px) {
  h1 { font-size: 48px; line-height: 56px; }
  h2 { font-size: 32px; line-height: 40px; }
  .wrap { width: calc(100% - 32px); }
  .top { padding: 32px 16px 28px; }
  .lead { font-size: 20px; line-height: 24px; }
  /* One row that scrolls sideways, so the bar that stays on screen stays one line tall */
  .section-nav { justify-content: flex-start; flex-wrap: nowrap; gap: 0; padding-inline: 8px; overflow-x: auto; scrollbar-width: none; }
  .section-nav a { flex: none; padding: 8px; }
  .band { padding-block: 32px; }
  .band h2 { margin-bottom: 20px; }
  .mods { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mod { padding: 12px; gap: 12px; }
  .ending { padding: 24px 16px 32px; }
  .ending .button { font-size: 16px; line-height: 24px; padding-inline: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: top 80ms steps(2, start); }
}
@media (forced-colors: active) {
  .button, .mod { border: 2px solid CanvasText; }
}
