/* base.css: shared by the three Tokenshire website samples (2026-10-31). Tokens are the game's own (stage.html :root,
   Game Dev/patterns/jrpg-ui); fonts are self-hosted (OFL, licences beside them). Sample-grade: the real build
   converts the TTFs to woff2 and preloads them. */
@font-face { font-family: 'Pixelify Sans'; src: url(fonts/PixelifySans.ttf) format('truetype'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url(fonts/Atkinson.ttf) format('truetype'); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #1b1226; --night: #0b0d1a; --night-2: #121633;
  --win-top: #3a4fb0; --win-mid: #1c2670; --win-bot: #111850; --win-edge: #f2f2ff;
  --gold: #f0c84a; --gold-deep: #b98a1e; --text: #ffffff; --muted: #b8c0ea;
  --ok: #8de08a; --work: #7fd0ff; --wait: #ffe066; --err: #ff5a4a; --idle: #c8b8ff;
  --pixel: 'Pixelify Sans', ui-monospace, monospace;
  --read: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --gutter: 16px; --dur-fast: .18s; --dur: .32s; --ease-out: cubic-bezier(.22,.61,.36,1);
}
@media (min-width: 780px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; overflow-x: clip; }
/* No ligatures: Pixelify Sans's "fi" ligature draws like an "A" ("fills" read "Alls", "battlefield" "battleAeld").
   On every element and !important, because the `font:` shorthand used all over resets font-variant-ligatures (and, in
   Chrome, font-feature-settings too) on each element that sets it, so a rule on html alone is undone a level down. */
*, *::before, *::after { font-variant-ligatures: none !important; }
body { margin: 0; background: var(--night); color: var(--text); font: 17px/1.45 var(--read); overflow-x: clip;
  -webkit-tap-highlight-color: transparent; }
img, canvas, video { display: block; max-width: 100%; }
.px, canvas.spr, .px img { image-rendering: pixelated; image-rendering: crisp-edges; }
/* a sprite's size is its whole-number scale, set by sprite.js; max-width would squash it to a fractional size */
canvas.spr { max-width: none; flex: none; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.12; margin: 0 0 .4em; text-wrap: balance; }
p { margin: 0 0 .8em; text-wrap: pretty; }
a { color: var(--gold); text-underline-offset: .18em; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--gold); color: var(--ink);
  font: 600 16px var(--pixel); border-radius: 4px; }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* the game's JRPG window */
.win { background: linear-gradient(180deg, var(--win-top) 0%, var(--win-mid) 55%, var(--win-bot) 100%);
  border: 2px solid var(--win-edge); box-shadow: 0 0 0 2px var(--ink), 0 10px 28px rgba(0,0,0,.45); border-radius: 6px;
  text-shadow: 1px 1px 0 var(--ink); padding: 18px 20px; }
.win p { color: #e6e9ff; }

/* buttons: flat, named for their action. Gold = the one main action. */
.btn { display: inline-flex; align-items: center; gap: .5em; min-height: 48px; padding: 0 20px; border-radius: 4px; font: 600 18px var(--pixel);
  text-decoration: none; cursor: pointer; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn--go { background: var(--gold); color: var(--ink); text-shadow: none; }
.btn--ghost { background: rgba(11,13,26,.55); color: var(--text); border-color: var(--win-edge); }
@media (hover: hover) and (pointer: fine) { .btn--go:hover { background: #ffd968; } .btn--ghost:hover { background: rgba(58,79,176,.6); } }

/* the gold cursor of the game's menus */
.cursor::before { content: ''; display: inline-block; width: 0; height: 0; border-left: 9px solid var(--gold); border-top: 6px solid transparent;
  border-bottom: 6px solid transparent; margin-right: 10px; animation: nudge .6s steps(2) infinite; filter: drop-shadow(1px 1px 0 var(--ink)); }
@keyframes nudge { 50% { transform: translateX(3px); } }

.pill { display: inline-block; font: 600 14px var(--pixel); padding: 2px 10px; border-radius: 99px; color: var(--ink); text-shadow: none; }
.pill--work { background: var(--work); } .pill--idle { background: var(--idle); } .pill--wait { background: var(--wait); }
.pill--err { background: var(--err); } .pill--ok { background: var(--ok); }

.pause { position: fixed; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 60; min-height: 44px; padding: 0 14px; font: 600 15px var(--pixel);
  color: var(--text); background: rgba(17,24,80,.85); border: 2px solid var(--win-edge); border-radius: 4px; box-shadow: 0 0 0 2px var(--ink); cursor: pointer; }

.demo-tag { font: 600 14px var(--pixel); color: var(--wait); }
.sample-note { font: 14px/1.4 var(--read); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html.is-still *, html.is-still *::before { animation-play-state: paused !important; }
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
