:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07111f;
  color: #e5eefc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(103, 232, 249, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 28%),
    linear-gradient(180deg, #08101d 0%, #040915 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #67e8f9, #8b5cf6);
  color: #06111f;
  font-weight: 700;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

input {
  width: 100%;
  margin-top: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  color: inherit;
  padding: 0.8rem 0.9rem;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 15, 28, 0.78);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #67e8f9;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.desc,
.note {
  color: #94a3b8;
  line-height: 1.65;
}

.controls {
  min-width: 260px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.row,
.button-row {
  display: grid;
  gap: 12px;
}

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

.button-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button-row .danger {
  background: linear-gradient(135deg, #fb7185, #f97316);
  color: #1f0a0a;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.canvas-panel {
  overflow: hidden;
}

.track-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.grid-bg {
  fill: rgba(3, 7, 18, 0.92);
}

.track-line {
  fill: none;
  stroke: url(#trackGlow);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(103, 232, 249, 0.35));
}

.marker {
  stroke: rgba(6, 11, 20, 0.9);
  stroke-width: 3;
}

.marker.start {
  fill: #67e8f9;
}

.marker.end {
  fill: #f472b6;
}

.info-panel {
  padding: 22px;
}

.stats {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.75);
}

.stats span {
  color: #94a3b8;
}

.error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.success {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.note-block {
  margin-top: 12px;
}

.note-title {
  margin-bottom: 10px;
  color: #cbd5e1;
  font-weight: 700;
}

.empty-text {
  fill: #94a3b8;
  font-size: 18px;
}

@media (max-width: 920px) {
  .intro,
  .layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .row,
  .button-row {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 18px;
  }
}
