/* ═══════════════════════════════════════════════════════════════════
   NIGHT ZONE — Modern Game-Shop Design System  v2
   Shared by: index (shop) / account / cases / admin
   Palette: bluish-graphite dark, acid-green accent, rounded cards
   ═══════════════════════════════════════════════════════════════════ */

/* ── Google Font (mono accent) ── */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');


/* ════════════════════════════════════════════════════════
   1. CSS VARIABLES
════════════════════════════════════════════════════════ */
:root {
  /* Base surfaces */
  --bg:      #0e1116;
  --panel:   #161b22;
  --panel2:  #1c2333;
  --panel3:  #222d3d;

  /* Borders */
  --border:  #222b36;
  --border2: #2d3748;

  /* Accent — acid-green + teal */
  --acc:      #aef23a;
  --acc2:     #34d399;
  --acc-grad: linear-gradient(135deg, #aef23a 0%, #34d399 100%);
  --acc-glow: 0 0 24px rgba(174, 242, 58, 0.20);

  /* Text */
  --txt: #e7ecf2;
  --dim: #8b95a3;

  /* Semantic */
  --danger:  #f87171;
  --warning: #fbbf24;
  --info:    #60a5fa;

  /* Border radius */
  --r:      12px;
  --r-sm:    8px;
  --r-xs:    5px;
  --r-pill: 999px;

  /* Transitions */
  --tr: 160ms ease;

  /* Fonts */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Share Tech Mono', 'Courier New', monospace;
}


/* ════════════════════════════════════════════════════════
   2. RESET & BASE
════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

kbd {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: var(--r-xs);
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: .85em;
  color: var(--acc);
}


/* ════════════════════════════════════════════════════════
   3. TYPOGRAPHY UTILITIES
════════════════════════════════════════════════════════ */
.mono        { font-family: var(--mono); }
.txt-acc     { color: var(--acc); }
.txt-muted   { color: var(--dim); }
.txt-danger  { color: var(--danger); }


/* ════════════════════════════════════════════════════════
   4. LAYOUT UTILITIES
════════════════════════════════════════════════════════ */
.container  { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.flex       { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8      { gap: 8px; }
.gap-12     { gap: 12px; }
.gap-16     { gap: 16px; }


/* ════════════════════════════════════════════════════════
   5. HEADER / NAVBAR
════════════════════════════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 58px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 20px rgba(0, 0, 0, .50);
}

/* Brand */
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.logo {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--acc);
  text-shadow: 0 0 14px rgba(174, 242, 58, .28);
  line-height: 1.1;
}

.slogan {
  font-size: 9px;
  letter-spacing: 5px;
  color: var(--dim);
  text-transform: uppercase;
  line-height: 1;
}

/* Navigation links (Магазин / Кейсы) */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 0 16px;
}

.nav-link {
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  transition: color var(--tr), background var(--tr);
}
.nav-link:hover        { color: var(--txt); background: var(--panel2); }
.nav-link.active,
.nav-link-active       { color: var(--acc); }

/* Backward-compat nav link style used by cases/account pages */
.cases-nav-link {
  color: var(--dim);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  transition: color var(--tr), background var(--tr);
}
.cases-nav-link:hover { color: var(--txt); background: var(--panel2); }

/* Right cluster: auth + cart */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Auth box */
#auth {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

#auth .ava {
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border2);
  vertical-align: middle;
}

#auth a {
  color: var(--dim);
  font-size: 12px;
  transition: color var(--tr);
}
#auth a:hover { color: var(--acc); }

#auth .login {
  background: var(--acc-grad);
  color: #0e1116;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  display: inline-block;
  transition: opacity var(--tr), box-shadow var(--tr);
}
#auth .login:hover { opacity: .9; box-shadow: var(--acc-glow); }

/* Clickable profile → account page */
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--txt);
  text-decoration: none;
  transition: color var(--tr);
}
.profile-link:hover span { color: var(--acc); }

/* Admin shortcut link in header */
.admin-link {
  color: var(--acc);
  border: 1px solid var(--border2);
  padding: 4px 10px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .5px;
  transition: background var(--tr), border-color var(--tr);
}
.admin-link:hover { background: var(--panel2); border-color: var(--acc); }

/* Cart button */
#cartBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--txt);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}
#cartBtn:hover {
  border-color: var(--acc);
  background: var(--panel3);
  box-shadow: var(--acc-glow);
}

/* Cart item count pill */
#cartCount {
  background: var(--acc-grad);
  color: #0e1116;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}


/* ════════════════════════════════════════════════════════
   6. HERO / PROMO BANNER
════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 64px 24px 56px;
  text-align: center;
  background: linear-gradient(160deg, #111928 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* Subtle accent glow from above */
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 320px;
  background: radial-gradient(ellipse, rgba(174, 242, 58, .09) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--acc2);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--mono);
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--acc);
  text-shadow: 0 0 40px rgba(174, 242, 58, .28);
  line-height: 1;
  margin-bottom: 12px;
}

.hero-slogan {
  font-size: 11px;
  letter-spacing: 8px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-sub {
  font-size: 15px;
  color: var(--dim);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.65;
}


/* ════════════════════════════════════════════════════════
   7. SHOP CONTAINER + CATEGORY PILLS
════════════════════════════════════════════════════════ */

/* Outer page wrapper for the shop page */
.shop-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Backward-compat wrapper (old shop used .layout + .main-area flex-row) */
.layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 58px - 200px);
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Category pills bar — replaces vertical sidebar */
#sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
}

/* Section pill */
#sidebar .sec {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r-pill);
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr), border-color var(--tr), box-shadow var(--tr);
}
#sidebar .sec:hover  { background: var(--panel2); color: var(--txt); }
#sidebar .sec.on {
  background: rgba(174, 242, 58, .12);
  border-color: var(--acc);
  color: var(--acc);
  box-shadow: 0 0 12px rgba(174, 242, 58, .14);
}

/* Sub-filter pill (smaller, teal active state) */
#sidebar .flt {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--dim);
  font-size: 12px;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}
#sidebar .flt:hover { background: var(--panel2); color: var(--txt); border-color: var(--border2); }
#sidebar .flt.on {
  background: rgba(52, 211, 153, .10);
  border-color: var(--acc2);
  color: var(--acc2);
}


/* ════════════════════════════════════════════════════════
   8. SEARCH BAR
════════════════════════════════════════════════════════ */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

#search {
  flex: 1;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--txt);
  padding: 9px 16px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}
#search::placeholder { color: var(--dim); }
#search:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(174, 242, 58, .10);
}


/* ════════════════════════════════════════════════════════
   9. PRODUCT GRID + CARDS
════════════════════════════════════════════════════════ */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  align-content: start;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
}
.card:hover {
  border-color: rgba(174, 242, 58, .38);
  box-shadow: 0 6px 28px rgba(0, 0, 0, .45), var(--acc-glow);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  height: 150px;
  background-color: var(--panel2);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Badge pill (top-right) */
.card .badge,
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--acc-grad);
  color: #0e1116;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  white-space: nowrap;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.3;
  padding: 12px 14px 4px;
}

