﻿/* =====================================================================
   SKINBOX — LAYOUT (header / sidebar / footer) + COMPONENTS
   ===================================================================== */

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas:
    "side header"
    "side main";
  min-height: 100vh;
}

/* ---------- Header ---------- */
.header {
  grid-area: header;
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(10, 8, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header .search { flex: 1; max-width: 460px; }
.header-spacer { flex: 1; }

.balance {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 8px 7px 14px;
}
.balance .amt { font-weight: 800; font-size: 15px; color: var(--rar-gold); text-shadow: 0 0 10px rgba(255,210,74,.4); }
.balance .topup {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, var(--neon-orange-2), var(--neon-orange)); color: #1c0f00;
  font-size: 18px; font-weight: 800; box-shadow: var(--glow-orange);
}

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-soft);
  transition: .2s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }

.avatar {
  width: 40px; height: 40px; border-radius: 11px; overflow: hidden; flex-shrink: 0;
  border: 2px solid rgba(201,154,74,.5); box-shadow: var(--glow-violet);
}
.avatar svg, .avatar img { width: 100%; height: 100%; }

/* ---------- Sidebar ---------- */
.sidebar {
  grid-area: side;
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(16,12,30,.92), rgba(8,6,16,.92));
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 18px;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--neon-orange-2), var(--neon-orange));
  display: grid; place-items: center; box-shadow: var(--glow-orange);
}
.brand .logo svg { width: 22px; height: 22px; color: #1c0f00; }
.brand .name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.brand .name b { color: var(--neon-orange); }
.brand-logo-full { height: 34px; width: auto; object-fit: contain; display: block; }

.nav-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); padding: 14px 12px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: 14px;
  transition: .18s; position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--bg-elev); }
.nav-item.active {
  color: var(--text); background: linear-gradient(90deg, rgba(255,140,0,.16), rgba(255,140,0,.02));
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 99px; background: var(--neon-orange); box-shadow: var(--glow-orange);
}
.nav-item.active svg { color: var(--neon-orange); }
.nav-item .tag { margin-left: auto; font-size: 10px; padding: 2px 7px; border-radius: 99px; }

/* ---------- Main ---------- */
.main { grid-area: main; padding: 26px 28px 60px; min-width: 0; }
.main-inner { max-width: var(--maxw); margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

/* ---------- 3D Neon icon tiles ---------- */
.ntile {
  position: relative; display: grid; place-items: center;
  border-radius: 16px; aspect-ratio: 1;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.14), transparent 50%),
    linear-gradient(160deg, color-mix(in srgb, var(--rar, var(--neon-violet)) 55%, #1a1430), #0e0a1c);
  border: 1px solid color-mix(in srgb, var(--rar, var(--neon-violet)) 50%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -10px 24px rgba(0,0,0,.5),
    0 8px 22px rgba(0,0,0,.45),
    0 0 22px color-mix(in srgb, var(--rar, var(--neon-violet)) 40%, transparent);
}
.ntile svg { width: 52%; height: 52%; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }

/* ---------- Case card ---------- */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.case-card {
  position: relative; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(28,22,52,.7), rgba(14,11,26,.7));
  border: 1px solid var(--border); padding: 16px 14px 14px;
  text-align: center; overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.case-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--rar, var(--neon-violet)) 28%, transparent), transparent 70%);
  opacity: .8;
}
.case-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 26px color-mix(in srgb, var(--rar, var(--neon-violet)) 30%, transparent); }
.case-card .corner-badge { position: absolute; top: 10px; left: 10px; z-index: 2; }

/* Case art (CSS-built crate) */
.crate {
  position: relative; width: 118px; height: 100px; margin: 6px auto 12px;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.55));
}
.crate .lid, .crate .body {
  position: absolute; left: 50%; transform: translateX(-50%);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar, var(--neon-violet)) 70%, #2a2046), #120e22);
  border: 1px solid color-mix(in srgb, var(--rar, var(--neon-violet)) 60%, #000);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -8px 18px rgba(0,0,0,.45);
}
.crate .body { bottom: 0; width: 92px; height: 64px; }
.crate .lid  { top: 0; width: 104px; height: 30px; }
.crate .glow {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  width: 70px; height: 30px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rar, var(--neon-orange)) 90%, #fff), transparent);
  filter: blur(6px); opacity: .9; animation: crateGlow 2.4s ease-in-out infinite;
}
@keyframes crateGlow { 0%,100%{opacity:.55; transform:translateX(-50%) scaleY(1)} 50%{opacity:1; transform:translateX(-50%) scaleY(1.25)} }
.crate .star { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); width: 30px; height: 30px; color:#fff; z-index: 3; filter: drop-shadow(0 0 8px var(--rar, var(--neon-orange))); }

