* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0b0d10;
  --bg-deep: #070809;
  --surface: #12151a;
  --surface-2: #171b21;
  --surface-3: #1c2128;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.13);
  --text: #f5f7f8;
  --text-soft: #c5cbd2;
  --muted: #737c86;
  --muted-2: #4f5760;
  --lime: #b8f34a;
  --lime-strong: #8ed321;
  --lime-soft: rgba(184,243,74,.11);
  --orange: #ff7b36;
  --orange-soft: rgba(255,123,54,.12);
  --red: #ff4d59;
  --red-soft: rgba(255,77,89,.13);
  --green: #49dd9b;
  --green-soft: rgba(73,221,155,.12);
  --amber: #ffb84c;
  --shadow: 0 30px 80px rgba(0,0,0,.42);
}

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 8%, rgba(184,243,74,.055), transparent 30%),
    radial-gradient(circle at 93% 30%, rgba(255,123,54,.045), transparent 27%),
    linear-gradient(180deg, #0e1114 0%, var(--bg) 45%, #07090b 100%);
  font-family: "Segoe UI", Arial, sans-serif;
  user-select: none;
}

button,
input { font: inherit; }

button { border: 0; }

svg { width: 100%; height: 100%; fill: currentColor; }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.ambient-one {
  width: 420px;
  height: 420px;
  left: -190px;
  top: 170px;
  background: rgba(184,243,74,.045);
}

.ambient-two {
  width: 500px;
  height: 500px;
  right: -250px;
  top: 420px;
  background: rgba(255,123,54,.035);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.controller-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 38px;
  position: relative;
  z-index: 1;
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-symbol {
  width: 48px;
  height: 48px;
  padding: 9px;
  color: #0b0d10;
  border-radius: 14px;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(184,243,74,.055), 0 12px 35px rgba(0,0,0,.32);
}

.overline,
.micro-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .16em;
}

.brand-block h1 {
  margin-top: 5px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -.04em;
  font-weight: 500;
}

.brand-block h1 strong {
  color: var(--lime);
  font-weight: 900;
}

.header-specs {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(18,21,26,.72);
}

.spec {
  min-width: 100px;
  padding: 10px 16px;
  border-left: 1px solid var(--line);
}

.spec:first-child { border-left: 0; }

.spec span,
.spec strong { display: block; }

.spec span {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: .18em;
  font-weight: 800;
}

.spec strong {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.connection-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(184,243,74,.025), transparent 32%),
    rgba(18,21,26,.83);
  box-shadow: 0 16px 48px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.02);
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.connection-strip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--red);
  box-shadow: 0 0 14px rgba(255,77,89,.5);
  transition: .25s ease;
}

.connection-strip.connected {
  border-color: rgba(184,243,74,.16);
  box-shadow: 0 16px 48px rgba(0,0,0,.2), 0 0 38px rgba(184,243,74,.025);
}

.connection-strip.connected::before {
  background: var(--lime);
  box-shadow: 0 0 18px rgba(184,243,74,.58);
}

.connection-state {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.connection-state > div { min-width: 0; }

.status-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 3px solid rgba(255,77,89,.2);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255,77,89,.045), 0 0 12px rgba(255,77,89,.3);
}

.status-dot.connecting {
  background: var(--amber);
  border-color: rgba(255,184,76,.2);
  animation: pulse 1s infinite;
}

.status-dot.connected {
  background: var(--lime);
  border-color: rgba(184,243,74,.2);
  box-shadow: 0 0 0 4px rgba(184,243,74,.05), 0 0 14px rgba(184,243,74,.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.78); }
}

.connection-state strong,
.connection-state small { display: block; }

.connection-state strong {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}

.connection-state small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-pill {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 175px;
  padding: 9px 12px;
  border: 1px solid rgba(184,243,74,.12);
  border-radius: 12px;
  background: var(--lime-soft);
}

.device-pill.show { display: flex; }

.device-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 6px;
  color: var(--lime);
  border-radius: 8px;
  background: rgba(184,243,74,.08);
}

.device-pill span,
.device-pill strong { display: block; }

