/* The board and join pages, in the app's colours (portal/app/(app)/app.css). The display page has its own few rules. */
:root {
  --bg: #0f1011; --surface: #141618; --surface-2: #17191b; --tile: #121415; --line: #1e2022; --line-2: #26292c;
  --line-button: #3a3e42; --text: #e8e9ea; --text-2: #c9cdd1; --muted: #9a9fa4; --faint: #80858a;
  --live: oklch(0.78 0.15 150); --attention: oklch(0.72 0.17 25); --screen: oklch(0.78 0.12 255); --held: oklch(0.8 0.14 75);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* else .card's display: flex shows the streamer's panel to moderators */
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
button, input { font: inherit; color: inherit; }
button { background: var(--surface-2); border: 1px solid var(--line-button); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--text-2); }
button:disabled { opacity: .5; cursor: default; }
button.danger { color: var(--attention); }
button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
input { background: var(--tile); border: 1px solid var(--line-button); border-radius: 6px; padding: 7px 10px; width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }

/* board page */
.top { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 15px; font-weight: 600; margin: 0; }
.top .spread { flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.live { background: var(--live); }
.dot.bad { background: var(--attention); }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 16px; height: calc(100% - 52px); }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; height: auto; } }
.main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* the stage is a view of the canvas: the stream (.screen) and its full size again on every side (core.ts
   LIMITS.offstage). board.js places .screen for the zoom and position; the OBS display shows only the stream, so
   images wait around it and glide in */
.stage { cursor: grab; position: relative; width: 100%; aspect-ratio: 16 / 9; background: repeating-linear-gradient(135deg, #0c0d0e 0 10px, #111315 10px 20px); border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; touch-action: none; user-select: none; }
.stage.dropping { border-color: var(--screen); }
.stage.panning { cursor: grabbing; }
.main > .bar { flex-wrap: nowrap; align-items: flex-start; }
#itembar { flex: 1; min-width: 0; }
.zoomlabel { position: absolute; right: 8px; top: 6px; font-size: 11px; color: var(--faint); z-index: 1; }
.screen { position: absolute; left: 16.6667%; top: 16.6667%; width: 66.6667%; height: 66.6667%; background: #000 repeating-conic-gradient(#151718 0 25%, #1a1c1e 0 50%) 0 0 / 24px 24px; outline: 1px solid var(--line-button); }
.offlabel, .onlabel { position: absolute; left: 8px; top: 6px; font-size: 11px; color: var(--faint); pointer-events: none; }
.onlabel { left: 6px; top: 4px; z-index: 1; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
/* "Use the player": clicks go through the images to the player. Nothing moves or fades: changing what covers the
   player made it pause (seen 2026-11-01), so the picture stays exactly the same and only the clicks change. */
.stage.peek iframe { pointer-events: auto; }
.stage.peek .items { pointer-events: none; }
.stage.peek { outline: 2px solid var(--screen); outline-offset: 2px; }
.bar .spread { flex: 1; }
.items { position: absolute; inset: 0; }
.item { position: absolute; transform-origin: 50% 50%; cursor: grab; }
.item img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.item.sel { outline: 1.5px solid var(--screen); }
.item.held { outline: 1.5px dashed var(--held); cursor: not-allowed; }
.item .tag { position: absolute; left: 0; top: -22px; font-size: 11px; background: var(--held); color: #000; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.item .h { position: absolute; width: 14px; height: 14px; background: var(--text); border: 2px solid var(--screen); border-radius: 50%; }
.item .h.size { right: -7px; bottom: -7px; cursor: nwse-resize; }
.item .h.turn { left: 50%; top: -28px; margin-left: -7px; cursor: grab; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 34px; }
.side { display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 13px; font-weight: 600; margin: 0; display: flex; justify-content: space-between; align-items: center; }
.tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tray .t { position: relative; cursor: grab; aspect-ratio: 1; background: var(--tile) repeating-conic-gradient(#151718 0 25%, #1a1c1e 0 50%) 0 0 / 12px 12px; border: 1px solid var(--line-2); border-radius: 6px; padding: 4px; cursor: pointer; }
.tray .t:hover { border-color: var(--text-2); }
.tray .t img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tray .t .x { position: absolute; top: 2px; right: 2px; padding: 0 5px; font-size: 11px; line-height: 16px; }
.drop { border: 1px dashed var(--line-button); border-radius: 6px; padding: 10px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--screen); color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; }
.mods { display: flex; flex-direction: column; gap: 6px; }
.mods .row span { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line-button); border-radius: 8px; padding: 10px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.center { max-width: 420px; margin: 12vh auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.center h1 { font-size: 20px; margin: 0; }
.err { color: var(--attention); }