.card-desc {
  font-size: 12px;
  color: var(--dim);
  padding: 0 14px 10px;
  flex: 1;
  line-height: 1.45;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 0 0 var(--r) var(--r);
}

.price {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--acc);
  white-space: nowrap;
}

.empty {
  color: var(--dim);
  font-size: 14px;
  padding: 48px 0;
  text-align: center;
  grid-column: 1 / -1;
}


/* ════════════════════════════════════════════════════════
   10. BUTTONS
   .btn         — base
   .btn-primary — gradient (also: button.buy)
   .btn-ghost   — outlined
   .btn-danger  — red
   .btn-sm      — small variant
════════════════════════════════════════════════════════ */

/* Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--tr), box-shadow var(--tr), background var(--tr), border-color var(--tr);
  text-decoration: none;
}

/* Primary — gradient (also applied to button.buy for backward compat) */
.btn-primary,
button.buy {
  background: var(--acc-grad);
  color: #0e1116;
  border: none;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--tr), box-shadow var(--tr);
}
.btn-primary:hover,
button.buy:hover { opacity: .9; box-shadow: 0 0 18px rgba(174, 242, 58, .30); }
.btn-primary:disabled,
button.buy:disabled { opacity: .45; cursor: not-allowed; }

/* Small size modifier */
.btn-sm,
button.buy.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Ghost — outlined */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--dim);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.btn-ghost:hover { color: var(--txt); border-color: var(--acc); background: var(--panel2); }

/* Danger */
.btn-danger {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--danger);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
}
.btn-danger:hover { border-color: var(--danger); background: rgba(248, 113, 113, .08); }


/* ════════════════════════════════════════════════════════
   11. BALANCE CHIP
════════════════════════════════════════════════════════ */
.balance-chip {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: var(--r-pill);
  color: var(--acc);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  letter-spacing: .5px;
  white-space: nowrap;
}


/* ════════════════════════════════════════════════════════
   12. CART DRAWER
════════════════════════════════════════════════════════ */
#cartPanel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border2);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right .22s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -6px 0 36px rgba(0, 0, 0, .55);
}
#cartPanel.open { right: 0; }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--acc);
  flex-shrink: 0;
}

.cart-close {
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: color var(--tr), background var(--tr);
}
.cart-close:hover { color: var(--txt); background: var(--panel2); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-items::-webkit-scrollbar       { width: 4px; }
.cart-items::-webkit-scrollbar-track { background: transparent; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* Cart item row */
.ci {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
}

.ci button {
  background: transparent;
  border: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
  border-radius: var(--r-xs);
  padding: 2px 5px;
  transition: color var(--tr), background var(--tr);
}
.ci button:hover { color: var(--danger); background: rgba(248, 113, 113, .08); }

.cart-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel2);
  flex-shrink: 0;
}

.cart-total {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--acc);
}

.cart-pay-btns { display: flex; gap: 8px; }

/* Cart-specific button sizing */
.cart-foot button.buy { padding: 9px 20px; font-size: 13px; }

/* Admin mock checkout button — hidden by default; JS reveals via inline style */
.cart-pay-mock { display: none; }
button.cart-pay-mock {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--dim);
  box-shadow: none;
  opacity: 1;
}
button.cart-pay-mock:hover {
  background: var(--panel2);
  border-color: var(--acc2);
  color: var(--txt);
  box-shadow: none;
  opacity: 1;
}


/* ════════════════════════════════════════════════════════
   13. TOAST NOTIFICATION
════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 9999;
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--border2);
  border-top: 3px solid var(--acc);
  border-radius: var(--r-sm);
  padding: 12px 22px;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6), var(--acc-glow);
  max-width: 90vw;
  opacity: 0;
  transform: translate(-50%, -24px) scale(.96);
  pointer-events: none;
  transition: opacity .26s cubic-bezier(.2,.8,.2,1), transform .26s cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }


/* ════════════════════════════════════════════════════════
   14. MODAL
════════════════════════════════════════════════════════ */
#productModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#productModal.open { display: flex; }

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 28px 32px;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .65);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--r-xs);
  padding: 2px 6px;
  transition: color var(--tr), background var(--tr);
}
.modal-close:hover { color: var(--txt); background: var(--panel2); }


/* ════════════════════════════════════════════════════════
   15. ACCOUNT PAGE (ЛК)
════════════════════════════════════════════════════════ */
.account-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.acc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.acc-head h2 {
  font-family: var(--mono);
  letter-spacing: 1px;
  font-size: 20px;
  margin: 0;
  color: var(--txt);
}

.balance-big {
  font-family: var(--mono);
  color: var(--acc);
  font-size: 20px;
  font-weight: 700;
}

.acc-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.acc-card h3 {
  margin: 0 0 8px;
  font-family: var(--mono);
  color: var(--acc);
  font-size: 14px;
  letter-spacing: 1px;
}

.acc-hint {
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 13px;
}

.acc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--txt);
}
.acc-row:last-child { border-bottom: none; }

.acc-row .tag {
  color: var(--acc2);
  font-size: 12px;
  border: 1px solid var(--border2);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.acc-stats {
  display: flex;
  gap: 32px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.acc-stats div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.acc-stats .big {
  font-size: 24px;
  color: var(--acc);
  font-family: var(--mono);
  font-weight: 700;
}

.acc-stats span:last-child {
  color: var(--dim);
  font-size: 12px;
}

/* Referral row */
.ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ref-label { color: var(--dim); font-size: 12px; flex-shrink: 0; }

.ref-link {
  flex: 1;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--acc2);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.ref-copy {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--dim);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--mono);
  flex-shrink: 0;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.ref-copy:hover { color: var(--acc); border-color: var(--acc); background: var(--panel2); }

/* Dashboard cards (account page) */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dash-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-card-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.dash-card-value { font-family: var(--mono); font-size: 22px; color: var(--acc); font-weight: 700; }


/* ════════════════════════════════════════════════════════
   16. CASES PAGE
════════════════════════════════════════════════════════ */
.cases-page {
  padding: 28px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.cases-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Case card */
.case-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px 20px;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
}
.case-card:hover {
  border-color: rgba(174, 242, 58, .35);
  box-shadow: 0 0 24px rgba(174, 242, 58, .12);
  transform: translateY(-2px);
}

/* Rarity glow variants */
.case-card.rarity-rare    { border-color: #60a5fa; }
.case-card.rarity-rare:hover    { box-shadow: 0 0 24px rgba(96, 165, 250, .20); }
.case-card.rarity-epic    { border-color: #c084fc; }
.case-card.rarity-epic:hover    { box-shadow: 0 0 24px rgba(192, 132, 252, .20); }
.case-card.rarity-legend  { border-color: var(--warning); }
.case-card.rarity-legend:hover  { box-shadow: 0 0 24px rgba(251, 191, 36, .22); }

.case-icon { font-size: 52px; line-height: 1; }
.case-icon img { width: 80px; height: 80px; object-fit: contain; }

.case-card-title { font-size: 14px; font-weight: 600; color: var(--txt); letter-spacing: .3px; }
.case-card-sub   { font-size: 12px; color: var(--dim); }

.case-open-btn { margin-top: 6px; pointer-events: none; }


/* ════════════════════════════════════════════════════════
   17. REEL / ROULETTE
════════════════════════════════════════════════════════ */
.case-reel-wrap { max-width: 960px; margin: 0 auto; }

.case-reel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.case-back-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--dim);
  padding: 7px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.case-back-btn:hover { color: var(--txt); border-color: var(--acc); background: var(--panel2); }

.case-reel-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--acc);
  letter-spacing: 2px;
}