.device-pill div span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.device-pill strong {
  max-width: 155px;
  margin-top: 2px;
  color: var(--lime);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect-button {
  min-width: 134px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  color: #101408;
  border-radius: 12px;
  background: var(--lime);
  box-shadow: 0 10px 26px rgba(184,243,74,.13), inset 0 1px 0 rgba(255,255,255,.25);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, background .2s ease;
}

.connect-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.connect-button:active { transform: translateY(1px) scale(.985); }
.connect-button:disabled { opacity: .55; cursor: wait; transform: none; }

.connect-button.disconnect {
  color: #fff;
  background: var(--red);
  box-shadow: 0 10px 26px rgba(255,77,89,.13);
}

.connect-button-icon {
  width: 18px;
  height: 18px;
  transition: transform .2s ease;
}

.connect-button.disconnect .connect-button-icon { transform: rotate(45deg); }

.control-deck {
  display: grid;
  grid-template-columns: minmax(370px, 1.02fr) minmax(370px, 1.02fr) minmax(280px, .7fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.deck-card,
.console-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.012), transparent 28%),
    rgba(18,21,26,.92);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.025);
  position: relative;
  overflow: hidden;
}

.deck-card::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 1px;
  top: 0;
  left: 28px;
  background: linear-gradient(90deg, var(--lime), transparent);
  opacity: .32;
}

.drive-card,
.joystick-card { min-height: 560px; padding: 25px; }

.card-header,
.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 13px;
}

.section-index {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: var(--lime);
  border: 1px solid rgba(184,243,74,.14);
  border-radius: 11px;
  background: rgba(184,243,74,.04);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
}

.card-header h2,
.mini-header h3,
.console-header h3 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -.03em;
}

.active-command {
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-command > span {
  color: var(--muted-2);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
}

.cmd-chip {
  min-width: 39px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #0c1006;
  border-radius: 9px;
  background: var(--lime);
  box-shadow: 0 0 18px rgba(184,243,74,.12);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.cmd-chip.idle {
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: #0c0e11;
  box-shadow: none;
}

.dpad-frame {
  flex: 1;
  min-height: 385px;
  display: grid;
  place-items: center;
  position: relative;
}

.dpad-frame::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255,255,255,.03);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(255,255,255,.009), 0 0 0 55px rgba(255,255,255,.005);
}

.dpad-shadow {
  width: 250px;
  height: 250px;
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.55), transparent 64%);
  filter: blur(4px);
}

.dpad {
  width: 272px;
  height: 272px;
  display: grid;
  grid-template-columns: 86px 86px 86px;
  grid-template-rows: 86px 86px 86px;
  gap: 7px;
  position: relative;
  z-index: 2;
}

.dpad-btn,
.stop-btn {
  color: #a9b1ba;
  background: linear-gradient(145deg, #232830, #161a20);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 11px 24px rgba(0,0,0,.36), inset 0 1px 1px rgba(255,255,255,.05), inset 0 -3px 7px rgba(0,0,0,.25);
  cursor: pointer;
  transition: transform .1s ease, color .1s ease, border-color .1s ease, box-shadow .1s ease;
  position: relative;
  outline: none;
}

.dpad-btn svg {
  width: 32px;
  height: 32px;
}

.dpad-btn small {
  position: absolute;
  color: #545d67;
  font-family: Consolas, monospace;
  font-size: 8px;
  font-weight: 900;
}

.dpad-up { grid-column: 2; grid-row: 1; border-radius: 18px 18px 10px 10px; }
.dpad-left { grid-column: 1; grid-row: 2; border-radius: 18px 10px 10px 18px; }
.dpad-right { grid-column: 3; grid-row: 2; border-radius: 10px 18px 18px 10px; }
.dpad-down { grid-column: 2; grid-row: 3; border-radius: 10px 10px 18px 18px; }

.dpad-up small { bottom: 8px; left: 10px; }
.dpad-down small { top: 8px; right: 10px; }
.dpad-left small { right: 8px; bottom: 8px; }
.dpad-right small { left: 8px; bottom: 8px; }

.stop-btn {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 22px;
  color: var(--red);
  background: linear-gradient(145deg, #241a1d, #171416);
}

.stop-core {
  width: 23px;
  height: 23px;
  display: block;
  border-radius: 6px;
  background: currentColor;
  box-shadow: 0 0 18px rgba(255,77,89,.19);
}

.stop-btn small {
  color: #795056;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
}

.dpad-btn:active,
.dpad-btn.on,
.stop-btn:active,
.stop-btn.on {
  transform: translateY(3px) scale(.97);
}

.dpad-btn.on {
  color: var(--lime);
  border-color: rgba(184,243,74,.28);
  box-shadow: 0 4px 12px rgba(0,0,0,.34), inset 0 0 22px rgba(184,243,74,.08), 0 0 20px rgba(184,243,74,.07);
}

.stop-btn.on {
  border-color: rgba(255,77,89,.25);
  box-shadow: 0 4px 12px rgba(0,0,0,.34), inset 0 0 20px rgba(255,77,89,.08), 0 0 18px rgba(255,77,89,.08);
}

.dpad-btn:disabled,
.stop-btn:disabled,
.preset-btn:disabled,
.send-button:disabled,
.command-input:disabled {
  cursor: not-allowed;
}

.direction-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.direction-legend div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.014);
}

