* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans JP", sans-serif;
  background: radial-gradient(1000px 700px at 10% -10%, #16203a 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 0%, #2a1b41 0%, transparent 55%),
    #020617;
  color: #e5e7eb;
  line-height: 1.6;
}

.wrap {
  max-width: 1150px;
  margin: 0 auto;
  padding: 18px;
}

.top h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 32px);
}

.top p {
  margin: 0 0 12px;
  color: #9ca3af;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 16px;
}

.game-panel {
  background: #020617;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.top-ui {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

#routeInfo {
  color: #a5b4fc;
}

canvas#game {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.middle-ui {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.middle-ui .group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#batterySlider {
  width: 180px;
}

.bottom-ui {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 13px;
}

#status {
  flex: 1;
  text-align: right;
  color: #fbbf24;
}

.sound-note {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
}

button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.8);
  background: linear-gradient(
    90deg,
    rgba(129, 140, 248, 0.18),
    rgba(56, 189, 248, 0.18)
  );
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.85);
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 250, 252, 0.9);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.info {
  background: #020617;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 12px;
  font-size: 14px;
  color: #d1d5db;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.info h2 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #e5e7eb;
}

.info p {
  margin: 0 0 8px;
}

.info ol,
.info ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

.info code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
}

.legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
}

.legend.origin {
  background: #22c55e;
}

.legend.dest {
  background: #f97316;
}

.legend.hub {
  background: #38bdf8;
}

/* スマホ向け */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
