/* ════════════════════════════════════════════════════════════════
   GamesOMG — Shared Generator Styles
   File: /assets/css/generator.css
   Used by: every config generator on the site.
   Source of truth: HTML <div class="setting" data-*>
════════════════════════════════════════════════════════════════ */

/* ─── Theme tokens ───────────────────────────────────────────────────────
   ⚠ THIS FILE USED TO BE LIGHT-ONLY, AND IT MADE EVERY GENERATOR ON THE SITE
   RENDER AS A WHITE SLAB INSIDE THE DARK PAGE. The pages themselves were fixed
   on 2026-08-05 by loading main.css, so the dark tokens were present the whole
   time — this sheet just painted ~19 hardcoded #ffffff/#f2f4f6 surfaces straight
   over them. The nav toggle flipped the attribute and nothing here responded.

   ▶ DARK IS :root. LIGHT IS THE TOGGLE.
   ▶ Only generator-only values live here. Surfaces, borders and text that exist
     sitewide (--bg-card, --border, --text, --orange …) are used directly from
     main.css so the two can never disagree.
   ▶ --gen-* prefix is deliberate: these must never shadow a sitewide token.
   🪤 The contrast sweep CANNOT catch the bug this block fixes. A white card with
      near-black text scores perfectly; the sweep has no concept of "this surface
      does not belong to the page it is sitting in." It reported 0 fails while
      every generator was visibly wrong. Look at the page.
─────────────────────────────────────────────────────────────────────────── */
:root {
  --gen-field: #1d1810;          /* inset field/tip grey — mirrors --bg-surface-solid */
  --gen-well:  #201a11;          /* chips + secondary buttons */
  --gen-btn:   #2f2718;          /* buttons, summary bars, hover states */
  /* State inks. These are TEXT on a translucent tint of their own hue, so each
     ground needs its own tone — the light values below are not the old ones:
     #ff6b6b and #ffc94a were dark-theme tones that had been sitting on the light
     silver page failing contrast the whole time. */
  --gen-ink-broken: #ff6b6b;
  --gen-ink-quirky: #ffc94a;
  --gen-ink-new:    #7ce38b;
  --gen-ink-dep:    #948c79;
  --gen-ink-err:    #ff9a9a;
  --gen-ink-warn:   #ffd277;
}
:root[data-theme="light"] {
  --gen-field: #f2f4f6;
  --gen-well:  #e9edf1;
  --gen-btn:   #e0e4e9;
  --gen-ink-broken: #b3261e;
  --gen-ink-quirky: #7a5200;
  --gen-ink-new:    #1b7a3a;
  --gen-ink-dep:    #545a63;
  --gen-ink-err:    #b3261e;
  --gen-ink-warn:   #7a5200;
}

/* ─── Page shell ─── */
.gen-page {
  width: 94vw;
  max-width: 2400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
/* Right column: output box with the AcidNodes ad riding under it, sticky as a unit. */
.gen-right { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1.25rem; }
.gen-right .output-panel { position: static; top: auto; }
@media (max-width: 980px) { .gen-right { position: static; } }

/* ─── Hero / intro ─── */
.gen-hero { margin-bottom: 2rem; }
/* Split hero (Pengullet pattern) — output-preview card beside the copy */
.gen-hero.gen-hero-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2.5rem; align-items: center; }
.gen-hero-split .gen-hero-copy { min-width: 0; }
.gen-hero-split h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.hero-cfg { background:var(--win-bg); border-radius: 14px; box-shadow: 0 22px 48px -12px rgba(0,0,0,.32), 0 6px 14px rgba(0,0,0,.14); overflow: hidden; }
.hero-cfg-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background:var(--win-bar); border-bottom: 1px solid var(--win-bar-line); }
.hero-cfg-bar i { width: 10px; height: 10px; border-radius: 50%; background:var(--win-dot); }
.hero-cfg-bar i:nth-child(1) { background:var(--win-dot-red); } .hero-cfg-bar i:nth-child(2) { background:var(--win-dot-amber); } .hero-cfg-bar i:nth-child(3) { background:var(--verified-dot); }
.hero-cfg-bar span { margin-left: 8px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.72rem; color:var(--win-title); letter-spacing: 0.04em; }
.hero-cfg pre { margin: 0; padding: 16px 18px 18px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.78rem; line-height: 1.75; color:var(--code-muted); overflow-x: auto; }
.hero-cfg .k { color:var(--code-key); } .hero-cfg .v { color:var(--code-value); } .hero-cfg .c { color:var(--code-comment); font-style: italic; }
.hero-cfg-caption { font-size: 0.8rem; color:var(--blue); margin-top: 0.7rem; text-align: center; }
/* ⚠ minmax(0,1fr), NOT 1fr — the third place this bit on 2026-08-19. Bare `1fr` is
   minmax(AUTO,1fr), so the track's minimum is its min-content, and the non-wrapping
   <pre> in .hero-cfg sized it: measured 496px inside a 375 viewport on sons-of-the-forest
   (+156px of page scroll), 7-days, astroneer and dayz. `overflow-x:auto` on the <pre>
   alone did NOT save it — the track was already sized. This one line fixed all four,
   and unturned's too, where a .setting-value merely sat at the right edge of an
   already-blown page and looked like a second cause. */