/* Reel viewport */
.reel-viewport {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--border2);
  border-radius: var(--r-sm);
  background: var(--panel2);
  height: 180px;
  margin-bottom: 20px;
}

.reel-track { display: flex; height: 100%; will-change: transform; }

.reel-item {
  flex-shrink: 0;
  width: 160px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding: 8px;
  text-align: center;
}

.reel-item-icon  { width: 60px; height: 60px; object-fit: contain; }
.reel-item-emoji { font-size: 36px; line-height: 1; }

.reel-item-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt);
  letter-spacing: .2px;
  word-break: break-word;
  max-width: 144px;
  line-height: 1.3;
}

.reel-item-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--acc);
  font-weight: 700;
}

/* Center highlight marker */
.reel-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 162px;
  border: 2px solid var(--acc);
  pointer-events: none;
  box-shadow: 0 0 18px rgba(174, 242, 58, .24);
}

.reel-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reel-spin-btn { padding: 10px 40px; font-size: 14px; letter-spacing: 1px; }
.reel-spin-btn:disabled { opacity: .5; cursor: not-allowed; }

.reel-msg        { font-size: 12px; font-family: var(--mono); color: var(--dim); letter-spacing: .5px; }
.reel-msg-err    { color: var(--danger); }

/* Prize win banner */
.reel-prize-display {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 16px 20px;
}

.prize-win      { font-family: var(--mono); font-size: 14px; color: var(--txt); letter-spacing: 1px; text-transform: uppercase; }
.prize-win-name { color: var(--acc); font-size: 16px; }


/* ════════════════════════════════════════════════════════
   18. ADMIN PANEL
════════════════════════════════════════════════════════ */

/* ── Fullscreen auth / forbidden screens ── */
.adm-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.adm-auth-card {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 40px 48px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .40);
}

.adm-auth-icon  { font-size: 40px; color: var(--acc); margin-bottom: 16px; }
.adm-auth-title { font-family: var(--mono); font-size: 18px; letter-spacing: 2px; color: var(--txt); margin-bottom: 10px; }
.adm-auth-sub   { font-size: 13px; color: var(--dim); margin-bottom: 24px; line-height: 1.5; }

/* ── App layout: sidebar + content ── */
.adm-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Left sidebar ── */
.adm-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.adm-sidebar::-webkit-scrollbar { display: none; }

.adm-sidebar-brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* reuse shared .logo / .slogan but slightly tighter in sidebar */
.adm-sidebar-brand .logo   { display: block; font-size: 17px; letter-spacing: 3px; line-height: 1.1; }
.adm-sidebar-brand .slogan { display: block; margin-top: 4px; }

/* ── Sidebar navigation ── */
.adm-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 2px;
  overflow-y: auto;
}

.adm-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .5px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: color var(--tr), background var(--tr), border-color var(--tr);
}
.adm-tab:hover { color: var(--txt); background: var(--panel2); }
.adm-tab.on {
  background: rgba(174, 242, 58, .08);
  color: var(--acc);
  border-left-color: var(--acc);
}

.adm-tab-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: .75;
}

/* ── Sidebar footer ── */
.adm-sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.adm-steam-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  word-break: break-all;
  line-height: 1.4;
}

.adm-shop-link {
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--mono);
  transition: color var(--tr);
}
.adm-shop-link:hover { color: var(--acc); }

/* ── Content area ── */
.adm-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: var(--bg);
}

/* Panes */
.adm-pane      { padding: 28px; max-width: 1100px; }
.adm-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.adm-pane-title { font-family: var(--mono); font-size: 13px; letter-spacing: 2px; color: var(--acc); text-transform: uppercase; }

/* Data tables — zebra rows + rounded header */
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--dim);
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border2);
  background: var(--panel2);
}
.adm-table th:first-child { border-radius: var(--r-xs) 0 0 0; }
.adm-table th:last-child  { border-radius: 0 var(--r-xs) 0 0; }
.adm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--txt);
}
.adm-table tr:nth-child(even) td { background: rgba(22, 27, 34, .55); }
.adm-table tr:hover td { background: var(--panel2); }

.adm-catalog-section { margin-bottom: 28px; }

.adm-section-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--acc2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Table cell utility classes */
.adm-mono  { font-family: var(--mono); font-size: 12px; }
.adm-dim   { color: var(--dim); }
.adm-small { font-size: 12px; }
.adm-price { font-family: var(--mono); color: var(--acc); font-weight: 700; }
.adm-actions { display: flex; gap: 6px; white-space: nowrap; }
.adm-err     { color: var(--danger); }
.adm-empty   { color: var(--dim); font-size: 13px; padding: 24px 0; }
.adm-hint    { color: var(--dim); font-size: 13px; }

/* Order status pills */
.adm-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
}
.adm-status-paid    { background: rgba(52, 211, 153, .15);  color: var(--acc2); }
.adm-status-pending { background: rgba(174, 242, 58, .10);  color: var(--acc);  }
.adm-status-failed  { background: rgba(248, 113, 113, .15); color: var(--danger); }

/* Product badge (catalog table cell) */
.adm-badge {
  background: var(--acc-grad);
  color: #0e1116;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
}

/* Admin action buttons */
.adm-btn-acc {
  background: var(--acc-grad);
  color: #0e1116;
  border: none;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: .5px;
  cursor: pointer;
  transition: opacity var(--tr), box-shadow var(--tr);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.adm-btn-acc:hover { opacity: .9; box-shadow: 0 0 14px rgba(174, 242, 58, .25); }

.adm-btn-dim {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--dim);
  padding: 8px 18px;
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
  letter-spacing: .5px;
  transition: border-color var(--tr), color var(--tr), background var(--tr);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.adm-btn-dim:hover { border-color: var(--acc); color: var(--txt); background: var(--panel2); }

.adm-btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--dim);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.adm-btn-ghost:hover { color: var(--acc); border-color: var(--acc); background: var(--panel2); }

.adm-btn-danger {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--danger);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
}
.adm-btn-danger:hover { border-color: var(--danger); background: rgba(248, 113, 113, .08); }

/* Inline status messages */
.adm-msg {
  font-size: 12px;
  font-family: var(--mono);
  padding: 7px 14px;
  border-left: 3px solid var(--border2);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
.adm-msg-err { border-left-color: var(--danger); color: var(--danger); background: rgba(248, 113, 113, .06); }
.adm-msg-ok  { border-left-color: var(--acc2);   color: var(--acc2);   background: rgba(52, 211, 153, .06); }


/* ════════════════════════════════════════════════════════
   19. FORMS & INPUTS
════════════════════════════════════════════════════════ */
.adm-form-panel {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-top: 20px;
}

.adm-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.adm-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--dim);
  text-transform: uppercase;
  font-family: var(--mono);
}

