:root {
  --bg: #0f1221;
  --panel: #171b2f;
  --panel-2: #1f2442;
  --text: #e6e8f1;
  --muted: #aab0c6;
  --accent: #6ee7b7;
  --danger: #ef4444;
  --primary: #60a5fa;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(1200px 900px at 50% -20%, #1a1f3b, var(--bg));
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  height: 100%;
}

.app-header {
  padding: 18px 20px 10px;
}

.app-header h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.controls {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-top: 1px solid #2a315b;
  border-bottom: 1px solid #2a315b;
  padding: 10px 16px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.tip-text {
  color: #a7f3d0;
  font-size: 13px;
  margin-top: 4px;
}

.control-row label {
  background: rgba(255,255,255,0.04);
  padding: 6px 10px;
  border-radius: 6px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toggle input[type="checkbox"] {
  transform: translateY(1px);
}

button {
  background: #27315a;
  color: var(--text);
  border: 1px solid #2a315b;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

button.primary {
  background: #2a3e75;
  border-color: #3656a7;
}

button.danger {
  background: #4a1f1f;
  border-color: #7a2a2a;
}

button.tool.active {
  outline: 2px solid var(--accent);
}

.spacer {
  flex: 1;
}

.canvas-wrap {
  position: relative;
  padding: 12px 16px 16px;
}

canvas#world {
  display: block;
  width: 100%;
  max-width: 1500px;
  height: auto;
  border-radius: 10px;
  background: radial-gradient(1100px 600px at 50% -40%, #2c221a, #14100d);
  outline: 1px solid #4a3a2d;
  margin: 0 auto;
}

/* Mobile: make play area square */
@media (max-width: 768px) {
  canvas#world {
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
  }
}

.hud {
  position: absolute;
  left: 28px;
  top: 22px;
  font-size: 14px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.app-footer {
  padding: 12px 16px 20px;
  color: var(--muted);
}

input[type="range"] {
  vertical-align: middle;
}


