@font-face {
  font-family: "Orbitron Local";
  src: url("../rd-64-robot-drummer/fonts/Orbitron-Variable.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #101010;
  --panel: #202020;
  --panel-2: #171717;
  --panel-3: #111111;
  --line: rgba(230, 230, 235, 0.14);
  --line-soft: rgba(230, 230, 235, 0.08);
  --line-strong: rgba(0, 174, 255, 0.55);
  --text: #f4f4f7;
  --muted: #aaaab2;
  --cyan: #00aeff;
  --green: #1cff5b;
  --amber: #d8bb78;
  --danger: #ff5f78;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  scrollbar-color: #3b3b3b #101010;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #101010;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: #3b3b3b;
  border: 2px solid #101010;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 174, 255, 0.13), transparent 34%),
    linear-gradient(135deg, #151515 0%, #0d0d0d 54%, #151515 100%);
  color: var(--text);
  font-family: "Orbitron Local", "Segoe UI", sans-serif;
  text-transform: uppercase;
}

button,
input,
select {
  font: inherit;
  color: var(--text);
}

button,
select,
input {
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #141414;
}

button {
  padding: 0 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

button:hover {
  border-color: var(--line-strong);
  background: #1c1c1c;
  transform: translateY(-1px);
}

select,
input {
  width: 100%;
  padding: 0 12px;
}

.app-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 1.6vw, 22px);
}

.hero,
.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(38, 38, 38, 0.94), rgba(18, 18, 18, 0.97));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: var(--radius);
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 1.8vw, 28px);
  min-width: 0;
}

.eyebrow {
  flex: 0 0 auto;
  margin: 0;
  color: var(--amber);
  font-size: clamp(0.58rem, 0.72vw, 0.72rem);
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  position: relative;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.75rem, 2.5vw, 3.1rem);
  line-height: 0.94;
  letter-spacing: 0.12em;
  color: #f7f7fb;
  background:
    linear-gradient(180deg, #ffffff 0%, #dfeaff 18%, #9ce6ff 38%, #00aeff 68%, #245c78 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
  filter: drop-shadow(0 0 10px rgba(0, 174, 255, 0.2));
}

h1::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.3) 0,
      rgba(255, 255, 255, 0.3) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: overlay;
  opacity: 0.38;
}

h2 {
  color: #f7f7fb;
  font-size: 0.98rem;
  letter-spacing: 0.16em;
}

h3 {
  color: var(--cyan);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
}

.subtitle {
  max-width: 820px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
  letter-spacing: 0.06em;
  text-transform: none;
}

.status-stack {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.status-pill,
.network-state {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.status-pill {
  min-width: 178px;
  padding: 0 14px;
  white-space: nowrap;
}

.status-pill.ready,
.network-state.ready {
  color: var(--green);
  border-color: rgba(28, 255, 91, 0.38);
}

.status-pill.warn,
.network-state.warn {
  color: var(--amber);
  border-color: rgba(216, 187, 120, 0.38);
}

.primary-action {
  min-height: 40px;
  min-width: 148px;
  border-color: rgba(0, 174, 255, 0.52);
  background: linear-gradient(180deg, rgba(0, 174, 255, 0.2), rgba(0, 174, 255, 0.08));
  color: #ffffff;
}

.icon-action {
  width: 42px;
  min-width: 42px;
  min-height: 40px;
  padding: 0;
  border-color: rgba(0, 174, 255, 0.48);
  color: var(--cyan);
  font-size: 1.05rem;
  line-height: 1;
}

.icon-action.active {
  border-color: rgba(28, 255, 91, 0.42);
  color: var(--green);
}

button.active {
  border-color: rgba(28, 255, 91, 0.42);
  color: var(--green);
}

.overview-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line);
}

.metric {
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 4px;
  background: rgba(24, 24, 24, 0.96);
}

.metric span {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
}

.metric strong {
  color: var(--cyan);
  font-size: 1.5rem;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.panel {
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}

.workspace > *,
.lower-grid > * {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.endpoint-group + .endpoint-group {
  margin-top: 18px;
}

.endpoint-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.endpoint {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.72), rgba(8, 8, 8, 0.42));
}