.adm-input {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  color: var(--txt);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  font-family: var(--font);
  transition: border-color var(--tr), box-shadow var(--tr);
  width: 100%;
}
.adm-input:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(174, 242, 58, .08);
}
.adm-input[disabled] { opacity: .5; cursor: not-allowed; }

/* Grants sub-section */
.adm-grants-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.adm-grants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.adm-grant-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.adm-grant-row .adm-input { flex: 1; }
.adm-grant-row.dragging   { opacity: .4; }

.adm-form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Player avatars */
.adm-ava {
  width: 32px;
  height: 32px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border2);
  display: block;
}

.adm-ava-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--dim);
  font-size: 14px;
  border-radius: var(--r-xs);
}

/* Settings */
.adm-settings-form { max-width: 480px; }
.adm-check-row     { display: flex; align-items: center; gap: 10px; }

/* Sections editor */
.adm-sec-block {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
}

.adm-filters-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.adm-filter-chip {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.adm-chip-x {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1;
}

/* Drag & drop */
.adm-drag-handle          { cursor: grab; color: var(--dim); user-select: none; text-align: center; font-size: 15px; }
.adm-prod-row.dragging    { opacity: .4; }
.adm-prod-row.drag-over   { outline: 1px dashed var(--acc); outline-offset: -2px; }

/* Image upload */
.adm-upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.adm-icon-preview {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--panel2);
}

#prizesTable .adm-input { font-size: 12px; padding: 5px 7px; }


/* ════════════════════════════════════════════════════════
   20. RESPONSIVE
════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Header */
  header      { padding: 0 14px; height: 54px; }
  .header-nav { display: none; }
  .slogan     { display: none; }

  /* Hero */
  .hero        { padding: 40px 16px 32px; }
  .hero-title  { font-size: 36px; letter-spacing: 4px; }
  .hero-slogan { letter-spacing: 4px; }

  /* Shop page */
  .shop-wrap { padding: 14px 14px 48px; }
  .layout    { padding: 14px; }

  /* Category pills — horizontal scrollable, no wrap */
  #sidebar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }
  #sidebar::-webkit-scrollbar { display: none; }

  /* Product grid: 2 columns */
  #grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Cart: full width */
  #cartPanel { width: 100%; right: -100%; }

  /* Admin: sidebar collapses to horizontal scroll strip on mobile */
  .adm-layout { flex-direction: column; }

  .adm-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .adm-sidebar-brand { padding: 12px 14px 10px; }

  .adm-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .adm-nav::-webkit-scrollbar { display: none; }

  .adm-tab {
    flex-shrink: 0;
    width: auto;
    border-left: none !important;
    border-bottom: 2px solid transparent;
    border-radius: var(--r-sm);
    padding: 8px 14px;
    font-size: 12px;
  }
  .adm-tab.on {
    border-left: none !important;
    border-bottom-color: var(--acc);
    background: rgba(174, 242, 58, .08);
  }

  .adm-sidebar-foot { flex-direction: row; align-items: center; padding: 10px 14px; gap: 16px; }

  .adm-pane   { padding: 14px; }
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-table  { font-size: 12px; }
  .adm-table th,
  .adm-table td { padding: 7px 8px; }
  .adm-actions  { flex-direction: column; gap: 4px; }

  /* Cases */
  .cases-list      { grid-template-columns: 1fr 1fr; }
  .reel-viewport   { height: 140px; }
  /* keep .reel-item width == JS ITEM_W (160) so the reel lands centered on the prize on mobile too */

  /* Account */
  .acc-stats       { gap: 20px; }
}

@media (max-width: 400px) {
  #grid          { grid-template-columns: 1fr; }
  .cases-list    { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════════════════════
   21. ACCOUNT DASHBOARD (v2 — page-specific additions)
════════════════════════════════════════════════════════ */

/* Two-column dashboard: sticky profile aside + scrolling main */
.acc-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.acc-side { position: sticky; top: 78px; }

/* Profile card */
.profile-card {
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 26px 22px;
}

.profile-ava {
  width: 96px;
  height: 96px;
  border-radius: var(--r);
  border: 2px solid var(--border2);
  object-fit: cover;
  box-shadow: var(--acc-glow);
}

.profile-nick {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: .5px;
}

.profile-steam {
  font-size: 12px;
  color: var(--dim);
  word-break: break-all;
}

.profile-balance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.profile-balance-value {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--acc);
  text-shadow: 0 0 22px rgba(174, 242, 58, .22);
  line-height: 1.1;
}

.profile-topup {
  width: 100%;
  margin-top: 4px;
}

/* Referral block inside profile card */
.profile-ref {
  width: 100%;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.profile-ref-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--dim);
}
.profile-ref-stats b { color: var(--txt); font-family: var(--mono); }

/* Main column section cards */
.acc-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.acc-card-head h3 { margin: 0; }

.acc-count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--acc);
  background: rgba(174, 242, 58, .10);
  border: 1px solid var(--border2);
  border-radius: var(--r-pill);
  padding: 1px 9px;
}

/* Pending items list */
.acc-item-list { display: flex; flex-direction: column; gap: 8px; }

.acc-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}

.acc-item-title { font-size: 13px; color: var(--txt); }

.acc-item-badge {
  color: var(--acc2);
  font-size: 11px;
  font-family: var(--mono);
  border: 1px solid var(--border2);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Orders list */
.acc-order-list { display: flex; flex-direction: column; gap: 8px; }

.acc-order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
}

.acc-order-id   { color: var(--dim); font-size: 12px; flex-shrink: 0; }
.acc-order-items { flex: 1; color: var(--txt); min-width: 0; }
.acc-order-sum  { font-size: 14px; flex-shrink: 0; }

/* Status badges (shared by orders) */
.status-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pending   { background: rgba(251, 191, 36, .14);  color: var(--warning); }
.status-claimed   { background: rgba(96, 165, 250, .14);  color: var(--info); }
.status-delivered { background: rgba(52, 211, 153, .15);  color: var(--acc2); }
.status-failed    { background: rgba(248, 113, 113, .15); color: var(--danger); }

/* Login CTA (logged-out account view) */
.acc-login-cta {
  max-width: 420px;
  margin: 48px auto;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .40);
}
.acc-login-icon { font-size: 40px; }
.acc-login-cta h2 { font-family: var(--mono); letter-spacing: 1px; font-size: 20px; color: var(--txt); }
.acc-login-cta p  { color: var(--dim); font-size: 13px; line-height: 1.6; }
.acc-login-cta .btn { margin-top: 6px; }


/* ════════════════════════════════════════════════════════
   22. CASES (v2 — page-specific additions)
════════════════════════════════════════════════════════ */
.cases-hero { padding: 48px 24px 36px; }

.case-card { position: relative; }

