:root {
  --bg: #0f1115;
  --panel: #161922;
  --text: #e6e8ee;
  --muted: #8a90a6;
  --accent: #6b9cff;
  --danger: #ff6b6b;
  --outline: #2a2f3b;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 14px;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #10131a;
  --muted: #606779;
  --accent: #3b6cff;
  --danger: #e14949;
  --outline: #e6e8ee;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}
.brand { margin: 0; font-size: 20px; letter-spacing: 0.4px; }
.muted { color: var(--muted); font-weight: 500; margin-left: 6px; }

#toggle-theme {
  padding: 8px 12px;
  border: 1px solid var(--outline);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  padding: 0 22px 22px;
}

.controls {
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.control-group label { display:block; font-size: 14px; margin-bottom: 8px; color: var(--muted); }
select, input[type="range"], button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--text);
}

.energy-row { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px; }
.energy-bar { height: 10px; background: var(--outline); border-radius: 999px; }
.energy-fill { height: 100%; background: linear-gradient(90deg, #39d98a, #e2b93b, #e14949); border-radius: 999px; }

.color-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { height: 34px; border: 1px solid var(--outline); }
.swatch[data-palette="sunset"] { background: linear-gradient(90deg,#ff7a7a,#ffd06b,#ff8e6b); }
.swatch[data-palette="neon"] { background: linear-gradient(90deg,#26ffe0,#3b6cff,#ff26bf); }
.swatch[data-palette="forest"] { background: linear-gradient(90deg,#14532d,#22c55e,#9ef0b8); }
.swatch[data-palette="mono"] { background: linear-gradient(90deg,#222,#555,#aaa); }

.control-actions { display:flex; gap:10px; }
.control-actions button { flex:1; }
.danger { background: var(--danger); color:#fff; border:none; }

.stage { position: relative; }
.canvas-holder {
  width: 100%;
  min-height: calc(100vh - 160px);
  background: radial-gradient(1200px 400px at 20% 20%, rgba(255,255,255,0.05), rgba(0,0,0,0) 60%), var(--panel);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hint { position:absolute; left:18px; bottom:18px; color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .canvas-holder { min-height: 60vh; }
}
