/* ===========================================================
   Sprite Locker — Fortnite Sprite Checklist
   =========================================================== */

:root {
  --bg-cream: #faf4ec;
  --bg-cream-2: #fff9f2;
  --bg-0: #faf4ec;
  --bg-1: #f3ebe2;
  --bg-2: #ebe0d4;
  /* Light cream panels — readable dark text on the bright page */
  --panel: rgba(255, 252, 247, 0.9);
  --panel-solid: #fff9f2;
  --stroke: rgba(107, 33, 168, 0.16);
  --stroke-soft: rgba(90, 80, 128, 0.14);
  --stroke-warm: rgba(255, 138, 30, 0.28);
  /* Ink system — dark, vibrant text for the cream background */
  --ink: #2a1f5c;
  --ink-body: #3d2f6e;
  --ink-muted: #5b4d8a;
  --ink-accent: #6d28d9;
  --text: var(--ink);
  --muted: var(--ink-muted);
  --page-muted: var(--ink-muted);
  --fn-orange: #ff8a1e;
  --fn-orange-2: #e86a00;
  --fn-blue: #1c5fd4;
  --fn-purple: #7b3dff;
  --fn-pink: #ff5fc8;
  --gold: #d4920a;
  --check: #ff8a1e;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(42, 31, 92, 0.1);
  --shadow-warm: 0 8px 24px rgba(255, 138, 30, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink-body);
  background:
    radial-gradient(ellipse 90% 75% at 50% 42%, var(--bg-cream-2) 0%, var(--bg-cream) 48%, var(--bg-1) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Decorative background — mirrors the export poster corner wisps */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image: linear-gradient(rgba(255, 138, 30, 0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 138, 30, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 82%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 48% at 100% 0%, rgba(255, 95, 30, 0.58), transparent 68%),
    radial-gradient(ellipse 52% 44% at 0% 100%, rgba(110, 45, 255, 0.52), transparent 68%),
    radial-gradient(ellipse 38% 32% at 0% 0%, rgba(70, 210, 230, 0.22), transparent 72%),
    radial-gradient(ellipse 42% 36% at 100% 100%, rgba(255, 150, 55, 0.38), transparent 72%);
  filter: blur(1.5px);
}
.bg-glow::after {
  content: "";
  position: absolute;
  right: 28px; bottom: 28px;
  width: 14px; height: 14px;
  background:
    linear-gradient(45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%);
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.6));
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(14px, 4vw, 48px);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(255, 252, 247, 0.55));
  border-bottom: 1px solid var(--stroke-soft);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-family: "Russo One", sans-serif;
  font-size: 38px; color: var(--fn-orange);
  display: flex; align-items: center; gap: 4px;
  filter: drop-shadow(0 0 10px rgba(255, 138, 30, 0.6));
}
.brand-mark .bolt { width: 38px; height: 38px; object-fit: contain; display: inline-block; vertical-align: middle; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-top {
  font-family: "Bebas Neue", sans-serif; letter-spacing: 5px;
  font-size: 13px; color: var(--fn-blue);
}
.brand-title {
  font-family: "Luckiest Guy", cursive; letter-spacing: 1px;
  font-size: clamp(22px, 3.4vw, 34px);
  background: linear-gradient(180deg, #2a1f5c, #c0461a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.5));
}

.admin-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Russo One", sans-serif; font-size: 13px; letter-spacing: 1px;
  color: var(--text); cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke); border-radius: 12px;
  padding: 9px 14px; transition: all 0.18s ease;
}
.admin-btn:hover { background: rgba(255, 138, 30, 0.16); border-color: var(--fn-orange); transform: translateY(-1px); }
.admin-btn .gear { font-size: 16px; }
.header-tag {
  font-family: "Bebas Neue", sans-serif; letter-spacing: 2px; font-size: 14px;
  color: var(--ink-muted); border: 1px solid var(--stroke-soft); border-radius: 999px;
  padding: 6px 14px; white-space: nowrap;
}
/* secret bolt is plain decoration — no pointer hint */
.brand-mark .bolt { cursor: default; }
@media (max-width: 560px) { .header-tag { display: none; } }

