/* CCN Casual Games Kit · the shared look: CCN orange on ink, plain and legible on phones.
   © Computational Classnotes · CC BY-NC-SA 4.0 */
:root {
  --ink: #17202b; --orange: #fa8f2b; --orange-ink: #a35206; --paper: #fffaf4; --soft: #f1e9df; --line: #e3d6c6;
  --ok: #15803d; --bad: #ff0000; --muted: #5b6573;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 12px 16px 24px; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.15; margin: 0.6em 0 0.4em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; border-bottom: 3px solid var(--orange); padding-bottom: 4px; display: inline-block; }
a { color: var(--orange-ink); }
.ccng-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink); color: #fff; }
.ccng-top .tile { width: 36px; height: 36px; border-radius: 9px; background: var(--orange); color: var(--ink); font: 700 14px var(--head); display: grid; place-items: center; text-decoration: none; letter-spacing: -0.5px; }
.ccng-top .title { font: 700 1.05rem var(--head); flex: 1; }
.ccng-top .title small { display: block; font: 400 0.75rem var(--font); color: #ffd3a8; }
button, .button { font: 600 1rem var(--font); border: 0; border-radius: 12px; padding: 10px 16px; background: var(--orange); color: var(--ink); cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button.quiet, .button.quiet { background: var(--soft); color: var(--ink); }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, .button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
input, select { font: 1rem var(--font); padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 44px; }
label { display: block; margin: 8px 0 4px; font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 12px 0; overflow-x: auto; }
.card table { min-width: max-content; }
.chip { display: inline-block; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.chip[data-state="connected"] { background: #dcfce7; color: var(--ok); }
.chip[data-state="unreachable"], .chip[data-state="offline"] { background: #fff1e2; color: var(--orange-ink); }
.confirmed { color: var(--ok); font-weight: 700; } .refused { color: var(--bad); font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 0.85rem; }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); } th { font-size: 0.85rem; color: var(--muted); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.game-card { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.game-card:hover { border-color: var(--orange); }
.game-card svg { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.ccng-footer { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 16px 12px 24px; border-top: 1px solid var(--line); }
.ccng-footer p { margin: 2px 0; }
dialog { border: 0; border-radius: 16px; padding: 18px; max-width: min(92vw, 460px); box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
dialog::backdrop { background: rgba(23,32,43,0.45); }
code.recovery { display: block; font-size: 0.95rem; word-spacing: 4px; background: var(--soft); padding: 8px; border-radius: 8px; user-select: all; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Bold colours (29 November 2026): every game's picture, 2D or 3D, drawn more saturated and with more contrast. */
main canvas { filter: saturate(1.6) contrast(1.1); }
/* the Update button (kit/update.js): always in the header; "Update now" when a new release is waiting */
.ccng-update { margin-left: auto; min-height: 36px; padding: 6px 14px; border-radius: 9px; border: 2px solid #ffd3a8; background: transparent; color: #fff; font: 700 0.9rem var(--head); cursor: pointer; }
.ccng-update:hover, .ccng-update:focus-visible { background: rgba(255, 211, 168, 0.15); }
.ccng-update.ccng-update-new { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.ccng-update.ccng-update-float { position: fixed; top: 10px; right: 10px; z-index: 50; background: var(--ink); }
.ccng-update-say { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 60; margin: 0; padding: 10px 16px; width: max-content; max-width: min(92vw, 480px); white-space: pre-line; text-align: center; line-height: 1.4; border-radius: 10px; background: var(--ink); color: #fff; font: 600 0.9rem var(--font); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
@media (max-width: 420px) { .ccng-update { padding: 4px 10px; font-size: 0.8rem; min-height: 32px; } }

/* Full-screen play (kit/playmode.js): the play card alone fills the screen, the game as large as it can be. */
.ccng-play-enter { margin-left: auto; }
.ccng-play-exit { display: none; }
html.ccng-play, html.ccng-play body { height: 100%; overflow: hidden; }
html.ccng-play .ccng-top, html.ccng-play .ccng-footer, html.ccng-play main > :not(.ccng-play-card), html.ccng-play .ccng-play-enter { display: none !important; }
html.ccng-play main { padding: 0; margin: 0; max-width: none; }
html.ccng-play .ccng-play-card { position: fixed; inset: 0; z-index: 40; margin: 0; max-width: none; border: 0; border-radius: 0; box-shadow: none;
  display: flex; flex-direction: column; gap: 6px; overflow: hidden;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
html.ccng-play .ccng-play-card > p, html.ccng-play .ccng-play-card > h2 { display: none; }
html.ccng-play .ccng-play-card > .row, html.ccng-play .ccng-play-card > div:not(#stage-wrap):not(#result) { flex: 0 0 auto; }
html.ccng-play .ccng-play-card .hud, html.ccng-play .ccng-play-card > .row:first-of-type { padding-right: 112px; }
.ccng-play-exit .ccng-arrow { font-size: 1.9rem; line-height: 1; font-weight: 900; margin-top: -4px; }
html.ccng-play #stage-wrap, html.ccng-play .ccng-play-card > #board, html.ccng-play .ccng-play-card > canvas, html.ccng-play .ccng-play-card > svg {
  flex: 1 1 auto; min-height: 0; max-width: none; width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; }
html.ccng-play #stage-wrap > canvas { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 10px; }
html.ccng-play .ccng-play-card > canvas, html.ccng-play .ccng-play-card > svg { width: auto; max-width: 100%; height: 100%; object-fit: contain; }
html.ccng-play #result { flex: 0 1 auto; max-height: 34vh; overflow: auto; }
html.ccng-play #result:empty { display: none; }
html.ccng-play .ccng-play-exit { display: block; position: fixed; top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 45;
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 14px 2px 10px; border-radius: 22px; border: 2px solid #fff; background: var(--ink); color: #fff; font: 700 0.9rem var(--head); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }


/* this session's report (kit/session-audit.js) */
.ccng-report { margin-left: auto; min-height: 36px; padding: 6px 12px; border-radius: 9px; border: 2px solid #9be7b0; background: transparent; color: #fff; font: 700 0.9rem var(--head); cursor: pointer; }
.ccng-report + .ccng-update { margin-left: 8px; }
.ccng-report:hover, .ccng-report:focus-visible { background: rgba(155, 231, 176, 0.15); }
.ccng-report.ccng-report-float { position: fixed; top: 10px; right: 96px; z-index: 50; background: var(--ink); }
.ccng-report-dialog { width: min(96vw, 860px); max-width: min(96vw, 860px); max-height: 90vh; padding: 0; border: 0; border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); }
.ccng-report-dialog::backdrop { background: rgba(23, 32, 43, 0.55); }
.ccng-report-box { padding: 16px 18px; overflow: auto; max-height: 90vh; box-sizing: border-box; }
.ccng-report-box h2 { margin-top: 0; }
.ccng-report-box .good { color: #0a7d3b; font-weight: 700; } .ccng-report-box .bad { color: #c0262d; font-weight: 700; }
.ccng-report-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; margin: 6px 0 10px; display: block; overflow-x: auto; }
.ccng-report-table th, .ccng-report-table td { border: 1px solid rgba(23, 32, 43, 0.15); padding: 3px 6px; text-align: left; vertical-align: top; }
.ccng-report-table th { background: rgba(23, 32, 43, 0.06); }
html.ccng-play .ccng-report { display: none; }
.ccng-update-say { cursor: pointer; }

/* The CCN Three Recorder in the games (kit/recorder.js): ● and + floating over the top-right corner of the game's picture (placed
   there by kit/recorder.js). + opens a small strip below them (the owner, 3 December 2026, 02:41: the full panel hid a quarter of the
   scene): the status line and, once a file is made, ⤓ Save; the ● stays the Record and Stop button. The recorder's own style is
   kit/three-recorder/ccn-three-recorder.css; this only places it and keeps it small over the game. */
.ccnsr.ccng-recorder.on-scene { position: fixed; right: auto; bottom: auto; z-index: 45; width: auto; background: rgba(23, 32, 43, .72);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35); backdrop-filter: blur(3px); }
.ccnsr.ccng-recorder.on-scene header { padding: 4px 5px; gap: 5px; border-bottom: 0; }
.ccnsr.ccng-recorder.on-scene header b { display: none; }
.ccnsr.ccng-recorder.on-scene .mini { display: inline-block; }
.ccnsr.ccng-recorder.on-scene .body > .row:first-child { display: none; }   /* the big Record button: the ● does it */
.ccnsr.ccng-recorder.on-scene .body { position: absolute; right: 0; top: calc(100% + 4px); width: min(210px, calc(100vw - 24px)); padding: 6px 8px;
  gap: 5px; background: rgba(23, 32, 43, .86); border: 1px solid #FA8F2B; border-radius: 9px; font-size: 11.5px; line-height: 1.3; }
.ccnsr.ccng-recorder.on-scene .body .row:not(:has(> :not([hidden]))) { display: none; }   /* a row whose buttons are all hidden */
.ccnsr.ccng-recorder.on-scene .body button { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; }
.ccnsr.ccng-recorder.on-scene .say { min-height: 0; }