.direction-legend span,
.direction-legend strong { display: block; }

.direction-legend span {
  color: var(--lime);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
}

.direction-legend strong {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
}

.mode-badge > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(184,243,74,.5);
}

.joystick-card {
  display: flex;
  flex-direction: column;
}

.joystick-console {
  flex: 1;
  min-height: 390px;
  display: grid;
  place-items: center;
  position: relative;
}

.joystick-orbit {
  position: absolute;
  border: 1px solid rgba(255,255,255,.033);
  border-radius: 50%;
}

.orbit-one { width: 330px; height: 330px; }
.orbit-two { width: 285px; height: 285px; border-style: dashed; }

.joy-base {
  width: 232px;
  height: 232px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.035), transparent 45%),
    linear-gradient(145deg, #0a0c0f, #15191e);
  box-shadow: inset 0 0 35px rgba(0,0,0,.74), inset 0 1px 2px rgba(255,255,255,.03), 0 19px 34px rgba(0,0,0,.33);
  position: relative;
  touch-action: none;
  cursor: grab;
}

.joy-base:active { cursor: grabbing; }

.axis {
  position: absolute;
  z-index: 1;
  color: #3f474f;
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
}

.axis-top { top: 13px; left: 50%; transform: translateX(-50%); }
.axis-bottom { bottom: 13px; left: 50%; transform: translateX(-50%); }
.axis-left { left: 14px; top: 50%; transform: translateY(-50%); }
.axis-right { right: 14px; top: 50%; transform: translateY(-50%); }

.joy-guideline {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
}

.joy-guideline.vertical {
  width: 1px;
  height: 70%;
  top: 15%;
  left: 50%;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.06), transparent);
}

.joy-guideline.horizontal {
  height: 1px;
  width: 70%;
  top: 50%;
  left: 15%;
}

.joy-knob {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 50%;
  background: linear-gradient(145deg, #2b3138, #171b20);
  box-shadow: 0 16px 25px rgba(0,0,0,.45), inset 0 2px 2px rgba(255,255,255,.08), inset 0 -8px 15px rgba(0,0,0,.28), 0 0 0 7px rgba(255,255,255,.018);
  position: absolute;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}

.joy-knob.active {
  border-color: rgba(184,243,74,.3);
  box-shadow: 0 16px 25px rgba(0,0,0,.45), inset 0 2px 2px rgba(255,255,255,.09), inset 0 -8px 15px rgba(0,0,0,.28), 0 0 0 7px rgba(184,243,74,.035), 0 0 35px rgba(184,243,74,.11);
}

.knob-highlight {
  width: 62px;
  height: 62px;
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.1), transparent 34%);
}

.knob-grip {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(184,243,74,.15);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(184,243,74,.08) 0 1px, transparent 1px 4px),
    rgba(184,243,74,.025);
}

.card-description {
  max-width: 440px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  text-align: center;
}

