/* Wobblyzoo UI: shared by game, lab and profile.
   Tokens (colours, fonts, shapes) live on :root and are overridden by themes, so a new look is only a new block of variables. */
:root {
  --radius: 18px; --radius-s: 12px; --bw: 1.5px; --shadow: none;
  --btn-shadow: none; --canvas-radius: 18px; --h1-size: 38px; --h1-weight: 700; --label-case: uppercase;
}
.dock { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 800px) { .dock[data-dock="side"] { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding-right: 2px; } }
.pn { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pn-h { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; cursor: grab; user-select: none; touch-action: none; border-bottom: 1px solid transparent; }
.pn:not(.collapsed) > .pn-h { border-bottom-color: var(--line); }
.pn-h:active { cursor: grabbing; }
.pn-grip { color: var(--muted); letter-spacing: -2px; font-size: 14px; line-height: 1; }
.pn-t { flex: 1; font: 700 12px/1.2 var(--font-body); text-transform: var(--label-case); letter-spacing: 0.08em; color: var(--muted); }
.pn-h button { padding: 4px 8px; font-size: 13px; border-radius: 8px; border-color: transparent; color: var(--muted); line-height: 1; box-shadow: none; }
.pn-b { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pn-b > * { flex-shrink: 0; }
.pn-b .row { flex-wrap: wrap; }
.pn.collapsed > .pn-b { display: none; }
.pn.dragging { opacity: 0.55; outline: 2px dashed var(--accent); }
.pn.floating { position: fixed; z-index: 40; width: min(340px, 92vw); max-height: 80vh; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.pn.nohead > .pn-h { display: none; }
.pn[hidden], .pn.off { display: none !important; }
.pn-b h1 { margin: 0; }
.pn-b h2, .pn-b h3 { margin: 0 0 6px; }
#wzMenuBtn { position: fixed; right: 12px; bottom: 12px; z-index: 60; width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 20px; background: var(--panel); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
#wzMenu { position: fixed; right: 12px; bottom: 64px; z-index: 60; width: min(300px, 92vw); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
#wzMenu h4 { margin: 4px 0 0; font: 700 12px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
#wzMenu label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
#wzMenu select { flex: 1; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }

/* Fonts picked by the user */
:root[data-font="pixel"] { --font-body: 'Silkscreen', 'Courier New', monospace; --font-display: 'Press Start 2P', 'Silkscreen', monospace; }
:root[data-font="mono"] { --font-body: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; --font-display: ui-monospace, Menlo, Consolas, monospace; }
:root[data-font="serif"] { --font-body: 'Cormorant Garamond', Georgia, serif; --font-display: 'Cormorant Garamond', Georgia, serif; }

/* Retro pixel game look */
:root[data-theme="pixel"] {
  --bg: #1b1230; --panel: #2a1f4a; --ink: #f6ecc9; --muted: #b9a9e0; --line: #6b55b3; --accent: #ff5fa2; --accent-ink: #1b1230;
  --sky-a: #23265e; --sky-b: #6a4fb5; --ground: #3fa34d; --ground-dark: #27693a; --outline: #0a0614; --wall-s: 30; --wall-l: 24; --beam-l: 52;
  --font-body: 'Silkscreen', 'Courier New', monospace; --font-display: 'Press Start 2P', 'Silkscreen', monospace;
  --radius: 0px; --radius-s: 0px; --bw: 3px; --shadow: 4px 4px 0 #0a0614; --btn-shadow: 3px 3px 0 #0a0614; --canvas-radius: 0px;
  --h1-size: 20px; --h1-weight: 400; --label-case: uppercase; color-scheme: dark;
}
:root[data-theme="pixel"] body { font-size: 13px; line-height: 1.6; image-rendering: pixelated; }
:root[data-theme="pixel"] button { border-width: 3px; border-radius: 0; box-shadow: var(--btn-shadow); letter-spacing: 0.03em; text-transform: none; }
:root[data-theme="pixel"] button:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
:root[data-theme="pixel"] button.primary { border-color: #0a0614; }
:root[data-theme="pixel"] canvas { border-radius: 0; border: 4px solid #0a0614; box-shadow: var(--shadow); image-rendering: auto; }
:root[data-theme="pixel"] .pn, :root[data-theme="pixel"] #wzMenu { border: 3px solid #0a0614; outline: 2px solid var(--line); outline-offset: -6px; }
:root[data-theme="pixel"] h1 { font-size: var(--h1-size); line-height: 1.3; }
:root[data-theme="pixel"] input, :root[data-theme="pixel"] select { border-radius: 0 !important; border-width: 2px !important; }
:root[data-theme="pixel"] .msg, :root[data-theme="pixel"] .row, :root[data-theme="pixel"] .tag { border-radius: 0; }

/* Staff bar: links to all tools, only for staff accounts */
#wzStaff { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; max-width: 1600px; margin: 0 auto 14px; padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
#wzStaff span { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; color: var(--accent); }
#wzStaff a { color: var(--ink); text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; }
#wzStaff a:hover { border-bottom-color: var(--accent); }
#wzStaff a[aria-current] { border-bottom-color: var(--accent); font-weight: 700; }

/* Hinweise als Fragezeichen statt offenem Text (ui.js tips) */
.tipbtn { min-width: 0; min-height: 0; width: 22px; height: 22px; padding: 0; margin: 2px 0; border-radius: 50%; font-size: 13px; line-height: 1; display: inline-grid; place-items: center; opacity: .75; }
.tippop { font-size: 12px; line-height: 1.4; margin: 2px 0 6px; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.08); }
.tipbtn[hidden] { display: none; }
