:root {
  --bg: #05060d;
  --surface: rgba(10, 16, 30, .62);
  --border: rgba(0, 240, 255, .25);
  --text: #d6f7ff;
  --muted: #6b7a99;
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --green: #00ffa3;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; }

body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.8;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0,240,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,.045) 1px, transparent 1px);
  background-size: 42px 42px;
  animation: gridmove 24s linear infinite;
}
@keyframes gridmove { from { background-position:0 0,0 0; } to { background-position:42px 42px,42px 42px; } }

/* neon glows */
body::before {
  content:""; position:fixed; inset:0; z-index:-2; pointer-events:none;
  background:
    radial-gradient(620px circle at 12% 18%, rgba(0,240,255,.14), transparent 42%),
    radial-gradient(620px circle at 88% 82%, rgba(255,43,214,.14), transparent 42%);
  animation: hue 16s ease-in-out infinite alternate;
}
@keyframes hue { from { filter:hue-rotate(0deg); } to { filter:hue-rotate(40deg); } }

/* CRT scanlines */
body::after {
  content:""; position:fixed; inset:0; z-index:9999; pointer-events:none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0, rgba(0,0,0,.16) 1px, transparent 1px, transparent 3px);
  opacity:.35; mix-blend-mode:overlay;
  animation: scan 7s linear infinite;
}
@keyframes scan { from { background-position:0 0; } to { background-position:0 120px; } }

.container { max-width: 1060px; margin: 0 auto; padding: 26px; position: relative; z-index: 1; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  padding: 14px 26px;
  background: rgba(5,8,18,.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,240,255,.08);
}

