/* ════════════════════════════════════════════
   🏙️ LEAGUE OF DEFENSE — BRIGHT PIXEL SKYLINE EDITION
   Sky-blue gradient · pixel clouds & city skyline · grass-green "go"
   ════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Press+Start+2P&family=VT323&display=swap');

:root{
  --primary:#e60012; --signal:#f68d1f; --amber:#fbd000; --nav-gold:#e48600;
  --canvas:#2e8fdd; --canvas-soft:#cdeafc; --lavender:#8fd5f5; --periwinkle:#4da3ec;
  --chrome-indigo:#1e3a5f; --muted-indigo:#3b6ea8; --platinum:#e9f4fc;
  --surface:#fff; --carbon:#1d3349; --ink:#21242e; --ink-soft:#1f5d99; --on-primary:#fff;
  --systems-teal:#1d9e74; --games-red:#a7282b;
  --grass:#46a93c; --grass-dark:#2e7a26;
  --sky-top:#8ed8f8; --sky-deep:#3f9ee8;
  --display:'Archivo Black', Arial Black, Arial, sans-serif;
  --pixel:'Press Start 2P', monospace;
}
*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:Arial, Helvetica, sans-serif; font-size:13px; color:var(--ink);
  background:linear-gradient(180deg, var(--sky-top) 0%, var(--sky-deep) 100%) fixed;
  min-height:100vh; line-height:1.4;
}

@keyframes wiggle{
  0%,100%{transform:rotate(0)} 25%{transform:rotate(-4deg)} 75%{transform:rotate(4deg)}
}
@keyframes popIn{
  0%{transform:scale(.85);opacity:0} 100%{transform:scale(1);opacity:1}
}

/* ── TABS (nav-bar) ── */
.tab-bar{
  display:flex;align-items:center;background:var(--carbon);
  background-image:radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size:5px 5px;
  border-bottom:3px solid var(--chrome-indigo);
  padding:6px 10px;gap:6px;overflow-x:auto;min-height:46px;
}
.tab-bar::-webkit-scrollbar{height:5px}
.tab-bar::-webkit-scrollbar-track{background:var(--carbon)}
.tab-bar::-webkit-scrollbar-thumb{background:var(--signal);border-radius:2px}
.shop-tab{
  display:flex;align-items:center;gap:6px;padding:8px 14px;
  border-radius:0;
  clip-path:polygon(8px 0,100% 0,100% 100%,0 100%,0 8px);
  background:var(--muted-indigo);
  cursor:pointer;white-space:nowrap;font-size:11px;font-weight:700;
  letter-spacing:.5px;text-transform:uppercase;color:var(--canvas-soft);
  transition:all .15s; flex-shrink:0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.35);
}
.shop-tab.active{
  background:var(--canvas);color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 0 var(--chrome-indigo), 0 0 0 2px var(--signal);
}
.shop-tab:hover:not(.active){ background:var(--chrome-indigo); color:#fff }
.tab-name-input{
  background:transparent;border:none;color:inherit;font:inherit;
  width:88px;outline:none;cursor:pointer;text-transform:uppercase;letter-spacing:.5px;
}
.tab-name-input:focus{ border-bottom:1px dotted var(--nav-gold); cursor:text }
.tab-close{ color:rgba(255,255,255,.5);font-size:14px;line-height:1;padding:0 2px;background:none;border:none;cursor:pointer;display:flex;align-items:center }
.tab-close:hover{ color:var(--primary) }
.add-tab-btn{
  width:32px;height:32px;border-radius:50%;flex-shrink:0;margin-left:4px;
  background:var(--signal); color:#fff; border:none; cursor:pointer;
  font-size:18px;font-weight:900;line-height:1;
  display:flex;align-items:center;justify-content:center;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.4), inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.4);
}
.add-tab-btn:hover{ animation:wiggle .4s ease-in-out; filter:brightness(1.08) }
.add-tab-btn:active{ transform:translateY(1px); box-shadow:inset 0 1px 0 rgba(255,255,255,.3) }

