:root {
  --bg: #0e0b09;
  --panel: #1a1411;
  --panel-hi: #231b16;
  --input: #120e0b;
  --line: #3b2d24;
  --line-hi: #5a4334;
  --text: #f4eadf;
  --muted: #a6968a;
  --ember: #ff7a2f;
  --flame: #ff4d2e;
  --gold: #f6c453;
  --glow: rgba(255, 122, 47, 0.35);
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 90, 30, 0.22), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(246, 196, 83, 0.10), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(255, 77, 46, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 18px 72px;
}

/* ---------- header ---------- */
header { margin-bottom: 32px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 5px 12px 5px 10px;
  border: 1px solid rgba(255, 122, 47, 0.4);
  border-radius: 999px;
  background: rgba(255, 122, 47, 0.08);
  color: var(--ember);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px 2px var(--ember);
  animation: ember 2.4s ease-in-out infinite;
}
@keyframes ember {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.01em;
  background: linear-gradient(100deg, var(--gold) 0%, var(--ember) 45%, var(--flame) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255, 122, 47, 0.18);
}
header p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- layout ---------- */
.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: flex-start;
}
.panel {
  position: relative;
  flex: 1 1 480px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 220px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--ember), var(--flame), transparent);
}
.panel.output {
  flex: 1 1 360px;
  position: sticky;
  top: 16px;
}

/* ---------- buttons ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
button {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
button:hover {
  border-color: var(--ember);
  background: rgba(255, 122, 47, 0.08);
}
button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), var(--ember) 45%, var(--flame));
  color: #1a0c05;
  box-shadow: 0 6px 22px var(--glow);
}
button.primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--ember) 45%, var(--flame));
  box-shadow: 0 8px 30px rgba(255, 122, 47, 0.55);
  transform: translateY(-1px);
}
button:active { transform: translateY(1px); }
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- form ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 30px 0 16px;
}
.section-title::before {
  content: "\25C6";
  font-size: 10px;
  color: var(--ember);
  text-shadow: 0 0 8px var(--ember);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-hi), transparent);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  color: var(--muted);
}
select, input[type=text], textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ff7a2f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select option { background: var(--panel); color: var(--text); }
select:hover, input[type=text]:hover, textarea:hover { border-color: var(--line-hi); }
select:focus, input[type=text]:focus, textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.2), 0 0 18px rgba(255, 122, 47, 0.15);
}
input::placeholder, textarea::placeholder { color: #6d5e53; }
textarea {
  min-height: 260px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
}
#output {
  min-height: 420px;
  color: #f1dfc9;
  background:
    linear-gradient(180deg, rgba(255, 122, 47, 0.05), transparent 120px),
    var(--input);
  border-color: var(--line-hi);
  caret-color: var(--ember);
}
input.other-input {
  margin-top: 8px;
  display: none;
  border-style: dashed;
  border-color: rgba(255, 122, 47, 0.5);
}
input.other-input.show { display: block; }

/* ---------- accessory chips ---------- */
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.checks label:hover { border-color: var(--line-hi); }
.checks input { accent-color: var(--ember); margin: 0; }
.checks label:has(input:checked) {
  border-color: var(--ember);
  background: rgba(255, 122, 47, 0.12);
  box-shadow: 0 0 14px rgba(255, 122, 47, 0.18);
}

/* ---------- copy feedback ---------- */
#copy.copied, #copy-mobile.copied, #share.copied {
  background: linear-gradient(135deg, #b8e07a, #5fbf6a);
  box-shadow: 0 6px 22px rgba(95, 191, 106, 0.4);
}

/* ---------- mobile bar (phones only) ---------- */
.mobile-bar { display: none; }

@media (max-width: 700px) {
  .wrap { padding-top: 28px; padding-bottom: 110px; }
  .panel { padding: 18px; }
  .panel.output { position: static; scroll-margin-top: 12px; }
  #form-panel { scroll-margin-top: 12px; }
  /* 16px stops iOS Safari zooming in when a field is tapped */
  select, input[type=text], textarea { font-size: 16px; }
  #output { min-height: 340px; }
  .mobile-bar {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(20, 15, 12, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  }
  .mobile-bar button { flex: 1; padding: 13px 16px; }
  .mobile-bar button:not(.primary) { background: var(--panel-hi); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ember); }

/* ---------- prose pages (privacy, guides) ---------- */
.prose {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.7;
  color: #e6d9cb;
}
.prose h2 {
  font-family: var(--display);
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin: 34px 0 10px;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--ember); text-underline-offset: 3px; }
.prose a:hover { color: var(--gold); }
.prose strong { color: var(--text); }
.prose .updated { color: var(--muted); font-size: 14px; }
.back-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--ember);
  text-decoration: none;
  font-weight: 600;
}
.back-link:hover { color: var(--gold); }
#share.copied { color: #10210f; border-color: transparent; }