/* brand + logo */
.brand { display:flex; align-items:center; gap:12px; font-weight:700; letter-spacing:.5px; min-width:0; }
.brand-logo { height:34px; width:auto; display:block; flex:0 0 auto; filter:drop-shadow(0 0 5px rgba(0,240,255,.55)); }
.brand-text { font-family:'Orbitron', sans-serif; font-weight:700; letter-spacing:1px; color:var(--cyan); font-size:17px; display:inline-flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.brand-text .bt-sep { color:var(--border); font-weight:400; }
.brand-text .bt-sub { font-family:'Vazirmatn', sans-serif; font-weight:500; font-size:13px; color:var(--muted); }

.nav { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.nav form { margin:0; }
.nav-link {
  display:inline-flex; align-items:center; gap:7px;
  height:38px; padding:0 14px; border-radius:9px;
  color:var(--muted); text-decoration:none; font-size:14px; font-family:inherit;
  background:transparent; border:1px solid transparent; cursor:pointer; transition:.22s;
  white-space:nowrap;
}
.nav-link i { font-size:14px; }
.nav-link:hover { color:var(--cyan); border-color:var(--border); box-shadow:0 0 14px rgba(0,240,255,.28); }
.nav-link.active { color:var(--cyan); border-color:var(--border); background:rgba(0,240,255,.06); }

/* glass cards with neon corner brackets */
.card {
  position:relative;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 0 0 1px rgba(0,240,255,.04), 0 18px 50px rgba(0,0,0,.5), inset 0 0 30px rgba(0,240,255,.03);
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both;
}
.card::before, .card::after {
  content:""; position:absolute; width:20px; height:20px; pointer-events:none;
}
.card::before { top:-1px; right:-1px; border-top:2px solid var(--cyan); border-right:2px solid var(--cyan); border-top-right-radius:8px; box-shadow:0 0 10px var(--cyan); }
.card::after { bottom:-1px; left:-1px; border-bottom:2px solid var(--pink); border-left:2px solid var(--pink); border-bottom-left-radius:8px; box-shadow:0 0 10px var(--pink); }
@keyframes rise { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }

/* auth */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.auth-card { width:100%; max-width:390px; }
.auth-card h1 { text-align:center; font-size:23px; margin-bottom:6px; text-shadow:0 0 14px rgba(0,240,255,.5); }
.auth-card .sub { text-align:center; color:var(--muted); font-size:13px; margin-bottom:24px; }

/* auth brand (login) */
.auth-brand { display:flex; flex-direction:column; align-items:center; gap:14px; margin-bottom:26px; text-align:center; }
.auth-brand .brand-logo { height:64px; filter:drop-shadow(0 0 10px rgba(0,240,255,.5)); }
.auth-brand .brand-text { justify-content:center; }

/* forms */
.field { margin-bottom:16px; }
label { display:block; font-size:13px; margin-bottom:7px; color:var(--muted); }
input[type=text], input[type=password], input[type=number], select {
  width:100%; padding:12px 14px;
  background:rgba(5,8,18,.7);
  border:1px solid var(--border); border-radius:11px;
  color:var(--text); font-family:inherit; font-size:14px; transition:.2s;
}
input:focus, select:focus {
  outline:none; border-color:var(--cyan);
  box-shadow:0 0 0 3px rgba(0,240,255,.15), 0 0 18px rgba(0,240,255,.25);
}
.checkbox { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); margin-bottom:18px; }
.checkbox input { width:auto; accent-color:var(--cyan); }

/* buttons */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:0 20px; border:1px solid transparent;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  font-family:inherit; font-size:14px; font-weight:700; letter-spacing:.3px;
  color:#04121a; text-decoration:none; cursor:pointer; white-space:nowrap;
  transition:transform .15s, filter .2s;
}
.btn i { font-size:14px; }
.btn:active { transform:scale(.97); }
.btn-primary { background:linear-gradient(135deg, var(--cyan), #38bdf8); }
.btn-primary:hover { filter:drop-shadow(0 0 12px rgba(0,240,255,.85)); transform:translateY(-1px); }
.btn-danger { background:linear-gradient(135deg, var(--pink), #ff5470); color:#1a0410; }
.btn-danger:hover { filter:drop-shadow(0 0 12px rgba(255,43,214,.85)); transform:translateY(-1px); }
.btn-success { background:linear-gradient(135deg, var(--green), var(--cyan)); }
.btn-success:hover { filter:drop-shadow(0 0 12px rgba(0,255,163,.8)); transform:translateY(-1px); }
.btn-ghost { background:rgba(0,240,255,.06); color:var(--cyan); border:1px solid var(--border); }
.btn-ghost:hover { background:rgba(0,240,255,.12); filter:drop-shadow(0 0 8px rgba(0,240,255,.5)); }
.btn-block { width:100%; }
.btn-sm { min-height:38px; padding:0 14px; font-size:13px; }

/* alerts */
.alert { padding:12px 14px; border-radius:11px; font-size:13px; margin-bottom:16px; border:1px solid transparent; animation:rise .4s ease both; }
.alert-success { background:rgba(0,255,163,.1); color:#7dffd0; border-color:rgba(0,255,163,.35); box-shadow:0 0 18px rgba(0,255,163,.12); }
.alert-error { background:rgba(255,43,214,.1); color:#ffaeec; border-color:rgba(255,43,214,.35); box-shadow:0 0 18px rgba(255,43,214,.12); }

/* wallet hero */
.wallet {
  position:relative; overflow:hidden;
  border-radius:18px; padding:30px; margin-bottom:26px;
  background:linear-gradient(135deg, rgba(0,240,255,.18), rgba(255,43,214,.18));
  border:1px solid var(--border);
  box-shadow:0 0 40px rgba(0,240,255,.18), inset 0 0 40px rgba(255,43,214,.08);
  animation: rise .5s ease both, glowpulse 4s ease-in-out infinite;
}
@keyframes glowpulse {
  0%,100% { box-shadow:0 0 40px rgba(0,240,255,.18), inset 0 0 40px rgba(255,43,214,.08); }
  50% { box-shadow:0 0 60px rgba(0,240,255,.32), inset 0 0 50px rgba(255,43,214,.14); }
}
.wallet::after {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size:26px 26px;
}
.wallet .label { display:flex; align-items:center; gap:8px; font-size:13px; opacity:.9; color:var(--cyan); position:relative; z-index:1; }
.wallet .amount { font-family:'Orbitron', monospace; font-size:36px; font-weight:700; margin-top:8px; letter-spacing:1px; position:relative; z-index:1; text-shadow:0 0 18px rgba(0,240,255,.6); word-break:break-word; }

/* stat cards */
.stats-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:0 0 26px; }
.stat-card { display:flex; align-items:center; gap:14px; padding:16px 18px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); backdrop-filter:blur(8px); }
.stat-icon { width:44px; height:44px; flex:0 0 auto; display:grid; place-items:center; border-radius:12px; background:rgba(0,240,255,.08); border:1px solid var(--border); color:var(--cyan); font-size:18px; box-shadow:0 0 12px rgba(0,240,255,.15) inset; }
.stat-label { font-size:12px; color:var(--muted); margin-bottom:4px; }
.stat-value { font-family:'Orbitron', sans-serif; font-weight:700; color:var(--text); font-size:18px; }
.stat-value span { font-size:12px; color:var(--muted); font-family:'Vazirmatn', sans-serif; font-weight:400; }

/* grid */
.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:repeat(2,1fr); }

/* table */
.table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:var(--radius); border:1px solid var(--border); box-shadow:0 0 26px rgba(0,240,255,.06); }
table { width:100%; border-collapse:collapse; min-width:600px; }
th, td { padding:14px; text-align:right; font-size:13px; border-bottom:1px solid rgba(0,240,255,.1); white-space:nowrap; }
th { background:rgba(0,240,255,.06); color:var(--cyan); font-weight:600; letter-spacing:.4px; }
tbody tr { transition:.18s; }
tbody tr:hover { background:rgba(0,240,255,.05); box-shadow:inset 3px 0 0 var(--cyan); }

/* badges */
.badge { display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px; font-size:12px; border:1px solid transparent; }
.badge-active { background:rgba(0,255,163,.12); color:#7dffd0; border-color:rgba(0,255,163,.4); }
.badge-banned { background:rgba(255,43,214,.12); color:#ffaeec; border-color:rgba(255,43,214,.4); }
.pos { color:var(--green); }
.neg { color:var(--pink); }

.page-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:12px; }
.page-head h1 { font-size:21px; display:flex; align-items:center; gap:10px; text-shadow:0 0 12px rgba(0,240,255,.4); }
.page-head h1 i { color:var(--cyan); }
.section-title { font-size:16px; margin:0 0 14px; display:flex; align-items:center; gap:8px; }
.section-title i { color:var(--cyan); }

/* ===================== RESPONSIVE ===================== */

/* tablet */
@media (max-width:820px) {
  .container { padding:20px; }
}

/* mobile: stack the topbar (brand row + nav row) */
@media (max-width:720px) {
  .topbar { flex-wrap:wrap; gap:10px 12px; padding:12px 16px; }
  .brand { width:100%; }
  .brand-text { font-size:15px; }
  .nav { width:100%; justify-content:flex-start; gap:8px; }
  .nav-link { height:36px; padding:0 12px; }
}

/* standard phones */
@media (max-width:640px) {
  .container { padding:16px; }
  .grid-2 { grid-template-columns:1fr; }
  .stats-row { grid-template-columns:1fr; }
  .wallet { padding:24px; }
  .wallet .amount { font-size:28px; }
  .card { padding:20px; }
  .page-head h1 { font-size:18px; }
  .auth-card h1 { font-size:21px; }
  /* prevent iOS auto-zoom on focus */
  input[type=text], input[type=password], input[type=number], select { font-size:16px; }
}

/* small phones */
@media (max-width:400px) {
  .container { padding:13px; }
  .brand-logo { height:30px; }
  .brand-text { font-size:14px; }
  .brand-text .bt-sub { font-size:11px; }
  .wallet { padding:20px; }
  .wallet .amount { font-size:24px; }
  .nav-link { font-size:13px; padding:0 11px; }
  .btn { font-size:13px; padding:0 16px; }
  .stat-value { font-size:16px; }
}

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