/* ── MAIN ── */
.main{padding:16px;max-width:900px;margin:0 auto}

/* ── HERO TITLE (hero-panel) ── */
h2{
  text-align:center; margin-bottom:14px; padding:18px 16px 14px;
  background:linear-gradient(180deg, var(--lavender) 0%, var(--periwinkle) 100%);
  border-radius:10px; clip-path:polygon(14px 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%,0 14px);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.5), inset 0 -3px 0 var(--chrome-indigo), 0 3px 10px rgba(33,36,46,.25);
  font-family:var(--display); font-size:28px; font-weight:900; letter-spacing:1px;
  color:#fff; -webkit-text-stroke:2px var(--carbon);
  text-shadow:3px 3px 0 var(--carbon);
  text-transform:uppercase;
}
h2::after{
  content:"👾 PRESS START TO ORDER 👾"; display:block; margin-top:10px;
  font-family:var(--pixel); font-size:10px; letter-spacing:1px;
  color:var(--nav-gold); -webkit-text-stroke:0; text-shadow:1px 1px 0 var(--carbon);
}

/* ── CONTROLS ── */
.controls{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px;align-items:center}
.search-bar{
  flex:1;min-width:170px;padding:9px 12px;border-radius:2px;
  border:1px solid var(--chrome-indigo);background:var(--surface);color:var(--ink);
  font-size:13px; box-shadow:inset 0 2px 3px rgba(61,79,151,.2);
}
.search-bar::placeholder{color:#9aa}
.search-bar:focus{ outline:none; border-color:var(--signal); box-shadow:inset 0 2px 3px rgba(246,141,31,.25) }

.btn{
  padding:9px 15px;border:none;border-radius:2px;cursor:pointer;
  font-size:11px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;
  transition:all .08s; box-shadow:inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.2), 0 2px 3px rgba(0,0,0,.25);
}
.btn:active{ transform:translateY(2px); box-shadow:inset 0 1px 0 rgba(255,255,255,.25) }
.btn-purple{background:var(--grass);color:#fff}
.btn-green{background:var(--grass);color:#fff}
.btn-red{background:var(--primary);color:#fff}
.btn-red:hover{animation:wiggle .35s}
.btn-blue{background:var(--carbon);color:var(--canvas-soft)}
.btn-amber{background:var(--amber);color:var(--carbon)}
.btn-sm{padding:5px 9px;font-size:10px}

/* ── CATEGORY TABS (subnav strip chips) ── */
.cat-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.ctab{
  padding:5px 13px;border-radius:20px;border:1px solid var(--chrome-indigo);
  background:var(--canvas-soft);color:var(--ink);cursor:pointer;
  font-size:11px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;
  transition:all .15s;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5);
}
.ctab.active{
  background:var(--amber);border-color:var(--nav-gold);color:var(--carbon);
  animation:popIn .2s ease-out;
}
.ctab:hover:not(.active){ background:var(--periwinkle);color:#fff }

/* ── DISCOUNT PANEL (form-panel) ── */
.discount-panel{
  background:var(--platinum); border-radius:6px; padding:0 0 12px;
  margin-bottom:12px; overflow:hidden;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5), inset 0 -2px 0 rgba(0,0,0,.08);
}
.discount-panel h3{
  background:var(--canvas); color:#fff; font-size:11px; padding:8px 12px;
  text-transform:uppercase; letter-spacing:1px; font-weight:700; margin-bottom:10px;
}
.discount-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px;padding:0 12px}
.discount-row label{color:var(--ink-soft);font-size:13px;font-weight:700;white-space:nowrap}
.disc-input{
  width:76px;padding:6px 7px;border-radius:2px;border:1px solid var(--chrome-indigo);
  background:var(--surface);color:var(--ink);font-size:13px;text-align:center;
}
.disc-input:focus{outline:none;border-color:var(--signal)}
.rule-select{
  padding:6px 9px;border-radius:2px;border:1px solid var(--carbon);
  background:var(--surface);color:var(--ink);font-size:13px;
}
.disc-preview{
  margin:0 12px;padding:8px 12px;background:var(--surface);border-radius:4px;
  color:var(--ink-soft);font-size:13px;min-height:24px;
  border-left:4px solid var(--signal);
}

/* ── TABLE (ex-data-table-cell) ── */
table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:6px;overflow:hidden;
  box-shadow:0 2px 8px rgba(33,36,46,.15)}
