/* Shared Hotolosophy games shell. First-party only: system fonts, no images, no external requests. */
:root {
  /* Older Main Street tokens, kept because some games still use them inside the play area. The shell chrome below uses the calm tokens. */
  --pop-ink: #0b0b0b; --pop-paper: #ffffff; --pop-red: #e4202b; --pop-yellow: #ffd500; --pop-blue: #1f4fe0; --pop-sky: #7fc4ff; --pop-green: #0f9d58;
  --bg: #f7f5f0;
  --ink: #0b0b0b;
  --muted: #2a2a2a;
  --panel: #ffffff;
  --border: #0b0b0b;
  --accent: #1f4d36;
  --accent-ink: #ffffff;
  --btn2: #ffffff;
  --btn2-ink: #1f4d36;
  --focus: #0b0b0b;
  --halo: #ffd500;
  --tile-a: #c9f2d9;
  --tile-b: #cfe6ff;
  --outside: #d6ebff;
  --note: #ffd500;
  /* Calm chrome (same as the site): 1px warm border, 12px cards, 10px buttons, soft shadow. Used by the header, panels and buttons. */
  --chrome-line: #ddd8ce;
  --chrome-field: #767061;
  --chrome-note: #e8f1ea;
  --chrome-radius: 12px;
  --chrome-btn-radius: 10px;
  --chrome-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  /* Inside the play areas some games keep their own thick outlines, radii and offset shadows. Pixel sprites stay crisp. */
  --radius: 18px;
  --radius-sm: 14px;
  --line: 4px;
  --shadow-ink: #0b0b0b;
  --shadow: 4px 4px 0 var(--shadow-ink);
  --hatch: rgba(11, 11, 11, .16);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
/* Dusk: the calm dark choice in Calm settings. */
[data-calm-theme="dusk"] {
  --bg: #1F2B33;
  --ink: #E6EDEA;
  --muted: #A9B8B8;
  --panel: #263642;
  --border: #8FA6A6;
  --accent: #9CC9B4;
  --accent-ink: #1F2B33;
  --focus: #F2D58A;
  --tile-a: #2A3A45;
  --tile-b: #30424E;
  --outside: #3A4650;
  --note: #2A3A45;
  --halo: #000000;
  --shadow-ink: #162029;
  --hatch: rgba(230, 237, 234, .16);
  --btn2: #263642;
  --btn2-ink: #B3D9C6;
  --chrome-line: #8FA6A6;
  --chrome-field: #8FA6A6;
  --chrome-note: #2A3A45;
  --chrome-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
/* Meadow Circle cosmetic themes (unlocked by playing) override the calm choice when picked. */
[data-theme="autumn"] {
  --bg: #f6ead8;
  --ink: #3a2512;
  --muted: #5a4430;
  --panel: #fff8ec;
  --border: #7a5a3a;
  --accent: #7a5a14;
  --accent-ink: #ffffff;
  --focus: #1a4fa3;
  --tile-a: #f0dcbc;
  --tile-b: #e8d0a8;
  --outside: #d8cdbd;
  --note: #f2e2c8;
  --shadow-ink: #7a5a3a;
  --hatch: rgba(58, 37, 18, .16);
  --btn2: #fff8ec;
  --btn2-ink: #7a5a14;
  --chrome-line: #d8c6ab;
  --chrome-field: #7a5a3a;
  --chrome-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;
  --halo: #000000;
  --shadow-ink: #10142a;
  --hatch: rgba(238, 240, 251, .16);
  --btn2: #1f2640;
  --btn2-ink: #b9c4ff;
  --chrome-line: #8d97c4;
  --chrome-field: #8d97c4;
  --chrome-note: #232b4a;
  --chrome-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 100%; scroll-padding-top: 7rem; } /* keeps focused items clear of the sticky 988/911 bar */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  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.
   Main Street look changes colors only. Wording, size and layout are as before (link border is paid for with less side padding). */
.crisis-bar { position: sticky; top: 0; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 10px; padding: 0 16px; background: #ffffff; color: #0b0b0b; font-size: 1rem; line-height: 1.25; text-align: center; border-bottom: 2px solid #0b0b0b; box-shadow: 0 5px 0 #0b0b0b; }
.crisis-bar a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 7px; border: 3px solid #0b0b0b; border-radius: 999px; background: #ffd500; color: #0b0b0b; font-weight: 900; text-decoration: none; box-shadow: 2px 2px 0 #0b0b0b; }
.crisis-bar a[href="tel:911"] { background: #e4202b; color: #ffffff; }
.crisis-bar a:focus-visible { outline: 4px solid #0b0b0b; outline-offset: 3px; box-shadow: 0 0 0 7px #ffd500; }
@media (max-width: 480px) { .crisis-bar { gap: 0 6px; padding-inline: 8px; font-size: .875rem; } .crisis-bar a { padding: 0 3px; } }

.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 1001; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; background: #ffffff; color: #1f2a24; border: 2px solid #1f4d36; border-radius: 10px; }
/* Focused, the skip link sits at the very top and the 988/911 bar slides down below it (the bar wraps to two rows on a
   phone), so the bar is never covered. Only the bar moves, with a transform, so nothing on the page shifts under a
   pointer when the link loses focus. 60px clears the 44px link, its 4px offset and its focus halo. */
.skip-link { white-space: nowrap; }
.skip-link:focus { top: 4px; }
body:has(> .skip-link:focus) > .crisis-bar { transform: translateY(60px); }

.game-shell { max-width: 60rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
/* The game header: a plain card with a quiet green label above the title. */
.game-header { position: relative; overflow: hidden; margin-bottom: 1rem; padding: 1rem; background: var(--panel); border: 1px solid var(--chrome-line); border-radius: var(--chrome-radius); box-shadow: var(--chrome-shadow); }
.street-tag { display: block; width: fit-content; margin: 0 0 .25rem; padding: 0; background: transparent; color: var(--accent); border: 0; font-size: 1rem; font-weight: 600; letter-spacing: .02em; }
.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(--chrome-note); color: var(--ink); border: 1px solid var(--chrome-line); border-radius: var(--chrome-radius); font-size: .95rem; }

/* Panels: plain cards with a 1px warm border, 12px corners and a soft shadow. */
.panel { background: var(--panel); border: 1px solid var(--chrome-line); border-radius: var(--chrome-radius); padding: .9rem 1rem; margin: 0 0 1rem; box-shadow: var(--chrome-shadow); }
.panel > :last-child { margin-bottom: 0; }

select, input[type="number"], input[type="file"]::file-selector-button {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--chrome-field);
  border-radius: var(--chrome-btn-radius);
  padding: .5rem .8rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  box-shadow: none;
}
/* Buttons, the same system as the site: outlined by default, solid green for the one main action (button.primary). */
button, .button {
  font: inherit;
  font-weight: 600;
  color: var(--btn2-ink);
  background: var(--btn2);
  border: 1px solid currentColor;
  border-radius: var(--chrome-btn-radius);
  padding: .5rem .8rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  box-shadow: none;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button, .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
button:hover:not([aria-disabled="true"]) { filter: brightness(.96); }
/* The press lift only runs when motion is allowed (the OS setting and the games' own Calm choice). */
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) button:active:not([aria-disabled="true"]) { transform: translateY(1px); }
}
button[aria-disabled="true"] { opacity: 1; border-style: dashed; border-color: var(--chrome-field); color: var(--muted); background: var(--panel); cursor: default; box-shadow: none; }
input[type="number"] { width: 5rem; cursor: text; box-shadow: none; }
select { max-width: 100%; }
label:has(> select) { max-width: 100%; }
label { display: inline-block; }
:focus-visible { outline: 5px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 9px var(--halo); }

.top-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: .5rem; }
.top-row .leave { margin-bottom: 0; }
.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; }
}
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation: none !important; transition: none !important; }

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

/* Wrapper for the comfort bar and the how-to: gives them a landmark; adds no box of its own. */
.before-play { display: contents; }
