:root {
  color-scheme: light;
  font-family: "Public Sans", Arial, sans-serif;
  color: #171717;
  background: #fff8ec;
  --ink: #171717;
  --paper: #fff8ec;
  --muted: #49433c;
  --yellow: #fdfd96;
  --green: #40d39c;
  --blue: #b9e2f8;
  --purple: #ded0f2;
  --red: #ffc5c8;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, textarea { font: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; line-height: 1.05; letter-spacing: -0.055em; text-transform: uppercase; }
h2 { font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
:focus-visible { outline: 3px solid #005c99 !important; outline-offset: 4px; }
.page-shell { width: 100%; max-width: 88rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem); }
.muted, .label { color: var(--muted); font-size: 14px; line-height: 1.6; }
.label { font-size: 13px; font-weight: 700; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.text-link { font-size: 14px; font-weight: 800; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.nb-card { max-width: none; border-radius: 0; }
/* These are workspaces, not clickable cards: hovering must not shift editors. */
.nb-card:hover { transform: none; box-shadow: 8px 8px 0 #000; }
.card { margin: 0; padding: 1.5rem; }
.nb-button { min-height: 2.75rem; font-family: inherit !important; line-height: 1.4; border-radius: 0; }
.nb-button.default, .nb-button.green, .nb-button.orange, .nb-button.blue { text-transform: none; }
.nb-button.green, .nb-button.orange { color: #171717; }
.nb-button.green:hover, .nb-button.green:focus { background: #74e5b9; color: #171717; }
.nb-button.orange:hover, .nb-button.orange:focus { background: #ff9278; color: #171717; }
.nb-button.default:hover, .nb-button.default:focus { background: var(--yellow); }
.nb-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.nb-input.default, .nb-textarea { font-family: inherit; font-weight: 500; border-radius: 0; min-width: 0; }
.nb-input.default { min-height: 2.75rem; }
.nb-input.default:hover { background: #fffef5; }
.nb-input.default:focus { background: #fff; transform: none; }
.nb-textarea { min-height: 11rem; box-shadow: 3px 3px 0 #000; }
input::placeholder, textarea::placeholder { color: #61594d; opacity: 1; }
input[type="file"] { font-size: 12px; }
input::file-selector-button { padding: 0.5rem; margin-right: 0.65rem; border: 2px solid var(--ink); background: var(--blue); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
label { font-size: 14px; font-weight: 800; }
.field .muted { font-size: 12px; }
.field-error { color: #a01720; font-size: 13px; font-weight: 700; line-height: 1.5; }
.field-error:empty { display: none; }
[aria-invalid="true"] { outline: 3px solid #a01720; outline-offset: 2px; }
.view-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.view-header .eyebrow { margin-bottom: 0.6rem; }
.view-header .muted { margin-top: 0.65rem; max-width: 42rem; }
.view-header > a { flex-shrink: 0; }
.library { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.challenge { overflow: hidden; }
.challenge-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1.25rem; }
.challenge h2 { overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 0.85rem; width: 100%; margin-top: auto; padding-top: 0.5rem; }
.status, .selected-label { display: inline-block; width: fit-content; border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); padding: 0.3rem 0.65rem; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.status.started { background: var(--green); }
.status.finished { background: var(--purple); }
.notice { background: #d2f7e6; color: var(--ink); }
.error { background: var(--red); color: #70101a; }
count-down { display: inline-block; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 0.1rem 0.65rem; background: var(--yellow); color: var(--ink); font: 800 1.1rem/1.4 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
count-down[data-urgent] { background: var(--red); color: #70101a; }
.watch-ended, .scoreboard-title { display: inline-block; padding: 0.35rem 1rem; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: var(--purple); color: var(--ink); font-size: 1rem; font-weight: 900; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; }
.lobby-page #join-game { max-width: 32rem; margin-bottom: 2rem; background: var(--yellow); }
.lobby-page .empty { padding: 2rem 0; color: var(--muted); font-weight: 700; }
.home-page { min-height: 100dvh; display: grid; place-items: center; padding: 2rem; background: var(--purple); }
.home-card { max-width: 48rem; padding: clamp(1.5rem, 5vw, 4rem); gap: 1.5rem; background: var(--yellow); }
.home-card h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); }
.home-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
@media (max-width: 700px) {
  .page-shell { padding: 1.5rem 1rem; }
  .view-header { align-items: flex-start; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
  .card { padding: 1.25rem; }
  .home-page { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