/* Top-corner badges on case cards (override generic .badge palette for free) */
.case-badge-free {
  background: var(--panel2);
  color: var(--acc2);
  border: 1px solid var(--border2);
  text-transform: none;
}
.case-badge-paid { text-transform: none; }


/* ── Responsive (account dashboard collapses to single column) ── */
@media (max-width: 860px) {
  .acc-layout { grid-template-columns: 1fr; }
  .acc-side   { position: static; }
}

@media (max-width: 640px) {
  .acc-order-row { flex-wrap: wrap; }
  .acc-order-items { flex-basis: 100%; order: 3; }
  .cases-hero { padding: 32px 16px 24px; }
}

/* ===== Case contents + drop chances ===== */
.case-contents { max-width: 960px; margin: 28px auto 0; }
.cc-title { font-family: var(--mono); color: var(--acc); font-size: 14px; letter-spacing: 1px; margin-bottom: 14px; text-align: center; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cc-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color var(--tr); }
.cc-item:hover { border-color: var(--border2); }
.cc-ico-wrap { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.cc-icon { max-width: 56px; max-height: 56px; object-fit: contain; }
.cc-emoji { font-size: 34px; line-height: 1; }
.cc-name { font-size: 12px; color: var(--txt); line-height: 1.3; }
.cc-chance { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--acc); }

/* ===== Prize win display (with product photo) ===== */
.prize-win { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.prize-win-ico { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; }
.prize-win-img { max-width: 72px; max-height: 72px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(174,242,58,.35)); }
.prize-win-emoji { font-size: 44px; line-height: 1; }
.prize-win-text { font-family: var(--mono); letter-spacing: 1px; text-align: left; color: var(--dim); font-size: 13px; }

/* ===== Product detail popup ===== */
#productModal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
#productModal.open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.product-modal { position: relative; z-index: 1; width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--border2); border-radius: var(--r); padding: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: pmIn .18s ease; }
@keyframes pmIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 12px; right: 12px; background: var(--panel2); border: 1px solid var(--border2); color: var(--dim); width: 30px; height: 30px; border-radius: var(--r-xs); font-size: 14px; }
.modal-close:hover { color: var(--acc); border-color: var(--acc); }
.pm-img { width: 100%; height: 200px; background: var(--panel2) center/contain no-repeat; border-radius: var(--r-sm); margin-bottom: 14px; }
.pm-badge { display: inline-block; margin-bottom: 8px; }
.pm-title { font-size: 22px; margin-bottom: 8px; }
.pm-desc { color: var(--dim); margin-bottom: 16px; line-height: 1.55; }
.pm-grants-title { font-family: var(--mono); color: var(--acc); font-size: 12px; letter-spacing: 1px; margin-bottom: 8px; }
.pm-grants { list-style: none; margin-bottom: 18px; display: grid; gap: 5px; }
.pm-grants li { font-size: 13px; color: var(--txt); padding: 6px 11px; background: var(--panel2); border-radius: var(--r-xs); border: 1px solid var(--border); }
.pm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding-top: 16px; }
.pm-price { font-size: 24px; }

/* ═══════════ Entrance animations & micro-interactions ═══════════ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popIn    { from { opacity: 0; transform: scale(.95); }       to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }

/* Shop cards — gentle staggered entrance (also on filter/search re-render) */
.card { animation: fadeInUp .30s ease both; }
.card:nth-child(1){animation-delay:.02s} .card:nth-child(2){animation-delay:.05s}
.card:nth-child(3){animation-delay:.08s} .card:nth-child(4){animation-delay:.11s}
.card:nth-child(5){animation-delay:.14s} .card:nth-child(6){animation-delay:.17s}

.case-card        { animation: fadeInUp .32s ease both; }
.dash-card,
.acc-card         { animation: fadeInUp .30s ease both; }
.hero             { animation: fadeInUp .42s ease both; }
.cc-item          { animation: popIn .26s ease both; }
.product-modal,
.prize-win        { /* already animated elsewhere */ }

/* Button press feedback */
.buy:active, .btn:active, #cartBtn:active,
.adm-btn-acc:active, .reel-spin-btn:active { transform: scale(.97); }
.buy, .btn, #cartBtn { transition: transform .12s ease, opacity var(--tr), box-shadow var(--tr), border-color var(--tr), background var(--tr); }

/* Prize win banner pops */
.prize-win { animation: popIn .35s cubic-bezier(.2,.9,.25,1.2) both; }

