:root {
  --bg: #0b0c0d;
  --bg-elev: #131517;
  --line: #1f2225;
  --line-2: #2a2e33;
  --fg: #f3f4f3;
  --fg-mute: #8e9296;
  --fg-dim: #5a5e62;
  --accent: #E94B30;
  --accent-bright: #FF5538;
  --accent-deep: #B8351F;
  --friend: #6EFF3A;
  --friend-bright: #9EFF6B;
  --new: #E94B30;
  --radius: 4px;
  --maxw: 1440px;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body { font-family: "Space Grotesk", system-ui, sans-serif; font-size: 15px; line-height: 1.4; min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ========== SHELL ========== */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 28px 48px 80px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand { transition: opacity .15s; }
.brand:hover { opacity: 0.82; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-title {
  display: flex; flex-direction: column; line-height: 1;
  white-space: nowrap;
}
.brand-title .lockup {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-title .lockup .colon { color: var(--accent); }
.brand-title .lockup .sub { color: var(--fg); font-weight: 700; }
.brand-title .tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.18em;
  margin-top: 6px;
  text-transform: uppercase;
}

.topbar-right { display: flex; align-items: center; gap: 12px; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--fg-mute); }
.topbar-right .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--accent); display: inline-block; margin-right: 8px; vertical-align: 1px;}
.ext-link {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  color: var(--fg-mute); text-decoration: none;
  border: 1px solid var(--line-2);
  padding: 7px 14px;
  border-radius: 2px;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: color .15s, border-color .15s, background .15s;
}
.ext-link svg { width: 11px; height: 11px; opacity: 0.7; transition: transform .15s, opacity .15s; }
.ext-link:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.ext-link:hover svg { opacity: 1; transform: translate(1px, -1px); }
@media (max-width: 700px) {
  .ext-link .label-long { display: none; }
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 0;
  margin-top: 32px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none; border: none; color: var(--fg-mute);
  padding: 18px 0 18px; margin-right: 40px;
  font-size: 15px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  display: flex; align-items: center; gap: 12px;
  white-space: nowrap;
  transition: color .15s;
}
.tab .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--fg-dim);
}
.tab.active { color: var(--fg); }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
}
.tab:hover { color: var(--fg); }

/* ========== PAGE HEADERS ========== */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 48px 0 32px;
  gap: 24px;
}
.page-head h1 {
  margin: 0; font-size: 56px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1;
}
.page-head .page-sub {
  margin: 16px 0 0;
  color: var(--fg-mute);
  font-size: 15px;
  letter-spacing: 0.01em;
  max-width: 520px;
}
.page-head .h1-accent { color: var(--accent); }

/* ===== Stickers tagline (animated) ===== */
.sticker-tagline {
  margin: 18px 0 0;
  display: flex; align-items: center; gap: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sticker-tagline .word {
  color: var(--accent-bright);
  text-shadow: 0 0 14px rgba(233,75,48,0.5);
  animation: stk-pulse 2.4s ease-in-out infinite;
}
.sticker-tagline .word:nth-child(3) { animation-delay: 0.4s; }
.sticker-tagline .word:nth-child(5) { animation-delay: 0.8s; }
.sticker-tagline .dot-sep { color: var(--fg-dim); }
@keyframes stk-pulse {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  40%      { opacity: 1;    transform: translateY(-2px); }
}

/* ===== Empty state ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 90px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--fg-mute);
}
.empty-icon { color: var(--fg-dim); margin-bottom: 14px; }
.empty-title { font-size: 18px; color: var(--fg); font-weight: 600; margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--fg-mute); }

/* ===== Sticker preview states ===== */
.sticker-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  color: var(--fg-dim);
  background: #14161a;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.16em;
}
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-head p {
  margin: 0; color: var(--fg-mute); font-size: 14px; max-width: 380px;
  line-height: 1.5;
}

/* ========== FILTER BAR ========== */
.filterbar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.filterbar .label { color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.16em; margin-right: 4px; }
.chip {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-mute);
  padding: 7px 14px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .15s;
}
.chip:hover { color: var(--fg); border-color: var(--fg-mute); }
.chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 700;
}
.chip .count { color: var(--fg-dim); }
.chip.active .count { color: #fff; opacity: 0.7; }
.filterbar .spacer { flex: 1; }
.filterbar .sort { color: var(--fg-mute); display: flex; gap: 8px; }
.filterbar .sort span { color: var(--fg); }

/* ========== WALLPAPER GRID ========== */
.grid {
  display: grid;
  gap: 28px;
}
.grid.desktop { grid-template-columns: repeat(3, 1fr); }
.grid.mobile  { grid-template-columns: repeat(5, 1fr); }
.grid.stickers { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: var(--bg-elev);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-2); }
.card .thumb-wrap {
  width: 100%; position: relative; overflow: hidden;
  background: #000;
}
.grid.desktop .thumb-wrap { aspect-ratio: 16 / 9; }
.grid.mobile  .thumb-wrap { aspect-ratio: 9 / 16; }
.grid.stickers .thumb-wrap { aspect-ratio: 3 / 4; background: #fff; }
.grid.stickers .thumb { object-fit: contain; }
.card canvas.thumb,
.card img.thumb {
  width: 100%; height: 100%; display: block; object-fit: cover;
  transition: transform .4s;
}
.card:hover canvas.thumb,
.card:hover img.thumb { transform: scale(1.03); }

.thumb-wrap.zoomable { cursor: zoom-in; }

/* zoom (magnifier) button — top-right on hover */
.zoom-btn {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(11,12,13,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: #fff;
  z-index: 3;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s, transform .18s, background .18s, border-color .18s;
}
.zoom-btn svg { width: 15px; height: 15px; }
.card:hover .zoom-btn { opacity: 1; transform: translateY(0); }
.zoom-btn:hover { background: var(--accent); border-color: var(--accent); }
@media (hover: none) {
  .zoom-btn { opacity: 1; transform: none; }
}

.badge-new {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #fff;
  padding: 4px 9px; border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
}
.badge-new::before {
  content: ""; width: 5px; height: 5px; background: #fff; border-radius: 50%;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  gap: 12px;
}
.card-title {
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.card-title .num {
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--fg-dim);
}
.card-stats {
  display: flex; align-items: center; gap: 14px;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.card-dl {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--fg-mute);
}
.card-dl svg { width: 9px; height: 9px; opacity: 0.7; }
.card-res {
  letter-spacing: 0.04em;
}

.badge-delete {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(11,12,13,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 3;
  opacity: 0;
  transition: opacity .15s, background .15s, border-color .15s;
}
.card:hover .badge-delete { opacity: 1; }
.badge-delete:hover { background: var(--accent); border-color: var(--accent); }

/* admin button in filterbar */
.admin-btn {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-mute);
  padding: 7px 14px;
  border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 18px;
  transition: all .15s;
}
.admin-btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
}
.admin-btn svg { width: 11px; height: 11px; }

/* ========== MODAL ========== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 640px; max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.modal-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.modal-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.modal-close {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-mute);
  border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--fg); border-color: var(--fg-mute); }
.modal-body {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  overflow-y: auto;
}
.dropzone {
  position: relative;
  background: var(--bg);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--fg-mute); }
.dropzone.drag { border-color: var(--accent); border-style: solid; background: rgba(233,75,48,0.06); }
.dropzone.has-preview { padding: 0; }
.dropzone img { width: 100%; height: 100%; object-fit: cover; }
.dropzone-empty {
  text-align: center;
  color: var(--fg-mute);
  padding: 12px;
}
.dropzone-empty svg { color: var(--fg-dim); margin-bottom: 6px; }
.dz-title { font-size: 13px; color: var(--fg); margin-bottom: 4px; font-weight: 500; }
.dz-sub { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.1em; color: var(--fg-dim); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-row {
  display: flex; flex-direction: column; gap: 6px;
}
.form-row > span:first-child {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.form-row input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 2px;
  font-size: 13px;
  outline: none;
}
.form-row input[type="text"]:focus { border-color: var(--accent); }
.form-row .detected { font-size: 13px; color: var(--fg); padding: 4px 0; }
.form-row.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.form-row.check span { font-size: 13px; color: var(--fg); }
.form-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px; height: 14px;
}

.seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px;
  gap: 2px;
  width: max-content;
}
.seg button {
  background: transparent;
  border: none;
  color: var(--fg-mute);
  padding: 7px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
}
.seg button.on { background: var(--line-2); color: var(--fg); }

.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
.modal-actions button {
  padding: 11px 18px; border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
  border: none;
}
.modal-actions button.ghost {
  background: transparent; color: var(--fg-mute);
  border: 1px solid var(--line-2);
}
.modal-actions button.ghost:hover { color: var(--fg); border-color: var(--fg-mute); }
.modal-actions button.primary {
  background: var(--accent); color: #fff;
}
.modal-actions button.primary:hover { background: var(--accent-bright); }
.modal-actions button.primary:disabled {
  background: var(--line-2);
  color: var(--fg-dim);
  cursor: not-allowed;
}
.modal-actions button.primary svg { width: 12px; height: 12px; }

@media (max-width: 700px) {
  .modal-body { grid-template-columns: 1fr; }
}

.card-actions {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.7) 100%);
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.card:hover .card-actions { opacity: 1; pointer-events: auto; }
.dl-btn {
  background: var(--accent); color: #fff;
  border: none; padding: 10px 16px; border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.dl-btn:hover { background: var(--accent-bright); }
.dl-btn svg { width: 12px; height: 12px; }

@media (max-width: 700px) {
  .dl-btn {
    padding: 10px;
    width: 38px; height: 38px;
    justify-content: center;
    border-radius: 50%;
  }
  .dl-btn .dl-label { display: none; }
  .dl-btn svg { width: 14px; height: 14px; }
  .card-actions { opacity: 1; pointer-events: auto; }
}

/* ========== CONSTRUCTOR ========== */
.constructor-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.stage-frame {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 3168 / 1344;
}
.stage-frame img.stage-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; object-fit: cover;
  user-select: none; -webkit-user-drag: none;
}

.stage-frame { --s: 1; }

/* ===== Clan title banner overlay ===== */
.clan-title-wrap {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: calc(6px * var(--s));
  max-width: 92%;
}
.clan-title-wrap.hidden { display: none; }
.clan-title {
  font-family: "Anton", system-ui, sans-serif;
  font-weight: 400;
  font-size: calc(44px * var(--s));
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: calc(1px * var(--s));
  white-space: nowrap;
  outline: none;
  cursor: text;
  padding: 0 calc(4px * var(--s));
  min-width: calc(40px * var(--s));
  text-align: center;
}
.clan-title.style-ember {
  background-image: linear-gradient(180deg, #ffe0ad 0%, #ff7a45 50%, #d8401c 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 calc(2px * var(--s)) calc(1px * var(--s)) rgba(0,0,0,0.6))
          drop-shadow(0 0 calc(14px * var(--s)) rgba(233,75,48,0.6));
}
.clan-title.style-chrome {
  background-image: linear-gradient(180deg, #ffffff 0%, #aab2bb 45%, #4c535b 55%, #dfe6ec 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: calc(1px * var(--s)) #0c0e11;
  filter: drop-shadow(0 calc(2px * var(--s)) calc(1px * var(--s)) rgba(0,0,0,0.7));
}
.clan-title.style-toxic {
  color: #9EFF6B; -webkit-text-fill-color: #9EFF6B;
  -webkit-text-stroke: calc(0.7px * var(--s)) rgba(8,20,4,0.8);
  filter: drop-shadow(0 0 calc(16px * var(--s)) rgba(110,255,58,0.85))
          drop-shadow(0 calc(1px * var(--s)) calc(1px * var(--s)) rgba(0,0,0,0.5));
}
.clan-title.style-stencil {
  font-family: "Black Ops One", system-ui, sans-serif;
  letter-spacing: calc(4px * var(--s));
  color: #ece6d8; -webkit-text-fill-color: #ece6d8;
  -webkit-text-stroke: calc(1.5px * var(--s)) #14120d;
  filter: drop-shadow(0 calc(2px * var(--s)) calc(1px * var(--s)) rgba(0,0,0,0.55));
}
.clan-title:empty::before {
  content: attr(data-placeholder);
  -webkit-text-fill-color: rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.45);
  -webkit-text-stroke: 0;
}
.title-remove {
  margin-top: calc(4px * var(--s));
  width: calc(20px * var(--s)); height: calc(20px * var(--s));
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(11,12,13,0.85);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: calc(13px * var(--s)); line-height: 1;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, border-color .15s;
  cursor: pointer;
  flex-shrink: 0;
}
.clan-title-wrap:hover .title-remove,
.clan-title-wrap:focus-within .title-remove { opacity: 1; }
.title-remove:hover { background: var(--accent); border-color: var(--accent); }

/* ===== Clan title panel section ===== */
.title-section {
  margin: 4px 0 22px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ts-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ts-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-dim);
}
.ts-toggle {
  background: transparent; border: 1px solid var(--line-2);
  color: var(--fg-mute);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 2px;
  transition: color .15s, border-color .15s;
}
.ts-toggle:hover { color: var(--accent-bright); border-color: var(--accent); }
.ts-toggle.add { color: var(--friend); border-color: rgba(110,255,58,0.4); }
.ts-toggle.add:hover { color: var(--friend-bright); border-color: var(--friend); }
.ts-input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  outline: none;
  margin-bottom: 12px;
}
.ts-input:focus { border-color: var(--accent); }
.ts-input::placeholder { color: var(--fg-dim); text-transform: none; font-weight: 400; letter-spacing: 0; }
.ts-styles {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.ts-style {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 9px 11px;
  transition: border-color .15s, background .15s;
}
.ts-style:hover { border-color: var(--fg-mute); }
.ts-style.active { border-color: var(--accent); background: var(--accent); }
.ts-style.active .ts-style-name { color: #fff; }
.ts-style-preview {
  font-size: 20px; line-height: 1; flex-shrink: 0;
  text-transform: uppercase;
}
.ts-style.style-ember .ts-style-preview {
  font-family: "Anton", sans-serif;
  background-image: linear-gradient(180deg, #ffe0ad, #ff7a45 55%, #d8401c);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ts-style.style-chrome .ts-style-preview {
  font-family: "Anton", sans-serif;
  background-image: linear-gradient(180deg, #fff, #9aa3ad 50%, #4c535b 55%, #dfe6ec);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ts-style.style-toxic .ts-style-preview {
  font-family: "Anton", sans-serif;
  color: #9EFF6B; text-shadow: 0 0 8px rgba(110,255,58,0.7);
}
.ts-style.style-stencil .ts-style-preview {
  font-family: "Black Ops One", sans-serif;
  color: #ece6d8; -webkit-text-stroke: 0.7px #14120d;
}
.ts-style-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-mute);
}
.ts-style.active .ts-style-name { color: var(--fg); }

.tag-input {
  position: absolute;
  transform: translate(-50%, -200%);
  display: flex; align-items: center;
  gap: calc(8px * var(--s));
  z-index: 3;
}
.tag-dot {
  width: calc(14px * var(--s));
  height: calc(14px * var(--s));
  border-radius: 50%;
  background: var(--friend);
  box-shadow: 0 0 calc(14px * var(--s)) rgba(110,255,58,0.7), 0 0 calc(4px * var(--s)) rgba(110,255,58,0.9), 0 0 2px rgba(0,0,0,0.6);
  flex-shrink: 0;
}
.tag-field {
  background: rgba(11,12,13,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(110,255,58,0.4);
  color: var(--friend-bright);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: calc(15px * var(--s));
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(110,255,58,0.7), 0 0 4px rgba(110,255,58,0.5);
  padding: calc(5px * var(--s)) calc(12px * var(--s));
  border-radius: 2px;
  outline: none;
  field-sizing: content;
  width: auto;
  min-width: calc(48px * var(--s));
  max-width: calc(160px * var(--s));
  transition: border-color .15s, background .15s;
}
.tag-field::placeholder {
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: none;
}
.tag-field:focus {
  border-color: var(--friend);
  background: rgba(11,12,13,0.75);
}

/* render-only labels for canvas export — none, handled in canvas drawing */

/* Side panel */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.panel h3 {
  margin: 0 0 6px;
  font-size: 18px; font-weight: 600;
}
.panel .panel-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--fg-dim);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 20px;
}
.panel .step {
  display: flex; gap: 12px; margin-bottom: 14px;
  color: var(--fg-mute);
  font-size: 13px; line-height: 1.55;
}
.panel .step .n {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  width: 18px; flex-shrink: 0;
  padding-top: 2px;
}
.panel .actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.panel button {
  background: var(--accent); color: #fff;
  border: none; padding: 14px 16px;
  border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.panel button:hover { background: var(--accent-bright); }
.panel button.ghost {
  background: transparent; color: var(--fg-mute);
  border: 1px solid var(--line-2);
}
.panel button.ghost:hover { color: var(--fg); border-color: var(--fg-mute); background: transparent; }
.panel button svg { width: 13px; height: 13px; }

.panel .field-list {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.panel .field-row {
  display: flex; align-items: center; gap: 10px;
}
.panel .field-row .row-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--friend);
  box-shadow: 0 0 8px rgba(110,255,58,0.6);
  flex-shrink: 0;
}
.panel .field-row input {
  flex: 1; min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 9px 11px;
  border-radius: 2px;
  font-size: 13px;
  outline: none;
}
.panel .field-row input:focus { border-color: var(--friend); }
.panel .field-row.off input {
  opacity: 0.35;
  text-decoration: line-through;
}
.panel .field-row.off .row-dot {
  background: var(--fg-dim);
  box-shadow: none;
  opacity: 0.5;
}
.panel .row-btn {
  width: 24px; height: 24px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-mute);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: all .15s;
}
.panel .row-btn:hover {
  color: var(--fg);
  border-color: var(--fg-mute);
}
.panel .row-btn.remove:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
}
.panel .row-btn.restore {
  color: var(--friend);
  border-color: rgba(110,255,58,0.35);
}
.panel .row-btn.restore:hover {
  color: var(--friend-bright);
  border-color: var(--friend);
}