thead{background:var(--canvas-soft)}
th{
  padding:9px 7px;text-align:left;color:var(--ink);font-size:10px;font-weight:700;
  text-transform:uppercase;letter-spacing:.5px;
}
td{padding:8px 7px;border-bottom:1px solid var(--platinum);vertical-align:middle;font-size:13px}
tr:nth-child(even) td{background:#f0f7fd}
tr:hover td{background:var(--canvas-soft)}
tr.row-selected td{background:var(--lavender);box-shadow:inset 4px 0 0 var(--signal)}
tr.out-of-stock td{opacity:.4}
.cat-badge{
  display:inline-block;padding:2px 8px;border-radius:2px;font-size:10px;font-weight:700;
  text-transform:uppercase;letter-spacing:.5px;color:#fff;
}
.cat-濃{background:var(--primary)}
.cat-純{background:var(--chrome-indigo)}
.cat-純幼{background:var(--systems-teal)}
.cat-薄荷粗{background:var(--ink-soft)}
.cat-薄荷幼{background:var(--periwinkle);color:var(--carbon)}
.cat-中關{background:var(--nav-gold);color:var(--carbon)}

.qty-ctrl{display:flex;align-items:center;gap:5px}
.qty-btn{
  width:24px;height:24px;border:none;border-radius:50%;
  background:var(--signal);color:#fff;cursor:pointer;font-size:14px;font-weight:900;line-height:1;
  display:flex;align-items:center;justify-content:center;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.4), inset 0 -2px 0 rgba(0,0,0,.2);
}
.qty-btn:hover{filter:brightness(1.1);transform:scale(1.08)}
.qty-btn:active{transform:scale(.92)}
.qty-input{
  width:42px;text-align:center;background:var(--surface);border:1px solid var(--chrome-indigo);
  color:var(--ink);border-radius:2px;padding:4px 0;font-size:13px;
}
.qty-input:focus{outline:none;border-color:var(--signal)}
.price-cell{color:var(--nav-gold);font-weight:900}
.oos-badge{
  font-size:10px;padding:2px 7px;border-radius:2px;background:var(--primary);color:#fff;
  font-weight:700;letter-spacing:.5px;
}

/* ── SUMMARY (command slab) ── */
.summary-bar{
  margin-top:14px;background:var(--carbon);
  background-image:radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size:5px 5px;
  border-radius:6px;padding:14px 18px;display:flex;justify-content:space-between;
  align-items:center;flex-wrap:wrap;gap:10px;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.08), 0 3px 8px rgba(0,0,0,.3);
}
.sum-item{text-align:center}
.sum-label{font-size:9px;color:var(--canvas-soft);margin-bottom:4px;font-weight:700;letter-spacing:1px;text-transform:uppercase}
.sum-val{font-size:24px;font-weight:900;color:var(--amber);font-family:var(--display)}
.disc-applied{font-size:11px;color:var(--signal);margin-top:3px;font-weight:700}