.endpoint > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.endpoint-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.endpoint.active .endpoint-dot {
  background: var(--green);
  box-shadow: 0 0 14px rgba(28, 255, 91, 0.5);
}

.endpoint-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-type {
  display: block;
  color: var(--muted);
  font-size: 0.59rem;
  letter-spacing: 0.12em;
}

.route-panel {
  max-width: 100%;
  overflow: auto;
}

.keymap-panel {
  grid-column: 1 / -1;
  overflow: auto;
}

.routes {
  display: grid;
  gap: 7px;
  min-width: 1080px;
}

.keymaps {
  display: grid;
  gap: 7px;
  min-width: 820px;
}

.route-grid {
  display: grid;
  grid-template-columns: 38px minmax(176px, 1.3fr) minmax(176px, 1.3fr) 86px 96px 86px 164px 78px 66px 40px;
  gap: 8px;
  align-items: center;
}

.keymap-grid {
  display: grid;
  grid-template-columns: 38px minmax(140px, 1fr) 110px 80px 120px 110px 40px;
  gap: 8px;
  align-items: center;
}

.route-grid-head {
  min-width: 1080px;
  margin: 2px 0 8px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.keymap-grid-head {
  min-width: 820px;
  margin: 2px 0 8px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.route {
  padding: 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(8, 8, 8, 0.54));
}

.keymap {
  padding: 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(8, 8, 8, 0.54));
}

.route select,
.route input,
.keymap select,
.keymap input,
.keymap button {
  min-height: 42px;
}

.route input[type="checkbox"],
.keymap input[type="checkbox"] {
  width: 20px;
  justify-self: center;
  min-height: 20px;
  accent-color: var(--cyan);
}

.route input[type="number"],
.keymap input[type="number"] {
  padding: 0 8px;
}

.note-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.delete-route,
.delete-keymap {
  width: 38px;
  padding: 0;
  color: var(--danger);
}

.capture-key {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(440px, 1.08fr);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.network-grid label {
  display: grid;
  gap: 6px;
}

.network-grid span {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.monitor {
  height: 222px;
  overflow: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-3);
}

.monitor-line {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.monitor-line strong {
  color: var(--cyan);
  font-weight: 600;
}

.monitor-line code {
  color: var(--text);
  font-family: "Orbitron Local", monospace;
}

@media (max-width: 1180px) {
  .workspace,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .status-stack {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
  }

  .lower-grid {
    align-items: initial;
  }
}

@media (max-width: 720px) {
  body {
    padding: 10px;
    background:
      radial-gradient(circle at 30% 0%, rgba(0, 174, 255, 0.11), transparent 34%),
      #101010;
  }

  .app-shell {
    width: auto;
    max-width: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
  }

  .hero,
  .panel {
    padding: 14px;
  }

  .header-brand {
    display: grid;
    gap: 8px;
  }

  h1 {
    font-size: clamp(2rem, 13vw, 2.95rem);
    letter-spacing: 0.075em;
  }

  h2 {
    font-size: 0.88rem;
    letter-spacing: 0.12em;
  }

  .eyebrow,
  .subtitle,
  .status-pill,
  .network-state {
    letter-spacing: 0.08em;
  }

  button,
  select,
  input {
    min-height: 38px;
  }

  .hero,
  .overview-panel,
  .panel,
  .status-stack,
  .status-pill,
  .primary-action {
    width: 100%;
    max-width: 100%;
  }

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

  .status-pill,
  .primary-action {
    min-width: 0;
  }

  .icon-action {
    width: 100%;
  }

  .hero,
  .overview-panel,
  .panel {
    overflow: hidden;
  }

  .route-panel {
    overflow-x: auto;
  }

  .subtitle {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .overview-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 76px;
  }

  .network-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    justify-content: flex-start;
  }

  .section-head button,
  .button-row button {
    min-height: 36px;
    padding: 0 12px;
  }

  .route-panel {
    padding-bottom: 10px;
  }

  .monitor {
    height: 190px;
  }
}
