:root {
  font-family: "Orbitron", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color-scheme: dark;
  --bg: #12071f;
  --bg-secondary: rgba(255, 255, 255, 0.08);
  --neon-pink: #ff5fd2;
  --neon-cyan: #25f5ff;
  --neon-purple: #b967ff;
  --accent-yellow: #ffe66d;
  --text-primary: #f6f6ff;
  --text-muted: rgba(246, 246, 255, 0.7);
  --tile-size: min(110px, 20vw);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #260045, var(--bg));
  color: var(--text-primary);
  display: flex;
  justify-content: center;
}

.app {
  width: min(1200px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 0 3rem;
}

.app__header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(37, 245, 255, 0.2), rgba(255, 95, 210, 0.08));
  padding: 1.75rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 95, 210, 0.3);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

h1 {
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  margin: 0;
}

p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.transport {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: center;
  background: rgba(16, 12, 31, 0.85);
  border: 1px solid rgba(37, 245, 255, 0.2);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(6px);
}

.transport__section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transport__recorders {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

input[type="range"] {
  width: 100%;
}

.button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 95, 210, 0.2);
}

.button--primary {
  background: linear-gradient(120deg, rgba(255, 95, 210, 0.65), rgba(37, 245, 255, 0.45));
  border: none;
  color: #12071f;
}

.button--ghost:not(:disabled) {
  border-color: rgba(37, 245, 255, 0.45);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.grid__column {
  background: rgba(12, 10, 26, 0.85);
  border-radius: 1.25rem;
  padding: 1rem 1.25rem 1.5rem;
  border: 1px solid rgba(185, 103, 255, 0.2);
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.25);
}

.grid__column--full {
  padding-top: 0;
}

.grid__column--full h2 {
  padding-top: 1rem;
}

.grid__hint {
  margin-bottom: 1rem;
  font-family: "VT323", monospace;
  letter-spacing: 0.06em;
  color: rgba(255, 230, 109, 0.8);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--tile-size), 1fr));
  gap: 1rem;
  justify-items: stretch;
}

.tile-grid--captured {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.pad-scale-legend {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(37, 245, 255, 0.25);
  background: rgba(12, 10, 26, 0.9);
  box-shadow: inset 0 0 20px rgba(37, 245, 255, 0.08);
}

.pad-scale-legend--full {
  margin: 0.5rem 0 2rem;
}

.pad-scale-legend__keys {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(37, 245, 255, 0.14);
  box-shadow: inset 0 0 15px rgba(185, 103, 255, 0.16);
}

.pad-scale-legend__label {
  font-family: "VT323", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.18em;
  color: rgba(255, 230, 109, 0.9);
  text-shadow: 0 0 8px rgba(255, 230, 109, 0.35);
}

.pad-scale-legend__control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "VT323", monospace;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(37, 245, 255, 0.1);
  border: 1px solid rgba(37, 245, 255, 0.3);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.pad-scale-legend__control:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 245, 255, 0.2);
}

.pad-scale-legend__control:disabled {
  cursor: default;
  opacity: 0.8;
}

.pad-scale-legend__control:disabled:hover,
.pad-scale-legend__control:disabled:active {
  transform: none;
  box-shadow: none;
}

.pad-scale-legend__control:active {
  transform: translateY(0);
  box-shadow: none;
}

.pad-scale-legend__control--left {
  padding-left: 0.8rem;
}

.pad-scale-legend__control--right {
  padding-right: 0.8rem;
}

.pad-scale-legend__arrow {
  font-size: 1.2rem;
  color: rgba(185, 103, 255, 0.9);
}

.tile {
  position: relative;
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(17, 10, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease, background 0.15s ease;
  min-height: 130px;
}

.tile__key {
  font-family: "VT323", monospace;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  color: var(--accent-yellow);
}

.tile__label {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tile__label--small {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.tile--active {
  transform: translateY(-4px);
  border-color: rgba(255, 230, 109, 0.8);
  box-shadow: 0 18px 35px rgba(37, 245, 255, 0.18);
  background: linear-gradient(
    140deg,
    rgba(37, 245, 255, 0.25),
    rgba(185, 103, 255, 0.25)
  );
}

.tile--loop::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 0.8rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.tile--pulse .tile__key {
  color: var(--neon-pink);
}

.tile--loop .tile__key {
  color: var(--neon-cyan);
}

.tile--pad .tile__key {
  color: var(--neon-purple);
}

.footer {
  display: flex;
  justify-content: space-between;
  font-family: "VT323", monospace;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(10, 6, 20, 0.9);
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(37, 245, 255, 0.2);
}

.footer__map {
  color: rgba(255, 230, 109, 0.85);
}

@media (max-width: 768px) {
  .app__header {
    flex-direction: column;
  }

  .transport__recorders {
    justify-content: flex-start;
  }

  .pad-scale-legend {
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 1.75rem;
  }

  .footer {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .tile {
    min-height: 120px;
  }

  .transport {
    grid-template-columns: 1fr;
  }
}
