:root {
  --page:#f4f6fb;
  --ink:#0b1020;
  --muted:#6f7788;
  --line:#e4e8f0;
  --panel:rgba(255,255,255,.92);
  --blue:#1769ff;
  --blue2:#2d78ff;
  --shadow:0 16px 45px rgba(35,51,89,.10);
  --radius:22px;
}

* { box-sizing:border-box; }
html { min-height:100%; background:var(--page); }
body {
  margin:0;
  min-height:100%;
  color:var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(80,132,255,.08), transparent 26rem),
    radial-gradient(circle at 88% 14%, rgba(122,164,255,.09), transparent 28rem),
    var(--page);
  font-family:Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

button, input, select { font:inherit; }
button { cursor:pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, label.upload-button:focus-within {
  outline:3px solid rgba(23,105,255,.22);
  outline-offset:2px;
}

.gba-editor-page { min-height:100dvh; }

.tool-header {
  height:68px;
  padding:0 clamp(18px,4vw,64px);
  border-bottom:1px solid rgba(17,35,70,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:rgba(255,255,255,.84);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  position:sticky;
  top:0;
  z-index:30;
}

.tool-brand {
  color:var(--ink);
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  letter-spacing:.02em;
}

.brand-mark {
  width:34px;
  aspect-ratio:1;
  border-radius:10px;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(145deg,#17191f,#546071);
  box-shadow:0 6px 16px rgba(15,20,34,.18);
}

.brand-section {
  color:#71788a;
  font-weight:650;
  padding-left:10px;
  border-left:1px solid #dfe3ea;
}

.tool-header-actions { display:flex; gap:10px; align-items:center; }

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.preset-button {
  min-height:42px;
  border-radius:12px;
  border:1px solid transparent;
  padding:0 15px;
  font-weight:750;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  color:#fff;
  background:linear-gradient(180deg,var(--blue2),var(--blue));
  box-shadow:0 9px 20px rgba(23,105,255,.22);
}
.primary-button:hover { transform:translateY(-1px); box-shadow:0 12px 26px rgba(23,105,255,.27); }

.secondary-button,
.preset-button {
  color:#263044;
  background:#f7f9fc;
  border-color:#e1e6ef;
}

.ghost-button { background:transparent; color:#4b556a; }
.danger-button { color:#b3261e; background:#fff3f2; border-color:#ffd8d5; }

.editor-shell {
  width:min(1520px, calc(100% - 32px));
  margin:22px auto 50px;
  display:grid;
  grid-template-columns:minmax(360px, .92fr) minmax(500px, 1.08fr);
  gap:22px;
  align-items:start;
}

.preview-column,
.control-card {
  background:var(--panel);
  border:1px solid rgba(215,222,235,.88);
  box-shadow:var(--shadow);
  border-radius:var(--radius);
}

.preview-column {
  padding:20px;
  position:sticky;
  top:90px;
}

.preview-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
  margin-bottom:16px;
}

.eyebrow {
  color:#8b94a7;
  font-size:11px;
  font-weight:850;
  letter-spacing:.13em;
}

.preview-toolbar h1,
.control-heading h2 {
  margin:4px 0 0;
  letter-spacing:-.035em;
}

.preview-toolbar h1 { font-size:22px; }
.control-heading h2 { font-size:31px; }

.preview-pills { display:flex; gap:8px; }

.pill {
  border:1px solid #e1e6ef;
  background:#f6f8fb;
  color:#778195;
  border-radius:999px;
  height:34px;
  padding:0 13px;
  font-size:12px;
  font-weight:750;
}
.pill.is-active { color:#1769ff; background:#eef4ff; border-color:#cfe0ff; }

.canvas-stage {
  min-height:420px;
  display:grid;
  place-items:center;
  background:
    linear-gradient(45deg,#f1f3f6 25%,transparent 25%),
    linear-gradient(-45deg,#f1f3f6 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#f1f3f6 75%),
    linear-gradient(-45deg,transparent 75%,#f1f3f6 75%),
    #fff;
  background-size:24px 24px;
  background-position:0 0,0 12px,12px -12px,-12px 0;
  border:1px solid #e3e7ef;
  border-radius:18px;
  padding:14px;
  overflow:hidden;
  position:relative;
}

#wallpaperCanvas {
  display:block;
  max-width:100%;
  max-height:72dvh;
  width:auto;
  height:auto;
  border-radius:18px;
  box-shadow:0 16px 40px rgba(15,22,37,.18);
  touch-action:none;
  background:#efefef;
}

.selection-badge {
  position:absolute;
  left:24px;
  bottom:24px;
  border-radius:999px;
  padding:7px 10px;
  background:rgba(10,15,26,.82);
  color:#fff;
  font-size:11px;
  font-weight:800;
  pointer-events:none;
  backdrop-filter:blur(8px);
}

.preview-help {
  margin:14px 4px 0;
  color:#7a8396;
  font-size:12px;
  line-height:1.5;
}

.control-column { min-width:0; }

.control-card { padding:26px; }

.control-heading {
  display:flex;
  align-items:flex-start;
  gap:14px;
  margin-bottom:20px;
}

.control-icon {
  flex:0 0 auto;
  width:50px;
  height:50px;
  border-radius:16px;
  display:grid;
  place-items:center;
  color:#1769ff;
  background:#eaf1ff;
  font-size:22px;
  font-weight:900;
}

.control-heading p {
  margin:7px 0 0;
  color:#778195;
  line-height:1.45;
}

.editor-tabs {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:7px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  margin-bottom:16px;
  overflow:auto;
}

.editor-tab {
  border:0;
  background:#f5f7fa;
  color:#7a8496;
  min-height:38px;
  border-radius:10px;
  font-weight:850;
  font-size:11px;
  letter-spacing:.06em;
}
.editor-tab.is-active { color:#0d57dc; background:#eaf2ff; }

.tab-panel { display:none; }
.tab-panel.is-active { display:block; animation:panelIn .22s ease both; }
@keyframes panelIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }

.setting-block {
  border:1px solid var(--line);
  background:#fbfcfe;
  border-radius:16px;
  padding:16px;
  margin-top:12px;
  display:grid;
  gap:13px;
}

.setting-copy { display:flex; flex-direction:column; gap:3px; }
.setting-copy strong, .upload-card-title { font-size:14px; }
.setting-copy span { color:#7b8495; font-size:12px; line-height:1.4; }
.setting-copy.split { flex-direction:row; justify-content:space-between; align-items:center; gap:12px; }

.swatches {
  display:flex;
  gap:9px;
  flex-wrap:wrap;
}

.swatch {
  width:32px;
  height:32px;
  border-radius:50%;
  background:var(--sw);
  border:3px solid #fff;
  box-shadow:0 0 0 1px #dfe4ed;
}
.swatch.selected { box-shadow:0 0 0 2px #1769ff; }

.color-input-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:#5c6678;
  font-size:12px;
  font-weight:650;
}

input[type="color"] {
  width:48px;
  height:32px;
  padding:2px;
  border:1px solid #dce2eb;
  border-radius:9px;
  background:#fff;
}

.grid-two { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }

.input-label {
  display:block;
  font-size:11px;
  color:#788296;
  font-weight:750;
  margin-bottom:6px;
}

input[type="text"], select {
  width:100%;
  min-height:42px;
  border:1px solid #dfe4ed;
  background:#fff;
  color:#1c2433;
  border-radius:11px;
  padding:0 12px;
}

.preset-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}

.preset-button { min-height:38px; font-size:12px; }

.background-presets {
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:8px;
}

.background-preset {
  border:2px solid transparent;
  border-radius:10px;
  aspect-ratio:1.35;
  background:#fbf9f9;
  box-shadow:inset 0 0 0 1px rgba(39,49,70,.08);
}
.background-preset.selected { border-color:#1769ff; }
.background-preset.sunset { background:linear-gradient(155deg,#ffe598 0%,#f6a45d 48%,#bd6076 100%); }
.background-preset.sky { background:linear-gradient(#8fc7ff,#dceeff 62%,#aec3df); }
.background-preset.twilight { background:linear-gradient(#2f315b,#7b5689 60%,#d38b9c); }
.background-preset.mint { background:linear-gradient(#c8f3e5,#8ed3cb); }
.background-preset.night { background:linear-gradient(#10172d,#262d4e); }

.upload-row, .button-row {
  display:flex;
  gap:9px;
  align-items:center;
}

.upload-button {
  min-height:42px;
  border:1px dashed #bfcce1;
  border-radius:11px;
  padding:0 14px;
  background:#f7faff;
  color:#1769ff;
  font-weight:800;
  font-size:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.upload-button.wide { width:100%; }
.upload-button input { position:absolute; opacity:0; width:1px; height:1px; overflow:hidden; }

.upload-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.upload-card {
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background:#fbfcfe;
  display:grid;
  gap:10px;
}

.upload-preview {
  min-height:94px;
  border-radius:13px;
  border:1px dashed #d9dfeb;
  background:#fff;
  display:grid;
  place-items:center;
  color:#adb4c2;
  font-size:10px;
  letter-spacing:.12em;
  font-weight:900;
  background-size:contain;
  background-position:center;
  background-repeat:no-repeat;
}
.upload-preview.pixel { image-rendering:pixelated; }

.range-row {
  display:grid;
  grid-template-columns:68px 1fr 52px;
  gap:10px;
  align-items:center;
  font-size:12px;
  color:#667084;
}
.range-row input { width:100%; accent-color:#1769ff; }
.range-row output { text-align:right; color:#313a4b; font-variant-numeric:tabular-nums; }

.toggle-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.toggle-row span { display:grid; gap:3px; }
.toggle-row small { color:#8992a4; line-height:1.35; }
.toggle-row input { width:20px; height:20px; accent-color:#1769ff; }

.export-summary {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.export-summary > div {
  padding:12px;
  background:#f2f5fa;
  border-radius:11px;
  display:grid;
  gap:4px;
}
.export-summary span { font-size:9px; letter-spacing:.1em; color:#939bad; font-weight:850; }
.export-summary strong { font-size:12px; }

.export-main { width:100%; min-height:54px; font-size:14px; }
.full { width:100%; }

.privacy-note {
  margin-top:12px;
  border-radius:14px;
  padding:12px 14px;
  color:#788194;
  background:#f7f8fb;
  border:1px solid #e5e8ef;
  font-size:11px;
  line-height:1.5;
}

.toast {
  position:fixed;
  left:50%;
  bottom:24px;
  z-index:100;
  transform:translate(-50%,20px);
  background:#111827;
  color:#fff;
  border-radius:999px;
  padding:10px 16px;
  font-size:12px;
  font-weight:750;
  opacity:0;
  pointer-events:none;
  transition:.2s ease;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
}
.toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width:1050px) {
  .editor-shell {
    grid-template-columns:1fr;
    width:min(920px, calc(100% - 24px));
  }
  .preview-column { position:relative; top:auto; }
  #wallpaperCanvas { max-height:70dvh; }
}

@media (max-width:680px) {
  .tool-header { height:60px; padding:0 14px; }
  .brand-section { display:none; }
  .ghost-button { display:none; }
  .compact-download { min-height:38px; padding:0 12px; }
  .editor-shell { margin-top:12px; width:calc(100% - 16px); gap:12px; }
  .preview-column, .control-card { border-radius:18px; }
  .preview-column { padding:12px; }
  .preview-toolbar { align-items:center; }
  .preview-toolbar h1 { font-size:18px; }
  .preview-help { display:none; }
  .canvas-stage { padding:8px; min-height:320px; }
  #wallpaperCanvas { max-height:57dvh; border-radius:14px; }
  .control-card { padding:14px; }
  .control-heading { margin:2px 2px 14px; }
  .control-icon { width:42px; height:42px; border-radius:13px; }
  .control-heading h2 { font-size:24px; }
  .control-heading p { font-size:12px; }
  .editor-tabs { margin-left:-2px; margin-right:-2px; grid-template-columns:repeat(5,96px); }
  .setting-block { padding:13px; }
  .grid-two, .upload-grid { grid-template-columns:1fr; }
  .preset-grid { grid-template-columns:repeat(2,1fr); }
  .background-presets { grid-template-columns:repeat(3,1fr); }
  .export-summary { grid-template-columns:1fr 1fr; }
}

@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}

/* v0.2 starter template picker */
.template-section { overflow:hidden; }
.template-badge {
  flex:0 0 auto;
  border-radius:999px;
  padding:6px 9px;
  background:#eef4ff;
  color:#1769ff !important;
  font-size:10px !important;
  font-weight:850;
  letter-spacing:.04em;
}
.template-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
}
.template-option {
  min-width:0;
  border:1px solid #dfe4ed;
  background:#fff;
  color:#4d5669;
  border-radius:12px;
  padding:7px;
  display:grid;
  gap:6px;
  justify-items:center;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.template-option:hover { transform:translateY(-1px); border-color:#b9c7df; }
.template-option.selected {
  border-color:#1769ff;
  box-shadow:0 0 0 2px rgba(23,105,255,.12);
  color:#0d57dc;
}
.template-option img,
.template-custom-preview {
  width:100%;
  aspect-ratio:1179/2556;
  max-height:122px;
  object-fit:cover;
  object-position:center;
  border-radius:8px;
  background:#f2f4f8;
  display:block;
}
.template-custom-preview {
  display:grid;
  place-items:center;
  min-height:98px;
  background:
    linear-gradient(145deg,rgba(23,105,255,.12),rgba(23,105,255,.02)),
    repeating-linear-gradient(45deg,#fff,#fff 8px,#f3f5f9 8px,#f3f5f9 16px);
  color:#1769ff;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
}
.template-option span:last-child {
  font-size:10px;
  line-height:1.2;
  font-weight:800;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.template-note {
  margin:0;
  color:#7d8799;
  font-size:11px;
  line-height:1.45;
}

@media (max-width:680px) {
  .template-grid { grid-template-columns:repeat(4,minmax(72px,1fr)); overflow-x:auto; padding-bottom:4px; }
  .template-option { min-width:76px; }
  .template-option img,.template-custom-preview { max-height:104px; }
}


/* v0.3 — Create / Pre-made mode */
.editor-shell[hidden],
.premade-shell[hidden] { display:none !important; }

.mode-tabs {
  width:min(1520px, calc(100% - 32px));
  margin:20px auto 0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.mode-tab {
  min-height:72px;
  border:1px solid rgba(207,214,228,.95);
  border-radius:18px;
  background:rgba(255,255,255,.74);
  color:#7b8496;
  padding:12px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
  box-shadow:0 8px 24px rgba(35,51,89,.05);
  transition:.18s ease;
}
.mode-tab:hover { transform:translateY(-1px); }
.mode-tab strong { color:#2b3446; font-size:16px; letter-spacing:-.02em; }
.mode-tab-kicker {
  color:#9ba3b2;
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
  margin-right:auto;
}
.mode-tab.is-active {
  border-color:#bcd1ff;
  background:#eef4ff;
  box-shadow:0 10px 26px rgba(23,105,255,.10);
}
.mode-tab.is-active strong { color:#0d57dc; }
.mode-count {
  min-width:28px;
  height:28px;
  padding:0 8px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#fff;
  border:1px solid #dce4f2;
  color:#657086;
  font-size:11px;
  font-weight:850;
}

.premade-shell {
  width:min(1520px, calc(100% - 32px));
  margin:22px auto 54px;
}
.premade-intro {
  border:1px solid rgba(215,222,235,.88);
  border-radius:22px;
  background:var(--panel);
  box-shadow:var(--shadow);
  padding:24px 26px;
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:22px;
}
.premade-intro h1 {
  margin:5px 0 6px;
  font-size:clamp(28px,4vw,44px);
  letter-spacing:-.045em;
}
.premade-intro p {
  margin:0;
  max-width:680px;
  color:#7b8496;
  line-height:1.55;
}
.premade-meta {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.premade-meta span {
  background:#f4f7fb;
  border:1px solid #e3e7ef;
  border-radius:999px;
  padding:8px 11px;
  color:#7c8597;
  font-size:11px;
}
.premade-meta strong { color:#273044; }

.premade-grid {
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.premade-card {
  overflow:hidden;
  border:1px solid rgba(215,222,235,.9);
  border-radius:20px;
  background:rgba(255,255,255,.92);
  box-shadow:0 12px 30px rgba(35,51,89,.07);
}
.premade-preview-button {
  display:block;
  width:100%;
  border:0;
  padding:0;
  background:#e9edf4;
  position:relative;
  overflow:hidden;
}
.premade-preview-button img {
  display:block;
  width:100%;
  aspect-ratio:1179 / 2556;
  object-fit:cover;
  transition:transform .28s cubic-bezier(.2,.8,.2,1);
}
.premade-preview-button:hover img { transform:scale(1.018); }
.premade-preview-overlay {
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translate(-50%,8px);
  opacity:0;
  white-space:nowrap;
  padding:8px 11px;
  border-radius:999px;
  background:rgba(9,14,26,.80);
  color:#fff;
  font-size:10px;
  font-weight:800;
  backdrop-filter:blur(10px);
  transition:.2s ease;
}
.premade-preview-button:hover .premade-preview-overlay {
  opacity:1;
  transform:translate(-50%,0);
}
.premade-card-copy {
  min-height:76px;
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.premade-card-copy > div { min-width:0; display:grid; gap:3px; }
.premade-card-copy strong {
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:13px;
}
.premade-card-copy span { color:#9098a8; font-size:10px; }
.premade-download {
  flex:0 0 auto;
  min-height:36px;
  padding:0 11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #dce4ef;
  border-radius:10px;
  text-decoration:none;
  color:#1769ff;
  background:#f4f8ff;
  font-size:10px;
  font-weight:850;
}

.premade-lightbox {
  position:fixed;
  inset:0;
  z-index:120;
  display:grid;
  place-items:center;
  padding:22px;
}
.premade-lightbox[hidden] { display:none; }
.premade-lightbox-backdrop {
  position:absolute;
  inset:0;
  border:0;
  background:rgba(5,8,16,.78);
  backdrop-filter:blur(16px);
}
.premade-lightbox-panel {
  position:relative;
  z-index:1;
  width:min(760px,96vw);
  max-height:94dvh;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.15);
  border-radius:22px;
  background:#11151d;
  box-shadow:0 26px 80px rgba(0,0,0,.42);
}
.premade-lightbox-head,
.premade-lightbox-foot {
  min-height:62px;
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:#fff;
}
.premade-lightbox-head > div { display:grid; gap:3px; }
.premade-lightbox-head .eyebrow { color:#858fa2; }
.premade-lightbox-close {
  width:38px;
  height:38px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:50%;
  background:rgba(255,255,255,.06);
  color:#fff;
  font-size:22px;
}
.premade-lightbox-image-wrap {
  min-height:0;
  background:#080a0f;
  display:grid;
  place-items:center;
  overflow:auto;
  padding:12px;
}
.premade-lightbox-image-wrap img {
  display:block;
  max-width:100%;
  max-height:76dvh;
  height:auto;
  border-radius:14px;
}
.premade-lightbox-foot {
  border-top:1px solid rgba(255,255,255,.08);
}
.premade-lightbox-foot > span { color:#929bad; font-size:11px; }
.premade-lightbox-download { min-height:42px; text-decoration:none; display:inline-flex; align-items:center; }

body.premade-mode #createHeaderActions { display:none; }

@media (max-width:1100px) {
  .premade-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:780px) {
  .mode-tabs { width:calc(100% - 16px); margin-top:10px; }
  .mode-tab { min-height:58px; border-radius:14px; padding:10px 12px; }
  .mode-tab-kicker { display:none; }
  .premade-shell { width:calc(100% - 16px); margin-top:12px; }
  .premade-intro { align-items:flex-start; flex-direction:column; border-radius:18px; padding:18px; }
  .premade-meta { justify-content:flex-start; }
  .premade-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:8px; }
  .premade-card { border-radius:14px; }
  .premade-card-copy { align-items:flex-start; flex-direction:column; min-height:88px; }
  .premade-download { width:100%; }
}


/* Pokémon Gen 8 right-screen sprite picker */
.sprite-upload-card { align-content:start; }
.sprite-source-actions { display:grid; gap:8px; }
.sprite-category-field { display:grid; gap:6px; }
.sprite-category-label {
  color:#7b8496;
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sprite-category-field select {
  width:100%;
  min-height:42px;
  border:1px solid #1769ff;
  border-radius:11px;
  padding:0 38px 0 13px;
  background:#1769ff;
  color:#fff;
  font:850 12px/1 -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
  cursor:pointer;
  appearance:auto;
}
.sprite-category-field select:hover { background:#0d5bea; }
.sprite-category-field select:focus-visible { outline:3px solid rgba(23,105,255,.24); outline-offset:2px; }
.sprite-selection-name {
  min-height:16px;
  color:#7b8496;
  font-size:10px;
  line-height:1.35;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pokemon-picker {
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#f9fbff;
  overflow:hidden;
}
.pokemon-picker[hidden] { display:none !important; }
.pokemon-picker-head {
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
  padding:15px 16px 12px;
  border-bottom:1px solid #e5e9f1;
  background:#fff;
}
.pokemon-picker-head > div { min-width:0; }
.pokemon-picker-head strong { display:block; margin-top:3px; color:#202838; font-size:15px; }
.pokemon-picker-head p { margin:5px 0 0; color:#8490a3; font-size:11px; line-height:1.4; }
.pokemon-picker-close {
  flex:0 0 auto;
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid #dde3ed;
  background:#f6f8fb;
  color:#596375;
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.pokemon-picker-tools {
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid #e8ebf2;
}
.pokemon-search-wrap {
  position:relative;
  min-width:0;
  flex:1;
}
.pokemon-search-wrap > span {
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:#8d97a8;
  pointer-events:none;
}
.pokemon-search-wrap input {
  width:100%;
  min-height:40px;
  border:1px solid #dfe4ed;
  border-radius:11px;
  background:#fff;
  color:#1c2433;
  padding:0 12px 0 34px;
  font-size:13px;
}
.pokemon-picker-count {
  flex:0 0 auto;
  color:#6e788a;
  font-size:10px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}
.pokemon-grid-scroll {
  overflow:auto;
  max-height:450px;
  padding:12px;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.pokemon-grid {
  display:grid;
  grid-template-columns:repeat(10,minmax(48px,1fr));
  gap:7px;
  min-width:560px;
}
.pokemon-sprite-option {
  position:relative;
  aspect-ratio:1;
  min-width:0;
  border:1px solid #e0e5ee;
  border-radius:11px;
  background:#fff;
  display:grid;
  place-items:center;
  padding:4px;
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease;
}
.pokemon-sprite-option:hover { border-color:#9fbdf6; background:#f3f7ff; transform:translateY(-1px); }
.pokemon-sprite-option.selected { border-color:#1769ff; background:#eaf2ff; box-shadow:0 0 0 2px rgba(23,105,255,.10); }
.pokemon-sprite-option img {
  width:100%;
  height:100%;
  max-width:68px;
  max-height:56px;
  object-fit:contain;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
}
.pokemon-sprite-option .sprite-placeholder {
  color:#b2bac8;
  font:800 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.pokemon-picker-empty {
  grid-column:1/-1;
  padding:28px 10px;
  text-align:center;
  color:#8b95a7;
  font-size:12px;
}
.pokemon-picker-foot {
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center;
  padding:10px 14px 12px;
  border-top:1px solid #e8ebf2;
  color:#8b95a7;
  font-size:10px;
}
.pokemon-picker-foot a { color:#1769ff; text-decoration:none; font-weight:750; white-space:nowrap; }
@media(max-width:620px){
  .pokemon-picker-tools { align-items:stretch; flex-direction:column; }
  .pokemon-search-wrap { width:100%; }
  .pokemon-picker-count { align-self:flex-start; }
  .pokemon-grid-scroll { padding:10px; max-height:390px; }
  .pokemon-grid { grid-template-columns:repeat(10,52px); gap:6px; min-width:max-content; }
  .pokemon-picker-foot { align-items:flex-start; flex-direction:column; }
}


/* Small creator attribution. */
.tool-credit {
  width:min(1180px,calc(100% - 32px));
  margin:18px auto 26px;
  text-align:center;
  color:#aab1bd;
  font-size:10px;
  line-height:1.4;
  letter-spacing:.01em;
}
.tool-credit a {
  color:#929baa;
  text-decoration:underline;
  text-decoration-color:rgba(146,155,170,.45);
  text-underline-offset:2px;
}
.tool-credit a:hover { color:#6f7a8e; }
@media(max-width:620px){
  .tool-credit { width:calc(100% - 24px); margin:14px auto 22px; font-size:9px; }
}


/* v1.3.36 — console hue masking + pre-made search */
.hue-setting-block { gap:10px; }
.range-value {
  flex:0 0 auto;
  min-width:58px;
  padding:7px 9px;
  border:1px solid #dce4ef;
  border-radius:10px;
  background:#fff;
  color:#1769ff;
  text-align:center;
  font:800 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.hue-range {
  width:100%;
  accent-color:#1769ff;
}
.hue-scale {
  display:flex;
  justify-content:space-between;
  color:#9aa2b1;
  font-size:9px;
  font-weight:700;
}
.mini-action-button {
  flex:0 0 auto;
  min-height:34px;
  padding:0 10px;
  border:1px solid #dce4ef;
  border-radius:10px;
  background:#f5f7fa;
  color:#697387;
  font-size:10px;
  font-weight:800;
}
.mini-action-button:hover { background:#eef3fb; }
.mini-action-button.is-active {
  color:#0d57dc;
  border-color:#bfd3ff;
  background:#eaf2ff;
}
.mini-action-button[hidden] { display:none !important; }

.premade-search {
  margin-top:14px;
  min-height:52px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(215,222,235,.92);
  border-radius:16px;
  background:rgba(255,255,255,.9);
  box-shadow:0 8px 24px rgba(35,51,89,.05);
}
.premade-search-field {
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
}
.premade-search-icon { color:#8c95a6; font-size:18px; }
#premadeSearch {
  width:100%;
  min-width:0;
  min-height:38px;
  border:0;
  outline:0;
  background:transparent;
  color:#222b3d;
  font-size:14px;
}
#premadeSearch::placeholder { color:#a0a8b6; }
.premade-search-count {
  flex:0 0 auto;
  padding:7px 9px;
  border-radius:999px;
  background:#f3f6fb;
  color:#7d8798;
  font-size:10px;
  font-weight:800;
}
.premade-empty {
  margin:14px 0 0;
  padding:24px;
  border:1px dashed #d8deea;
  border-radius:16px;
  color:#8992a3;
  text-align:center;
  background:rgba(255,255,255,.6);
}
.premade-empty[hidden], .premade-card[hidden] { display:none !important; }
@media(max-width:780px){
  .premade-search { margin-top:8px; }
  .premade-search-count { display:none; }
  .setting-copy.split { align-items:flex-start; }
}


/* v1.3.37 — strict Create vs Pre-made separation */
body.premade-mode .editor-shell, body.premade-mode #createHeaderActions { display:none !important; }