.side-stack {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.speed-card,
.commands-card { padding: 20px; }

.mini-header h3 { font-size: 18px; }

.speed-value {
  padding: 7px 9px;
  color: var(--lime);
  border: 1px solid rgba(184,243,74,.13);
  border-radius: 8px;
  background: rgba(184,243,74,.045);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.range-panel { margin-top: 25px; }

.range-scale,
.range-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.range-scale {
  margin-bottom: 9px;
  color: #454c54;
  font-family: Consolas, monospace;
  font-size: 8px;
}

.range-caption {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
}

input[type=range] {
  --range-progress: 23.8%;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--lime) var(--range-progress), #2a3037 var(--range-progress));
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 4px solid #111419;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--lime);
  box-shadow: 0 0 0 1px rgba(184,243,74,.32), 0 0 18px rgba(184,243,74,.18);
}

input[type=range]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 4px solid #111419;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 1px rgba(184,243,74,.32), 0 0 18px rgba(184,243,74,.18);
}

.commands-card {
  display: flex;
  flex-direction: column;
}

.command-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  margin-top: 20px;
}

.command-input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  background: #0b0d10;
  font-family: Consolas, monospace;
  font-size: 12px;
  letter-spacing: .12em;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.command-input::placeholder { color: #3d444b; }
.command-input:focus { border-color: rgba(184,243,74,.26); box-shadow: 0 0 0 3px rgba(184,243,74,.025); }

.send-button {
  width: 48px;
  height: 48px;
  padding: 14px;
  color: #101408;
  border-radius: 11px;
  background: var(--lime);
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}

.send-button:hover { filter: brightness(1.08); }
.send-button:active { transform: scale(.95); }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.preset-btn {
  min-height: 59px;
  padding: 11px 12px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.preset-btn span,
.preset-btn small { display: block; }

.preset-btn span {
  color: var(--lime);
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.preset-btn small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.preset-btn:hover:not(:disabled) {
  border-color: rgba(184,243,74,.17);
  background: rgba(184,243,74,.035);
  transform: translateY(-1px);
}

.preset-stop {
  grid-column: 1 / -1;
  border-color: rgba(255,77,89,.1);
}

.preset-stop span { color: var(--red); }

.card-lockable { position: relative; }

.card-lockable.locked::after {
  content: "CONECTA EL HM-10 PARA HABILITAR";
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #6f7780;
  border-radius: inherit;
  background: rgba(11,13,16,.7);
  backdrop-filter: blur(4px);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  text-align: center;
}

.console-panel {
  margin-top: 16px;
  padding: 18px;
}

.console-panel::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 1px;
  top: 0;
  left: 22px;
  background: linear-gradient(90deg, var(--orange), transparent);
  opacity: .38;
}

.console-header,
.console-header > div {
  display: flex;
  align-items: center;
}

.console-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.console-header > div { gap: 10px; }

.console-lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255,123,54,.5);
}

.console-header h3 { font-size: 15px; }