/* × button on the photo overlay */
.tag-remove {
  position: absolute;
  top: calc(-9px * var(--s));
  right: calc(-9px * var(--s));
  width: calc(18px * var(--s));
  height: calc(18px * var(--s));
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(11,12,13,0.85);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: calc(12px * var(--s));
  line-height: 1;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s, border-color .15s, background .15s;
  cursor: pointer;
  z-index: 4;
}
.tag-input:hover .tag-remove,
.tag-input:focus-within .tag-remove {
  opacity: 1;
}
.tag-remove:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.panel .field-row .idx {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--fg-dim);
  width: 18px;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp .3s;
}
@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ========== LIGHTBOX ========== */
.lb-backdrop {
  position: fixed; inset: 0;
  background: rgba(6,7,8,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; flex-direction: column;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.lb-bar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  gap: 16px;
}
.lb-title {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-dim);
  display: flex; align-items: baseline; gap: 6px;
}
.lb-title .lb-name { color: var(--fg); font-weight: 700; font-size: 14px; }
.lb-actions { display: flex; align-items: center; gap: 12px; }
.lb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none;
  padding: 9px 16px; border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background .15s;
}
.lb-btn:hover { background: var(--accent-bright); }
.lb-btn svg { width: 12px; height: 12px; }
.lb-close {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--fg-mute);
  border-radius: 50%;
  font-size: 20px; line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
}
.lb-close:hover { color: #fff; border-color: var(--fg-mute); background: rgba(255,255,255,0.06); }

.lb-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 28px 12px;
  overflow: auto;
}
.lb-img, .lb-canvas {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  cursor: zoom-in;
  transition: transform .25s ease;
}
.lb-img.zoomed, .lb-canvas.zoomed {
  max-width: none; max-height: none;
  width: auto; height: 160vh;
  cursor: zoom-out;
}
.lb-canvas { background: #fff; }
.lb-pdf-wrap {
  display: flex; align-items: center; justify-content: center;
  position: relative; max-width: 100%; max-height: 100%;
}
.lb-spin { width: 32px; height: 32px; }
.lb-pdf-err {
  color: var(--fg-mute);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; letter-spacing: 0.05em;
}
.lb-hint {
  flex-shrink: 0;
  text-align: center;
  padding: 0 0 18px;
  color: var(--fg-dim);
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
}

/* footer-ish */
.foot {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--fg-dim);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.foot-left { display: flex; align-items: center; gap: 14px; }
.foot-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
  transition: opacity .15s;
}
.foot-mark:hover { opacity: 0.82; }
.foot-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foot-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.foot-links a {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--fg-mute); text-decoration: none;
  transition: color .15s;
}
.foot-links a svg { width: 11px; height: 11px; opacity: 0.7; transition: transform .15s, opacity .15s; }
.foot-links a:hover { color: var(--accent); }
.foot-links a:hover svg { opacity: 1; transform: translate(1px, -1px); }

@media (max-width: 1000px) {
  .shell { padding: 20px 24px 64px; }
  .grid.desktop { grid-template-columns: repeat(2, 1fr); }
  .grid.mobile  { grid-template-columns: repeat(3, 1fr); }
  .grid.stickers { grid-template-columns: repeat(2, 1fr); }
  .constructor-wrap { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 40px; }
  .topbar-right { gap: 16px; font-size: 11px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 18px; }
  .foot-links { justify-content: flex-start; }
}