.case-card .ctitle { font-size: 14px; font-weight: 700; position: relative; z-index: 1; }
.case-card .price {
  margin-top: 6px; font-weight: 800; color: var(--rar-gold);
  position: relative; z-index: 1; font-size: 15px;
}
.case-card .open-btn { margin-top: 12px; position: relative; z-index: 1; }

/* ---------- Skin card ---------- */
.skin-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, rgba(26,20,46,.7), rgba(12,10,24,.8));
  border: 1px solid var(--border);
  border-top: 3px solid var(--rar, var(--rar-rare));
  padding: 12px; transition: transform .2s, box-shadow .2s;
}
.skin-card:hover { transform: translateY(-3px); box-shadow: 0 0 20px color-mix(in srgb, var(--rar) 35%, transparent); }
.skin-art {
  height: 80px; display: grid; place-items: center; margin-bottom: 8px;
  background: radial-gradient(60% 80% at 50% 40%, color-mix(in srgb, var(--rar) 22%, transparent), transparent 70%);
  border-radius: 10px;
}
.skin-art svg { width: 100%; height: 56px; color: #d9d4ee; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.skin-card .wname { font-size: 11px; color: var(--text-dim); }
.skin-card .sname { font-size: 13px; font-weight: 700; }
.skin-card .srow { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.skin-card .sprice { font-weight: 800; color: var(--rar-gold); font-size: 13px; }
.skin-card .float { font-size: 10px; color: var(--text-faint); }
.rar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rar); box-shadow: 0 0 8px var(--rar); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-dim); font-weight: 600; font-size: 13px; transition: .18s;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.active { color: #1c0f00; background: linear-gradient(135deg, var(--neon-orange-2), var(--neon-orange)); border-color: transparent; box-shadow: var(--glow-orange); }

/* ---------- Live drop feed ---------- */
.live-feed { display: flex; flex-direction: column; gap: 8px; }
.drop-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-left: 3px solid var(--rar, var(--rar-rare));
  animation: dropIn .4s var(--ease) both;
}
@keyframes dropIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.drop-row .dav { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg-elev); }
.drop-row .ditem { width: 38px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: radial-gradient(closest-side, color-mix(in srgb, var(--rar) 30%, transparent), transparent); }
.drop-row .ditem svg { width: 34px; height: 22px; color: #e3def5; }
.drop-row .dmeta { min-width: 0; flex: 1; }
.drop-row .dname { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-row .duser { font-size: 11px; color: var(--text-dim); }
.drop-row .dprice { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--rar-gold); }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 14px; }
.stat {
  padding: 16px; border-radius: var(--radius); text-align: center;
  background: var(--bg-elev); border: 1px solid var(--border);
}
.stat .num { font-size: 26px; font-weight: 800; }
.stat .lab { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Footer ---------- */
.footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  background: rgba(8,6,16,.6); margin-top: 40px;
  padding: 40px 28px 28px;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-soft); margin-bottom: 14px; }
.footer a { display: block; color: var(--text-dim); font-size: 13px; padding: 5px 0; transition: .15s; }
.footer a:hover { color: var(--neon-orange); }
.footer .socials { display: flex; gap: 10px; margin-top: 14px; }
.footer .socials a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); padding: 0; }
.footer .socials a:hover { border-color: var(--neon-blue); box-shadow: var(--glow-blue); color: var(--neon-blue); }
.footer-bottom { max-width: var(--maxw); margin: 28px auto 0; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-faint); font-size: 12px; }

/* ---------- Mobile ---------- */
.menu-toggle { display: none; }
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 90;
    transform: translateX(-105%); transition: transform .28s var(--ease);
    box-shadow: 0 0 50px rgba(0,0,0,.6);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; opacity: 0; pointer-events: none; transition: .25s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
}
@media (max-width: 720px) {
  .main { padding: 18px 14px 50px; }
  .header { padding: 0 14px; gap: 10px; }
  .header .search { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .case-grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
  .balance .label-hide { display: none; }
}
@media (min-width: 1081px) { .scrim { display: none; } }
