/* cobalt-ui.css — JSLC design schema components (Cobalt, 2026-10-03). Requires cobalt-tokens.css.
 * Node content only: never draw shell chrome (bar, nav drawer, radio, rail, signpost) inside a node.
 * Classes are prefixed c- to avoid colliding with legacy page CSS. CSP: no inline styles needed anywhere.
 */
.c-root, .c-root *, .c-root *::before, .c-root *::after { box-sizing: border-box; }
.c-root { margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink); font: 400 var(--fs-body)/1.55 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
.c-root a { color: var(--link); }
.c-root button { font: inherit; color: inherit; }
.c-root :focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* type */
.c-title { margin: 6px 0; font-size: var(--fs-title); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.c-label { color: var(--muted); font: 700 var(--fs-label)/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.c-label.c-on { color: var(--cobalt); }
.c-muted { color: var(--muted); }
.c-mono { font-family: var(--mono); font-size: 11px; }
.c-num { font-variant-numeric: tabular-nums; }
/* the house row: bold lede + quiet subline */
.c-row { position: relative; display: block; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; }
.c-row b, .c-row .c-lede { display: block; font-size: var(--fs-body); font-weight: 700; }
.c-row small, .c-row .c-sub { display: block; color: var(--muted); font-size: var(--fs-small); }
.c-row.c-nav::after { content: "›"; position: absolute; right: 12px; top: 50%; margin-top: -8px; color: var(--muted); font-weight: 700; }
.c-row.c-on { background: var(--accent-subtle); }
.c-row.c-on b { color: var(--cobalt); }
.c-row.c-on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--cobalt); }
.c-status { font: 700 var(--fs-small)/1 var(--font); }
.c-status.c-good { color: var(--good); } .c-status.c-bad { color: var(--bad); } .c-status.c-warn { color: var(--warn); }
.c-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }

/* surfaces */
.c-glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); }
@media (prefers-reduced-transparency: reduce) { .c-glass { background: var(--glass-strong); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.c-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.c-wrap { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(84px + var(--safe-b)); }
@media (min-width: 760px) { .c-wrap { padding-top: 28px; } .c-title { font-size: 24px; } }

/* controls: quiet visuals, generous targets */
.c-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: var(--ctl); padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: var(--card); color: var(--cobalt); font: 700 11px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.c-btn.c-pri { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-accent); }
.c-btn::after, .c-ico-btn::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 40px); height: max(100%, var(--hit)); transform: translate(-50%,-50%); }
.c-ico-btn { position: relative; display: inline-grid; place-items: center; width: var(--ctl); height: var(--ctl); border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--ink); cursor: pointer; }
.c-ico-btn:hover { background: var(--accent-subtle); }
.c-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.c-ico.c-brand { fill: currentColor; stroke: none; }
.c-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r-ctl); overflow: hidden; background: var(--card); }
.c-seg button { position: relative; height: var(--ctl); padding: 0 11px; border: 0; border-left: 1px solid var(--rule); background: transparent; color: var(--ink); font: 400 11px/1 var(--font); cursor: pointer; }
.c-seg button:first-child { border-left: 0; }
.c-seg button[aria-pressed="true"], .c-seg button.c-on { background: var(--cobalt); color: var(--on-accent); font-weight: 700; }
.c-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.c-chips::-webkit-scrollbar { display: none; }
.c-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 13px; background: var(--card); color: var(--ink); font: 400 11px/1 var(--font); cursor: pointer; white-space: nowrap; }
.c-chip[aria-pressed="true"], .c-chip.c-on { border-color: var(--cobalt); background: var(--accent-subtle); color: var(--cobalt); font-weight: 700; }
.c-x { position: relative; width: 24px; height: 24px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); font: 700 11px/1 var(--font); cursor: pointer; flex: none; }
.c-x::after { content: ""; position: absolute; inset: -10px; }

/* dock: one glass row at the bottom, re-centred in the area not covered by shell overlays */
.c-dock { position: fixed; z-index: 40; left: calc(8px + var(--overlay-left)); right: calc(8px + var(--overlay-right)); bottom: calc(8px + var(--safe-b)); display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; box-shadow: 0 6px 20px rgba(17,26,45,.12); overflow-x: auto; scrollbar-width: none; transition: left var(--dur) var(--ease), right var(--dur) var(--ease); }
.c-dock::-webkit-scrollbar { display: none; }
.c-dock .c-grow { flex: 1; }
.c-dock .c-pin { position: sticky; right: 0; }
@media (min-width: 760px) { .c-dock { right: auto; left: calc(50% + (var(--overlay-left) - var(--overlay-right)) / 2); transform: translateX(-50%); max-width: calc(100% - 16px - var(--overlay-left) - var(--overlay-right)); } }
/* edge controls move out from under shell overlay panels */
.c-edge-r { transform: translateX(calc(-1 * var(--overlay-right))); transition: transform var(--dur) var(--ease); }
.c-edge-l { transform: translateX(var(--overlay-left)); transition: transform var(--dur) var(--ease); }

