:root {
  --bg: #0a0c0f;
  --bg-elev: #0e1116;
  --surface: #14181e;
  --surface-2: #1a1f27;
  --surface-3: #212a34;
  --line: #232b34;
  --line-2: #333e4a;
  --text: #eaf0f6;
  --muted: #94a1b2;
  --muted-2: #5a6675;
  --accent: #ff6a2b;
  --accent-2: #ffc24b;
  --accent-soft: rgba(255,106,43,.13);
  --good: #46d17f;
  --bad: #ff5d6c;
  --stage: #05070a;
  --r: 11px;
  --r-sm: 7px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Chakra Petch", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(255,106,43,.07), transparent 60%),
    radial-gradient(760px 420px at 6% 2%, rgba(255,194,75,.045), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1220px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); }

.ico { width: 16px; height: 16px; flex: 0 0 auto; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10,12,15,.9);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 66px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { width: 38px; height: 38px; display: block; object-fit: contain; filter: drop-shadow(0 1px 4px rgba(0,0,0,.4)); }
.brand-word {
  font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: .04em;
  color: var(--text); line-height: 1; white-space: nowrap;
}
.brand-word strong { font-weight: 700; color: var(--accent); }
.brand-word.small { font-size: 15px; }
.brand-tld { color: var(--muted-2); font-weight: 500; margin-left: 1px; }

.tabs { display: flex; gap: 3px; }
.tab {
  font-family: var(--display); font-size: 14px; font-weight: 500; letter-spacing: .02em;
  color: var(--muted); padding: 8px 15px; border-radius: var(--r-sm);
  position: relative; transition: color .16s, background .16s;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px;
}

.search-box {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 0 13px; height: 40px; min-width: 240px; max-width: 300px;
  color: var(--muted); transition: border-color .16s, box-shadow .16s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--text); }
.search-ico { display: inline-flex; }
.search-box input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; width: 100%; outline: none; }
.search-box input::placeholder { color: var(--muted-2); }

/* ---------- layout ---------- */
main#view { max-width: 1220px; margin: 0 auto; padding: 34px 22px 70px; }
.hero { margin-bottom: 26px; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -.01em; margin: 0 0 8px; }
.hero-sub { color: var(--muted); font-size: 15px; max-width: 640px; margin: 0; }
.section-h { font-family: var(--display); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 26px 0 4px; }
.empty { padding: 48px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); }
.empty code, .notice code { background: var(--bg-elev); padding: 1px 6px; border-radius: 5px; color: var(--accent-2); font-family: var(--mono); font-size: .9em; }

