:root{
  --bg:#081018;
  --panel:#11181f;
  --line:#31414c;
  --text:#d7dde1;

  /* Fixed plugin dimensions */
  --pedal-width:780px;
  --panel-width:460px;
  --column-gap:20px;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
  overflow:auto;
  color:var(--text);
  font-family:Arial,Helvetica,sans-serif;
  background:#11181d;
}

body{
  display:flex;
  justify-content:center;
  align-items:flex-start;
}

/* Fixed-size desktop/plugin layout.
   The browser scrolls instead of resizing/reflowing the pedal. */
.app-shell{
  width:calc(var(--pedal-width) + var(--panel-width) + var(--column-gap));
  min-width:calc(var(--pedal-width) + var(--panel-width) + var(--column-gap));
  display:grid;
  grid-template-columns:var(--pedal-width) var(--panel-width);
  gap:var(--column-gap);
  align-items:start;
  padding:16px 0 28px;
}

.app{
  display:contents;
}

/* PEDAL --------------------------------------------------------------- */
.pedal-wrap,
.pedal-container,
.pedal-stage{
  width:var(--pedal-width);
  min-width:var(--pedal-width);
  max-width:var(--pedal-width);
}

.pedal-wrap{
  position:relative;
}

.pedal{
  position:relative;
  width:var(--pedal-width);
  min-width:var(--pedal-width);
  max-width:var(--pedal-width);
  aspect-ratio:1122/1402;
  user-select:none;
}

.face{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
}

.pedal-face,
.faceplate,
.pedal img.pedal-face{
  width:100%;
  height:auto;
  display:block;
}

.pedal>input[type=range]{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

/* KNOBS --------------------------------------------------------------- */
.knob-hit{
  position:absolute;
  border-radius:50%;
  cursor:ns-resize;
  z-index:10;
  touch-action:none;
}

/* Manually aligned centers — KEEP THESE VALUES */
.knob-hit.motion{
  left:28.82%;
  top:24.35%;
  width:17.3%;
  height:13.8%;
  transform:translate(-50%,-50%);
}

.knob-hit.cave{
  left:71.00%;
  top:24.35%;
  width:17.3%;
  height:13.8%;
  transform:translate(-50%,-50%);
}

.knob-hit.wet{
  left:49.91%;
  top:52.25%;
  width:17.3%;
  height:13.8%;
  transform:translate(-50%,-50%);
}

.knob-image{
  position:absolute;
  left:50%;
  top:50%;
  width:90%;
  height:90%;
  object-fit:contain;
  transform:translate(-50%,-50%) rotate(0deg);
  transform-origin:50% 50%;
  pointer-events:none;
  will-change:transform;
  filter:drop-shadow(0 3px 3px rgba(0,0,0,.55));
}

/* LEDS ---------------------------------------------------------------- */
.led{
  position:absolute;
  border-radius:50%;
  z-index:12;
  pointer-events:none;
  mix-blend-mode:screen;
  width:1.5%;
  aspect-ratio:1;
}

/* Manually aligned LED positions — KEEP THESE VALUES */
.motion-led{
  left:27.8%;
  top:12.40%;
  background:#8652d9;
  box-shadow:0 0 12px #873bff,0 0 24px #6d2ee8;
}

.cave-led{
  left:70.00%;
  top:12.40%;
  background:#806022;
  box-shadow:0 0 9px #be7e16;
}

.wet-led{
  left:49.09%;
  top:40.70%;
  background:#5ff3d3;
  box-shadow:0 0 10px #4fffe3;
}

.panic-led{
  left:62.52%;
  top:85.55%;
  background:#72339e;
  box-shadow:0 0 10px #a53cff;
  opacity:.8;
}

/* BUTTON / HOTSPOT AREAS --------------------------------------------- */
.panic{
  position:absolute;
  left:43.3%;
  top:78.1%;
  width:13.2%;
  aspect-ratio:1;
  border:0;
  border-radius:50%;
  background:transparent;
  cursor:pointer;
  z-index:14;
}

.setup-hotspot{
  position:absolute;
  right:9.3%;
  top:.65%;
  width:6%;
  height:5.5%;
  border:0;
  background:transparent;
  cursor:pointer;
  z-index:15;
}

.settings-hit,
.setup-hit,
#settingsButton,
#setupButton{
  position:absolute;
  left:86.5%;
  top:1.2%;
  width:6%;
  height:5.5%;
  z-index:30;
  cursor:pointer;
  background:transparent;
  border:0;
}

.panic:focus-visible,
.setup-hotspot:focus-visible,
.knob-hit:focus-visible{
  outline:2px solid #65dcff;
  outline-offset:3px;
}

/* SETUP PANEL --------------------------------------------------------- */
.setup-panel{
  position:sticky;
  top:16px;
  width:var(--panel-width);
  min-width:var(--panel-width);
  max-width:var(--panel-width);
  max-height:calc(100vh - 32px);
  overflow:auto;
  margin:0;
  background:rgba(12,17,22,.96);
  border:1px solid #344551;
  border-radius:8px;
  box-shadow:0 14px 35px #000b;
  display:none;
  z-index:30;
}

.setup-panel.open{
  display:block;
}

.setup-panel[hidden],
.setup-panel.closed{
  display:none !important;
}

.setup-panel header{
  height:38px;
  padding:0 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid #2b3942;
  font-size:12px;
  letter-spacing:.14em;
}

.setup-panel header button{
  background:none;
  border:0;
  color:#aaa;
  font-size:24px;
  cursor:pointer;
}

.setup-grid{
  display:grid;
  grid-template-columns:1fr;
}

.setup-grid>div{
  padding:14px;
  border-right:0;
  border-bottom:1px solid #27343d;
  min-height:auto;
}

.setup-grid>div:last-child{
  border-bottom:0;
}

.setup-grid label{
  display:block;
  font-size:9px;
  letter-spacing:.12em;
  color:#9ba9b1;
  margin-bottom:9px;
}

.setup-grid button,
.setup-grid select,
.filebutton{
  background:#202931;
  color:#d6dde1;
  border:1px solid #40505a;
  border-radius:4px;
  padding:8px 10px;
  font-size:10px;
  cursor:pointer;
}

.topology{
  display:grid;
  gap:5px;
}

.topology button.active,
#killDry[aria-pressed=true]{
  background:#123b4d;
  border-color:#19bce5;
  box-shadow:0 0 7px #00bfff55;
  color:#bff4ff;
}

.wide{width:100%}

.setup-grid select{
  width:100%;
  margin-bottom:8px;
}

.row{
  display:flex;
  gap:6px;
  margin-top:7px;
}

.row>*{flex:1}

.setup-grid small{
  display:block;
  margin-top:8px;
  font-size:9px;
  line-height:1.35;
  color:#7f8c94;
}

.filebutton{text-align:center}
.filebutton input{display:none}

.live-status{
  display:flex;
  gap:7px;
  align-items:center;
  margin-top:9px;
  font-size:9px;
  color:#8e9aa2;
}

.live-status i{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#334047;
}

.live-status i.active{
  background:#44dc80;
  box-shadow:0 0 8px #44dc80;
}
