@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');
:root{--bg:#0f0f1b;--screen:#14141f;--panel:#1a1a2e;--panel2:#252542;--hover:#33335a;--red:#e03a3a;--red2:#ff6b6b;--blue:#3aa0e0;--green:#39ff14;--yellow:#ffb800;--text:#e8e8f0;--muted:#8a8ab0;--black:#000;--px:4px}
*{box-sizing:border-box}html{background:var(--bg);color:var(--text)}body{margin:0;font-family:'VT323',monospace;font-size:22px;background:radial-gradient(circle at 20% 0,#1a1a2e 0,transparent 35%),var(--bg);min-height:100vh}body:before{content:'';position:fixed;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,#0000 0 3px,#0002 4px);z-index:50}.wrap{max-width:1180px;margin:auto;padding:18px}.topbar{position:sticky;top:0;z-index:20;background:#10101df2;border-bottom:4px solid #000;box-shadow:0 4px 0 var(--red)}.nav{display:flex;align-items:center;gap:18px;max-width:1180px;margin:auto;padding:14px 18px}.brand{font:14px 'Press Start 2P';color:#fff;text-shadow:3px 3px #000;line-height:1.5}.brand b{color:var(--red2)}.navlinks{display:flex;gap:14px;margin-left:auto;align-items:center}.nav a,.btn{font:10px 'Press Start 2P';color:var(--text);text-decoration:none;background:var(--panel2);border:3px solid #000;padding:12px 14px;box-shadow:4px 4px 0 #000;cursor:pointer}.nav a:hover,.btn:hover{transform:translate(-1px,-1px);background:var(--hover)}.nav a:active,.btn:active{transform:translate(3px,3px);box-shadow:1px 1px 0 #000}.btn.red{background:var(--red)}.btn.blue{background:var(--blue);color:#07111a}.btn.green{background:var(--green);color:#09120a}.btn.small{padding:9px;font-size:8px}.hamb{display:none}.device{background:var(--red);border:6px solid #000;box-shadow:9px 9px 0 #000;padding:18px;margin:28px 0;position:relative}.device:before,.device:after{content:'';position:absolute;width:12px;height:12px;background:#232323;border:3px solid #000;top:10px}.device:before{left:10px}.device:after{right:10px}.screen{background:var(--screen);border:6px solid #000;box-shadow:inset 0 0 0 3px #3b3b56;padding:28px;min-height:270px;display:grid;place-items:center;text-align:center}.screen h1{font:clamp(19px,4vw,36px)/1.45 'Press Start 2P';margin:0 0 18px}.screen p{color:var(--muted);font-size:28px}.light{display:inline-block;width:16px;height:16px;background:var(--blue);border:3px solid #000;box-shadow:0 0 14px var(--blue);margin-right:8px}.section-title{font:16px 'Press Start 2P';margin:36px 0 18px;color:#fff}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.card,.panel{background:var(--panel);border:4px solid #000;box-shadow:6px 6px 0 #000;padding:16px}.product-img{height:190px;background:linear-gradient(135deg,#252542,#11111d);border:3px solid #000;display:grid;place-items:center;overflow:hidden}.product-img img{max-width:100%;max-height:100%;object-fit:contain}.pixel-placeholder{font:12px 'Press Start 2P';color:var(--muted);text-align:center}.card h3{font:12px/1.5 'Press Start 2P'}.price{font:16px 'Press Start 2P';color:var(--yellow)}.muted{color:var(--muted)}.badge{font:8px 'Press Start 2P';display:inline-block;padding:7px;border:3px solid #000;background:var(--blue);color:#061018}.badge.sale{background:var(--red2)}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.modal{position:fixed;inset:0;background:#000b;z-index:40;display:none;place-items:center;padding:15px}.modal.open{display:grid}.modalbox{width:min(660px,100%);max-height:90vh;overflow:auto;background:var(--panel);border:5px solid #000;box-shadow:9px 9px 0 #000;padding:20px}.modalbox h2{font:14px 'Press Start 2P'}.field{display:grid;gap:6px;margin:10px 0}.field label{font:9px 'Press Start 2P';color:var(--muted)}input,select,textarea{width:100%;background:#0f0f1b;color:#fff;border:3px solid #000;padding:12px;font:22px 'VT323';outline:none}input:focus,select:focus,textarea:focus{border-color:var(--blue)}.toast{position:fixed;right:18px;bottom:18px;z-index:70;background:var(--panel2);border:4px solid #000;box-shadow:5px 5px 0 #000;padding:14px;display:none}.toast.show{display:block}.account{display:flex;align-items:center;gap:8px}.avatar{width:32px;height:32px;border:3px solid #000;object-fit:cover}.two{display:grid;grid-template-columns:1fr 1fr;gap:18px}.order{border-bottom:2px dashed #555;padding:10px 0}.status{color:var(--green)}footer{margin-top:60px;border-top:4px solid #000;padding:30px 0;color:var(--muted);text-align:center}.adminbar{background:#251111;border:4px solid #000;padding:12px;margin:15px 0}
@media(max-width:850px){body{font-size:20px}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.two{grid-template-columns:1fr}.navlinks{display:none;position:absolute;top:68px;left:10px;right:10px;flex-direction:column;background:var(--panel);border:4px solid #000;padding:12px}.navlinks.open{display:flex}.hamb{display:block;margin-left:auto}.nav a{width:100%}.account{width:100%}}
@media(max-width:520px){.wrap{padding:10px}.grid{grid-template-columns:1fr}.screen{padding:18px;min-height:230px}.device{padding:12px;margin:15px 0}.brand{font-size:11px}.card,.panel{padding:12px}.nav{padding:10px}.screen p{font-size:23px}.btn{font-size:8px;padding:10px}.product-img{height:165px}}
.setup-alert{border:3px solid #ffb800;background:#241d0e;color:#ffe9a7;padding:12px 14px;margin:14px 0;font-family:"VT323",monospace;font-size:22px;box-shadow:5px 5px 0 #000}.setup-alert a{color:#fff}.auth-warning{display:inline-block;font-family:"VT323",monospace;font-size:16px;color:#ffb800;max-width:220px}.btn:disabled{opacity:.45;cursor:not-allowed;transform:none!important}.admin-toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}.product-admin-row{display:grid;grid-template-columns:70px 1.3fr 1fr 110px 100px 150px;gap:10px;align-items:center;border-bottom:2px solid #0b0b13;padding:10px 0}.product-admin-row img{width:64px;height:64px;object-fit:cover;border:2px solid #000}.product-admin-row .thumb-empty{width:64px;height:64px;border:2px solid #000;background:#11111c}.product-admin-actions{display:flex;gap:6px;flex-wrap:wrap}@media(max-width:900px){.product-admin-row{grid-template-columns:64px 1fr;}.product-admin-row>*:not(:first-child){min-width:0}.product-admin-actions{grid-column:1/-1}}

.badge.bluebadge{border-color:#3aa0e0;color:#3aa0e0;margin-left:6px}.product-img img{width:100%;height:100%;object-fit:contain;background:#fff}.card h3{line-height:1.55}.card .actions{display:flex;flex-wrap:wrap;gap:8px}

/* V4: Shopee-style 1:1 product image tiles */
.product-img{width:100%;height:auto!important;aspect-ratio:1/1;background:#fff;border:3px solid #000;display:block;overflow:hidden;position:relative}
.product-img img{display:block;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:center;background:#fff}
@media(max-width:520px){.product-img{height:auto!important;aspect-ratio:1/1}}


/* V5 marketplace catalog: Shopee-style functionality with Gustavos pixel branding */
.market-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:18px;align-items:start}.category-panel{background:transparent;padding:6px 0;position:sticky;top:92px}.category-title{font:10px 'Press Start 2P';padding:12px 8px;border-bottom:2px solid #2d2d44;margin-bottom:8px}.category-link{display:block;width:100%;text-align:left;border:0;background:transparent;color:var(--text);padding:9px 10px;font:20px 'VT323';cursor:pointer}.category-link:hover,.category-link.active{color:var(--red2);transform:none}.sortbar{display:flex;align-items:center;gap:10px;background:var(--panel2);border:3px solid #000;padding:12px;margin-bottom:14px;box-shadow:4px 4px 0 #000}.sort-label{color:var(--muted);margin-right:4px}.sort-btn,.price-sort{border:2px solid #000;background:#fff;color:#222;padding:10px 18px;font:18px 'VT323';cursor:pointer;min-width:100px}.sort-btn.active{background:var(--red);color:#fff}.price-sort{min-width:220px;margin-left:0}.product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.shop-card{background:#fff;color:#222;border:2px solid #000;box-shadow:4px 4px 0 #000;min-width:0;transition:transform .12s ease,box-shadow .12s ease}.shop-card:hover{transform:translateY(-3px);box-shadow:5px 7px 0 #000}.shop-card .product-img{border:0;border-bottom:1px solid #ddd;box-shadow:none}.shop-card-body{padding:10px;display:flex;flex-direction:column;min-height:210px}.shop-card h3{font:19px/1.08 'VT323';font-weight:400;margin:0 0 8px;color:#222;height:42px;overflow:hidden}.shop-card .price{font:26px 'VT323';color:#ee4d2d;margin:6px 0}.market-meta{display:flex;align-items:center;min-height:22px;gap:8px;color:#777;font:17px 'VT323'}.market-meta .sold{margin-left:auto;color:#666}.rating{color:#f5a623}.variant-title{font:15px 'VT323';color:#777;margin:4px 0}.variant-buttons{display:flex;flex-wrap:wrap;gap:5px;margin:2px 0 8px}.variant-btn{border:1px solid #c9c9c9;background:#fff;color:#333;padding:5px 8px;font:15px 'VT323';cursor:pointer}.variant-btn:hover,.variant-btn.selected{border-color:#ee4d2d;color:#ee4d2d;box-shadow:inset 0 0 0 1px #ee4d2d}.market-cart{margin-top:auto;border:2px solid #000;background:var(--red);color:#fff;padding:9px;font:9px 'Press Start 2P';cursor:pointer;box-shadow:3px 3px 0 #000}.market-cart:hover{transform:translate(-1px,-1px)}.market-cart:disabled{opacity:.45;cursor:not-allowed}.image-error:after{content:'IMAGE';display:grid;place-items:center;width:100%;height:100%;background:#eee;color:#888;font:11px 'Press Start 2P'}.shop-card .product-img img{object-fit:cover!important}.shop-card .pixel-placeholder{height:100%;display:grid;place-items:center;background:#eee;color:#666}.shop-section{scroll-margin-top:100px}
@media(max-width:1050px){.product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.market-layout{grid-template-columns:160px minmax(0,1fr)}}
@media(max-width:780px){.market-layout{grid-template-columns:1fr}.category-panel{position:static;display:flex;overflow-x:auto;gap:6px;padding-bottom:6px}.category-title{display:none}.category-link{width:auto;white-space:nowrap;border:2px solid #000;background:var(--panel2);padding:7px 10px;font-size:17px}.sortbar{overflow-x:auto;align-items:stretch}.sort-label{display:none}.sort-btn,.price-sort{min-width:max-content}.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:470px){.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.shop-card-body{padding:8px;min-height:190px}.shop-card h3{font-size:17px;height:38px}.shop-card .price{font-size:22px}.market-meta{font-size:15px}.sortbar{padding:8px;gap:6px}.sort-btn,.price-sort{padding:8px 10px;font-size:16px}.market-cart{font-size:7px;padding:8px}.variant-btn{font-size:13px;padding:4px 6px}}


/* V6 responsive Shopee-style marketplace controls and variation picker */
.sortbar{display:grid;grid-template-columns:auto repeat(3,minmax(118px,1fr)) minmax(220px,2.4fr);gap:10px;align-items:stretch;overflow:visible}
.sort-label{display:flex;align-items:center;padding:0 4px;line-height:1.1}
.sort-btn,.price-sort{width:100%;min-width:0!important;height:52px;box-sizing:border-box;margin:0;display:flex;align-items:center;justify-content:center;text-align:center;font:18px 'VT323';white-space:normal}
.price-sort{display:block;padding-left:16px;text-align:left}
.product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.shop-card-body{min-height:175px}.market-cart{width:100%}
.variation-modal-box{width:min(880px,96vw)}
.variation-layout{display:grid;grid-template-columns:minmax(260px,1fr) 1.1fr;gap:20px;align-items:start}
.variation-main{aspect-ratio:1/1;background:#fff;border:3px solid #000;overflow:hidden}.variation-main img{width:100%;height:100%;object-fit:cover;display:block}
.variation-price{font:34px 'VT323';color:#ee4d2d;margin-bottom:6px}.variation-stock{font:20px 'VT323';color:var(--muted);margin-bottom:12px}
.variation-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.variation-card{display:grid;grid-template-columns:58px 1fr;grid-template-rows:auto auto;gap:3px 8px;align-items:center;text-align:left;background:#fff;color:#222;border:2px solid #bbb;padding:7px;cursor:pointer;font:17px 'VT323'}.variation-card img{grid-row:1/3;width:58px;height:58px;object-fit:cover;border:1px solid #ddd}.variation-card b{color:#ee4d2d;font-weight:400}.variation-card:hover,.variation-card.selected{border-color:#ee4d2d;box-shadow:inset 0 0 0 1px #ee4d2d}.variation-card.selected{position:relative}.variation-card.selected:after{content:'✓';position:absolute;right:0;bottom:0;background:#ee4d2d;color:#fff;padding:1px 5px}
@media(max-width:1100px){.sortbar{grid-template-columns:auto repeat(3,minmax(100px,1fr)) minmax(180px,2fr)}.product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){.market-layout{grid-template-columns:1fr}.category-panel{position:static}.sortbar{grid-template-columns:repeat(3,1fr);gap:8px}.sort-label{grid-column:1/-1;padding:0}.price-sort{grid-column:1/-1}.sort-btn,.price-sort{height:48px}.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.variation-layout{grid-template-columns:1fr}.variation-main{max-width:420px;margin:auto;width:100%}}
@media(max-width:540px){.wrap{padding:8px}.sortbar{padding:8px;gap:6px;grid-template-columns:repeat(3,1fr)}.sort-btn,.price-sort{font-size:15px;height:44px;padding:6px}.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.shop-card{box-shadow:2px 2px 0 #000}.shop-card-body{min-height:150px;padding:7px}.shop-card h3{font-size:16px;line-height:1.08;height:35px}.shop-card .price{font-size:21px}.market-meta{font-size:14px}.market-cart{font-size:7px;padding:8px 5px}.variation-choices{grid-template-columns:1fr}.variation-modal-box{padding:12px}.variation-price{font-size:28px}}
@media(min-width:1440px){.wrap{max-width:1360px}.product-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}

/* V7: variation picker consistency */
.variation-card span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.variation-card b{white-space:nowrap}
@media(max-width:540px){.variation-card{grid-template-columns:52px minmax(0,1fr);padding:6px}.variation-card img{width:52px;height:52px}.variation-card span{white-space:normal;line-height:1.05}}

/* V8 CART: responsive image + remove controls */
.cart-line{display:grid;grid-template-columns:92px minmax(0,1fr);gap:12px;padding:12px 0;border-bottom:2px dashed #555;align-items:start}.cart-thumb{width:92px;aspect-ratio:1/1;background:#fff;border:3px solid #000;display:grid;place-items:center;overflow:hidden;color:#777;font:10px 'Press Start 2P'}.cart-thumb img{width:100%;height:100%;object-fit:cover}.cart-info{min-width:0}.cart-info>b{display:block;font:18px/1.35 'VT323';color:#fff}.cart-variant{margin:4px 0;color:var(--blue);font:20px 'VT323'}.cart-price{color:#ff6b4a;font:25px 'VT323';margin:5px 0}.cart-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.cart-controls label{display:flex;align-items:center;gap:7px;color:var(--muted);font:17px 'VT323'}.cart-controls input{width:72px!important;padding:7px!important;font-size:20px!important}.cart-remove{background:#7a2020!important;color:#fff!important}.cart-remove:hover{background:#a52a2a!important}
@media(max-width:560px){.modalbox{padding:12px}.cart-line{grid-template-columns:72px minmax(0,1fr);gap:9px}.cart-thumb{width:72px}.cart-info>b{font-size:16px}.cart-variant{font-size:18px}.cart-price{font-size:22px}.cart-controls{align-items:stretch}.cart-controls label{width:100%}.cart-controls .cart-remove{width:auto}.actions .btn{flex:1 1 140px}}