/* ── MODAL (ex-modal-card) ── */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(33,36,46,.7);z-index:100;align-items:center;justify-content:center}
.modal-overlay.open{display:flex}
/* 🎮 pixel-mask scene transition — blocky stepped reveal, NES screen-change tribute */
.modal-overlay.open .modal,
.modal-overlay.open .edit-modal,
.modal-overlay.open .copy-modal{
  animation:pixelIn .35s steps(5) both;
}
@keyframes pixelIn{
  0%{clip-path:inset(0 100% 0 0);transform:scale(.94)}
  60%{clip-path:inset(0 0 0 0);transform:scale(1.02)}
  100%{clip-path:inset(0 0 0 0);transform:scale(1)}
}
.modal{
  background:var(--surface);border-radius:10px;padding:0 0 18px;
  width:90%;max-width:520px;max-height:80vh;display:flex;flex-direction:column;gap:12px;
  overflow:hidden; box-shadow:0 8px 30px rgba(0,0,0,.4);
}
.modal h3{
  background:var(--canvas);color:#fff;font-size:13px;font-weight:700;
  text-transform:uppercase;letter-spacing:1px;padding:12px 18px;
}
.modal-body{
  overflow-y:auto;flex:1;font-size:13px;line-height:1.7;white-space:pre-wrap;
  background:var(--platinum);padding:14px;border-radius:4px;color:var(--ink);
  margin:0 18px; font-family:'Courier New',monospace;
}
.modal-footer{display:flex;gap:8px;justify-content:flex-end;padding:0 18px}

/* ── EDIT PRICE MODAL ── */
.edit-modal{
  background:var(--surface);border-radius:10px;padding:0 0 18px;
  width:320px;display:flex;flex-direction:column;gap:12px;overflow:hidden;
  box-shadow:0 8px 30px rgba(0,0,0,.4);
}
.edit-modal h3{
  background:var(--amber);color:var(--carbon);font-size:12px;font-weight:700;
  text-transform:uppercase;letter-spacing:1px;padding:12px 18px;
}
.edit-modal #editProductName{padding:0 18px;color:var(--ink-soft);font-size:12px;margin-bottom:0}
.edit-modal > div{padding:0 18px}
.edit-input{
  width:100%;padding:9px 12px;border-radius:2px;border:1px solid var(--chrome-indigo);
  background:var(--surface);color:var(--ink);font-size:14px;
}
.edit-input:focus{outline:none;border-color:var(--signal)}
.no-results{text-align:center;color:var(--muted-indigo);padding:30px;font-weight:700}

/* copy tab modal */
.copy-modal{
  background:var(--surface);border-radius:10px;padding:0 0 18px;
  width:340px;display:flex;flex-direction:column;gap:12px;overflow:hidden;
  box-shadow:0 8px 30px rgba(0,0,0,.4);
}
.copy-modal h3{
  background:var(--canvas);color:#fff;font-size:12px;font-weight:700;
  text-transform:uppercase;letter-spacing:1px;padding:12px 18px;
}
.copy-modal > p, .copy-modal > select, .copy-modal > div{margin-left:18px;margin-right:18px}
select.copy-select{
  width:calc(100% - 36px);margin:0 18px;padding:8px;border-radius:2px;border:1px solid var(--chrome-indigo);
  background:var(--surface);color:var(--ink);font-size:13px;
}

/* ── CHECKBOX ── */
input[type="checkbox"]{width:20px;height:20px;cursor:pointer;accent-color:var(--signal)}