/* ---------- Mode switch ---------- */
.mode-switch {
  display: flex; justify-content: center; gap: 10px;
  margin: 26px auto 6px; padding: 0 16px; flex-wrap: wrap;
}
.mode-tab {
  font-family: "Russo One", sans-serif; font-size: 15px; letter-spacing: 0.5px;
  color: var(--ink-muted); cursor: pointer;
  background: var(--panel); border: 1px solid var(--stroke-warm);
  border-radius: 999px; padding: 11px 24px; transition: all 0.18s ease;
  box-shadow: var(--shadow);
}
.mode-tab .mode-emoji { margin-right: 6px; }
.mode-tab:hover { color: var(--ink); border-color: var(--fn-orange); transform: translateY(-1px); }
.mode-tab.active {
  color: #1a1208; border-color: transparent;
  background: linear-gradient(135deg, var(--fn-orange-2), var(--fn-orange));
  box-shadow: 0 8px 26px rgba(255, 138, 30, 0.4);
}
.mode-tab.active.mw {
  background: linear-gradient(135deg, #ff6a6a, #e01e1e); color: #fff;
  box-shadow: 0 8px 26px rgba(224, 30, 30, 0.4);
}

/* ---------- Container ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 16px clamp(12px, 3vw, 28px) 64px; }

/* ---------- Stats panel ---------- */
.stats-panel {
  background: var(--panel); border: 1px solid var(--stroke-warm);
  border-radius: var(--radius); padding: 18px 20px; margin: 14px 0 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  color: var(--ink-body);
}
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stats-head h2 {
  margin: 0;
  font-family: "Russo One", sans-serif;
  font-size: clamp(18px, 2.6vw, 24px);
  color: #5b21b6;
}
.stats-count { font-family: "Bebas Neue", sans-serif; font-size: 26px; color: var(--fn-orange-2); letter-spacing: 1px; }
.progress-track {
  position: relative; height: 22px; margin: 14px 0 8px;
  background: rgba(42, 31, 92, 0.1); border-radius: 999px;
  border: 1px solid var(--stroke-warm); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--fn-orange), #ffd23f);
  border-radius: 999px; transition: width 0.5s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 12px rgba(255, 138, 30, 0.45);
}
.progress-pct {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: "Russo One", sans-serif; font-size: 12px; color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.stats-hint { margin: 6px 0 0; color: var(--ink-muted); font-size: 13px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  font-family: "Russo One", sans-serif; font-weight: 400; font-size: 13px; letter-spacing: 0.3px;
  color: var(--ink); cursor: pointer;
  background: var(--panel); border: 1px solid var(--stroke-warm);
  border-radius: 10px; padding: 9px 14px; transition: all 0.15s ease;
  box-shadow: var(--shadow);
}
.tool-btn:hover {
  color: #5b21b6; background: #fff;
  border-color: var(--fn-orange); box-shadow: var(--shadow-warm);
}
.share-btn {
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 13px;
  color: #fff; cursor: pointer; border: none;
  border-radius: 10px; padding: 9px 14px; transition: all 0.15s ease;
}
.share-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.share-btn.x { background: #000; border: 1px solid #444; }
.share-btn.fb { background: #1877f2; }
.share-btn.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.share-btn.dc { background: #5865f2; }
.share-btn.png { background: #2a8f5a; }
.share-btn.export { background: linear-gradient(135deg, var(--fn-orange-2), var(--fn-orange)); color: #1a1208; }

/* ---------- Board (mobile-first) ----------
   Mobile: single column stack -> Left group, Special (middle), Right group.
   Desktop (>=980px): three columns side by side (left | special | right). */
.board { display: flex; flex-direction: column; gap: 16px; }
.board-side, .board-middle { display: flex; flex-direction: column; gap: 16px; }
.board-middle { justify-content: center; }

@media (min-width: 980px) {
  .board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start; gap: 22px;
  }
}

/* Special middle column heading */
.special-heading {
  text-align: center; font-family: "Bebas Neue", sans-serif; letter-spacing: 2px;
  color: var(--fn-orange-2); font-size: 16px; margin: 2px 0 -4px;
}

/* A sprite group = its variant cards + a name under it */
.sprite-group {
  background: var(--panel); border: 1px solid var(--stroke-warm);
  border-radius: var(--radius); padding: 12px 12px 10px;
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.variant-row {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.sprite-name {
  text-align: center; margin-top: 10px;
  font-family: "Russo One", sans-serif; font-size: 15px;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.sprite-name .row-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: none; }
.sprite-name .name-count { font-family: "Inter", sans-serif; font-size: 11px; color: var(--ink-muted); font-weight: 700; }

.sprite-card {
  position: relative; cursor: pointer; user-select: none;
  flex: 1 1 96px; min-width: 84px; max-width: 132px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(250,244,236,0.95));
  border: 1.5px solid var(--stroke-warm); border-radius: 14px;
  padding: 9px 7px 7px; text-align: center;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.sprite-card:hover { transform: translateY(-3px); border-color: var(--fn-blue); }
.sprite-card.checked {
  border-color: var(--check);
  box-shadow: 0 0 0 2px var(--check), var(--shadow-warm);
  background: linear-gradient(180deg, rgba(255, 240, 220, 0.55), rgba(255, 252, 247, 0.98));
}
.sprite-card.checked.wanted-mode {
  border-color: #e01e1e;
  box-shadow: 0 0 0 2px #e01e1e, 0 8px 24px rgba(224, 30, 30, 0.18);
  background: linear-gradient(180deg, rgba(255, 220, 220, 0.45), rgba(255, 252, 247, 0.98));
}
.variant-badge {
  display: inline-block; font-family: "Bebas Neue", sans-serif; letter-spacing: 1px;
  font-size: 11px; padding: 1px 8px; border-radius: 999px; margin-bottom: 5px;
  color: #0a0a0a; font-weight: 700;
}
.sprite-img-wrap {
  position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.sprite-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
.sprite-img-missing {
  width: 70%; aspect-ratio: 1; border: 2px dashed var(--stroke-warm); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 11px;
}
.check-box {
  margin: 7px auto 0; width: 24px; height: 24px; border-radius: 7px;
  border: 2px solid rgba(42, 31, 92, 0.22); background: rgba(255, 252, 247, 0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: transparent; transition: all 0.14s ease;
}
.sprite-card.checked .check-box { color: var(--check); border-color: var(--check); background: rgba(255, 236, 210, 0.65); }
.sprite-card.checked.wanted-mode .check-box { color: #e01e1e; border-color: #e01e1e; background: rgba(255, 220, 220, 0.55); }
.card-empty { opacity: 0.18; cursor: default; pointer-events: none; }
.card-empty:hover { transform: none; border-color: var(--stroke); }

/* Special sprite card (no variants, single image + (name)) */
.special-card {
  position: relative; cursor: pointer; user-select: none;
  background: var(--panel); border: 1px solid var(--stroke-warm);
  border-radius: var(--radius); padding: 14px 14px 10px; text-align: center;
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  min-width: 150px;
}
.special-card:hover { transform: translateY(-3px); border-color: var(--fn-blue); }
.special-card.checked {
  border-color: var(--check);
  box-shadow: 0 0 0 2px var(--check), var(--shadow-warm);
  background: linear-gradient(180deg, rgba(255, 240, 220, 0.5), rgba(255, 252, 247, 0.98));
}
.special-card.checked.wanted-mode {
  border-color: #e01e1e;
  box-shadow: 0 0 0 2px #e01e1e, 0 8px 24px rgba(224, 30, 30, 0.18);
  background: linear-gradient(180deg, rgba(255, 220, 220, 0.45), rgba(255, 252, 247, 0.98));
}
.special-card .badge-special {
  display: inline-block; font-family: "Bebas Neue", sans-serif; letter-spacing: 1px;
  font-size: 11px; padding: 1px 9px; border-radius: 999px; margin-bottom: 6px;
  color: #1a1208; font-weight: 700; background: #ffd23f;
}
.special-card .sprite-img-wrap { width: 120px; height: 120px; margin: 0 auto; }
.special-name {
  margin-top: 8px; font-family: "Russo One", sans-serif; font-size: 13px;
  color: var(--ink); font-weight: 400;
}
.special-card .check-box { margin-top: 8px; }
.special-card.checked .check-box { color: var(--check); border-color: var(--check); background: rgba(255, 236, 210, 0.65); }
.special-card.checked.wanted-mode .check-box { color: #e01e1e; border-color: #e01e1e; background: rgba(255, 220, 220, 0.55); }

/* Checkmark color picker */
.check-color {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px;
  background: var(--panel); border: 1px solid var(--stroke-warm); border-radius: 10px;
  box-shadow: var(--shadow);
}
.check-color-label { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.swatches { display: inline-flex; gap: 5px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(42, 31, 92, 0.18); cursor: pointer; padding: 0; }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(107, 33, 168, 0.25); transform: scale(1.12); }
#checkColorCustom { width: 26px; height: 24px; padding: 0; border: 1px solid var(--stroke-warm); border-radius: 6px; background: transparent; cursor: pointer; }
.check-inline { display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; }
.check-inline input { width: auto !important; margin: 0 !important; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; color: var(--ink-muted); font-size: 12px; padding: 30px 16px 50px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 6, 20, 0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, #161b46, #0e1130);
  border: 1px solid rgba(120, 150, 255, 0.25); border-radius: 20px;
  padding: 26px; box-shadow: var(--shadow);
  color: #eef2ff;
}
.modal h3 { font-family: "Russo One", sans-serif; margin: 0 0 14px; font-size: 22px; color: #eef2ff; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border-radius: 10px; border: 1px solid rgba(120, 150, 255, 0.25); background: rgba(255,255,255,0.05);
  color: #eef2ff; cursor: pointer; font-size: 16px;
}
.modal-close:hover { background: rgba(255,82,82,0.2); border-color: #ff5252; }

.modal label { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; color: #b8c4e8; }
.modal input[type="text"], .modal input[type="password"], .modal select {
  width: 100%; margin-top: 6px; padding: 11px 12px;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(120, 150, 255, 0.25); border-radius: 10px;
  color: #eef2ff; font-size: 15px; font-family: "Inter", sans-serif;
}
.modal input[type="color"] { margin-top: 6px; width: 60px; height: 38px; border: 1px solid rgba(120, 150, 255, 0.25); border-radius: 10px; background: transparent; cursor: pointer; }
.primary-btn {
  font-family: "Russo One", sans-serif; font-size: 15px; cursor: pointer;
  color: #1a1208; border: none; border-radius: 12px; padding: 12px 20px; margin-top: 10px;
  background: linear-gradient(135deg, var(--fn-orange-2), var(--fn-orange));
  box-shadow: 0 8px 22px rgba(255,138,30,0.35); transition: all 0.15s ease;
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ghost-btn {
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 14px; cursor: pointer;
  color: #eef2ff; background: rgba(255,255,255,0.06); border: 1px solid rgba(120, 150, 255, 0.25);
  border-radius: 12px; padding: 11px 18px; margin-top: 10px; transition: all 0.15s ease;
}
.ghost-btn:hover { background: rgba(255,255,255,0.12); }
.ghost-btn.danger:hover { background: rgba(255,82,82,0.2); border-color: #ff5252; }
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Admin gate */
.admin-gate { text-align: center; }
.admin-gate p { color: #b8c4e8; }
.gate-error { color: #ff6a6a; font-weight: 700; }

/* Admin tabs */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid rgba(120, 150, 255, 0.25); padding-bottom: 10px; }
.admin-tab {
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 13px; cursor: pointer;
  color: #b8c4e8; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 8px 12px;
}
.admin-tab.active { color: #1a1208; background: linear-gradient(135deg, var(--fn-orange-2), var(--fn-orange)); }
.admin-pane { display: none; }
.admin-pane.active { display: block; }

.variant-pick { border: 1px solid rgba(120, 150, 255, 0.25); border-radius: 12px; padding: 12px; margin: 12px 0; }
.variant-pick legend { padding: 0 8px; color: #b8c4e8; font-weight: 600; font-size: 13px; }
.variant-checkboxes label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #eef2ff; }

.hint { color: #b8c4e8; font-size: 13px; line-height: 1.5; }

.upload-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.upload-filters label { flex: 1; min-width: 140px; }
.upload-drop { margin-top: 14px; border: 2px dashed var(--stroke); border-radius: 14px; padding: 18px; text-align: center; }
.variant-checkboxes { display: flex; flex-wrap: wrap; gap: 12px; }
.variant-checkboxes input { width: auto; margin: 0; }

.upload-preview {
  min-height: 130px; display: flex; align-items: center; justify-content: center;
  color: #b8c4e8; margin-bottom: 12px; background: rgba(0,0,0,0.25); border-radius: 12px;
}
.upload-preview img { max-height: 130px; max-width: 100%; object-fit: contain; }

.manage-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.manage-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--stroke); border-radius: 10px; padding: 9px 12px;
}
.manage-item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.manage-item .badge-default { font-size: 11px; color: #b8c4e8; }
.manage-item button { font-size: 12px; padding: 6px 12px; margin: 0; }
.manage-editor {
  background: rgba(0,0,0,0.2); border: 1px solid rgba(120, 150, 255, 0.25);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.manage-editor .primary-btn { margin-top: 8px; }
.admin-pane h4 { font-family: "Russo One", sans-serif; margin: 0 0 10px; font-size: 15px; color: #eef2ff; }

/* Publish bar */
.publish-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--stroke); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.publish-bar .primary-btn { margin-top: 0; }
.dirty-badge { color: #ffb000; font-weight: 800; font-size: 13px; }
.clean-badge { color: #46d35a; font-weight: 700; font-size: 13px; }

.repo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.repo-actions .primary-btn, .repo-actions .ghost-btn { margin-top: 8px; }
.repo-status { font-size: 13px; font-weight: 700; min-height: 18px; margin: 10px 0 0; }
.repo-status.ok { color: #46d35a; }
.repo-status.err { color: #ff6a6a; }
.repo-status.busy { color: #ffd23f; }
.repo-help { margin-top: 14px; color: #b8c4e8; font-size: 13px; }
.repo-help summary { cursor: pointer; font-weight: 700; color: #eef2ff; }
.repo-help ol { padding-left: 18px; line-height: 1.6; }
.modal code { background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

.repo-image-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px; margin-top: 12px; max-height: 240px; overflow-y: auto;
  padding: 8px; background: rgba(0,0,0,0.25); border: 1px solid var(--stroke); border-radius: 12px;
}
.repo-image-grid figure {
  margin: 0; cursor: pointer; text-align: center; border: 1.5px solid transparent;
  border-radius: 10px; padding: 6px; transition: all 0.14s ease;
}
.repo-image-grid figure:hover { border-color: var(--fn-orange); background: rgba(255,138,30,0.1); }
.repo-image-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.repo-image-grid figcaption { font-size: 10px; color: #b8c4e8; word-break: break-all; margin-top: 4px; }

/* Export modal */
.export-modal { max-width: 920px; }
.export-sub { color: #b8c4e8; font-size: 13px; margin: -6px 0 14px; }
.export-canvas-wrap { position: relative; width: 100%; overflow: auto; border-radius: 12px; border: 1px solid var(--stroke-soft); background: var(--bg-cream); min-height: 120px; }
.export-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.export-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); font-weight: 700; font-size: 14px; background: var(--bg-cream); z-index: 2;
}
.export-loading[hidden] { display: none; }
.export-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.export-actions .primary-btn, .export-actions .ghost-btn { margin-top: 0; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #fff9f2, #faf4ec); border: 1px solid var(--fn-orange);
  color: var(--ink); padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-warm); z-index: 200; opacity: 0; transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* Responsive */
@media (max-width: 640px) {
  .toolbar { justify-content: center; }
  .toolbar-left, .toolbar-right { justify-content: center; width: 100%; }
  .admin-label { display: none; }
  .check-color { flex-wrap: wrap; justify-content: center; }
  .sprite-card { flex: 1 1 84px; min-width: 78px; }
}