/* Pill nav + sub-filters fade in */
#sidebar .sec, #sidebar .flt { animation: fadeIn .25s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ═══════════ Page loader ═══════════ */
#pageLoader { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--bg); transition: opacity .42s ease; }
#pageLoader.hide { opacity: 0; pointer-events: none; }
.pl-logo { font-family: var(--mono); font-size: 28px; letter-spacing: 7px; color: var(--acc); text-shadow: 0 0 22px rgba(174,242,58,.4); animation: plPulse 1.4s ease-in-out infinite; }
@keyframes plPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.loader { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--border2); border-top-color: var(--acc); border-right-color: var(--acc2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap { display: flex; justify-content: center; padding: 50px 0; }

.adm-hidden-tag { font-size: 10px; color: var(--dim); border: 1px solid var(--border2); border-radius: 10px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }


/* ════════════════════════════════════════════════════════
   23. POINTS CHIP (Очки Зоны — ОЗ)
════════════════════════════════════════════════════════ */
.points-chip {
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: var(--r-pill);
  color: var(--info);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  letter-spacing: .5px;
  white-space: nowrap;
}

/* Cart pay-by-points button — hidden by default; JS reveals for points carts */
.cart-pay-points { display: none; }

/* ===== Account: PDA stats ===== */
.pda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.pda-tile { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 12px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.pda-val { font-family: var(--mono); font-size: 22px; color: var(--acc); font-weight: 700; line-height: 1.1; }
.pda-label { font-size: 11px; color: var(--dim); }

/* ═══════════ Home champions banners ═══════════ */
.banners { max-width: 1280px; margin: 48px auto 28px; padding: 0 24px; }
.banners-title { font-family: var(--mono); color: var(--acc); letter-spacing: 2px; font-size: 18px; margin-bottom: 16px; text-shadow: 0 0 12px rgba(174,242,58,.25); }
.banners-stage { position: relative; height: 188px; }
.banner {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 26px; padding: 0 40px; overflow: hidden;
  background: linear-gradient(120deg, #16240f 0%, var(--panel) 62%); border: 1px solid var(--border2);
  border-radius: var(--r); box-shadow: 0 8px 30px rgba(0,0,0,.45);
  opacity: 0; transform: translateX(24px); transition: opacity .5s ease, transform .5s ease; pointer-events: none;
}
.banner.on { opacity: 1; transform: none; pointer-events: auto; }
.banner-emoji-bg { position: absolute; right: 8px; bottom: -34px; font-size: 180px; opacity: .06; line-height: 1; pointer-events: none; }
.banner-ava { width: 104px; height: 104px; border-radius: 50%; border: 2px solid var(--acc); object-fit: cover; box-shadow: var(--acc-glow); flex-shrink: 0; }
.banner-emoji { width: 104px; height: 104px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 52px; background: var(--panel2); border: 2px solid var(--acc); flex-shrink: 0; box-shadow: var(--acc-glow); }
.banner-text { display: flex; flex-direction: column; gap: 6px; z-index: 1; min-width: 0; }
.banner-title { font-family: var(--mono); color: var(--acc); letter-spacing: 2px; font-size: 13px; text-shadow: 0 0 12px rgba(174,242,58,.3); }
.banner-name { font-size: 30px; font-weight: 800; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-sub { color: var(--dim); font-size: 15px; }
@media (max-width: 640px) {
  .banners { margin: 20px auto; }
  .banners-stage { height: 150px; }
  .banner { padding: 0 18px; gap: 14px; }
  .banner-ava, .banner-emoji { width: 72px; height: 72px; font-size: 34px; }
  .banner-name { font-size: 22px; }
  .banner-title { font-size: 11px; }
}

/* ═══════════ Legends of the Zone (champions row) ═══════════ */
.legends { max-width: 1200px; margin: 30px auto 0; padding: 0 24px; }
.legends-head { margin-bottom: 14px; }
.legends-title { font-family: var(--mono); color: var(--acc); letter-spacing: 2px; font-size: 15px; text-shadow: 0 0 12px rgba(174,242,58,.25); }
.legends-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.legend-card { position: relative; flex: 0 0 230px; background: linear-gradient(150deg, #16240f 0%, var(--panel) 65%); border: 1px solid var(--border2); border-radius: var(--r); padding: 18px 16px; overflow: hidden; transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr); }
.legend-card:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: var(--acc-glow); }
.legend-emoji-bg { position: absolute; right: -10px; bottom: -28px; font-size: 120px; opacity: .07; line-height: 1; pointer-events: none; }
.legend-ava { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--acc); object-fit: cover; box-shadow: var(--acc-glow); margin-bottom: 10px; }
.legend-emoji { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--panel2); border: 2px solid var(--acc); margin-bottom: 10px; }
.legend-cap { font-family: var(--mono); color: var(--acc); font-size: 11px; letter-spacing: 1px; line-height: 1.3; min-height: 2.4em; }
.legend-name { font-size: 18px; font-weight: 800; margin: 4px 0 2px; position: relative; z-index: 1; }
.legend-sub { color: var(--dim); font-size: 13px; position: relative; z-index: 1; }
@media (max-width: 640px) { .legends { padding: 0 12px; margin-top: 20px; } .legend-card { flex-basis: 200px; } }

/* ═══════════ Leaders page ═══════════ */
.leaders-page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.leaders-h1 { font-family: var(--mono); letter-spacing: 2px; font-size: 22px; color: var(--acc); margin-bottom: 22px; }
.leaders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lb-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 16px 10px; }
.lb-head { font-weight: 700; font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.lb-emoji { font-size: 20px; }
.lb-sub { color: var(--dim); font-size: 12px; font-weight: 400; margin-left: auto; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; }
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-pos { width: 22px; text-align: center; font-family: var(--mono); color: var(--dim); font-size: 13px; flex-shrink: 0; }
.lb-ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border2); flex-shrink: 0; }
.lb-ava-ph { display: flex; align-items: center; justify-content: center; background: var(--panel2); font-size: 16px; }
.lb-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { font-family: var(--mono); color: var(--acc); font-weight: 700; }
.lb-rank-1 { background: linear-gradient(90deg, rgba(255,211,77,.14), transparent); border-radius: var(--r-xs); }
.lb-rank-1 .lb-pos { color: #ffd34d; font-weight: 700; }
.lb-rank-1 .lb-ava { border-color: #ffd34d; }
.lb-rank-2 .lb-pos { color: #cdd6e0; font-weight: 700; }
.lb-rank-3 .lb-pos { color: #e0a36a; font-weight: 700; }

/* ═══════════ Account: per-category leader crown on PDA tiles ═══════════ */
.profile-card { position: relative; }
.pda-tile { position: relative; }
.pda-tile-lead { border-color: #ffd34d; background: linear-gradient(160deg, rgba(255,211,77,.12), var(--panel2)); box-shadow: 0 0 16px rgba(255,211,77,.18); }
.pda-tile-lead .pda-val { color: #ffd34d; }
.pda-crown { position: absolute; top: -12px; right: -8px; font-size: 22px; transform: rotate(16deg); filter: drop-shadow(0 2px 5px rgba(0,0,0,.55)); }

/* ═══════════ Faction badges ═══════════ */
.fac-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600; vertical-align: middle; white-space: nowrap;
  color: var(--fc, #aaa);
  border: 1px solid color-mix(in srgb, var(--fc, #888) 55%, transparent);
  background: color-mix(in srgb, var(--fc, #888) 16%, transparent);
}
.profile-faction { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.profile-faction .fac-badge { margin-left: 0; font-size: 12px; padding: 2px 10px; }
.profile-role { font-size: 11px; color: var(--dim); }
.profile-lead .dash-card-label { color: #ffd34d; }

/* ═══════════ Multi-currency buy buttons (₽ green, ОЗ blue, ОЛ yellow) ═══════════ */
.card-buys { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-buys .buy { flex: 0 1 auto; white-space: nowrap; }
/* `.buy.buy-*` (2 classes) outranks `button.buy` so each currency keeps its own colour. */
.buy.buy-balance { background: #2ea043; border-color: #2ea043; color: #fff; }
.buy.buy-balance:hover { background: #36c24f; }
.buy.buy-points { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.buy.buy-points:hover { background: #3f7fff; }
.buy.buy-lead { background: linear-gradient(135deg, #ffd34d, #e0a800); border-color: #ffd34d; color: #2a2200; }
.buy.buy-lead:hover { filter: brightness(1.08); }
/* Price text colours by currency (cart lines / totals) */
.cur-balance { color: #3fbf57; }
.cur-points  { color: #4a9bff; }
.cur-lead    { color: #ffd34d; }

/* ═══════════ Zone control (capture points) ═══════════ */
.zone-control { max-width: 1280px; margin: 40px auto 8px; padding: 0 24px; }
.zc-head { margin-bottom: 16px; }
.zc-title { font-family: var(--mono); color: var(--acc); letter-spacing: 2px; font-size: 18px; text-shadow: 0 0 12px rgba(174,242,58,.25); }
.zc-sub { color: var(--dim); font-size: 13px; margin-top: 4px; }
.zc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.zc-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); }
.zc-card-held { border-color: color-mix(in srgb, var(--fc) 55%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--fc) 13%, var(--panel)), var(--panel)); }
.zc-flag { font-size: 22px; flex-shrink: 0; }
.zc-info { flex: 1; min-width: 0; }
.zc-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-owner { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--fc, #aaa); }
.zc-free { color: var(--dim); font-weight: 400; }
.zc-sched { font-family: var(--mono); font-size: 11px; color: var(--dim); flex-shrink: 0; text-align: right; line-height: 1.4; }
@media (max-width: 640px) { .zone-control { padding: 0 14px; } .zc-grid { grid-template-columns: 1fr; } }

/* ═══════════ Zone control page (/zone) ═══════════ */
.zone-page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.zone-h1 { font-family: var(--mono); letter-spacing: 2px; font-size: 22px; color: var(--acc); margin-bottom: 14px; text-shadow: 0 0 12px rgba(174,242,58,.25); }
.zone-h2 { font-size: 16px; margin: 30px 0 14px; color: var(--txt); }
.zone-intro { color: var(--dim); font-size: 14px; line-height: 1.65; max-width: 860px; }
.txt-gold { color: #ffd34d; }
.zone-standings { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.zs-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--fc); border-radius: var(--r); }
.zs-emoji { font-size: 24px; flex-shrink: 0; }
.zs-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-stats { display: flex; flex-direction: column; gap: 2px; font-size: 12px; text-align: right; flex-shrink: 0; }
.zs-pts { color: var(--txt); }
.zs-oz { color: #ffd34d; font-family: var(--mono); }
.zone-points { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.zp-card { padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); }
.zp-held { border-color: color-mix(in srgb, var(--fc) 55%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--fc) 12%, var(--panel)), var(--panel)); }
.zp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zp-flag { font-size: 18px; }
.zp-name { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-type { font-size: 10px; color: var(--dim); border: 1px solid var(--border2); border-radius: 8px; padding: 1px 7px; font-family: var(--mono); flex-shrink: 0; }
.zp-owner-row { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.zp-owner { font-weight: 600; color: var(--fc, #aaa); }
.zp-free { color: var(--dim); font-weight: 400; }
.zp-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dim); }
@media (max-width: 640px) { .zone-page { padding: 20px 14px 50px; } .zone-points, .zone-standings { grid-template-columns: 1fr; } }

/* ═══════════ Leader trader (/trader) ═══════════ */
.trader-page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.trader-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.trader-h1 { font-family: var(--mono); letter-spacing: 2px; font-size: 22px; color: var(--acc); text-shadow: 0 0 12px rgba(174,242,58,.25); }
.trader-h2 { font-size: 16px; margin: 28px 0 14px; }
.trader-purse { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--fc) 50%, transparent); border-radius: var(--r); background: color-mix(in srgb, var(--fc) 10%, var(--panel)); }
.tp-fac { font-size: 12px; color: var(--dim); }
.tp-bal { font-family: var(--mono); font-weight: 700; color: #ffd34d; font-size: 18px; }
.trader-note { color: var(--dim); font-size: 13px; line-height: 1.6; max-width: 760px; margin-top: 8px; }
.trader-locked { margin-top: 18px; padding: 22px; border: 1px solid var(--border2); border-radius: var(--r); background: var(--panel); color: var(--dim); line-height: 1.6; }
.trader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ti-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.ti-img { height: 130px; background: var(--panel2) center/contain no-repeat; }
.ti-body { padding: 12px 14px 8px; flex: 1; }
.ti-title { font-weight: 700; font-size: 15px; }
.ti-desc { color: var(--dim); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.ti-buy { margin: 0 14px 14px; }
.trader-marks { display: flex; flex-direction: column; gap: 8px; }
.mark-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); }
.mark-icon { width: 34px; height: 34px; border-radius: var(--r-xs); background: var(--panel2) center/contain no-repeat; flex-shrink: 0; }
.mark-title { flex: 1; font-weight: 600; font-size: 14px; }
.mark-price { font-family: var(--mono); color: #ffd34d; font-size: 13px; }
.mark-status { font-size: 12px; }
.ms-pending { color: var(--warn, #f0a020); }
.ms-given { color: var(--acc); }

/* Trader метки in account */
.acc-trade-list { display: flex; flex-direction: column; gap: 8px; }
.acc-trade-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.acc-trade-title { flex: 1; font-weight: 600; font-size: 14px; }
.acc-trade-price { font-family: var(--mono); color: #ffd34d; font-size: 13px; }
.acc-trade-status { font-size: 12px; }

/* ═══════════ Factions directory (/factions) ═══════════ */
.factions-page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.fac-h1 { font-family: var(--mono); letter-spacing: 2px; font-size: 22px; color: var(--acc); margin-bottom: 18px; text-shadow: 0 0 12px rgba(174,242,58,.25); }
.fac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: stretch; }
.fac-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--fc); border-radius: var(--r); padding: 18px; }
/* Stats + roster sink to the bottom so cards in a row share height even with short/no description. */
.fac-card .fac-stats { margin-top: auto; }
.fac-head { display: flex; align-items: center; gap: 12px; }
.fac-emoji { font-size: 30px; }
.fac-titles { flex: 1; min-width: 0; }
.fac-name { font-size: 18px; font-weight: 800; }
.fac-count { font-size: 12px; color: var(--dim); }
.fac-info { color: var(--dim); font-size: 13px; line-height: 1.55; margin: 12px 0; }
.fac-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fac-chip { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--border); }
.fac-chip-gold { color: #ffd34d; border-color: rgba(255,211,77,.35); }
.fac-roster { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border); padding-top: 10px; }
.fac-mem { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r-xs); }
.fac-mem-lead { background: linear-gradient(90deg, color-mix(in srgb, var(--fc) 16%, transparent), transparent); }
.fac-mem-ava { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border2); flex-shrink: 0; }
.fac-mem-ph { display: flex; align-items: center; justify-content: center; background: var(--panel2); font-size: 13px; }
.fac-mem-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fac-mem-role { font-size: 11px; color: var(--dim); }
.fac-mem-lead .fac-mem-role { color: #ffd34d; }
.fac-empty { color: var(--dim); font-size: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
@media (max-width: 640px) { .factions-page { padding: 20px 14px 50px; } .fac-grid { grid-template-columns: 1fr; } }

/* Faction roster expand toggle */
.fac-toggle { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 9px 4px; background: none; border: none; border-top: 1px solid var(--border); color: var(--dim); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.fac-toggle:hover { color: var(--txt); }
.fac-toggle-arrow { transition: transform var(--tr); display: inline-block; }
.fac-toggle.open .fac-toggle-arrow { transform: rotate(90deg); }
.fac-card .fac-roster { border-top: none; padding-top: 2px; }

/* Ensure the [hidden] roster actually collapses despite .fac-roster display:flex */
.fac-roster[hidden] { display: none !important; }

/* ═══════════ «Наборы» — large card with a full-body character photo ═══════════ */
/* A pure sets view switches the grid to exactly 3 columns → 3 big cards per row. */
#grid.grid-sets { grid-template-columns: repeat(3, 1fr); }
#grid.grid-sets .card-set { grid-column: auto; }
/* Fallback if a set card appears in a mixed section: span 2 of the normal columns. */
.card-set { grid-column: span 2; }
.card-set .card-img { height: 600px; background-size: contain; background-position: center top; } /* full-height render */
.card-set .card-title { font-size: 17px; padding-top: 14px; }
.card-set .card-desc { font-size: 13px; }
@media (max-width: 900px) { #grid.grid-sets { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  #grid.grid-sets { grid-template-columns: 1fr; }
  .card-set { grid-column: span 2; }
  .card-set .card-img { height: 380px; }
}

/* ═══════════ Admin: trader purchases by player ═══════════ */
.adm-trader-player { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 12px; }
.adm-trader-phead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.adm-trader-ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); }
.adm-trader-player .adm-table { margin: 0; }

/* Account: custom spawn card */
.spawn-body { display: flex; flex-direction: column; gap: 6px; }
.spawn-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.spawn-row + .spawn-row { border-top: 1px solid var(--border); padding-top: 6px; }
.spawn-active { color: var(--acc); font-weight: 600; }
.spawn-frozen { color: #4a9bff; font-weight: 600; }
.spawn-cancel { margin-top: 12px; width: 100%; }

/* ═══════════ Admin: faction text editor ═══════════ */
.adm-fac { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--fc); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 12px; }
.adm-fac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.adm-fac-emoji { width: 60px; text-align: center; }
.adm-fac-label { flex: 1; min-width: 140px; }
.adm-fac-color { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--panel2); cursor: pointer; }
.adm-fac-descr { width: 100%; resize: vertical; font-family: inherit; }
.adm-fac-actions { display: flex; gap: 8px; align-items: center; }

/* Account: promo code redeem */
.promo-row { display: flex; gap: 8px; }
.promo-input { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--border2); border-radius: var(--r-sm); padding: 9px 12px; color: var(--txt); font-family: var(--mono); letter-spacing: 1px; }
.promo-input:focus { border-color: var(--acc); outline: none; }

/* ═══════════ Inline catalog admin (shop page) ═══════════ */
.card-admin { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; background: rgba(14,17,22,.86); border-bottom: 1px solid var(--border); font-size: 11px; }
.card-drag { cursor: grab; color: var(--dim); font-size: 15px; }
.card-vis { display: flex; align-items: center; gap: 5px; color: var(--dim); cursor: pointer; }
.card-hidden { opacity: .5; }
.card-hidden::after { content: 'СКРЫТ'; position: absolute; top: 32px; right: 8px; font-size: 9px; background: #f0a020; color: #1a1a1a; padding: 1px 6px; border-radius: 8px; font-weight: 700; z-index: 2; }
.card.dragging { opacity: .4; outline: 2px dashed var(--acc); }
.card[draggable="true"] { cursor: grab; }
.ctx-menu { position: absolute; z-index: 1000; background: var(--panel); border: 1px solid var(--border2); border-radius: var(--r-sm); box-shadow: 0 12px 44px rgba(0,0,0,.6); padding: 4px; min-width: 190px; }
.ctx-menu button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--txt); padding: 8px 12px; border-radius: var(--r-xs); cursor: pointer; font-size: 13px; }
.ctx-menu button:hover { background: var(--panel2); }

/* Discord button in the header */
.discord-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;background:#5865F2;color:#fff;flex:0 0 auto;transition:transform .12s ease,box-shadow .12s ease,background .12s ease}
.discord-btn:hover{background:#4752c4;transform:translateY(-1px);box-shadow:0 6px 16px rgba(88,101,242,.45)}
.discord-btn svg{display:block}

/* Live server status + game IP (hero) */
.srv-status{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:center;margin-top:18px}
.srv-badge{display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;font-weight:700;font-size:13px;letter-spacing:.02em}
.srv-badge .srv-dot{width:9px;height:9px;border-radius:50%}
.srv-on{background:rgba(174,242,58,.12);color:#aef23a;border:1px solid rgba(174,242,58,.35)}
.srv-on .srv-dot{background:#aef23a;box-shadow:0 0 8px #aef23a;animation:srvPulse 1.8s ease-in-out infinite}
.srv-off{background:rgba(224,122,74,.12);color:#e07a4a;border:1px solid rgba(224,122,74,.35)}
.srv-off .srv-dot{background:#e07a4a}
@keyframes srvPulse{0%,100%{opacity:1}50%{opacity:.35}}
.srv-players{font-size:14px;color:var(--txt)}
.srv-players b{color:#aef23a;font-size:16px}
.srv-ip-box{display:inline-flex;align-items:center;gap:8px;padding:6px 8px 6px 14px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid var(--border)}
.srv-ip-label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--dim)}
.srv-ip{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:14px;font-weight:700;color:#fff}
.srv-copy{padding:6px 12px;border-radius:8px;border:1px solid var(--border);background:var(--acc);color:#0c1208;font-weight:700;cursor:pointer;transition:filter .12s}
.srv-copy:hover{filter:brightness(1.08)}

/* КТ: highlight the next-to-activate capture point */
.zc-card-next{position:relative;border-color:#aef23a !important;box-shadow:0 0 0 1px rgba(174,242,58,.45),0 6px 18px rgba(174,242,58,.18)}
.zc-next-badge{position:absolute;top:-9px;right:10px;background:#aef23a;color:#0c1208;font-size:11px;font-weight:800;letter-spacing:.03em;padding:2px 9px;border-radius:999px}
.zc-soon{color:#aef23a;font-weight:700}

/* «Следующее КТ» hero on the Контроль (/zone) page */
.zone-next{display:flex;flex-direction:column;gap:4px;background:linear-gradient(135deg,rgba(174,242,58,.13),rgba(174,242,58,.03));border:1px solid rgba(174,242,58,.4);border-radius:16px;padding:18px 22px;margin-bottom:22px;box-shadow:0 0 0 1px rgba(174,242,58,.15),0 8px 24px rgba(174,242,58,.10)}
.zn-tag{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#aef23a}
.zn-name{font-size:26px;font-weight:800;color:#fff;line-height:1.15}
.zn-when{font-size:16px;color:var(--txt)}
.zn-when b{color:#fff}
.zn-soon{color:#aef23a;font-weight:700}
.zn-owner{font-size:13px;color:var(--dim);margin-top:2px}

/* КТ tactical map (Контроль page) */
.zone-map{margin-top:8px;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:#0a0f0c;box-shadow:inset 0 0 120px rgba(174,242,58,.05)}
.zmap-svg{display:block;width:100%;height:auto}
.zmap-bg{fill:#0a0f0c}
.zmap-grid line{stroke:rgba(174,242,58,.06);stroke-width:1}
.zmap-n{fill:#aef23a;font-size:18px;font-weight:800;letter-spacing:.12em}
.map-flag{font-size:13px}
.map-lbl{fill:#e8eef0;font-size:15px;font-weight:700;paint-order:stroke;stroke:#0a0f0c;stroke-width:4px}
.map-lbl-next{fill:#aef23a}
.map-next-ring{fill:none;stroke:#aef23a;stroke-width:3;animation:mapPulse 1.6s ease-in-out infinite}
@keyframes mapPulse{0%,100%{opacity:.9}50%{opacity:.25}}
.zmap-legend{display:flex;flex-wrap:wrap;gap:18px;padding:12px 16px;font-size:12px;color:var(--dim);border-top:1px solid var(--border)}
.zmap-legend i{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:6px;vertical-align:middle}
