:root {
  --bg-1: #05060a;
  --bg-2: #0d1020;
  --bg-3: #131733;
  --text: #f6f2ff;
  --muted: #a9b0d0;
  --border: rgba(255, 255, 255, 0.09);
  --panel: rgba(12, 15, 28, 0.82);
  --panel-strong: rgba(20, 24, 40, 0.92);
  --soft-card: rgba(255, 255, 255, 0.045);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --accent-1: #8b5cff;
  --accent-2: #ff5ea8;
  --accent-3: #1ee7d7;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 12%, rgba(139, 92, 255, 0.28), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 94, 168, 0.22), transparent 20%),
    radial-gradient(circle at 72% 82%, rgba(30, 231, 215, 0.14), transparent 24%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 42%, var(--bg-3) 100%);
}

button,
input,
select {
  font: inherit;
}

input[type="file"] {
  display: none;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 20px;
}

.panel-glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
  gap: 18px;
  padding: 24px;
  align-items: stretch;
}

.hero-copy {
  padding: 6px 4px;
}

.eyebrow,
.mini-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
}

.eyebrow {
  color: #c598ff;
  margin-bottom: 12px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-text {
  margin: 16px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.58;
  font-size: 1rem;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.hero-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 10, 19, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.hero-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-note-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip-button,
.action-button {
  border: none;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease, border-color 0.14s ease;
}

.chip-button {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.chip-button:hover,
.action-button:hover {
  transform: translateY(-1px);
}

.chip-button.is-active {
  background: linear-gradient(135deg, rgba(139, 92, 255, 0.3), rgba(255, 94, 168, 0.26));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(139, 92, 255, 0.18);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  min-height: 760px;
}

.control-dock {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dock-section {
  background: rgba(8, 10, 18, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 14px;
}

.compact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-note {
  font-size: 12px;
  color: var(--muted);
}

.control-grid {
  display: grid;
  gap: 10px;
}

.two-up {
  grid-template-columns: 1fr 1fr;
}

.full-span {
  grid-column: 1 / -1;
}

.control-card {
  min-width: 0;
  background: var(--soft-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 11px 12px;
}

.range-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
}

.range-card input[type="range"] {
  grid-column: 1 / -1;
}

.select-card,
.color-card {
  display: grid;
  gap: 8px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-card span,
.control-card strong {
  font-size: 12px;
}

.control-card span {
  color: var(--muted);
}

.control-card strong {
  color: #ffffff;
}

.control-card input[type="range"] {
  width: 100%;
  accent-color: #d77dff;
}

.control-card input[type="color"],
.control-card select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 10px;
}

.control-card input[type="color"] {
  padding: 4px;
}

.control-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #d77dff;
}

.action-button {
  min-height: 46px;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cff, #ff5ea8);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(139, 92, 255, 0.18);
}

.secondary-button {
  background: linear-gradient(135deg, rgba(30, 231, 215, 0.24), rgba(255, 255, 255, 0.08));
  color: #ebfffd;
  border: 1px solid rgba(30, 231, 215, 0.25);
}

.accent-button {
  background: linear-gradient(135deg, rgba(255, 94, 168, 0.28), rgba(139, 92, 255, 0.28));
  color: #fff5fb;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.action-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.stage-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.meta-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dce3ff;
  font-size: 12px;
}

.accent-pill {
  background: linear-gradient(135deg, rgba(139, 92, 255, 0.22), rgba(255, 94, 168, 0.18));
}

.workspace-frame {
  position: relative;
  flex: 1;
  min-height: 640px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #06070b;
  overflow: auto;
  padding: 28px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.workspace-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
}

.workspace-frame.dragover,
.workspace-frame:focus-visible {
  border-color: rgba(255, 94, 168, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 94, 168, 0.3), 0 0 0 4px rgba(139, 92, 255, 0.08);
}

.frame-hint {
  position: absolute;
  inset: 22px 22px auto auto;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
  z-index: 1;
}

.frame-hint p,
.frame-hint span {
  margin: 0;
}

.frame-hint p {
  font-size: 12px;
  font-weight: 700;
}

.frame-hint span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

#asciiOutput {
  position: relative;
  z-index: 2;
  margin: 0;
  min-height: 260px;
  display: inline-block;
  width: max-content;
  max-width: none;
  text-align: left;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 6px;
  line-height: 0.92;
  white-space: pre;
  color: #f7f2ff;
}

#asciiOutput span {
  white-space: pre;
}

@media (max-width: 1200px) {
  .workspace-shell {
    grid-template-columns: 330px minmax(0, 1fr);
  }
}

@media (max-width: 1040px) {
  .hero-panel,
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    min-height: 0;
  }

  .workspace-frame {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .compact-actions,
  .two-up {
    grid-template-columns: 1fr;
  }

  .stage-toolbar {
    align-items: stretch;
  }

  .workspace-frame {
    min-height: 440px;
    padding: 18px;
  }

  .frame-hint {
    position: static;
    margin-bottom: 10px;
    text-align: left;
  }
}