.clear-button {
  padding: 7px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.clear-button:hover { color: var(--text-soft); border-color: var(--line-strong); }

.console-body {
  height: 180px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 13px;
  overflow: hidden;
  background: #080a0c;
  box-shadow: inset 0 0 28px rgba(0,0,0,.28);
}

.console-gutter {
  padding: 12px 0;
  border-right: 1px solid rgba(255,255,255,.045);
  background: #0b0d10;
}

.console-gutter span {
  display: block;
  height: 24px;
  color: #2d3339;
  font-family: Consolas, monospace;
  font-size: 9px;
  text-align: center;
}

.log-box {
  height: 100%;
  padding: 12px 14px;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.7;
  user-select: text;
}

.log-line {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.lt { color: #394047; flex: 0 0 auto; }
.ld { color: #7c8791; }
.lc { color: var(--lime); font-weight: 800; }
.le { color: #ff6973; }
.ls { color: #67dea8; }
.la { color: #f8b25d; }

.log-box::-webkit-scrollbar { width: 5px; }
.log-box::-webkit-scrollbar-track { background: transparent; }
.log-box::-webkit-scrollbar-thumb { background: #242a30; border-radius: 99px; }

.app-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 18px 5px 0;
  color: #4b535c;
  font-size: 9px;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  letter-spacing: .11em;
}

.footer-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
}

.app-footer p { text-align: center; }
.app-footer > strong { font-family: Consolas, monospace; color: #59616a; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 999;
  max-width: calc(100% - 28px);
  padding: 11px 15px;
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(18,21,26,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, 90px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2,.9,.2,1), opacity .2s ease;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok { color: #c6ff66; border-color: rgba(184,243,74,.2); }
.toast.err { color: #ff8a91; border-color: rgba(255,77,89,.2); }

@media (max-width: 1120px) {
  .control-deck { grid-template-columns: 1fr 1fr; }
  .side-stack { grid-column: 1 / -1; grid-template-columns: 1fr 1.2fr; grid-template-rows: none; }
  .drive-card, .joystick-card { min-height: 540px; }
}

@media (max-width: 820px) {
  .controller-shell { width: min(100% - 24px, 680px); padding-top: 18px; }
  .app-header { align-items: flex-start; }
  .header-specs { display: none; }
  .connection-strip { grid-template-columns: 1fr auto; }
  .device-pill { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .control-deck { grid-template-columns: 1fr; }
  .side-stack { grid-column: auto; grid-template-columns: 1fr; }
  .drive-card, .joystick-card { min-height: auto; }
  .dpad-frame, .joystick-console { min-height: 390px; }
  .app-footer { grid-template-columns: 1fr auto; }
  .app-footer p { display: none; }
}

@media (max-width: 520px) {
  .controller-shell { width: min(100% - 18px, 500px); padding-top: 12px; }
  .app-header { min-height: 64px; padding-bottom: 12px; }
  .brand-symbol { width: 42px; height: 42px; border-radius: 12px; }
  .brand-block h1 { font-size: 21px; }
  .overline { font-size: 8px; }
  .connection-strip { gap: 12px; padding: 13px; border-radius: 15px; }
  .connection-state small { max-width: 190px; }
  .connect-button { min-width: 109px; height: 42px; padding: 0 12px; font-size: 10px; }
  .connect-button-icon { width: 15px; height: 15px; }
  .deck-card, .console-panel { border-radius: 18px; }
  .drive-card, .joystick-card { padding: 18px 14px; }
  .speed-card, .commands-card { padding: 17px 14px; }
  .card-header h2 { font-size: 18px; }
  .section-index { width: 33px; height: 33px; }
  .dpad-frame { min-height: 340px; }
  .dpad-frame::before { width: 268px; height: 268px; }
  .dpad { width: 248px; height: 248px; grid-template-columns: 78px 78px 78px; grid-template-rows: 78px 78px 78px; gap: 7px; }
  .dpad-btn svg { width: 28px; height: 28px; }
  .direction-legend { grid-template-columns: repeat(2, 1fr); }
  .joystick-console { min-height: 340px; }
  .orbit-one { width: 285px; height: 285px; }
  .orbit-two { width: 250px; height: 250px; }
  .joy-base { width: 218px; height: 218px; }
  .joy-knob { width: 80px; height: 80px; }
  .console-panel { padding: 14px; }
  .console-body { grid-template-columns: 30px 1fr; height: 165px; }
  .console-gutter span { font-size: 8px; }
  .log-box { padding: 10px; font-size: 9.5px; }
  .app-footer { padding: 14px 3px 0; font-size: 8px; }
}

@media (max-width: 380px) {
  .brand-block { gap: 10px; }
  .brand-symbol { width: 38px; height: 38px; }
  .brand-block h1 { font-size: 18px; }
  .connection-state small { max-width: 145px; }
  .connect-button { min-width: 96px; }
  .connect-button-icon { display: none; }
  .dpad-frame { min-height: 315px; }
  .dpad-frame::before { width: 238px; height: 238px; }
  .dpad { width: 224px; height: 224px; grid-template-columns: 70px 70px 70px; grid-template-rows: 70px 70px 70px; gap: 7px; }
  .orbit-one { width: 250px; height: 250px; }
  .orbit-two { width: 220px; height: 220px; }
  .joy-base { width: 200px; height: 200px; }
  .joy-knob { width: 74px; height: 74px; }
}