/* ---------- gallery ---------- */
.ai-note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.inline-link { color: var(--ember); }
.inline-link:hover { color: var(--gold); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.filters button { padding: 8px 16px; font-size: 14px; }
.filters button[aria-pressed="true"] {
  border-color: var(--ember);
  background: rgba(255, 122, 47, 0.14);
  color: var(--gold);
}
/* Masonry columns: every image keeps its own shape, nothing is cropped. */
.grid { columns: 3 260px; column-gap: 18px; }
.card {
  display: inline-block; /* keeps margins from spilling into the next column */
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--ember);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 122, 47, 0.18);
}
.card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.card img { display: block; width: 100%; height: auto; background: var(--input); }
.card-body { display: block; padding: 12px 14px 14px; }
.card-title {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-hi);
  color: var(--muted);
}
.chip.model { border-color: rgba(255, 122, 47, 0.5); color: var(--ember); }

/* ---------- character page ---------- */
.breadcrumb { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.breadcrumb a { color: var(--ember); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.character {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.character-img {
  margin: 0;
  border: 1px solid var(--line-hi);
  border-radius: 16px;
  overflow: hidden;
  background: var(--input);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.character-img img { display: block; width: 100%; height: auto; }
.character-info .chips { margin-bottom: 18px; }
.character-info h2 {
  font-family: var(--display);
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin: 24px 0 10px;
}
.character-info h2:first-of-type { margin-top: 0; }
.note { font-size: 16px; line-height: 1.7; color: #e6d9cb; margin: 0; }
.prompt {
  margin: 0 0 14px;
  padding: 14px 16px;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #f1dfc9;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
a.button {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: 999px;
  color: #1a0c05;
  background: linear-gradient(135deg, var(--gold), var(--ember) 45%, var(--flame));
  box-shadow: 0 6px 22px var(--glow);
}
a.button:hover { filter: brightness(1.05); }
#copy-prompt.copied {
  border-color: transparent;
  background: linear-gradient(135deg, #b8e07a, #5fbf6a);
  color: #10210f;
}
.settings {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: 14px;
}
.settings dt { color: var(--muted); }
.settings dd { margin: 0; color: var(--text); }
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  font-size: 15px;
}
.pager a { color: var(--ember); text-decoration: none; font-weight: 600; }
.pager a:hover { color: var(--gold); }
@media (max-width: 760px) {
  .character { grid-template-columns: 1fr; }
}
.character-img figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.character-img figcaption a { color: var(--ember); }

/* Model comparisons: same prompt, several models side by side. */
.section-heading, .comparisons h2 {
  font-family: var(--display);
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin: 28px 0 14px;
}
.comparisons { margin-bottom: 8px; }
.comparison-list { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
/* Cards grow in proportion to their number of images, so every thumbnail is the same size. */
.compare-card {
  flex: var(--cols, 4) 1 calc(var(--cols, 4) * 140px);
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line-hi);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.compare-card:hover, .compare-card:focus-visible { transform: translateY(-2px); border-color: var(--ember); }
.compare-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.compare-thumbs { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 2px; background: var(--input); }
.compare-thumbs img { display: block; width: 100%; height: auto; }
.compare-card .chips { margin-top: 8px; }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
}
.compare-item img { display: block; width: 100%; height: auto; }
.compare-item figcaption { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.compare-item .note { font-size: 14.5px; line-height: 1.6; }
.compare-item .original { margin: 0; font-size: 12.5px; }
.compare-prompt { margin-bottom: 26px; }
.related {
  display: flex;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.related img { width: 120px; height: auto; border-radius: 10px; flex-shrink: 0; }
.related > span { display: flex; flex-direction: column; gap: 6px; }
.related:hover .card-title { color: var(--ember); }
.eyebrow-small { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.related-text { color: var(--muted); font-size: 14.5px; }
@media (max-width: 1000px) { .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .compare-grid { grid-template-columns: 1fr; }
  .compare-thumbs { grid-template-columns: repeat(2, 1fr); }
  .related img { width: 84px; }
}

/* Small explanatory line under a form field. */
.field-hint { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
select:disabled { opacity: 0.6; cursor: not-allowed; }
.builder-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.compare-grid[style*="--cols: 2"] { max-width: 820px; }