/* ── MOBILE ── */
@media (max-width:600px){
  .main{padding:8px}
  h2{font-size:18px;padding:14px 10px 12px}
  h2::after{font-size:8px}
  .controls{gap:6px}
  .btn{padding:9px 11px;font-size:10px}
  table,thead,tbody,tr{display:block}
  thead{display:none}
  tr{
    margin-bottom:10px;background:var(--surface);border-radius:6px;
    box-shadow:0 2px 6px rgba(33,36,46,.15);padding:6px;
  }
  tr.row-selected{box-shadow:0 0 0 2px var(--signal)}
  td{display:flex;justify-content:space-between;align-items:center;border-bottom:none;padding:6px 8px;text-align:right}
  td::before{content:attr(data-label);color:var(--ink-soft);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;text-align:left;margin-right:8px}
  td:first-child::before{content:""}
  td:first-child{justify-content:flex-start}
  input[type="checkbox"]{width:24px;height:24px}
  .qty-ctrl{justify-content:flex-end}
  .summary-bar{flex-direction:column;align-items:stretch;text-align:center}
  .discount-row{flex-direction:column;align-items:stretch}
  .discount-row label{white-space:normal}
  .disc-input,.rule-select{width:100%}

  /* ── collapsible product cards: collapsed = checkbox + name + price ── */
  tr:not(.row-selected){display:flex;align-items:center;gap:2px;padding:8px 10px;cursor:pointer}
  tr:not(.row-selected) td{border-bottom:none;padding:2px 4px}
  tr:not(.row-selected) td::before{content:none}
  tr:not(.row-selected) td:nth-child(3),
  tr:not(.row-selected) td:nth-child(5),
  tr:not(.row-selected) td:nth-child(6),
  tr:not(.row-selected) td:nth-child(7){display:none}
  tr:not(.row-selected) td:nth-child(2){flex:1;justify-content:flex-start;text-align:left}
  tr:not(.row-selected) td:nth-child(4){font-weight:900;white-space:nowrap}
}

/* ════════════════════════════════════════════
   👾 8-BIT MODE — pixel sprites + chunky stepped corners
   ════════════════════════════════════════════ */

/* keep real content above the roaming sprites */
.tab-bar,.main{position:relative;z-index:1}

