* {
  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: 1100px;
  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.3fr);
  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;
}

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

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

.build-ui {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.build-group .label {
  font-size: 13px;
  color: #9ca3af;
}

.tower-btn {
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(94, 234, 212, 0.5);
  background: radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.2), transparent 60%);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
  min-width: 120px;
  text-align: left;
}

.tower-btn small {
  display: block;
  color: #a5b4fc;
}

.tower-btn.active {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.4);
  background: radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.24), transparent 60%);
}

#startWaveBtn {
  padding: 8px 14px;
  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-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.85);
}

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

.selected-ui {
  margin-top: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 13px;
}

.selected-ui p {
  margin: 0 0 4px;
  font-weight: 600;
}

#towerInfo {
  white-space: pre-line;
  color: #d1d5db;
}

.selected-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.selected-actions button {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
}

.selected-actions button:hover {
  background: #111827;
}

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

.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 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;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
