@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Archivo:wght@600;800&family=Press+Start+2P&display=swap');

:root {
  --bg: #dfc76e;          /* gold */
  --panel: #f0e3ae;       /* parchment — lighter tint of gold, for cards */
  --panel-deep: #e8d68f;  /* slightly deeper parchment, for inset controls */
  --line: #9263c1;        /* purple — structural borders, grid seams */
  --cyan: #6bf2f2;
  --magenta: #da55b6;
  --purple: #9263c1;
  --ink: #241832;         /* near-black purple — primary text on gold */
  --ink-dim: #7c5a91;     /* muted purple — secondary text on gold */
  --accent: var(--magenta);
  --accent-hover: #ec6fc8;
  --mono: 'JetBrains Mono', monospace;
  --display: 'Archivo', sans-serif;
  --pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* motivated texture: subtle animated grain over the whole app, not just the canvas —
   ties the chrome itself to the thesis instead of only the output */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 28px;
  background: var(--panel-deep);
  border-bottom: 3px solid var(--purple);
}

.brand { display: flex; flex-direction: column; gap: 4px; }

/* the signature move: isometric pixel-block extrusion, built in pure CSS —
   cyan face, magenta bevel edge, purple drop steps. Same construction as the
   Daggadex mark, applied to the tool's own name. */
.brand-mark {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--cyan);
  -webkit-text-stroke: 2px var(--magenta);
  text-stroke: 2px var(--magenta);
  text-shadow:
    1px 1px 0 var(--purple),
    2px 2px 0 var(--purple),
    3px 3px 0 var(--purple),
    4px 4px 0 var(--purple);
}

.brand-sub {
  font-family: var(--mono);
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.brand-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.brand-credit {
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  border-bottom: 1px dashed var(--purple);
}
.brand-credit:hover { color: var(--magenta); }

/* the byline gets the tool's own effect applied to itself: a small
   chromatic-aberration channel split, echoing the aberration slider in 04. */
.brand-maker {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink);
  position: relative;
}
.brand-maker::before,
.brand-maker::after {
  content: 'BY DAGGADEX';
  position: absolute;
  left: 0; top: 0;
  opacity: 0.65;
}
.brand-maker::before { color: var(--cyan); transform: translate(-1px, 0); }
.brand-maker::after  { color: var(--magenta); transform: translate(1px, 0); }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 3px;
  background: var(--line);
}

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

.panel {
  background: var(--panel);
  padding: 20px;
}

.panel-title {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.panel-note {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--ink-dim);
  opacity: 0.9;
}

/* the visible seam — chunky pixel-block border, not a soft rounded box */
.dropzone {
  border: 2px dashed var(--purple);
  background: var(--panel-deep);
  padding: 24px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 24px;
  position: relative;
}
.dropzone:hover { border-color: var(--cyan); }
.dropzone.drag-over { border-color: var(--magenta); background: rgba(218,85,182,0.14); }
.dropzone-small { padding: 16px 10px; margin-bottom: 12px; }

.dropzone-label {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}
.dropzone-label span { color: var(--ink-dim); font-size: 11px; }

.control-row { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.control { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--ink-dim); }
.control select {
  background: var(--panel-deep);
  color: var(--ink);
  border: 2px solid var(--purple);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 12px;
}

.panel-preview { display: flex; flex-direction: column; }

/* the cabinet bezel: the one place the UI stays black, on purpose — this is
   the CRT tube itself, housed inside the gold arcade-cabinet chrome. */
.canvas-wrap {
  position: relative;
  background: #000;
  border: 4px solid var(--purple);
  box-shadow: 0 0 0 2px var(--panel-deep), 0 0 24px rgba(146,99,193,0.35);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.canvas-wrap canvas { max-width: 100%; max-height: 100%; display: block; }

.empty-state {
  position: absolute;
  color: #4a4a52;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.export-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  background: var(--accent);
  color: #1a1020;
  border: 2px solid var(--ink);
  padding: 10px 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.btn-primary:disabled { background: var(--panel-deep); color: var(--ink-dim); border-color: var(--line); cursor: not-allowed; }
.btn-primary:not(:disabled):hover { background: var(--cyan); }

.export-status { font-size: 11px; color: var(--ink-dim); }

.preset-row { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.preset-btn {
  background: var(--panel-deep);
  border: 2px solid var(--purple);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
}
.preset-btn:hover { border-color: var(--cyan); color: var(--ink); }
.preset-btn.active { border-color: var(--magenta); color: var(--magenta); background: rgba(218,85,182,0.12); }

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.slider-row input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--line);
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--cyan);
  border: 2px solid var(--purple);
  cursor: pointer;
  border-radius: 0;
}

.checkbox-row { flex-direction: row; align-items: center; justify-content: space-between; }
.checkbox-row input { accent-color: var(--magenta); }

.footer-note {
  padding: 16px 28px 32px;
  color: var(--ink-dim);
  font-size: 10.5px;
  max-width: 640px;
}
.footer-note a { color: var(--purple); }
.footer-note a:hover { color: var(--magenta); }