/* roaming background sprites */
.pixel-bg{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.sprite{
  position:absolute;width:32px;height:32px;
  image-rendering:pixelated;image-rendering:crisp-edges;
  opacity:.5;filter:drop-shadow(2px 2px 0 rgba(0,0,0,.3));
  animation-timing-function:linear;animation-iteration-count:infinite;
  left:0;
}
@keyframes runRight{
  from{transform:translateX(-15vw)}
  to{transform:translateX(115vw)}
}
/* tiny stepped hop — gives the run-cycle feel without touching transform */
@keyframes runBob{
  0%,100%{margin-bottom:0}
  50%{margin-bottom:3px}
}
.sprite-star{
  top:10%;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cg fill='%23ecab37'%3E%3Crect x='3' y='0' width='2' height='1'/%3E%3Crect x='2' y='1' width='4' height='1'/%3E%3Crect x='0' y='2' width='8' height='1'/%3E%3Crect x='1' y='3' width='6' height='1'/%3E%3Crect x='1' y='4' width='6' height='1'/%3E%3Crect x='1' y='5' width='2' height='1'/%3E%3Crect x='5' y='5' width='2' height='1'/%3E%3Crect x='1' y='6' width='1' height='1'/%3E%3Crect x='6' y='6' width='1' height='1'/%3E%3C/g%3E%3C/svg%3E");
  animation:runRight 22s linear infinite, runBob .3s steps(2) infinite;
}
.sprite-heart{
  top:36%;width:28px;height:28px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cg fill='%23e60012'%3E%3Crect x='1' y='0' width='2' height='1'/%3E%3Crect x='5' y='0' width='2' height='1'/%3E%3Crect x='0' y='1' width='4' height='1'/%3E%3Crect x='4' y='1' width='4' height='1'/%3E%3Crect x='0' y='2' width='8' height='1'/%3E%3Crect x='1' y='3' width='6' height='1'/%3E%3Crect x='2' y='4' width='4' height='1'/%3E%3Crect x='3' y='5' width='2' height='1'/%3E%3C/g%3E%3C/svg%3E");
  animation:runRight 28s linear infinite reverse, runBob .35s steps(2) infinite;animation-delay:-6s,0s;
}
.sprite-coin{
  top:64%;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cg fill='%23f68d1f'%3E%3Crect x='3' y='0' width='2' height='1'/%3E%3Crect x='2' y='1' width='4' height='1'/%3E%3Crect x='1' y='2' width='6' height='1'/%3E%3Crect x='1' y='3' width='6' height='1'/%3E%3Crect x='1' y='4' width='6' height='1'/%3E%3Crect x='1' y='5' width='6' height='1'/%3E%3Crect x='2' y='6' width='4' height='1'/%3E%3Crect x='3' y='7' width='2' height='1'/%3E%3C/g%3E%3C/svg%3E");
  animation:runRight 18s linear infinite, runBob .25s steps(2) infinite;animation-delay:-3s,0s;
}
.sprite-coin2{
  top:88%;width:24px;height:24px;opacity:.4;
  animation:runRight 16s linear infinite reverse, runBob .25s steps(2) infinite;animation-delay:-9s,0s;
}
.sprite-ghost{
  top:80%;width:36px;height:36px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cg fill='%23acace7'%3E%3Crect x='2' y='0' width='4' height='1'/%3E%3Crect x='1' y='1' width='6' height='1'/%3E%3Crect x='0' y='2' width='8' height='1'/%3E%3Crect x='0' y='3' width='8' height='1'/%3E%3Crect x='0' y='4' width='8' height='1'/%3E%3Crect x='0' y='5' width='8' height='1'/%3E%3Crect x='0' y='6' width='2' height='1'/%3E%3Crect x='3' y='6' width='2' height='1'/%3E%3Crect x='6' y='6' width='2' height='1'/%3E%3C/g%3E%3Cg fill='%2321242e'%3E%3Crect x='2' y='2' width='1' height='2'/%3E%3Crect x='5' y='2' width='1' height='2'/%3E%3C/g%3E%3C/svg%3E");
  animation:runRight 26s linear infinite reverse;animation-delay:-12s;
}

/* chunky stepped pixel corners — replaces smooth bevels with NES-style notches */
.btn,.shop-tab,.ctab,.cat-badge,h2,.modal,.edit-modal,.copy-modal,
.discount-panel,.summary-bar,table,.add-tab-btn,.qty-btn,.oos-badge{
  border-radius:0;
  clip-path:polygon(
    0 4px,4px 4px,4px 0,
    calc(100% - 4px) 0,calc(100% - 4px) 4px,100% 4px,
    100% calc(100% - 4px),calc(100% - 4px) calc(100% - 4px),calc(100% - 4px) 100%,
    4px 100%,4px calc(100% - 4px),0 calc(100% - 4px)
  );
}

/* pixel-font labels for that arcade HUD feel */
.btn,.shop-tab .tab-name-input,.ctab,.cat-badge,.sum-label,.oos-badge{
  font-family:var(--pixel);
}
.btn{font-size:8px;letter-spacing:0;line-height:1.6;padding:10px 12px}
.btn-sm{font-size:7px;padding:8px 10px}
.shop-tab{font-size:8px;padding:10px 12px}
.shop-tab .tab-name-input{width:78px}
.ctab{font-size:8px;padding:8px 12px}
.cat-badge{font-size:7px;padding:4px 6px;letter-spacing:0}
.sum-label{font-size:7px}
.oos-badge{font-size:7px;letter-spacing:0}

@media (max-width:600px){
  .sprite,.deco{display:none}
  .pixel-bg::before{height:90px;opacity:.6}
}

/* ════════════════════════════════════════════
   🎮 PIXEL PLAYGROUND — ground line, item-box buttons, easter eggs
   ════════════════════════════════════════════ */

/* pixel city skyline behind the grass — League of Defense tribute */
.pixel-bg::before{
  content:"";
  position:absolute;left:0;right:0;bottom:14px;height:170px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 24' shape-rendering='crispEdges'%3E%3Cg fill='%23ddeffc'%3E%3Crect x='0' y='10' width='6' height='14'/%3E%3Crect x='7' y='6' width='8' height='18'/%3E%3Crect x='16' y='12' width='6' height='12'/%3E%3Crect x='23' y='3' width='7' height='21'/%3E%3Crect x='31' y='14' width='8' height='10'/%3E%3Crect x='40' y='8' width='7' height='16'/%3E%3C/g%3E%3Cg fill='%23b2d6ef'%3E%3Crect x='1' y='12' width='1' height='1'/%3E%3Crect x='3' y='12' width='1' height='1'/%3E%3Crect x='1' y='15' width='1' height='1'/%3E%3Crect x='3' y='15' width='1' height='1'/%3E%3Crect x='8' y='8' width='1' height='1'/%3E%3Crect x='10' y='8' width='1' height='1'/%3E%3Crect x='12' y='8' width='1' height='1'/%3E%3Crect x='8' y='11' width='1' height='1'/%3E%3Crect x='12' y='11' width='1' height='1'/%3E%3Crect x='9' y='14' width='4' height='6'/%3E%3Crect x='17' y='14' width='1' height='1'/%3E%3Crect x='19' y='14' width='1' height='1'/%3E%3Crect x='17' y='17' width='1' height='1'/%3E%3Crect x='19' y='17' width='1' height='1'/%3E%3Crect x='24' y='5' width='1' height='1'/%3E%3Crect x='26' y='5' width='1' height='1'/%3E%3Crect x='28' y='5' width='1' height='1'/%3E%3Crect x='24' y='8' width='1' height='1'/%3E%3Crect x='28' y='8' width='1' height='1'/%3E%3Crect x='24' y='11' width='1' height='1'/%3E%3Crect x='26' y='11' width='1' height='1'/%3E%3Crect x='28' y='11' width='1' height='1'/%3E%3Crect x='32' y='16' width='1' height='1'/%3E%3Crect x='34' y='16' width='1' height='1'/%3E%3Crect x='36' y='16' width='1' height='1'/%3E%3Crect x='41' y='10' width='1' height='1'/%3E%3Crect x='43' y='10' width='1' height='1'/%3E%3Crect x='45' y='10' width='1' height='1'/%3E%3Crect x='41' y='13' width='1' height='1'/%3E%3Crect x='45' y='13' width='1' height='1'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat:repeat-x;
  background-position:bottom left;
  background-size:auto 100%;
  image-rendering:pixelated;
  opacity:.85;
}

/* grass ground line along the bottom of the background */
.pixel-bg::after{
  content:"";
  position:absolute;left:0;right:0;bottom:0;height:14px;
  background-color:var(--grass);
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 4px, transparent 4px 12px),
    linear-gradient(180deg, #6fce5c 0 3px, transparent 3px);
  box-shadow:0 -2px 0 0 var(--grass-dark);
  image-rendering:pixelated;
}
.sprite{bottom:14px;top:auto !important}
.sprite-star{bottom:60%}
.sprite-heart{bottom:34%}
.sprite-coin{bottom:14px}
.sprite-coin2{bottom:14px}
.sprite-ghost{bottom:14px}

/* ── item-box "?" buttons (Clear / Clear All) ── */
.item-box{
  background:repeating-linear-gradient(45deg,#f6b73c 0 6px,#e89c1a 6px 12px) !important;
  border:2px solid var(--carbon) !important;
  color:#5a3300 !important;
  text-shadow:1px 1px 0 rgba(255,255,255,.4);
  position:relative;
  animation:boxIdle 1.6s steps(2) infinite;
}
.item-box:hover,.item-box:focus-visible{
  animation:boxBump .35s steps(2);
}
@keyframes boxIdle{
  0%,100%{filter:brightness(1)}
  50%{filter:brightness(1.12)}
}
@keyframes boxBump{
  0%{transform:translateY(0)}
  30%{transform:translateY(-6px)}
  60%{transform:translateY(1px)}
  100%{transform:translateY(0)}
}

/* ── Clear All easter egg: sprites scatter & speed up ── */
.pixel-bg.frenzy .sprite{
  animation-duration:2.5s !important;
  filter:drop-shadow(2px 2px 0 rgba(0,0,0,.3)) brightness(1.3);
}

/* ── 1UP popup when total qty hits a milestone ── */
.oneup-popup{
  position:fixed;left:50%;top:40%;
  transform:translate(-50%,0);
  font-family:var(--pixel);font-size:22px;color:#3ddc3d;
  text-shadow:2px 2px 0 #145214;
  opacity:0;pointer-events:none;z-index:5;
  white-space:nowrap;
}
.oneup-popup.show{
  animation:oneUpFloat 1.4s ease-out forwards;
}
@keyframes oneUpFloat{
  0%{opacity:0;transform:translate(-50%,20px) scale(.6)}
  20%{opacity:1;transform:translate(-50%,0) scale(1.1)}
  35%{transform:translate(-50%,-4px) scale(1)}
  80%{opacity:1;transform:translate(-50%,-40px) scale(1)}
  100%{opacity:0;transform:translate(-50%,-60px) scale(1)}
}

/* ── static level scenery: clouds, bushes, pipe ── */
.deco{
  position:absolute;image-rendering:pixelated;image-rendering:crisp-edges;
  background-repeat:no-repeat;background-size:contain;
}
.deco-cloud{
  top:8%;width:112px;height:56px;opacity:.95;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8' shape-rendering='crispEdges'%3E%3Cg fill='%23ffffff'%3E%3Crect x='4' y='0' width='4' height='2'/%3E%3Crect x='9' y='1' width='4' height='1'/%3E%3Crect x='2' y='2' width='12' height='2'/%3E%3Crect x='0' y='4' width='16' height='2'/%3E%3C/g%3E%3Cg fill='%23c8ecd4'%3E%3Crect x='1' y='6' width='14' height='1'/%3E%3Crect x='3' y='5' width='4' height='1'/%3E%3Crect x='10' y='5' width='3' height='1'/%3E%3C/g%3E%3C/svg%3E");
}
.deco-cloud2{top:22%;width:72px;height:36px;opacity:.75}
.deco-bush{
  bottom:14px;width:48px;height:24px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8' shape-rendering='crispEdges'%3E%3Cg fill='%2346a93c'%3E%3Crect x='0' y='4' width='16' height='4'/%3E%3Crect x='2' y='2' width='4' height='2'/%3E%3Crect x='6' y='0' width='4' height='4'/%3E%3Crect x='10' y='2' width='4' height='2'/%3E%3C/g%3E%3Cg fill='%232e7a26'%3E%3Crect x='0' y='6' width='16' height='2'/%3E%3C/g%3E%3C/svg%3E");
}
.deco-bush2{width:64px;height:32px;opacity:.85}
.deco-pipe{
  bottom:14px;width:48px;height:56px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18' shape-rendering='crispEdges'%3E%3Cg fill='%2346a93c'%3E%3Crect x='0' y='0' width='16' height='4'/%3E%3Crect x='1' y='4' width='14' height='14'/%3E%3C/g%3E%3Cg fill='%232e7a26'%3E%3Crect x='0' y='3' width='16' height='1'/%3E%3Crect x='1' y='17' width='14' height='1'/%3E%3Crect x='13' y='4' width='2' height='14'/%3E%3C/g%3E%3Cg fill='%2370c95e'%3E%3Crect x='1' y='0' width='2' height='3'/%3E%3Crect x='2' y='4' width='2' height='13'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── category tab switch: pixel "level change" flash over the table ── */
.main{position:relative}
.main::before{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:repeating-conic-gradient(var(--canvas) 0% 25%, transparent 0% 50%);
  background-size:24px 24px;
  opacity:0;
}
.main.cat-flash::before{
  animation:pixelFlash .25s steps(3);
}
@keyframes pixelFlash{
  0%{opacity:.9}
  100%{opacity:0}
}
