:root {
  --bg: #0b0b0f;
  --panel-bg: #15151c;
  --border: #26262f;
  --text: #e8e8ee;
  --muted: #8a8a99;
  --accent: #7c8bff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  padding: 28px 24px 8px;
  text-align: center;
}

header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 24px 48px;
  align-items: start;
}

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

.stage-wrap {
  position: sticky;
  top: 24px;
}

.stage {
  padding: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b6b, #f06595, #cc5de8, #845ef7);
  transition: background 0.2s ease, padding 0.15s ease;
  overflow: auto;
}

.frame {
  border-radius: 12px;
  overflow: hidden;
  background: #1e1e2e;
  min-width: 320px;
  max-width: 100%;
}

.frame.shadow {
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 10px 24px rgba(0, 0, 0, 0.4);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
}

.dots { display: flex; gap: 7px; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.filename {
  flex: 1;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-spacer { width: 46px; }

.frame.no-chrome .titlebar { display: none; }

pre {
  margin: 0;
  padding: 28px 32px 36px;
  overflow: auto;
}

pre code.hljs {
  background: transparent !important;
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

textarea, input[type="text"], select {
  background: #0f0f16;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  resize: vertical;
}

textarea {
  min-height: 220px;
  line-height: 1.6;
}

select { font-family: "Inter", sans-serif; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.gradient-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.swatch {
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.swatch:hover { transform: scale(1.06); }
.swatch.active { border-color: #fff; }

.download-btn {
  margin-top: 4px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c8bff, #a78bfa);
  color: #0b0b0f;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.download-btn:hover { opacity: 0.9; }
.download-btn:disabled { opacity: 0.5; cursor: wait; }
