:root {
  --bg: #05060d;
  --panel: #0f162d;
  --panel-2: #101b39;
  --line: #2d4374;
  --text: #e2ebff;
  --muted: #9db1df;
  --accent: #67b3ff;
  --accent-2: #9c76ff;
  --good: #59ffb0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 95% -5%, rgba(90, 74, 220, 0.35), transparent 58%),
    radial-gradient(700px 500px at -10% 100%, rgba(20, 111, 222, 0.3), transparent 60%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.09;
}

.app {
  width: min(980px, 95vw);
  margin: 1.4rem auto 2rem;
}

.topbar {
  margin-bottom: 0.95rem;
}

.kicker {
  margin: 0;
  color: #ffd46b;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

h1 {
  margin: 0.25rem 0;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: 0.03em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel) 0%, #0a1224 100%);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  padding: 1rem;
}

.controls {
  margin-bottom: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input[type="text"],
.field select {
  background: #091127;
  border: 1px solid #345189;
  color: var(--text);
  border-radius: 9px;
  font-size: 1rem;
  padding: 0.55rem 0.68rem;
}

.field input[type="text"]:focus,
.field select:focus {
  outline: none;
  border-color: #74b6ff;
  box-shadow: 0 0 0 2px rgba(116, 182, 255, 0.2);
}

.field input[type="range"] {
  accent-color: var(--accent);
}

.field strong {
  color: #b8d4ff;
  font-size: 0.85rem;
}

.field--wide {
  margin-bottom: 0.7rem;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.7rem;
}

.actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  border: 1px solid #4568a9;
  background: #122144;
  color: var(--text);
  border-radius: 9px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover,
.btn:focus-visible {
  background: #17305f;
  transform: translateY(-1px);
  outline: none;
}

.btn--primary {
  border-color: #70b4ff;
  background: linear-gradient(180deg, #2f84ff 0%, #2766d4 100%);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: linear-gradient(180deg, #4a97ff 0%, #2f72de 100%);
}

.hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.status {
  margin: 0.45rem 0 0;
  border-radius: 10px;
  border: 1px solid #314d84;
  background: #0c1732;
  padding: 0.6rem 0.7rem;
  min-height: 44px;
}

.status.good {
  border-color: #34966e;
  color: #b8ffdb;
}

.status.warn {
  border-color: #9a5f5f;
  color: #ffd6d6;
}

.monitor {
  background: linear-gradient(180deg, var(--panel-2) 0%, #0a142d 100%);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.stat {
  border: 1px solid #30456f;
  border-radius: 10px;
  padding: 0.52rem 0.6rem;
  background: #101d3d;
}

.stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat strong {
  font-size: 1.17rem;
}

#scope {
  width: 100%;
  border: 1px solid #38558f;
  border-radius: 10px;
  display: block;
  margin-bottom: 0.8rem;
  background: #050915;
}

.sequence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.45rem;
}

.step {
  border: 1px solid #2f4776;
  border-radius: 9px;
  background: #0f1a37;
  padding: 0.42rem 0.48rem;
  min-height: 64px;
}

.step .ch {
  display: block;
  font-weight: 700;
  color: #d7e6ff;
}

.step .note {
  display: block;
  color: #8bc9ff;
  font-size: 0.82rem;
}

.step .dur {
  color: var(--muted);
  font-size: 0.74rem;
}

.step.active {
  border-color: #84deff;
  box-shadow: 0 0 0 1px #84deff inset;
}

.step.rest {
  background: #151735;
  border-style: dashed;
}

.footer {
  margin-top: 0.85rem;
}

.footer a {
  color: #accdff;
  text-decoration: none;
}

.footer a:hover {
  color: #dce9ff;
}

@media (max-width: 640px) {
  .app {
    margin-top: 1rem;
  }

  .panel {
    padding: 0.82rem;
  }

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