:root {
  --bg: #0b0b0d;
  --surface: #141417;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f2f4;
  --muted: #8b8b94;
  --accent: #9a8cff;
  --accent-2: #ffb38a;
  --tile: #2a2a30;
}

* { box-sizing: border-box; margin: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* the whole generator is sized on width AND height, so it fits a short box too */
.gen {
  --w: min(520px, calc(100vw - 32px), calc((100vh - 200px) * 4 / 3));
  width: var(--w);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-variation-settings: "wdth" 100;
  white-space: nowrap;
  overflow: hidden;
}
.prompt__spark { width: 14px; height: 14px; flex: none; fill: var(--accent); }
.prompt__text { overflow: hidden; text-overflow: clip; min-width: 0; color: var(--text); }
.prompt__caret {
  width: 1.5px; height: 15px; flex: none; margin-left: -6px;
  background: var(--accent); opacity: 0;
}
.prompt__model {
  margin-left: auto;
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  isolation: isolate;
}
/* the glow sits behind the frame and comes up while the image is generating */
.frame__glow {
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: conic-gradient(from var(--a, 0deg), transparent 0 55%, var(--accent) 72%, var(--accent-2) 82%, transparent 92%);
  opacity: 0;
  z-index: -1;
}
.frame__glow::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 26px;
  background: inherit;
  filter: blur(18px);
  opacity: 0.55;
}
.frame__canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: var(--tile);
  box-shadow: 0 0 0 1px var(--line);
}
.frame__shine {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 48%, rgba(255, 255, 255, 0.06) 54%, transparent 64%);
  background-size: 260% 100%;
  background-position: 160% 0;
  mix-blend-mode: screen;
}

.status { display: flex; flex-direction: column; gap: 7px; }
.status__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.status__label { color: var(--text); }
.status__time { color: var(--muted); }
.status__pct { margin-left: auto; color: var(--muted); }
.status__bar {
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.status__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn--light { background: var(--text); color: #0b0b0d; border-color: transparent; }
.btn--ghost { background: transparent; color: var(--text); }
.btn:disabled { cursor: default; }
@media (hover: hover) {
  .btn--ghost:hover { border-color: var(--line-strong); }
}

.pointer {
  position: fixed;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  fill: #fff;
  stroke: #0b0b0d;
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@media (max-width: 420px) {
  .prompt { font-size: 12px; }
  .prompt__model { display: none; }
  .gen { gap: 10px; --w: min(520px, calc(100vw - 32px), calc((100vh - 180px) * 4 / 3)); }
}