@media (max-width: 820px) { .gen-hero.gen-hero-split { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.gen-hero .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.gen-hero .breadcrumb a { color: var(--blue); text-decoration: none; }
.gen-hero .breadcrumb a:hover { text-decoration: underline; }
.gen-hero h1 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.gen-hero h1 .accent { color:var(--orange); }
.gen-hero .lede {
  font-family: 'Urbanist', sans-serif;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 780px;
  margin: 0;
}
/* Mod-author credit — "give the mod authors the love" (Jason 2026-07-07).
   One consistent block on every generator built on a third-party mod, sits
   right under the hero. Blue-accent callout, matches .section-intro. */
.gen-credit {
  font-family: 'Urbanist', sans-serif;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 780px;
  margin: 1.25rem 0 0;
  padding: 0.8rem 1rem;
  background: var(--gen-field);
  border: 1px solid var(--gen-btn);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
}
.gen-credit strong { color: var(--text); }
.gen-credit a { color:var(--orange); text-decoration: none; }
.gen-credit a:hover { text-decoration: underline; }

/* Currency badge — visible "built for [game] [version]" freshness signal.
   The thing competitors (XGamingServer, Shockbyte, Nodecraft) don't show. */
.gen-verified {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--gen-well);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
}
.gen-verified .gv-dot { width: 7px; height: 7px; border-radius: 50%; background:var(--verified-dot); flex-shrink: 0; }
.gen-verified strong { color: var(--text); font-weight: 700; }
.gen-verified .gv-ver { color:var(--orange); font-weight: 700; }
.gen-verified .gv-updated { background: rgba(126,207,160,.16); color:var(--code-value); border: 1px solid rgba(126,207,160,.34); border-radius: 999px; padding: 1px 9px; font-weight: 700; font-size: .82em; white-space: nowrap; }

/* ─── Template chips ─── */
.template-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 1.5rem;
}
.chip {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card-solid);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color:var(--orange); color: var(--text); }
.chip.active {
  background: var(--orange);
  border-color:var(--orange);
  color:var(--cta-ink);
}

/* ─── Two-column layout ─── */
/* 70/30, his call 2026-08-19. Was minmax(0,1fr) minmax(0,1.05fr) — i.e. 49/51, with the
   OUTPUT column marginally wider than the settings it is generated from. The settings side
   carries every label, tip and control; the output side is short monospace lines. 70/30 also
   matches the house guide layout (.page-2col.full-70). */
