:root{--bg:#222226;--card:#2c2d31;--line:#3a3b42;--purple:#8356d4;--light:#cdb2ff;--text:#fff;--muted:#a4a4ad}
*{box-sizing:border-box;margin:0;padding:0;font-family:Tahoma,"Noto Sans Thai",sans-serif;user-select:none}
html,body{width:100%;height:100%;overflow:hidden;background:transparent;color:var(--text)}
body{display:flex;align-items:center;justify-content:center}
.shop-ui{display:none;gap:12px;width:min(1050px,88vw);height:min(590px,75vh);filter:drop-shadow(0 16px 36px rgba(0,0,0,.45))}
.shop-ui.visible{display:flex}.panel{position:relative;background:rgba(34,34,38,.97);border:1px solid #44454c;border-radius:13px;padding:14px}
.catalog{flex:1}.cart-panel{width:320px;display:flex;flex-direction:column}
header{height:52px;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding-bottom:12px}
header div{display:flex;gap:7px;align-items:baseline}header strong{font-size:16px}header small{font-size:12px;color:var(--light)}
.round-icon{display:grid;place-items:center;width:38px;height:38px;border:4px solid var(--purple);background:var(--light);color:#382356;border-radius:50%;font-size:15px}
#search{margin-left:auto;width:175px;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:white;outline:0;user-select:text}
.close{margin-left:auto;width:32px;height:32px;border:0;border-radius:7px;background:#393940;color:white;font-size:24px;cursor:pointer}.close:hover{background:#d64f62}
.products{height:calc(100% - 66px);padding-top:14px;display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));grid-auto-rows:190px;gap:11px;overflow-y:auto}
.product{position:relative;border:1px solid var(--line);border-radius:10px;background:var(--card);padding:12px;text-align:center;cursor:pointer;transition:.15s}
.product:hover{background:#503878;border-color:#a87bf5;transform:translateY(-2px)}
.product img{width:105px;height:105px;object-fit:contain}.product .name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.product small{display:block;color:var(--muted);margin-top:5px}.product b{color:#d8b9ff}
.cart{flex:1;margin-top:14px;overflow-y:auto}.empty{height:100%;display:grid;place-items:center;color:#767680}
.cart-row{height:63px;display:grid;grid-template-columns:1fr 88px 30px;align-items:center;gap:7px;border:1px solid var(--line);border-radius:9px;background:var(--card);padding:8px;margin-bottom:7px}
.cart-row .info{min-width:0}.cart-row .info b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.cart-row .info small{color:#c9a5fa}
.qty{display:flex;align-items:center;justify-content:center;gap:5px}.qty button,.delete{border:0;border-radius:5px;background:#44454d;color:white;cursor:pointer}.qty button{width:23px;height:27px}.qty span{min-width:23px;text-align:center}.delete{height:28px}.delete:hover{background:#d64f62}
.summary{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding:13px 2px}.summary strong{color:#d8b9ff;font-size:18px}
.wallet{display:flex;align-items:center;gap:10px;padding:9px;border:1px solid var(--purple);border-radius:9px;background:#35284b}.wallet img{width:38px;height:38px;object-fit:contain}.wallet div{display:flex;flex-direction:column}.wallet small{color:#bbb4c7}.buy{margin-top:10px;height:43px;border:1px solid #9f76ed;border-radius:9px;background:linear-gradient(135deg,#6940ae,#8b5bdc);color:white;font-size:14px;cursor:pointer}.buy:hover{filter:brightness(1.12)}.buy:disabled{opacity:.45;cursor:default}
.status{height:24px;padding-top:7px;text-align:center;font-size:12px;color:#ffce74}.status.ok{color:#77e49c}.status.error{color:#ff7e8e}
::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#5e3d93;border-radius:5px}
@media(max-width:900px){.shop-ui{width:94vw}.products{grid-template-columns:repeat(3,1fr)}.cart-panel{width:300px}}
