* { box-sizing: border-box; }
:root{
  --bg1: #0f1020;
  --bg2: #0a0b14;
  --panel: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.15);
  --text: #e8e8f0;
  --muted: #b8b9c9;
  --accent: #89b4ff;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 20%, #2a1a55 0%, transparent 60%),
              radial-gradient(1200px 800px at 80% 10%, #103654 0%, transparent 60%),
              linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}

.app-shell{ max-width: 1200px; margin: 0 auto; padding: 24px; }
.app-header{ text-align: center; margin-bottom: 20px; }
.app-header h1{ font-size: 40px; line-height: 1.1; margin: 0; letter-spacing: 0.5px; }
.app-header h1 span{ opacity: 0.9; font-weight: 300; }
.subtitle{ color: var(--muted); margin-top: 8px; }

.app-main{ display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
@media (max-width: 980px){
  .app-main{ grid-template-columns: 1fr; }
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.controls h2{ margin: 6px 0 12px; font-size: 18px; }
.controls .hint{ color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.control-row{ display: grid; grid-template-columns: 110px 1fr 56px; gap: 8px; align-items: center; margin: 10px 0; }
.control-row label{ color: var(--muted); }
.control-row input[type="range"]{ accent-color: var(--accent); }
.control-row .value{ text-align: right; color: var(--muted); }

.stops-header{ display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
#stops .stop-row{ display: grid; grid-template-columns: 1fr 1fr 70px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
#stops .stop-row input[type="color"]{ width: 100%; height: 36px; border: 1px solid var(--border); background: transparent; border-radius: 8px; padding: 0; }
#stops .stop-row input[type="number"],
#stops .stop-row input[type="range"]{ width: 100%; }
#stops .stop-row .remove{ width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); cursor: pointer; }

.divider{ height: 1px; background: var(--border); margin: 16px 0; }

.btn{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.35); }
.btn.small{ padding: 8px 10px; font-size: 12px; border-radius: 10px; }
.btn.primary{
  border-color: rgba(137,180,255,0.6);
  box-shadow: 0 0 24px rgba(137,180,255,0.3);
}

.buttons{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.preset-row{ display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.preset-list{ list-style: none; padding: 0; margin: 8px 0 0; max-height: 180px; overflow: auto; }
.preset-list li{ display: flex; align-items: center; justify-content: space-between; padding: 8px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.preset-list li button{ margin-left: 8px; }

.preview{ display: grid; grid-template-rows: 1fr auto; gap: 14px; }
.preview-canvas{
  height: 520px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
}
.demo-stack{ display: grid; gap: 16px; place-items: center; }
.demo-card{
  background: rgba(20,20,28,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 16px;
  min-width: 280px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.demo-card .chip{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  margin: 6px 6px 0 0;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.cta{
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
}
.cta:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.45); }
.cta.ghost{ background: rgba(255,255,255,0.02); }

.code pre{
  margin: 0;
  max-height: 220px;
  overflow: auto;
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
}

.glow-text{
  text-shadow:
    0 0 10px rgba(255,255,255,0.2),
    0 0 20px rgba(137,180,255,0.25),
    0 0 40px rgba(137,180,255,0.15);
}

.app-footer{ text-align: center; color: var(--muted); margin-top: 16px; font-size: 12px; }
