:root{
  --bg:#0b0f16; --panel:#121826; --panel2:#0f1522; --muted:#8aa0b8;
  --acc:#8dd3ff; --card:#192132;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:#dbe7ff;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial;
}

/* ===== Nội dung trang ===== */
.container{max-width:1420px;margin:40px auto;padding:0 10px}
.hero{
  background:linear-gradient(180deg,rgba(141,211,255,.08),rgba(120,243,196,.05));
  border:1px solid rgba(141,211,255,.15);
  border-radius:18px;padding:24px 22px 18px;
  box-shadow:0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(2px);
}
.bar{display:flex;align-items:center;justify-content:space-between}
h1{margin:0 0 10px 0;font-weight:800;letter-spacing:.2px}
.subtitle{color:var(--muted);margin-bottom:18px}

/* ===== Bố cục: Preview chiếm nhiều hơn Upload =====
   - Cột trái (upload): ~27%
   - Cột phải (preview): ~73%
*/
.grid{
  display:grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(760px, 2.3fr);
  gap:18px;
  align-items:start;
}
.panel{
  background:var(--panel); border:1px solid rgba(141,211,255,.12); border-radius:16px; padding:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
}
/* giúp phần previewWrap nở đầy chiều cao panel */
.grid > .panel{ display:flex; flex-direction:column; }

.panelHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}

/* ===== Khu upload ===== */
.dropzone{
  border:1.5px dashed rgba(141,211,255,.35); border-radius:14px; padding:22px; text-align:center;
  background:linear-gradient(180deg,rgba(25,33,50,.75), rgba(25,33,50,.55));
  transition:.2s ease; cursor:pointer;
}
.dropzone.drag{border-color:var(--acc); box-shadow:0 0 0 4px rgba(141,211,255,.15)}
.dz-title{font-weight:700;margin-bottom:6px}
.dz-sub{color:var(--muted);font-size:13px}
.files{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.filetag{
  background:var(--panel2); border:1px solid rgba(141,211,255,.2); color:#dbe7ff;
  padding:6px 10px; border-radius:999px; font-size:12px
}
.row{display:flex; gap:10px; align-items:center; margin-top:12px}

input[type="password"]{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid rgba(141,211,255,.2);
  background:#0f1522; color:#eaf3ff; outline:none;
}
.btn{
  appearance:none; border:none; border-radius:12px; padding:12px 14px; font-weight:700; cursor:pointer;
  color:#0b0f16; background:linear-gradient(180deg,var(--acc),#58bfff);
  box-shadow:0 8px 24px rgba(141,211,255,.25);
  transition:transform .06s,filter .2s;
}
.btn.mini{padding:8px 12px; font-size:13px}
.btn:disabled{opacity:.5; cursor:not-allowed; filter:grayscale(25%)}
.btn.secondary{color:#dbe7ff; background:linear-gradient(180deg,#273149,#1c2439); border:1px solid rgba(141,211,255,.25); box-shadow:none}

/* ===== Khu preview (to hơn, thoáng hơn) ===== */
.previewWrap{
  flex:1;
  min-height:560px;
  max-height:82vh;
  overflow:auto;
  background:var(--card);
  border-radius:12px; padding:16px;
  border:1px solid rgba(141,211,255,.12);
}
.gridSprites{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(230px,1fr));
  gap:16px;
}
.spriteCard{
  background:#0f1522;border:1px solid rgba(141,211,255,.15);
  border-radius:12px;padding:10px;text-align:center
}
.spriteCard img{
  width:100%;
  height: clamp(220px, 36vh, 380px);
  object-fit:contain;
  background:#0b0f16; border-radius:8px
}
.actions{margin-top:8px}
.actions .mini{
  border:1px solid rgba(141,211,255,.25); background:#1b243a; color:#dbe7ff;
  padding:6px 10px; border-radius:999px; font-size:12px; cursor:pointer
}
.actions .mini:hover{filter:brightness(1.08)}
.nm{font-size:12px;color:var(--muted);margin-top:8px;word-break:break-all}

/* ===== Khác ===== */
.status{font-size:12px;color:var(--muted);margin-top:6px}
.badge{font-size:11px;padding:3px 7px;border-radius:999px;background:#1a243a;border:1px solid rgba(141,211,255,.2);margin-left:6px}
footer{margin:26px 0 8px;color:#c8d6ef;font-size:12px;text-align:center}
footer a{color:#8dd3ff;text-decoration:none}
footer a:hover{text-decoration:underline}

/* ===== Responsive ===== */
@media (max-width: 1080px){
  .grid{ grid-template-columns: 1fr; }
  .previewWrap{ min-height: 440px; max-height: 74vh; }
  .gridSprites{ grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); }
  .spriteCard img{ height: clamp(200px, 32vh, 320px); }
}