/* ---------- pro grid ---------- */
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 15px; }
.pro-card {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px;
  color: var(--text); font: inherit; position: relative; overflow: hidden;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .18s;
}
.pro-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0; transition: opacity .2s;
}
.pro-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.pro-card:hover::before { opacity: 1; }
.pro-card-body { flex: 1; min-width: 0; }
.pro-name { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .01em; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-team { color: var(--accent-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-detail { color: var(--muted-2); font-size: 11.5px; font-family: var(--mono); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-sig { width: 62px; height: 62px; flex: 0 0 auto; border-radius: 9px; background: var(--stage); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- avatar ---------- */
.avatar { position: relative; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; overflow: hidden; color: #fff; font-family: var(--display); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.avatar-initials { text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.avatar.has-img .avatar-initials { display: none; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.avatar.has-img .avatar-img { opacity: 1; }
.avatar-sm { width: 38px; height: 38px; font-size: 13px; border-radius: 9px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; border-radius: 16px; }

.flag-img { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; margin-right: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); vertical-align: -2px; }
.flag { margin-right: 8px; }
.pro-head-info h2 .flag-img { width: 30px; height: 21px; }

.xhair-canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; max-width: 100%; max-height: 100%; }

/* ---------- tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 15px; margin-top: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: border-color .16s, transform .16s; }
.tile:hover { border-color: var(--line-2); }
.tile-stage {
  position: relative;
  height: 152px; display: grid; place-items: center; border-bottom: 1px solid var(--line);
  background-color: var(--stage);
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 17px 17px, 17px 17px; background-position: center;
}
.tile-invalid { color: var(--bad); font-family: var(--mono); font-size: 13px; }
.tile-meta { padding: 13px; display: flex; flex-direction: column; gap: 10px; }
.tile-head { display: flex; align-items: baseline; gap: 8px; }
.tile-title { font-family: var(--display); font-weight: 600; font-size: 14px; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-text { flex: 1; font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; color: var(--muted); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.chip-swatch { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.swatch { width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.tile-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.convars { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--text); background: var(--stage); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px; max-height: 230px; overflow: auto; white-space: pre; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font-family: var(--font); font-size: 12.5px; font-weight: 600; cursor: pointer;
  border-radius: var(--r-sm); padding: 8px 13px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn .ico { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(180deg, var(--accent), #e2521c); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(255,106,43,.28); }
.btn-primary:hover { filter: brightness(1.07); border-color: transparent; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn-ghost.open .st-chevron, .btn-ghost.open .ico { color: var(--accent-2); }
.btn-icon { padding: 8px; }
.btn.danger:hover { color: var(--bad); border-color: var(--bad); }

/* ---------- modal ---------- */
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(4,6,9,.74); backdrop-filter: blur(5px); display: grid; place-items: start center; padding: 42px 16px; overflow: auto; animation: fade .18s ease; }
.modal { position: relative; width: 100%; max-width: 980px; background: var(--bg-elev); border: 1px solid var(--line-2); border-radius: 18px; padding: 26px; box-shadow: 0 40px 90px rgba(0,0,0,.6); animation: pop .22s cubic-bezier(.2,.8,.3,1); }
.modal-close { position: absolute; top: 15px; right: 16px; z-index: 2; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); width: 34px; height: 34px; border-radius: 9px; font-size: 20px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: #fff; border-color: var(--accent); }
.pro-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pro-head-info h2 { font-family: var(--display); font-size: 26px; margin: 0 0 3px; display: flex; align-items: center; }
.pro-links { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.link-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 8px 13px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); transition: .15s; }
.link-btn .ico { width: 15px; height: 15px; color: var(--muted); }
.link-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.link-btn:hover .ico { color: var(--accent); }

/* ---------- settings dropdown ---------- */
.settings-block { margin: 20px 0 4px; }
.settings-none { padding: 15px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); font-size: 13px; background: var(--surface); }
.settings-toggle { width: 100%; display: flex; align-items: center; gap: 12px; cursor: pointer; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; color: var(--text); font: inherit; text-align: left; transition: .15s; }
.settings-toggle:hover { border-color: var(--accent); }
.settings-toggle > .ico:first-child { color: var(--accent-2); width: 18px; height: 18px; }
.st-label { font-family: var(--display); font-weight: 600; font-size: 15px; }
.st-hint { color: var(--muted); font-size: 12px; flex: 1; }
.st-chevron { transition: transform .2s; color: var(--muted); }
.settings-toggle.open .st-chevron { transform: rotate(180deg); color: var(--accent); }
.settings-body { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 15px 16px 8px; margin-top: -1px; background: var(--bg-elev); animation: slidedown .2s ease; }
.cfg-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.settings-group { margin-bottom: 15px; }
.settings-group-title { font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px; }
.kv-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 12px; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.kv-k { color: var(--muted); font-size: 12.5px; }
.kv-v { color: var(--text); font-family: var(--mono); font-size: 12.5px; cursor: pointer; padding: 1px 6px; border-radius: 5px; transition: .12s; white-space: nowrap; }
.kv-v:hover { background: var(--surface-2); color: var(--accent-2); }
.settings-src { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.settings-src a { color: var(--muted); text-decoration: underline; }

/* ---------- panels: decode / community ---------- */
.panel { max-width: 900px; }
.decode-form { margin: 18px 0; }
.text-input { width: 100%; font: inherit; font-size: 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 12px 14px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.text-input.mono { font-family: var(--mono); }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.text-input.bad, .bad { border-color: var(--bad) !important; }
.decode-out { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; margin-top: 6px; }
.decode-out .tile { width: 280px; }
.decode-error { color: var(--bad); font-size: 14px; }
.settings-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; }

.upload-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 8px; align-items: end; }
.upload-form .field:first-child { grid-column: 1 / -1; }
.upload-form .btn-primary { grid-column: 1 / -1; justify-self: start; padding: 11px 20px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.notice { display: flex; gap: 11px; align-items: flex-start; background: var(--accent-soft); border: 1px solid rgba(255,106,43,.28); border-radius: var(--r); padding: 13px 15px; color: var(--text); font-size: 13px; margin: 4px 0 6px; }
.notice .ico { color: var(--accent); margin-top: 1px; }
.community-list { margin-top: 20px; }
.loading { padding: 24px 0; }
.uploader { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; color: var(--text); }
.uploader-info { min-width: 0; }
.uploader-name { font-family: var(--display); font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploader-by { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; }
.uploader-by .ico { width: 13px; height: 13px; }
.uploader:hover .uploader-name { color: var(--accent-2); }

/* ---------- header actions + add button ---------- */
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box { margin-left: 0; }
.add-btn { height: 40px; padding: 0 16px; }

/* ---------- community bar / sort ---------- */
.community-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 4px; flex-wrap: wrap; }
.sort-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.sort-btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-family: var(--display); font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; border: 0; border-radius: 7px; padding: 7px 14px; cursor: pointer; transition: .14s; }
.sort-btn .ico { width: 15px; height: 15px; }
.sort-btn:hover { color: var(--text); }
.sort-btn.active { color: #fff; background: linear-gradient(180deg, var(--surface-3), var(--surface-2)); box-shadow: inset 0 0 0 1px var(--line-2); }
.sort-btn.active .ico { color: var(--accent); }

/* ---------- favorite pill ---------- */
.fav-pill {
  position: absolute; top: 9px; right: 9px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(10,12,15,.72); border: 1px solid var(--line-2); border-radius: 20px;
  padding: 4px 10px 4px 8px; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(4px); transition: .14s; z-index: 2;
}
.fav-pill .ico { width: 15px; height: 15px; fill: none; stroke: currentColor; transition: .14s; }
.fav-pill:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.fav-pill.faved { color: #ff5d6c; border-color: rgba(255,93,108,.5); }
.fav-pill.faved .ico { fill: #ff5d6c; stroke: #ff5d6c; }
.fav-pill.pulse { animation: favpop .3s ease; }
@keyframes favpop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- rank badge ---------- */
.rank-badge {
  position: absolute; top: 9px; left: 9px; z-index: 2; font-family: var(--display); font-weight: 700;
  font-size: 12px; padding: 3px 9px; border-radius: 7px; color: #10130f;
  background: linear-gradient(180deg, #ffd76a, #f0a500); box-shadow: 0 2px 8px rgba(240,165,0,.4);
}
.rank-badge.rank-2 { background: linear-gradient(180deg, #e7edf3, #b9c4cf); box-shadow: 0 2px 8px rgba(185,196,207,.35); }
.rank-badge.rank-3 { background: linear-gradient(180deg, #f0b088, #cc7a44); box-shadow: 0 2px 8px rgba(204,122,68,.35); color: #1a1206; }

/* ---------- add modal ---------- */
.add-head { margin-bottom: 16px; padding-right: 40px; }
.add-head h2 { font-family: var(--display); font-size: 24px; margin: 0 0 5px; }
.add-head p { margin: 0; font-size: 13.5px; max-width: 560px; }
.modal .upload-form { margin-top: 6px; }

/* ---------- crosshair maker ---------- */
.maker-panel { max-width: 1100px; }
.maker { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: start; margin-top: 18px; }
.maker-preview { display: flex; flex-direction: column; gap: 12px; }
.scene-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.scene-btn { font: inherit; font-family: var(--display); font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 12px; cursor: pointer; transition: .14s; }
.scene-btn:hover { color: var(--text); border-color: var(--line-2); }
.scene-btn.active { color: #fff; border-color: var(--accent); background: var(--accent-soft); }

.maker-stage { position: relative; height: 380px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); display: grid; place-items: center; }
.maker-canvas { position: relative; z-index: 2; }
.scene-fig { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }

/* scenes (original gradients; drop assets/scenes/<id>.jpg to use real screenshots) */
.scene { --scene-img: none; background-repeat: no-repeat; }
.scene-grid { background-color: var(--stage); background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 22px 22px, 22px 22px; background-position: center; }
.scene-dark { background: var(--scene-img) center/cover, radial-gradient(120% 90% at 50% 20%, #1a1e22, #090b0d 75%); }
.scene-light { background: var(--scene-img) center/cover, linear-gradient(180deg, #cfd8e2, #97a4b3 70%, #7d8b9c); }
.scene-dust { background: var(--scene-img) center/cover, linear-gradient(180deg, #cdb188 0%, #b8975f 45%, #6d5636 46%, #4a3a22 100%); }
.scene-sky { background: var(--scene-img) center/cover, linear-gradient(180deg, #6ea3d8 0%, #a9c9e8 55%, #d7c9a6 56%, #b49b6e 100%); }
.scene-aim { background: var(--scene-img) center/cover, linear-gradient(180deg, #4a5560 0%, #333c45 55%, #2a2f27 56%, #1c2018 100%); }

.load-row { display: flex; gap: 8px; }
.load-row .text-input { flex: 1; }
.maker-out { display: flex; flex-direction: column; gap: 10px; }
.out-row { display: flex; flex-direction: column; gap: 6px; }
.out-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.out-field { display: flex; gap: 8px; align-items: stretch; }
.out-field .code-text { flex: 1; font-size: 13px; padding: 10px 12px; }
.out-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-copy { background: var(--accent); color: #150c06; border-color: transparent; }
.btn-copy:hover { filter: brightness(1.08); border-color: transparent; }

/* controls */
.maker-controls { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px 18px; }
.ctrl-group-title { font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ctrl-row { margin-bottom: 13px; }
.ctrl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ctrl-label { font-size: 13px; color: var(--text); }
.ctrl-val { font-family: var(--mono); font-size: 12.5px; color: var(--accent-2); }
.ctrl-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 4px; background: var(--surface-3); outline: none; cursor: pointer; }
.ctrl-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-elev); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }
.ctrl-slider::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-elev); cursor: pointer; }
.ctrl-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ctrl-select { width: 100%; font: inherit; font-size: 13.5px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 20px; transition: .18s; }
.switch-track::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--muted); border-radius: 50%; transition: .18s; }
.switch input:checked + .switch-track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(18px); background: var(--accent); }
.color-control { display: flex; flex-direction: column; gap: 10px; }
.color-swatches { display: flex; gap: 8px; }
.color-swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); transition: .14s; }
.color-swatch:hover { transform: translateY(-2px); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.color-custom { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.color-custom.active { color: var(--text); }
.color-picker { width: 34px; height: 34px; padding: 0; border: 2px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.color-custom.active .color-picker { border-color: var(--accent); }

/* presets */
.presets { margin: 6px 0 10px; }
.presets-title { font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 12px 0 8px; }
.preset-row { display: flex; gap: 10px; flex-wrap: wrap; }
.preset-chip {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 8px 9px; cursor: pointer; color: var(--text); font: inherit;
  width: 84px; transition: .15s; position: relative;
}
.preset-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.preset-thumb {
  width: 62px; height: 62px; border-radius: 6px; background: var(--stage);
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line);
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 12px 12px, 12px 12px; background-position: center;
}
.preset-name { font-family: var(--display); font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.preset-chip:hover .preset-name { color: var(--text); }
.preset-av { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); z-index: 1; }

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

/* ---------- side banner rails (sponsor / ad slots) ---------- */
.side-rail {
  position: fixed; top: 0; bottom: 0; width: calc((100vw - 1240px) / 2);
  display: none; align-items: center; justify-content: center; z-index: 5; pointer-events: none;
}
.side-l { left: 0; }
.side-r { right: 0; }
.rail-card {
  position: relative; pointer-events: auto; width: 300px; height: 600px; flex: 0 0 auto;
  background: #14181e; border: 1px solid #2f3742; border-radius: 12px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s cubic-bezier(.2,.7,.3,1);
}
/* glow-only hover — never covers the live ad, so clicks/impressions aren't blocked */
.rail-card:hover { border-color: var(--accent); box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px var(--accent), 0 0 26px rgba(255,106,43,.26); }
.rail-frame { display: block; width: 300px; height: 600px; border: 0; }
.rail-card img { max-width: 100%; max-height: 100%; display: block; }
@media (min-width: 1880px) { .side-rail { display: flex; } }

/* honeypot (hidden from humans) */
.hp-field { position: absolute !important; left: -9999px !important; top: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* support / ad-block notice */
#support-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px));
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px 14px 12px 18px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
  font-size: 13.5px; color: var(--text); animation: riseIn .3s ease both;
}
#support-bar strong { color: var(--accent-2); }
#support-bar button { flex: 0 0 auto; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line-2); background: var(--accent); color: #150c06; border-radius: 7px; padding: 7px 13px; }
#support-bar button:hover { filter: brightness(1.07); }

/* ---------- SEO content / FAQ ---------- */
.seo-content { padding-top: 38px; padding-bottom: 10px; margin-top: 34px; border-top: 1px solid var(--line); color: var(--muted); }
.seo-content h2 { font-family: var(--display); font-size: 21px; color: var(--text); margin: 0 0 12px; letter-spacing: -.01em; }
.seo-content h3 { font-family: var(--display); font-size: 15px; color: var(--text); margin: 24px 0 8px; }
.seo-content p { font-size: 13.5px; max-width: 780px; line-height: 1.68; margin: 0 0 8px; }
.seo-content a { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid rgba(255,194,75,.3); }
.seo-content a:hover { border-bottom-color: var(--accent-2); }
.seo-content code { background: var(--bg-elev); padding: 1px 6px; border-radius: 4px; font-family: var(--mono); font-size: .86em; color: var(--accent-2); }
.faq { margin-top: 6px; }
.faq details { border-bottom: 1px solid var(--line); padding: 11px 0; max-width: 780px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); font-size: 14px; list-style: none; display: flex; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--accent); margin-right: 9px; font-weight: 700; font-family: var(--mono); }
.faq details[open] summary::before { content: "\2013"; }
.faq details p { margin: 9px 0 2px; font-size: 13px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; margin-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand p { margin: 0; font-size: 12.5px; }
.site-footer .tiny { max-width: 460px; text-align: right; }
.partner-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--accent-2); text-decoration: none; letter-spacing: .01em; transition: color .15s; }
.partner-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 7px var(--good); flex: 0 0 auto; }
.partner-badge:hover { color: var(--accent); }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px); display: flex; align-items: center; gap: 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); padding: 11px 17px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 80; opacity: 0; transition: .25s cubic-bezier(.2,.8,.3,1); box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.toast .ico { color: var(--good); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-bad { border-color: var(--bad); }
.toast-bad .ico { color: var(--bad); }

/* ---------- animations ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slidedown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.view-enter { animation: riseIn .34s cubic-bezier(.2,.7,.3,1) both; }
.pro-card, .tile { animation: riseIn .3s cubic-bezier(.2,.7,.3,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, .view-enter, .pro-card, .tile, .modal, .modal-backdrop, .settings-body { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px 18px; }
  .brand { order: 1; }
  .tabs { order: 3; width: 100%; }
  .search-box { order: 2; margin-left: auto; }
  .hero-title { font-size: 26px; }
  .upload-form, .settings-table { grid-template-columns: 1fr; }
  .site-footer .tiny { text-align: left; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
