/* ════════════════════════════════════════════════════════════════
   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-*>
════════════════════════════════════════════════════════════════ */

/* ─── Page shell ─── */
.gen-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ─── Hero / intro ─── */
.gen-hero { margin-bottom: 2rem; }
.gen-hero .breadcrumb {
  font-size: 0.85rem;
  color: #8899a6;
  margin-bottom: 0.75rem;
}
.gen-hero .breadcrumb a { color: #2790f9; 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: #f0f4f8;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.gen-hero h1 .accent { color: #f08000; }
.gen-hero .lede {
  font-family: 'Urbanist', sans-serif;
  color: #aab4c0;
  font-size: 1rem;
  line-height: 1.55;
  max-width: 780px;
  margin: 0;
}

/* ─── 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 #3e4c59;
  background: #243040;
  color: #c8d0d8;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: #f08000; color: #f0f4f8; }
.chip.active {
  background: #f08000;
  border-color: #f08000;
  color: #1a1a1a;
}

/* ─── Two-column layout ─── */
.gen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 980px) {
  .gen-layout { grid-template-columns: 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: #243040;
  border: 1px solid #3e4c59;
  border-left: 3px solid rgb(39, 144, 249);
  border-radius: 8px;
  color: #f0f4f8;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search-box input::placeholder {
  color: rgba(39, 144, 249, 0.75);
  font-weight: 500;
}
.search-box input:hover {
  background: #2a3642;
}
.search-box input:focus {
  border-color: #f08000;
  border-left-color: rgb(39, 144, 249);
  background: #2a3642;
}
.search-box input:focus::placeholder {
  color: rgba(39, 144, 249, 0.45);
}
.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: #243040;
  border: 1px solid #3e4c59;
  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: #2a3642;
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
}
.gen-section[open] > summary { border-bottom-color: #3e4c59; }
.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: #f08000;
}
.gen-section > summary .meta {
  font-family: 'Urbanist', sans-serif;
  font-size: 0.78rem;
  color: #aab4c0;
  background: #1f2933;
  border: 1px solid #3e4c59;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.gen-section > summary .meta .changed { color: #f08000; font-weight: 700; }
.gen-section > summary .arrow {
  display: inline-block;
  transition: transform 0.18s;
  color: #aab4c0;
}
.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: #aab4c0;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #1f2933;
  border-left: 3px solid #2790f9;
  border-radius: 4px;
}

