/* studio.css — the editor chrome (header, stage, customizer panel, export box).
   None of this ships to OBS; overlay mode hides all of it (see overlay.css). */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0c0e12;
  color: #e7e9ee;
}

.os-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid #1c1f27;
  background: #0e1116;
}
.os-brand { font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.os-logo { filter: saturate(1.2); }
.os-status { font-size: 13px; color: #9aa1ad; font-variant-numeric: tabular-nums; }

.os-main {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - 57px);
}

/* stage */
.os-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  /* faint checkerboard so transparency reads clearly */
  background-color: #0c0e12;
  background-image:
    linear-gradient(45deg, #14171d 25%, transparent 25%),
    linear-gradient(-45deg, #14171d 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #14171d 75%),
    linear-gradient(-45deg, transparent 75%, #14171d 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.os-hint { margin: 0; font-size: 13px; color: #8b919c; text-align: center; max-width: 420px; }
.os-hint b { color: #c7ccd6; }

/* drag-and-drop a wrap image: highlight the controller as a drop zone while a file is dragged over it */
.os-stage.drop-hot {
  outline: 2px dashed #6aa6ff;
  outline-offset: 14px;
  border-radius: 14px;
  background: rgba(106, 166, 255, 0.06);
}

/* panel */
.os-panel-wrap {
  border-left: 1px solid #1c1f27;
  background: #0e1116;
  overflow-y: auto;
  padding: 18px;
}
.os-section { margin-bottom: 22px; }
/* Section headers: Orbitron display face, clipped to a cyan→violet gradient with a soft glow, so each
   section reads as a bold designer heading and the groups stand apart at a glance on the dark panel. */
.os-section h3 {
  margin: 0 0 13px;
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-image: linear-gradient(90deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.5));
}

.os-select {
  width: 100%;
  padding: 9px 10px;
  background: #161a21;
  color: #e7e9ee;
  border: 1px solid #262b34;
  border-radius: 8px;
  font-size: 14px;
}

.os-paddle-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.os-paddle-row span { width: 74px; flex: none; font-size: 13px; color: #c2c7d0; }
.os-paddle-row .os-select { flex: 1; }

.os-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.os-preset {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 9px;
  background: #161a21;
  color: #d4d8df;
  border: 1px solid #262b34;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
}
.os-preset::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--sw, #888);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.os-preset:hover { border-color: #3a414f; background: #1a1f27; }
.os-preset--on { border-color: #6aa6ff; background: #1b2330; color: #fff; }

/* skin gallery (photo controllers) */
.os-skins { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.os-skin {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: #161a21;
  border: 1px solid #262b34;
  border-radius: 10px;
  color: #c8cdd6;
  font-size: 12.5px;
  cursor: pointer;
}
.os-skin-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #0d1014 center / contain no-repeat;
  border-radius: 6px;
}
.os-skin-name { text-align: center; padding-bottom: 2px; }
.os-skin:hover { border-color: #3a414f; background: #1a1f27; }
.os-skin--on { border-color: #6aa6ff; background: #1b2330; color: #fff; }

/* collapsible skin folder (groups the AimControllers designs) */
.os-skin-folder { margin-top: 9px; }
.os-skin-folder-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  background: #161a21;
  border: 1px solid #262b34;
  border-radius: 10px;
  color: #d4d8df;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.os-skin-folder-head:hover { border-color: #3a414f; background: #1a1f27; }
.os-skin-folder-caret { color: #7c828d; font-size: 10px; transition: transform 0.15s ease; }
.os-skin-folder-head--open .os-skin-folder-caret { transform: rotate(90deg); }
.os-skin-folder-name { flex: 1; font-weight: 500; }
.os-skin-folder-count {
  font-size: 11px;
  color: #8b919c;
  background: #0e1116;
  border: 1px solid #262b34;
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.os-skin-folder-grid { margin-top: 9px; }
/* the grid is display:grid via .os-skins, which beats the UA [hidden] rule — so make collapse win */
.os-skin-folder-grid[hidden] { display: none; }

.os-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}
.os-color { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #c2c7d0; }
.os-color input[type="color"] {
  width: 30px; height: 30px;
  padding: 0;
  border: 1px solid #2a2f3a;
  border-radius: 7px;
  background: none;
  cursor: pointer;
  flex: none;
}
.os-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.os-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }

.os-slider { margin-bottom: 13px; }
.os-slider-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; color: #c2c7d0; }
.os-val { color: #8b919c; font-variant-numeric: tabular-nums; }
.os-slider input[type="range"] { width: 100%; accent-color: #e23b3b; }

.os-reset {
  width: 100%;
  padding: 9px;
  background: transparent;
  color: #9aa1ad;
  border: 1px solid #262b34;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.os-reset:hover { color: #e7e9ee; border-color: #3a414f; }

/* branding (stub) */
.os-brand-slot {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  background: #12161d;
  border: 1px dashed #2c323d;
  border-radius: 10px;
  color: #9aa1ad;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.os-brand-slot:hover { border-color: #3a414f; color: #cdd2da; }
.os-brand-plus {
  width: 24px; height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #1b212b;
  color: #e23b3b;
  font-weight: 700;
  font-size: 16px;
}
.os-brand-slot--soon { border-style: solid; border-color: #e23b3b; color: #e7e9ee; }

/* creator code */
.os-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.os-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.os-switch-track {
  position: relative; width: 38px; height: 22px; flex: none;
  background: #262b34; border-radius: 999px; transition: background 0.15s;
}
.os-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #8b919c; border-radius: 50%; transition: transform 0.15s, background 0.15s;
}
.os-switch input:checked + .os-switch-track { background: #e23b3b; }
.os-switch input:checked + .os-switch-track::after { transform: translateX(16px); background: #fff; }
.os-switch input:focus-visible + .os-switch-track { outline: 2px solid #6aa6ff; outline-offset: 2px; }
.os-switch-label { font-size: 13px; color: #c2c7d0; }

.os-code-fields { margin-top: 13px; display: flex; flex-direction: column; gap: 11px; }
.os-code-fields[hidden] { display: none; }
.os-field { display: flex; flex-direction: column; gap: 5px; }
.os-field-label { font-size: 12px; color: #8b919c; }
.os-input {
  width: 100%; padding: 9px 10px;
  background: #161a21; color: #e7e9ee;
  border: 1px solid #262b34; border-radius: 8px; font-size: 14px;
}
.os-input:focus { outline: none; border-color: #3a414f; }
/* Sub-headers (e.g. "Eye colors", "Position & size") — a soft off-white, smaller than the section headers,
   so they read as a level below the bright-white headers while still popping off the dark panel. */
.os-sublabel { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #c4cad6; }
.os-font-row { display: flex; gap: 9px; align-items: center; }
.os-font-row .os-select { flex: 1; min-width: 0; }
.os-font-color {
  width: 38px; height: 38px; flex: none; padding: 0;
  background: none; border: 1px solid #2a2f3a; border-radius: 7px; cursor: pointer;
}
.os-font-color::-webkit-color-swatch-wrapper { padding: 2px; }
.os-font-color::-webkit-color-swatch { border: none; border-radius: 5px; }

.os-code-preview {
  margin-top: 4px; padding: 16px 14px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 0.18em; line-height: 1;
  font-size: 26px; white-space: nowrap; overflow: hidden;
  border: 1px solid #1c1f27;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  /* checkerboard so it reads like the transparent overlay */
  background-color: #0c0e12;
  background-image:
    linear-gradient(45deg, #14171d 25%, transparent 25%),
    linear-gradient(-45deg, #14171d 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #14171d 75%),
    linear-gradient(-45deg, transparent 75%, #14171d 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.os-code-move-row { display: flex; gap: 8px; margin-top: 2px; }
.os-code-move-row .os-btn-narrow { flex: none; }

/* export */
.os-export {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid #1c1f27;
}
.os-export h3 { margin: 0 0 8px; font-family: 'Orbitron', sans-serif; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; background-image: linear-gradient(90deg, #22d3ee, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.5)); }
.os-export-help { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; color: #8b919c; }
.os-url {
  width: 100%;
  padding: 8px 10px;
  background: #161a21;
  color: #aeb4be;
  border: 1px solid #262b34;
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  margin-bottom: 10px;
}
.os-export-actions { display: flex; gap: 8px; }
.os-btn {
  flex: 1;
  padding: 9px 12px;
  background: #161a21;
  color: #d4d8df;
  border: 1px solid #262b34;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.os-btn:hover { border-color: #3a414f; background: #1a1f27; }
.os-btn-primary { background: #e23b3b; border-color: #e23b3b; color: #fff; font-weight: 600; }
.os-btn-primary:hover { background: #f04848; border-color: #f04848; }

/* top-level device chooser — a segmented control above the panel; flips controller <-> keyboard */
.os-device {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  background: #12161d;
  border: 1px solid #1c1f27;
  border-radius: 11px;
}
.os-device-btn {
  padding: 10px 8px;
  background: transparent;
  color: #aeb4be;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.os-device-btn:hover { color: #e7e9ee; background: #161a21; }
.os-device-btn--on { background: #1b2330; color: #fff; border-color: #6aa6ff; }
.os-device-btn--on:hover { background: #1b2330; }

/* Two-PC stream setup — a prominent collapsible help card at the top of the panel (native <details>, so the
   click-to-drop-down needs no JS; hidden in overlay/OBS mode with the rest of .os-panel-wrap). */
.os-twopc {
  margin-bottom: 18px;
  border: 1px solid #34507e;
  border-radius: 10px;
  background: #131a28;
  overflow: hidden;
}
.os-twopc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  user-select: none;
}
.os-twopc > summary::-webkit-details-marker { display: none; }
.os-twopc > summary:hover { background: #182133; }
.os-twopc-ico { font-size: 15px; line-height: 1; }
.os-twopc-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.os-twopc-title { font-weight: 700; font-size: 14px; color: #eaf1ff; }
.os-twopc-sub { font-size: 11.5px; color: #8ea6cf; }
.os-twopc-chev { color: #6aa6ff; font-size: 13px; transition: transform 0.18s ease; }
.os-twopc[open] .os-twopc-chev { transform: rotate(180deg); }
.os-twopc-body {
  padding: 4px 15px 15px;
  font-size: 12.8px;
  line-height: 1.5;
  color: #c2c8d2;
  border-top: 1px solid #20283a;
}
.os-twopc-body p { margin: 10px 0 4px; }
.os-twopc-head { font-weight: 700; color: #dfe6f2; margin-top: 13px; }
.os-twopc-body ol { margin: 4px 0 0; padding-left: 20px; }
.os-twopc-body li { margin: 3px 0; }

/* keyboard-size tiles (name + key count) used by the keyboard customizer's size picker */
.os-size { flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 10px; padding: 9px 13px; }
.os-size-name { font-weight: 700; font-size: 14px; }
.os-size-sub { font-size: 11px; color: #8b919c; }
.os-size.os-preset--on .os-size-sub { color: #aebfff; }

@media (max-width: 820px) {
  .os-main { grid-template-columns: 1fr; height: auto; }
  .os-panel-wrap { border-left: none; border-top: 1px solid #1c1f27; }
}