.gen-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 980px) {
  /* ⚠ minmax(0,1fr), NOT 1fr. Bare `1fr` is minmax(AUTO,1fr), so the column's minimum is
     its min-content and any non-wrapping child (a <pre>, a long path) sizes the track and
     scrolls the whole page sideways. That is the same trap fixed above. */
  .gen-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Search box — treated as an info element per the design system, blue accent. */
.search-box {
  position: relative;
  margin-bottom: 1rem;
}
.search-box input {
  width: 100%;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.95rem;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search-box input::placeholder {
  color: color-mix(in srgb, var(--blue) 75%, transparent);
  font-weight: 500;
}
.search-box input:hover {
  background: var(--gen-btn);
}
.search-box input:focus {
  border-color:var(--orange);
  border-left-color: var(--blue);
  background: var(--gen-btn);
}
.search-box input:focus::placeholder {
  color: color-mix(in srgb, var(--blue) 45%, transparent);
}
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1rem;
  opacity: 0.9;
}

/* ─── Section (collapsible <details>) ─── */
.gen-section {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.gen-section[open] { border-color: rgba(240, 128, 0, 0.5); }
.gen-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.15rem;
  background: var(--gen-btn);
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
}
.gen-section[open] > summary { border-bottom-color: var(--border); }
.gen-section > summary::-webkit-details-marker { display: none; }
.gen-section > summary .icon { font-size: 1.25rem; }
.gen-section > summary h2 {
  flex: 1;
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color:var(--orange);
}
.gen-section > summary .meta {
  font-family: 'Urbanist', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--gen-field);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.gen-section > summary .meta .changed { color:var(--orange); font-weight: 700; }
.gen-section > summary .arrow {
  display: inline-block;
  transition: transform 0.18s;
  color: var(--text-muted);
}
.gen-section[open] > summary .arrow { transform: rotate(90deg); }

.section-body { padding: 0.75rem 1.15rem 1.15rem; }
.section-intro {
  font-family: 'Urbanist', sans-serif;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--gen-field);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
}

/* ─── Thematic sub-header within a section (breaks long lists into groups) ─── */
.gen-subhead {
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  margin: 1.7rem 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.gen-subhead:first-of-type { margin-top: 0.35rem; }
.gen-subhead.hidden { display: none; }

/* ─── Individual setting block ─── */
/* Visual order inside a setting: label → control → tip. The markup keeps
   label/tip/control in source order for crawlers & screen readers; flex `order`
   moves the tip below the control so the page reads like a normal form —
   name, input, then the small helper text (Jason's call 2026-07-05). */
.setting {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--gen-btn);
  display: flex;
  flex-direction: column;
}
.setting .tip { order: 5; }
.setting .gen-warning { order: 6; }
.setting:last-child { border-bottom: none; }
.setting.hidden { display: none; }
.setting.modified .setting-label { color:var(--orange); }
.setting.modified .setting-value { color:var(--orange); font-weight: 700; }

.setting-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}
.setting-label {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
  cursor: pointer;
}
.setting-value {
  font-family: 'Manrope', monospace;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--gen-field);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  min-width: 3rem;
  text-align: center;
  white-space: nowrap;
}
.setting .tip {
  font-family: 'Urbanist', sans-serif;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0.45rem 0 0;
  max-width: 68ch;
}
.setting input[type="range"] {
  width: 100%;
  accent-color:var(--orange);
}
.setting input[type="number"],
.setting input[type="text"],
.setting select {
  width: 100%;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.92rem;
  padding: 0.5rem 0.7rem;
  background: var(--gen-field);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
}
.setting input[type="number"]:focus,
.setting input[type="text"]:focus,
.setting select:focus { border-color:var(--orange); }

/* ─── Editable value box + paired slider ───
   The canonical control is a small editable number box sitting in the header
   (right side), styled like the old read-only value badge but typeable. When a
   setting also has a slider, the two stay in sync (see generator-core/ui). Only
   the small box is width-capped; the paired range keeps the full-width rule. */
.setting-valuebox { display: inline-flex; align-items: baseline; gap: 0.25rem; flex-shrink: 0; }
.setting input[type="number"].setting-value {
  width: auto;
  max-width: 5.5rem;
  text-align: center;
  font-family: 'Manrope', monospace;
  font-size: 0.88rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.setting-unit { font-size: 0.82rem; color: var(--text-muted); }
.setting.modified input.setting-value { color:var(--orange); font-weight: 700; border-color:var(--orange); }
.setting input[type="range"].setting-slider { margin-top: 0.2rem; }

/* ─── Warning badges (broken / quirky settings) ─── */
.setting-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.setting-badge {
  font-family: 'Manrope', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.setting-badge.broken {
  background: rgba(220, 53, 53, 0.15);
  color: var(--gen-ink-broken);
  border: 1px solid rgba(220, 53, 53, 0.4);
}
.setting-badge.quirky {
  background: rgba(240, 180, 0, 0.15);
  color: var(--gen-ink-quirky);
  border: 1px solid rgba(240, 180, 0, 0.4);
}
.setting-badge.community {
  background: color-mix(in srgb, var(--blue) 15%, transparent);
  color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
}
.setting-badge.new {
  background: rgba(74, 222, 128, 0.16);
  color: var(--gen-ink-new);
  border: 1px solid rgba(74, 222, 128, 0.45);
}
.setting-badge.deprecated {
  background: rgba(120, 120, 120, 0.15);
  color: var(--gen-ink-dep);
  border: 1px solid rgba(120, 120, 120, 0.4);
}

/* ─── Toggle ─── */
.setting.toggle .setting-header { margin-bottom: 0.25rem; }
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
  cursor: pointer;
  user-select: none;
}
.toggle-wrap input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 22px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0;
  flex-shrink: 0;
}
.toggle-wrap input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle-wrap input[type="checkbox"]:checked { background: var(--orange); }
.toggle-wrap input[type="checkbox"]:checked::after { transform: translateX(16px); }
.toggle-wrap .toggle-state {
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── Per-level grid ───
   Used by per-level stat sections. Cells have padding, full word labels,
   bigger inputs, and a clearer modified/broken state. Each grid sits in
   its own section now (game-ini has 5 separate per-level sections) so
   columns get full width to breathe.
*/
.setting.perlevel {
  padding: 0.85rem 0;
}
.perlevel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 0.65rem;
}
.perlevel-slot {
  text-align: center;
  position: relative;
  padding: 0.4rem 0.3rem;
  background: var(--gen-well);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.perlevel-slot:hover {
  border-color: var(--border-hover);
}
.perlevel-slot .slot-label {
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perlevel-slot .slot-label .slot-flag {
  font-size: 0.7rem;
  color: var(--gen-ink-broken);
  font-weight: 700;
  cursor: help;
}
.perlevel-slot input[type="number"] {
  width: 100%;
  padding: 6px 4px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.perlevel-slot input[type="number"]:focus {
  border-color:var(--orange);
}
.perlevel-slot.broken {
  background: rgba(220, 53, 53, 0.06);
  border-color: rgba(220, 53, 53, 0.3);
}
.perlevel-slot.broken input[type="number"] {
  opacity: 0.7;
  border-color: rgba(220, 53, 53, 0.4);
}
.perlevel-slot.modified {
  background: rgba(240, 128, 0, 0.08);
  border-color: rgba(240, 128, 0, 0.5);
}
.perlevel-slot.modified input[type="number"] {
  border-color:var(--orange);
  color:var(--orange);
  font-weight: 700;
}

.perlevel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.7rem;
}
.perlevel-btn {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 5px 12px;
  background: var(--gen-btn);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.perlevel-btn:hover {
  background: var(--border);
  border-color:var(--orange);
  color: var(--text);
}

@media (max-width: 600px) {
  .perlevel-grid {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 5px;
  }
  .perlevel-slot {
    padding: 0.3rem 0.2rem;
  }
  .perlevel-slot .slot-label {
    font-size: 0.7rem;
  }
}

/* Mobile output-bar controls — injected into .output-header by the engine.
   Hidden on desktop, where the panel is a normal sticky sidebar. */
.output-live,
.output-quick-copy,
.output-expand { display: none; }

/* ─── Right side: output panel ─── */
.output-panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: sticky;
  top: 1rem;
  overflow: hidden;
}
.output-header {
  padding: 0.9rem 1.15rem;
  background: var(--gen-btn);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.output-header h2 {
  flex: 1;
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}
.output-header .file-tag {
  font-family: 'Manrope', monospace;
  font-size: 0.78rem;
  color:var(--orange);
  background: var(--gen-field);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(240, 128, 0, 0.4);
}

.output-body { padding: 1rem 1.15rem; }
.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.btn {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--gen-btn);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn:hover { background: var(--border); border-color: var(--border-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: var(--orange);
  border-color:var(--orange);
  color:var(--cta-ink);
}
.btn.primary:hover { background:var(--orange-hover); border-color: var(--orange-hover); }

.gen-output {
  background: var(--gen-well);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
  /* `pre` (not pre-wrap) so the visual line count = actual line count.
     Palworld's single OptionSettings line stays on one row instead of wrapping
     into something that looks like many lines. Long lines scroll horizontally. */
  white-space: pre;
  max-height: 60vh;
  overflow: auto;
}
.output-stats {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.78rem;
}
.stat-pill {
  background: var(--gen-field);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  color: var(--text-muted);
}
.stat-pill strong { color: var(--text); }

/* ─── SEO content block ─── */
.seo-block {
  margin-top: 3rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
}
.seo-block h2 {
  font-family: 'Manrope', sans-serif;
  color:var(--orange);
  font-size: 1.25rem;
  margin: 0 0 0.85rem;
}
.seo-block h3 {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  font-size: 1rem;
  margin: 1.3rem 0 0.4rem;
}
.seo-block p, .seo-block li {
  font-family: 'Urbanist', sans-serif;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  /* ⛔ THE SETTING NAMES IN THIS PROSE ARE NOT ALWAYS IN <code>. `.gen-page code` above
     handles the ones that are; these sit in a bare <strong>, e.g.
     <li><strong>PerLevelStatsMultiplier_Player[11]</strong> — 34 chars with no break
     opportunity, which overflowed its own <li> and scrolled the page +17px at 375
     (/generators/ark/game-ini/, 2026-08-24).
     🪤 IT TOOK TWO WRONG FIXES FIRST — break-all on prose <code>, then overflow-x on
     <pre> — because removal-bisection only said "the .seo-block", and no single child
     of it fixed the page. The ISOLATE pass (`--why`, hide all children then reveal one
     at a time) named the two <ul>s in one run. ▶ When removing one child does not
     help, two children contribute; isolate rather than guess. */
  overflow-wrap: anywhere;
}
.seo-block p { margin: 0 0 0.85rem; }
.seo-block ul { padding-left: 1.25rem; margin: 0 0 0.85rem; }
.seo-block a { color:var(--orange); text-decoration: none; font-weight: 600; }
.seo-block a:hover { text-decoration: underline; }
/* The visible FAQ at the foot of a generator. Its words are the page's FAQPage JSON-LD, word for word:
   a FAQ that only lives in the JSON-LD is a defect (Bridge, 2026-12-01). */
.seo-block .gen-faq { margin: 0 0 1rem; }
.seo-block .gen-faq details { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin: 0 0 0.5rem; }
.seo-block .gen-faq summary { cursor: pointer; list-style: none; padding: 0.75rem 0.9rem; font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 0.95rem; color: var(--text); overflow-wrap: anywhere; }
.seo-block .gen-faq summary::-webkit-details-marker { display: none; }
.seo-block .gen-faq summary::after { content: '+'; float: right; margin-left: 0.6rem; color: var(--orange); font-weight: 700; }
.seo-block .gen-faq details[open] summary::after { content: '\2212'; }
.seo-block .gen-faq details > p { margin: 0; padding: 0 0.9rem 0.85rem; }

/* ─── Toast ─── */
.gen-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--orange);
  color:var(--cta-ink);
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.gen-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Select / enum settings (e.g. Palworld DeathPenalty) ─── */
.setting select {
  width: 100%;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.92rem;
  padding: 0.5rem 0.7rem;
  background: var(--gen-field);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.setting select:focus { border-color:var(--orange); }

/* ─── Multiselect / list settings (e.g. Palworld CrossplayPlatforms) ───
   Checkbox "pills" matching the template-chip aesthetic. Used by the
   `multiselect` setting type for list values that emit as a tuple. */
.multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.3rem;
}
.ms-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--gen-field);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ms-option:hover { border-color: var(--border-hover); color: var(--text); }
.ms-option input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  background: var(--bg-card-solid);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ms-option input[type="checkbox"]:checked {
  background: var(--orange);
  border-color:var(--orange);
}
.ms-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color:var(--cta-ink);
}
/* Whole pill lights up when its box is checked. :has() is already used sitewide. */
.ms-option:has(input:checked) {
  background: rgba(240, 128, 0, 0.12);
  border-color:var(--orange);
  color: var(--text);
}

/* ─── Mobile: output panel becomes a collapsible sheet pinned to the bottom ───
   Placed after the base .output-panel rules so these overrides win the cascade. */
@media (max-width: 980px) {
  /* Extra bottom room so the fixed bar never hides the last setting. */
  .gen-page { padding-bottom: 5rem; }
  /* Lift the toast above the collapsed bar. */
  .gen-toast { bottom: 5rem; }

  .output-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
  }

  /* The header is the always-visible tap bar. */
  .output-header { cursor: pointer; user-select: none; }
  .output-header h2 { display: none; }
  .output-header .file-tag {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* A FLEX ITEM DEFAULTS TO min-width:auto, so a nowrap child cannot shrink below its
     own text and the whole bar sizes the fixed sheet. Measured 2026-08-24 on
     generators/ark/gus: .output-header min-content was 468px inside a 375 viewport,
     which is what actually scrolled the document — .output-panel just mirrored it.
     .file-tag already had min-width:0 below; .output-live never did. */
  .output-header { min-width: 0; }
  .output-live { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* the two tap targets keep their size; the labels are what give way */
  .output-quick-copy, .output-expand { flex: none; }

  .output-live {
    display: inline-block;
    margin-left: auto;
    font-family: 'Urbanist', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .output-quick-copy,
  .output-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--gen-field);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
  }
  .output-quick-copy:hover,
  .output-expand:hover { border-color:var(--orange); }
  .output-expand { transition: transform 0.2s ease; }
  .output-panel.expanded .output-expand { transform: rotate(180deg); }

  /* Collapsed by default: body hidden. Expanded: body scrolls inside the sheet. */
  .output-body { display: none; }
  .output-panel.expanded .output-body {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ──────────────────────────────────────────────────────────
   Idlist — textarea of one entry per line (Rust ownerid/moderatorid/banid)
   Compact, scrollable, with an optional inline note for invalid entries.
─────────────────────────────────────────────────────────── */
textarea.idlist {
  width: 100%;
  min-height: 84px;
  max-height: 220px;
  padding: 0.55rem 0.7rem;
  margin-top: 0.3rem;
  background: var(--gen-well);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.15s ease;
}
textarea.idlist:focus {
  outline: none;
  border-color:var(--orange);
}
textarea.idlist.has-invalid {
  border-color: var(--gen-ink-err);
}
.idlist-note {
  display: none;
  margin-top: 0.35rem;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.78rem;
  color: var(--gen-ink-err);
}
.idlist-note.show { display: block; }

/* ──────────────────────────────────────────────────────────
   Raw lines — the box an import fills with every line the form has no field for
   (mod sections, repeated lines, unfielded keys), written back out verbatim so
   import → edit → copy is still the whole file. GeneratorCore.splitIniImport.
─────────────────────────────────────────────────────────── */
textarea.raw-lines {
  width: 100%;
  min-height: 8rem;
  padding: 0.6rem 0.8rem;
  background: var(--gen-well);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
textarea.raw-lines:focus {
  outline: none;
  border-color: var(--orange);
}

/* ──────────────────────────────────────────────────────────
   Import — round-trip editing. Opt-in: a generator passes importParse()
   to GeneratorUI.init and the engine injects this control above the
   template chips. Lets users paste / drop an existing config to populate
   the form (import a shared "top config" → tweak → reshare).
─────────────────────────────────────────────────────────── */
.import-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-card-solid);
  border: 1px dashed var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
}
.import-bar.dragover {
  border-color:var(--orange);
  border-left-color:var(--orange);
  background: var(--gen-btn);
}
.import-bar .import-label {
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.import-bar .import-hint {
  font-family: 'Urbanist', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1 1 auto;
  min-width: 0;
}
.import-bar .import-hint .drop-only {
  color: color-mix(in srgb, var(--blue) 85%, transparent);
}
@media (max-width: 600px) {
  /* drag-drop is awkward on touch; lead with the paste button */
  .import-bar .import-hint .drop-only { display: none; }
}

/* ──────────────────────────────────────────────────────────
   Interdependency warnings — opt-in. A generator passes a `warnings`
   array to GeneratorUI.init; active rules render inline near a setting
   (level: quirk = yellow, broken = red, info = blue). Reuses the
   callout vocabulary already established on the cave pages.
─────────────────────────────────────────────────────────── */
.gen-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.86rem;
  line-height: 1.5;
}
.gen-warning .gw-icon { flex-shrink: 0; line-height: 1.4; }
/* ⚠ A warning routinely carries a bare URL or a long config key, and a flex item
   defaults to min-width:auto — so one unbreakable token sets the box's minimum
   width and the whole PAGE scrolls sideways on a phone. Measured 2026-08-19 on
   /unturned-server-config-generator/ at 375px: "steamcommunity.com/dev/managegameservers"
   held the box at 423px inside a 375px viewport, 131px of page overflow.
   BOTH declarations are needed: min-width:0 lets the item shrink at all, and
   `anywhere` (NOT break-word) is the one that actually reduces min-content so the
   box can be re-sized. table-audit cannot see this class — it only measures tables. */
.gen-warning .gw-msg { min-width: 0; overflow-wrap: anywhere; }

/* ⛔⛔ MOBILE PAGE-LEVEL SIDEWAYS SCROLL — the whole generator lane had it, measured
   2026-08-19 at 375px: core-keeper 511px in a 375 viewport (136px over), unturned 506.
   ▶ CAUSE: a prose <code> holding a FILE PATH. Nothing on this site sets overflow-wrap
   on inline code, so `%USERPROFILE%\AppData\LocalLow\Pugstorm\Core Keeper\…` rendered
   423px wide and pushed the document out. `.output-panel` reporting 511px is a SYMPTOM,
   not the cause — it is position:fixed with left:0;right:0, so it stretches to whatever
   the scroll width already is. I chased that first and it wasted a pass.
   ▶ `table-audit` is structurally blind to this: it measures TABLES, and it was green at
   390 across 671 pages the whole time this was live.
   🪤 `pre code` is deliberately left alone — a code BLOCK should scroll inside itself
   rather than reflow, which is the .ref-table-wrap bargain. */
.gen-page code { overflow-wrap: anywhere; }
.gen-page pre code { overflow-wrap: normal; }
/* ⛔ A <pre> THAT CANNOT SCROLL SCROLLS THE PAGE INSTEAD. `.hero-cfg pre` got
   overflow-x:auto when this bit the hero (see the note above), but a <pre> anywhere
   ELSE in .gen-page never did — and /generators/ark/game-ini/ has one in its
   .seo-block, worth +17px at 375 (measured 2026-08-24, the last real mobile overflow
   on the site). ⭐ This is the deliberate counterpart to the wrapping rules above:
   prose <code> REFLOWS, a code BLOCK SCROLLS. Both keep the page still. */
.gen-page pre, .seo-block pre { overflow-x: auto; }

/* ⛔ A 48-CHAR WINDOWS PATH IN A PROSE <code> STILL SCROLLED THE PAGE (+17px at 375,
   measured 2026-08-24 on /generators/ark/game-ini/). `.gen-page code` already sets
   overflow-wrap:anywhere above, and it was not enough — the same finding table-audit
   records as its cause #5: `anywhere` will not break a token a phone still cannot fit,
   and `break-all` will. Scoped to narrow viewports so desktop prose keeps whole words.
   🪤 `pre code` stays excluded here as it is above — a code BLOCK should scroll, not reflow. */
@media (max-width: 760px) {
  .gen-page code, .seo-block code { word-break: break-all; }
  .gen-page pre code, .seo-block pre code { word-break: normal; }
}

/* The hero sample is decorative; let it scroll in its own box rather than size the grid
   track. At mobile the hero drops to a single `1fr` column, and 1fr is minmax(AUTO,1fr) —
   so a non-wrapping <pre> sets the column's minimum and blows the page out. */
.hero-cfg pre { overflow-x: auto; }
.gen-warning.level-quirk {
  background: rgba(240, 180, 0, 0.1);
  border: 1px solid rgba(240, 180, 0, 0.4);
  color: var(--gen-ink-warn);
}
.gen-warning.level-broken {
  background: rgba(220, 53, 53, 0.1);
  border: 1px solid rgba(220, 53, 53, 0.4);
  color: var(--gen-ink-err);
}
.gen-warning.level-info {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
  color: var(--blue);
}
.gen-warning code {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}
/* Warnings collected into a top-of-form bar (rules with near:"top"). */
.gen-warning-bar { margin: 0 0 1rem; }
.gen-warning-bar .gen-warning { margin: 0 0 0.5rem; }
.gen-warning-bar .gen-warning:last-child { margin-bottom: 0; }

/* ──────────────────────────────────────────────────────────
   Output tabs — for generators that emit multiple files (Rust:
   server.cfg / start.bat / start.sh). Sits between the output header
   and the action buttons; clicking swaps the <pre> content via page JS.
─────────────────────────────────────────────────────────── */
.output-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}
.output-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--gen-field);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.output-tab:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.output-tab.active {
  background: rgba(240, 128, 0, 0.14);
  border-color:var(--orange);
  color: var(--text);
}
.output-tab .tab-file {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
}