/* sheets: bottom sheet on phone, centred 520px on desktop; drag/swipe handled by cobalt-sheet.js */
.c-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s; }
.c-scrim.c-open { opacity: 1; pointer-events: auto; }
.c-sheet { position: fixed; z-index: 61; left: 6px; right: 6px; bottom: calc(6px + var(--safe-b)); height: auto; max-height: min(86dvh, 720px); display: flex; flex-direction: column; border-radius: var(--r-sheet); box-shadow: 0 -8px 30px rgba(17,26,45,.18); background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-line); transform: translateY(calc(100% + 24px)); transition: transform var(--dur) var(--ease), height var(--dur) var(--ease); visibility: hidden; }
.c-sheet.c-open { transform: none; visibility: visible; }
.c-sheet.c-peek { height: 76px; } .c-sheet.c-half { height: 52dvh; } .c-sheet.c-full { height: 86dvh; }
.c-sheet.c-dragging { transition: none; }
@media (min-width: 760px) { .c-sheet { left: calc(50% + (var(--overlay-left) - var(--overlay-right)) / 2); right: auto; width: 520px; margin-left: -260px; } }
.c-grab { width: 36px; height: 4px; margin: 7px auto 0; border-radius: 2px; background: color-mix(in srgb, var(--ink) 25%, transparent); flex: none; touch-action: none; }
.c-grab-zone { padding: 0 0 2px; touch-action: none; cursor: grab; }
.c-shd { display: flex; align-items: flex-start; gap: 10px; padding: 8px 14px 9px; border-bottom: 1px solid var(--line); flex: none; }
.c-shd > div { flex: 1; min-width: 0; }
.c-shd .c-ttl { margin: 4px 0 2px; font-size: 15px; font-weight: 700; line-height: 1.25; }
.c-shd .c-sub { color: var(--muted); font-size: 11.5px; }
.c-sbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 6px; }
.c-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--line); flex: none; }

/* side drawer inside a node (e.g. desktop events list): non-modal, content-sized, glass */
.c-drawer { position: fixed; z-index: 30; top: 8px; left: calc(8px + var(--overlay-left)); width: 320px; max-height: calc(100dvh - 16px - 64px); display: flex; flex-direction: column; border-radius: var(--r-sheet); box-shadow: var(--shadow); overflow: hidden; transition: left var(--dur) var(--ease); }

/* disclosure: named, retracted complexity */
details.c-more { border-top: 1px solid var(--line); }
details.c-more > summary { display: flex; align-items: baseline; gap: 6px; min-height: var(--hit); padding-top: 12px; cursor: pointer; font-weight: 700; list-style: none; }
details.c-more > summary::-webkit-details-marker { display: none; }
details.c-more > summary small { color: var(--muted); font-weight: 400; }
details.c-more > summary::after { content: "›"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.c-more[open] > summary::after { transform: rotate(90deg); }

/* "How to play" / explainer card (shared by every game and explainer) */
.c-howto { max-width: 420px; margin: auto; padding: 16px 16px 12px; border-radius: var(--r-sheet); box-shadow: var(--shadow); }
.c-howto .c-step { display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.c-howto .c-step .c-ico { grid-row: span 2; width: 18px; height: 18px; margin-top: 1px; color: var(--cobalt); }
.c-howto .c-step b { font-size: var(--fs-body); }
.c-howto .c-step small { color: var(--muted); font-size: var(--fs-small); }
.c-howto .c-keys { display: none; margin-top: 8px; color: var(--muted); font-size: var(--fs-small); }
@media (hover: hover) and (pointer: fine) { .c-howto .c-keys { display: block; } }
.c-kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 4px; font: 700 10px/1.4 var(--mono); text-align: center; }

/* states */
.c-skel { position: relative; overflow: hidden; background: var(--paper-soft); border-radius: var(--r-card); }
.c-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 70%, transparent), transparent); transform: translateX(-100%); animation: c-shimmer 1.4s infinite; }
@keyframes c-shimmer { to { transform: translateX(100%); } }
.c-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-small); }
.c-empty { padding: 14px 0; color: var(--muted); font-size: 12px; }
.c-error { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); border-radius: var(--r-ctl); color: var(--bad); font-size: 12px; }
.c-toast { position: fixed; z-index: 80; left: 50%; bottom: calc(70px + var(--safe-b)); transform: translate(-50%, 20px); padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 12px; opacity: 0; transition: .2s; pointer-events: none; }
.c-toast.c-show { opacity: 1; transform: translate(-50%, 0); }

/* utilities (instead of style="" attributes) */
.c-hidden { display: none !important; }
.c-flex { display: flex; align-items: center; gap: 8px; } .c-grow { flex: 1; min-width: 0; }
.c-mt-4 { margin-top: 4px; } .c-mt-8 { margin-top: 8px; } .c-mt-12 { margin-top: 12px; } .c-mt-16 { margin-top: 16px; }
.c-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .c-root *, .c-root *::before, .c-root *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }
