/* Shared base for workspace projects. Projects can ignore this and style themselves. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --accent: #3b82f6;
  --bg: #0e0e12;
  --panel: #18181d;
  --hairline: #32323a;
  --text: #e4e4e7;
  --muted: #8e8e99;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 12px/1.4 var(--sans); overflow: hidden; }
canvas { display: block; }

/* Small floating label in a corner of a project */
.hud { position: absolute; z-index: 5; display: flex; gap: 6px; align-items: center; pointer-events: none; }
.hud > * { pointer-events: auto; }
.pill {
  font: 11px var(--mono); color: var(--text); background: rgba(20, 20, 26, 0.82);
  border: 1px solid var(--hairline); border-radius: 5px; padding: 4px 8px;
  backdrop-filter: blur(8px);
}
.pill b { color: var(--accent); font-weight: 500; }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--accent); }

.banner {
  position: absolute; left: 50%; top: 48px; transform: translateX(-50%); z-index: 6;
  max-width: min(520px, 90vw); padding: 8px 12px; border-radius: 6px;
  background: rgba(30, 24, 12, 0.92); border: 1px solid rgba(245, 158, 11, 0.5); color: #fcd34d;
  font: 11.5px var(--mono); display: flex; gap: 10px; align-items: center;
}
.banner[hidden] { display: none; }
.banner button { background: none; border: 0; color: #a1a1aa; cursor: pointer; font-size: 13px; }

/* ---------- Bridge standalone panel ---------- */
.wsb-panel {
  position: fixed; top: 12px; right: 12px; z-index: 50; width: 236px;
  background: rgba(24, 24, 29, 0.94); border: 1px solid var(--hairline); border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px);
  font: 11px var(--sans); color: var(--text); max-height: calc(100vh - 24px); display: flex; flex-direction: column;
}
.wsb-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #26262c; border-bottom: 1px solid var(--hairline); border-radius: 6px 6px 0 0; }
.wsb-title { font: 600 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.wsb-collapse { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.wsb-body { padding: 8px 10px; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.wsb-collapsed .wsb-body, .wsb-collapsed .wsb-foot { display: none; }
.wsb-section { font: 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.wsb-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wsb-label { color: #b4b4bd; }
.wsb-value { font-family: var(--mono); color: var(--text); }
.wsb-hint { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.wsb-row input[type=range] { width: 100%; margin-top: 4px; accent-color: var(--accent); }
.wsb-row input[type=checkbox] { accent-color: var(--accent); }
.wsb-row select { max-width: 62%; min-width: 0; text-overflow: ellipsis; background: #141418; color: var(--text); border: 1px solid var(--hairline); border-radius: 4px; font: 11px var(--mono); padding: 2px 4px; }
.wsb-btn { width: 100%; padding: 5px 8px; background: #262630; color: var(--text); border: 1px solid #383846; border-radius: 4px; cursor: pointer; font: 11px var(--sans); }
.wsb-btn:hover { border-color: var(--accent); }
.wsb-btn.wsb-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.wsb-track { height: 5px; background: #141418; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.wsb-bar { height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
.wsb-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--hairline); font: 10px var(--mono); color: var(--muted); }
.wsb-link { color: var(--accent); text-decoration: none; white-space: nowrap; }
.wsb-link:hover { text-decoration: underline; }

/* ---------- Bridge standalone right-click menu ---------- */
.wsb-menu { position: fixed; z-index: 100; min-width: 180px; padding: 4px; background: #1e1e24; border: 1px solid #3a3a46; border-radius: 6px; box-shadow: 0 14px 34px rgba(0,0,0,.55); display: grid; }
.wsb-menu-item { text-align: left; padding: 6px 10px; border: 0; border-radius: 4px; background: none; color: var(--text); font: 12px var(--sans); cursor: pointer; }
.wsb-menu-item:hover { background: var(--accent); color: #fff; }

/* ---------- Device-aware pieces (classes set by shell/bridge.js) ---------- */
/* Buttons that need tab audio vanish where it can't work (phones, tablets). */
.no-tab-audio [data-needs="tab-audio"] { display: none !important; }
/* Mark hint text data-hint="keys" (keyboard/mouse) or data-hint="touch". */
html.touch [data-hint="keys"] { display: none !important; }
html:not(.touch) [data-hint="touch"] { display: none !important; }