/* ─── Individual setting block ─── */
.setting {
  padding: 0.85rem 0;
  border-bottom: 1px solid #2a3642;
}
.setting:last-child { border-bottom: none; }
.setting.hidden { display: none; }
.setting.modified .setting-label { color: #f08000; }
.setting.modified .setting-value { color: #f08000; 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: 600;
  font-size: 0.95rem;
  color: #f0f4f8;
  margin: 0;
  cursor: pointer;
}
.setting-value {
  font-family: 'Manrope', monospace;
  font-size: 0.88rem;
  color: #aab4c0;
  background: #1f2933;
  border: 1px solid #3e4c59;
  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.88rem;
  line-height: 1.5;
  color: #aab4c0;
  margin: 0.25rem 0 0.55rem;
}
.setting input[type="range"] {
  width: 100%;
  accent-color: #f08000;
}
.setting input[type="number"],
.setting input[type="text"] {
  width: 100%;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.92rem;
  padding: 0.5rem 0.7rem;
  background: #1f2933;
  border: 1px solid #3e4c59;
  border-radius: 6px;
  color: #f0f4f8;
  outline: none;
}
.setting input[type="number"]:focus,
.setting input[type="text"]:focus { border-color: #f08000; }

/* ─── 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: #ff6b6b;
  border: 1px solid rgba(220, 53, 53, 0.4);
}
.setting-badge.quirky {
  background: rgba(240, 180, 0, 0.15);
  color: #ffc94a;
  border: 1px solid rgba(240, 180, 0, 0.4);
}
.setting-badge.community {
  background: rgba(39, 144, 249, 0.15);
  color: #62a8ff;
  border: 1px solid rgba(39, 144, 249, 0.4);
}
.setting-badge.deprecated {
  background: rgba(120, 120, 120, 0.15);
  color: #aaa;
  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: #3e4c59;
  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: #f0f4f8;
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle-wrap input[type="checkbox"]:checked { background: #f08000; }
.toggle-wrap input[type="checkbox"]:checked::after { transform: translateX(16px); }
.toggle-wrap .toggle-state {
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  color: #aab4c0;
  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: #1a232e;
  border: 1px solid #3e4c59;
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.perlevel-slot:hover {
  border-color: #5a6776;
}
.perlevel-slot .slot-label {
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c8d0d8;
  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: #ff6b6b;
  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: #243040;
  border: 1px solid #3e4c59;
  border-radius: 4px;
  color: #f0f4f8;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.perlevel-slot input[type="number"]:focus {
  border-color: #f08000;
}
.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: #f08000;
  color: #f08000;
  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: #2a3642;
  border: 1px solid #3e4c59;
  border-radius: 4px;
  color: #c8d0d8;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.perlevel-btn:hover {
  background: #3e4c59;
  border-color: #f08000;
  color: #f0f4f8;
}

@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: #243040;
  border: 1px solid #3e4c59;
  border-radius: 10px;
  position: sticky;
  top: 1rem;
  overflow: hidden;
}
.output-header {
  padding: 0.9rem 1.15rem;
  background: #2a3642;
  border-bottom: 1px solid #3e4c59;
  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: #f0f4f8;
}
.output-header .file-tag {
  font-family: 'Manrope', monospace;
  font-size: 0.78rem;
  color: #f08000;
  background: #1f2933;
  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 #3e4c59;
  background: #2a3642;
  color: #f0f4f8;
  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: #3e4c59; border-color: #5a6776; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: #f08000;
  border-color: #f08000;
  color: #1a1a1a;
}
.btn.primary:hover { background: #ff9420; border-color: #ff9420; }

.gen-output {
  background: #1a232e;
  border: 1px solid #3e4c59;
  border-radius: 6px;
  padding: 0.9rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #d4dce5;
  /* `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: #1f2933;
  border: 1px solid #3e4c59;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  color: #aab4c0;
}
.stat-pill strong { color: #f0f4f8; }

/* ─── SEO content block ─── */
.seo-block {
  margin-top: 3rem;
  background: #243040;
  border: 1px solid #3e4c59;
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
}
.seo-block h2 {
  font-family: 'Manrope', sans-serif;
  color: #f08000;
  font-size: 1.25rem;
  margin: 0 0 0.85rem;
}
.seo-block h3 {
  font-family: 'Manrope', sans-serif;
  color: #f0f4f8;
  font-size: 1rem;
  margin: 1.3rem 0 0.4rem;
}
.seo-block p, .seo-block li {
  font-family: 'Urbanist', sans-serif;
  color: #c8d0d8;
  font-size: 0.92rem;
  line-height: 1.6;
}
.seo-block p { margin: 0 0 0.85rem; }
.seo-block ul { padding-left: 1.25rem; margin: 0 0 0.85rem; }
.seo-block a { color: #f08000; text-decoration: none; font-weight: 600; }
.seo-block a:hover { text-decoration: underline; }

/* ─── Toast ─── */
.gen-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #f08000;
  color: #1a1a1a;
  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: #1f2933;
  border: 1px solid #3e4c59;
  border-radius: 6px;
  color: #f0f4f8;
  outline: none;
  cursor: pointer;
}
.setting select:focus { border-color: #f08000; }

/* ─── 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 #3e4c59;
  background: #1f2933;
  color: #c8d0d8;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ms-option:hover { border-color: #5a6776; color: #f0f4f8; }
.ms-option input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #5a6776;
  border-radius: 4px;
  background: #243040;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ms-option input[type="checkbox"]:checked {
  background: #f08000;
  border-color: #f08000;
}
.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: #1a1a1a;
}
/* 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: #f08000;
  color: #f0f4f8;
}

/* ─── 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;
  }

  .output-live {
    display: inline-block;
    margin-left: auto;
    font-family: 'Urbanist', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aab4c0;
    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 #3e4c59;
    border-radius: 8px;
    background: #1f2933;
    color: #f0f4f8;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
  }
  .output-quick-copy:hover,
  .output-expand:hover { border-color: #f08000; }
  .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: #1a242e;
  border: 1px solid #3e4c59;
  border-radius: 8px;
  color: #f0f4f8;
  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: #f08000;
}
textarea.idlist.has-invalid {
  border-color: #d9544a;
}
.idlist-note {
  display: none;
  margin-top: 0.35rem;
  font-family: 'Urbanist', sans-serif;
  font-size: 0.78rem;
  color: #d9544a;
}
.idlist-note.show { display: block; }

/* ──────────────────────────────────────────────────────────
   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: #1f2933;
  border: 1px solid #3e4c59;
  border-radius: 7px;
  color: #aab4c0;
  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: #5a6776;
  color: #f0f4f8;
}
.output-tab.active {
  background: rgba(240, 128, 0, 0.14);
  border-color: #f08000;
  color: #f0f4f8;
}
.output-tab .tab-file {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
}
