/* Shared Hotolosophy games shell. First-party only: system fonts, no images, no external requests. */
:root {
  /* Theme: clover green, calm blue and white. Autumn and Moonlight below are unlockable themes. */
  --bg: #f6faf3;
  --ink: #12261a;
  --muted: #3d5444;
  --panel: #ffffff;
  --border: #3d6b48;
  --accent: #2e7d32;
  --accent-ink: #ffffff;
  --focus: #0b4f8a;
  --tile-a: #e1f0da;
  --tile-b: #d3e6f3;
  --outside: #cfdbd3;
  --note: #e8f3e2;
  --font: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
[data-theme="autumn"] {
  --bg: #f6ead8;
  --ink: #3a2512;
  --muted: #5a4430;
  --panel: #fff8ec;
  --border: #7a5a3a;
  --accent: #8a3d14;
  --accent-ink: #ffffff;
  --focus: #1a4fa3;
  --tile-a: #f0dcbc;
  --tile-b: #e8d0a8;
  --outside: #d8cdbd;
  --note: #f2e2c8;
}
[data-theme="moonlight"] {
  --bg: #161b30;
  --ink: #eef0fb;
  --muted: #b9bfdc;
  --panel: #1f2640;
  --border: #8d97c4;
  --accent: #b9c4ff;
  --accent-ink: #161b30;
  --focus: #ffd479;
  --tile-a: #262e4d;
  --tile-b: #2d3558;
  --outside: #3a3f52;
  --note: #232b4a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; letter-spacing: .02em; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
a { color: inherit; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 988 / 911 bar: sticky above everything, including pause and leave panels, which are in-page and never cover it. */
.crisis-bar { position: sticky; top: 0; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding: 6px 16px; background: #0b2a3f; color: #ffffff; font-size: .95rem; text-align: center; border-bottom: 4px solid #e08a77; }
.crisis-bar a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px; background: #ffffff; color: #8f2b1c; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.crisis-bar a:focus-visible { outline: 4px solid #ffe08a; outline-offset: 2px; }

.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 1001; padding: .5rem .75rem; background: var(--panel); border: 2px solid var(--border); }
.skip-link:focus { top: 3.5rem; }

.game-shell { max-width: 60rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
.game-header { margin-bottom: 1rem; }
.game-header .leave { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .5rem; font-weight: 700; }
.tagline { color: var(--muted); }
.optional-note { padding: .6rem .8rem; background: var(--note); border: 2px solid var(--border); font-size: .95rem; }

/* Chunky 8-bit panels: stepped corners and a hard offset shadow, no blur, no gradients. */
.panel { background: var(--panel); border: 3px solid var(--border); padding: .9rem 1rem; margin: 0 0 1rem; box-shadow: 4px 4px 0 var(--border); clip-path: none; }
.panel > :last-child { margin-bottom: 0; }

button, .button, select, input[type="number"], input[type="file"]::file-selector-button {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid var(--border);
  padding: .5rem .8rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--border);
}
button.primary { background: var(--accent); color: var(--accent-ink); }
button:hover { filter: brightness(.96); }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }
button[aria-disabled="true"] { opacity: 1; border-style: dashed; color: var(--muted); cursor: default; box-shadow: none; }
input[type="number"] { width: 5rem; cursor: text; box-shadow: none; }
label { display: inline-block; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }

.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.pill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

.px { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

/* Motion: nothing here animates by default; the few state transitions are removed for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active { transform: none; }
}
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
[data-motion="reduced"] button:active { transform: none; }

@media (forced-colors: active) {
  .panel, button { border-color: CanvasText; }
}
