/* The site's Ballance theme (docs/.vitepress/theme/ballance.css), dusk variant: the menu's dark
   translucent panels with silver rims and the gold highlight, under the sunset sky. */
:root {
  color-scheme: dark;
  --peach: #f4a46b;
  --sunset: #e8835a;
  --rose: #f2b6a0;
  --gold: #d9a441;
  --silver: #c9cdd6;
  --silver-dark: #8b909c;
  --rail: #5d6f9e;
  --flame: #ff3fa4;
  --bg: #17141c;
  --bg-alt: #121016;
  --bg-soft: #231e2a;
  --panel: rgba(40, 34, 48, 0.82);
  --divider: #3a3343;
  --text: #f1e8de;
  --text-2: #c4b7aa;
  --ok: #9fd18b;
  --warn: #e6b65a;
  --bad: #ff7cc0;
  --rim: linear-gradient(90deg, var(--silver-dark), var(--silver) 30%, var(--gold) 50%, var(--silver) 70%, var(--silver-dark));
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); font: 15px/1.6 var(--font); }
html { background: var(--bg); }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 15% -10%, rgba(232, 131, 90, 0.28), transparent 60%),
    radial-gradient(900px 420px at 90% -5%, rgba(242, 182, 160, 0.16), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(93, 111, 158, 0.18), transparent 60%),
    var(--bg);
}
a { color: var(--peach); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .88em; background: rgba(255, 255, 255, 0.07); padding: .1em .35em; border-radius: 4px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 1.5rem 0 .5rem; width: fit-content;
  background: linear-gradient(115deg, var(--peach) 10%, var(--sunset) 35%, var(--rose) 60%, var(--gold) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--silver); }
.small { font-size: .85rem; color: var(--text-2); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 24px; height: 60px; background: rgba(23, 20, 28, 0.92); backdrop-filter: blur(8px); }
.bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--rim); opacity: .85; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 600; font-size: 15px;
  letter-spacing: .12em; text-transform: uppercase; }
.bar nav { display: flex; gap: 1.2rem; font-size: .9rem; }
.bar nav a { color: var(--text-2); }
.bar nav a[aria-current] { color: var(--peach); }

main { max-width: 1100px; margin: 0 auto; padding: 8px 24px 32px; }
.lead { color: var(--text-2); max-width: 60rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 1.2rem 0; }
/* The menu's panels: dark glass with a silver rim. */
.card { background: linear-gradient(160deg, rgba(48, 42, 56, 0.9), rgba(28, 24, 33, 0.92));
  border: 1px solid rgba(201, 205, 214, 0.25); border-radius: 14px; padding: 18px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.25); }
.card ul { padding-left: 1.2rem; margin: 0; }
.card li { margin: .35rem 0; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .8rem 0; }

/* Buttons: the menu's pills, silver-rimmed; the primary one lit like the selected entry. */
button { font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: .45rem 1.15rem;
  border: 1px solid var(--silver-dark); background: rgba(40, 34, 48, 0.9); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
button:hover { background: rgba(58, 50, 68, 0.95); border-color: var(--silver); }
button.primary { background: linear-gradient(180deg, #8f5a4a, #6c4038); border-color: var(--gold); color: #fff6ec;
  box-shadow: 0 0 0 1px rgba(217, 164, 65, 0.35), 0 6px 18px rgba(232, 131, 90, 0.25); }
button.primary:hover { background: linear-gradient(180deg, #a26655, #7b4a40); }
button.link { background: none; border: none; box-shadow: none; padding: .45rem .2rem; color: var(--peach); font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.checks { list-style: none; padding: 0 !important; margin: .8rem 0 0 !important; }
.checks li { padding-left: 1.4rem; position: relative; }
.checks li::before { position: absolute; left: 0; font-weight: 700; }
.checks li.ok::before { content: "+"; color: var(--ok); }
.checks li.bad { color: var(--bad); }
.checks li.bad::before { content: "x"; }
progress { width: 100%; height: 10px; accent-color: var(--sunset); margin-top: .8rem; }

.message { max-width: 60rem; padding: .6rem 1rem; border-radius: 10px; border-left: 4px solid var(--sunset); background: var(--panel); }
.message.warn { border-color: var(--warn); }
.message.error { border-color: var(--flame); }

/* The game: 4:3 in the window; the game letterboxes itself in fullscreen. */
#game { margin: 1rem 0; }
.stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; margin: 0 auto;
  width: min(100%, calc((100vh - 150px) * 4 / 3)); aspect-ratio: 4 / 3;
  box-shadow: 0 0 0 1px rgba(201, 205, 214, 0.5), 0 0 0 3px rgba(217, 164, 65, 0.3), 0 18px 40px rgba(0, 0, 0, 0.45); }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.stage:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin-top: .8rem; }
.toolbar button { padding: .35rem .9rem; font-size: .85rem; }

#controls { margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--divider); }
th { color: var(--text-2); font-weight: 600; }
tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }

dialog { background: var(--bg-soft); color: var(--text); border: 1px solid rgba(201, 205, 214, 0.3); border-radius: 14px; max-width: 640px; width: 90vw; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
textarea { width: 100%; font: 13px/1.45 var(--mono); background: var(--bg-alt); color: var(--text); border: 1px solid var(--divider); border-radius: 8px; padding: .6rem; }
.error { color: var(--bad); white-space: pre-wrap; font-size: .85rem; }
.foot .powered { margin: 0 0 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.foot .powered img { display: block; }
.foot { max-width: 1100px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--divider); color: var(--text-2); font-size: .8rem; text-align: center; }

[hidden] { display: none !important; }
@media (max-width: 640px) { .bar nav a:not([aria-current]):not(:last-child) { display: none; } }
