:root {
  --bg0: #06080f;
  --bg1: #121826;
  --ink: #f6f0e6;
  --muted: #b9b1a3;
  --accent: #ff9f43;
  --accent-hot: #ff7a18;
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(10, 14, 22, 0.78);
  --ok: #57f0a5;
  --bad: #ff6d6d;
  --warn: #ffd166;
  --display: 'Oxanium', 'IBM Plex Sans Arabic', 'Vazirmatn', sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Vazirmatn', Tahoma, sans-serif;
}

html { direction: rtl; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 122, 24, 0.18), transparent 55%),
    radial-gradient(900px 500px at -10% 30%, rgba(70, 110, 255, 0.12), transparent 50%),
    var(--bg0);
  overflow-x: hidden;
}

.noise, .scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}
.noise {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.scanline {
  opacity: 0.06;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.28) 2px 3px);
}

.topbar {
  position: fixed;
  top: 0; inset-inline: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  background: linear-gradient(to bottom, rgba(6,8,15,.94), rgba(6,8,15,0));
}
.brand-mark {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-decoration: none;
}
.topbar nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.topbar a, .topbar-actions a {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
}
.topbar a:hover { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  padding: 0 1.35rem 4.4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(145deg, #0a101c 0%, #17130f 48%, #24160c 100%);
  animation: drift 16s ease-in-out infinite alternate;
}
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(6,8,15,.96) 6%, rgba(6,8,15,.25) 55%, rgba(6,8,15,.2)),
    repeating-linear-gradient(118deg, transparent 0 20px, rgba(255,159,67,.04) 20px 21px);
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; animation: rise .9s ease both; }
.brand-lock {
  font-family: var(--display);
  letter-spacing: .28em;
  color: var(--accent);
  font-size: .78rem;
  margin-bottom: .8rem;
}
.hero h1, .block h2, .auth-card h1, .section-title, .panel-main h1 {
  font-family: var(--display);
  letter-spacing: .04em;
}
.hero h1 {
  font-size: clamp(3.1rem, 11vw, 6.8rem);
  line-height: .92;
  text-shadow: 0 0 36px rgba(255,122,24,.28);
}
.lede, .block p, .hint {
  color: var(--muted);
  line-height: 1.9;
}
.lede { margin-top: 1.1rem; max-width: 34rem; font-size: 1.05rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.7rem; }

.btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  padding: .82rem 1.2rem;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-hot), var(--accent));
  border-color: transparent;
  color: #1a1006;
}
.btn.ghost { background: rgba(255,255,255,.04); }
.btn.tiny { padding: .4rem .8rem; font-size: .85rem; }

.block { padding: 4.8rem 1.35rem; border-top: 1px solid rgba(255,255,255,.06); }
.block.alt { background: linear-gradient(180deg, rgba(255,122,24,.05), transparent 45%), var(--bg1); }
.block-inner { max-width: 980px; margin: 0 auto; }
.block h2 { font-size: clamp(1.55rem, 4vw, 2.3rem); margin-bottom: .9rem; }

.feature-list { list-style: none; margin-top: 1.8rem; display: grid; gap: .9rem; }
.feature-list li {
  padding-block: .95rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  line-height: 1.7;
}
.feature-list span {
  display: block;
  font-family: var(--display);
  color: var(--accent);
  letter-spacing: .14em;
  font-size: .76rem;
  margin-bottom: .25rem;
}

.rank-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.8rem; }
.rank-strip span {
  font-family: var(--display);
  min-width: 2.9rem;
  text-align: center;
  padding: .65rem .85rem;
  border: 1px solid rgba(255,159,67,.35);
  color: var(--accent);
  background: rgba(255,159,67,.06);
  animation: pulseSoft 3.2s ease-in-out infinite;
}

.connect-line { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.connect-line code {
  padding: .85rem 1rem;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,140,0,.4);
  border-radius: 12px;
  color: #ffd7a8;
  direction: ltr;
}
.hint { margin-top: .7rem; font-size: .92rem; }
.hint[hidden] { display: none !important; }

.players-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem;
}
.status-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); font-size: .9rem;
}
.status-chip .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); }
.status-chip.online .dot { background: var(--ok); animation: ping 2s ease infinite; }
.status-chip.offline .dot { background: var(--bad); }

.players-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem;
}
.players-meta div {
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.players-meta strong {
  display: block; font-family: var(--display); font-size: 1.35rem; color: var(--accent); margin-bottom: .2rem;
}
.players-meta span { color: var(--muted); font-size: .84rem; }

.players-table-wrap { overflow-x: auto; border-top: 1px solid rgba(255,255,255,.08); }
.players-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.players-table th, .players-table td {
  text-align: start; padding: .9rem .35rem;
  border-bottom: 1px solid rgba(255,255,255,.07); font-size: .94rem;
}
.players-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.players-table tbody tr:hover { background: rgba(255,159,67,.06); }

.site-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem;
  padding: 2rem 1.35rem 3rem; border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted); font-size: .9rem;
}
.site-foot strong { font-family: var(--display); color: var(--accent); letter-spacing: .12em; }

.auth-body, .panel-main { padding-top: 5.5rem; }
.auth-main {
  min-height: calc(100vh - 5.5rem);
  display: grid; place-items: center; padding: 1.2rem;
}
.auth-card {
  width: min(440px, 100%);
  padding: 1.6rem;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(10,14,22,.82);
  border-radius: 18px;
  display: grid; gap: .85rem;
}
.auth-card.nested { width: 100%; }
.auth-card label { display: grid; gap: .4rem; color: var(--muted); font-size: .92rem; }
.auth-card input {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35);
  color: var(--ink);
  border-radius: 12px;
  padding: .8rem .9rem;
  font: inherit;
}
.form-msg { color: var(--ok); font-size: .9rem; }
.form-msg.warn { color: var(--warn); }
.form-msg.bad { color: var(--bad); }

/* Login page */
.auth-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.auth-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 85% 10%, rgba(255,122,24,.22), transparent 55%),
    radial-gradient(700px 480px at 5% 80%, rgba(40,70,160,.18), transparent 50%),
    linear-gradient(160deg, #070b14 0%, #12101a 45%, #1a120c 100%);
}
.auth-glow {
  position: absolute;
  inset: 20% 10% auto;
  height: 40%;
  background: radial-gradient(circle, rgba(255,159,67,.14), transparent 70%);
  filter: blur(20px);
  animation: drift 14s ease-in-out infinite alternate;
}
.auth-grid {
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 75%);
}
.auth-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
  padding: 6.5rem 1.5rem 2.5rem;
  max-width: 1080px;
  margin: 0 auto;
}
.auth-visual h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  line-height: .95;
  letter-spacing: .04em;
  text-shadow: 0 0 40px rgba(255,122,24,.25);
}
.auth-visual .lede { max-width: 28rem; }
.login-panel {
  width: min(420px, 100%);
  justify-self: end;
  padding: 1.7rem 1.5rem 1.5rem;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8,12,20,.78);
  backdrop-filter: blur(10px);
  border-radius: 22px;
  display: grid;
  gap: .85rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: rise .7s ease both;
}
.login-kicker {
  font-family: var(--display);
  color: var(--accent);
  letter-spacing: .22em;
  font-size: .72rem;
}
.login-panel h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  margin: 0;
}
.login-sub, .login-foot {
  color: var(--muted);
  line-height: 1.8;
  font-size: .92rem;
}
.field { display: grid; gap: .4rem; color: var(--muted); font-size: .92rem; }
.field input {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.38);
  color: var(--ink);
  border-radius: 12px;
  padding: .9rem 1rem;
  font: inherit;
  direction: rtl;
}
.field input:focus {
  outline: none;
  border-color: rgba(255,159,67,.7);
  box-shadow: 0 0 0 3px rgba(255,159,67,.12);
}
.login-submit { width: 100%; margin-top: .25rem; text-align: center; }

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.6rem 0 2rem;
}
.wallet-grid div {
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.wallet-grid span { color: var(--muted); font-size: .85rem; }
.wallet-grid strong {
  display: block; margin-top: .35rem;
  font-family: var(--display); color: var(--accent); font-size: 1.15rem;
}
.money-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-title { margin: 1.5rem 0 1rem; font-size: 1.3rem; }

@keyframes drift {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to { transform: scale(1.08) translate3d(-1.5%, 1%, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseSoft {
  0%,100% { opacity: .7; } 50% { opacity: 1; }
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(87,240,165,.5); }
  70% { box-shadow: 0 0 0 8px rgba(87,240,165,.0); }
  100% { box-shadow: 0 0 0 0 rgba(87,240,165,0); }
}

@media (max-width: 820px) {
  .money-forms, .wallet-grid, .players-meta { grid-template-columns: 1fr; }
  .topbar nav { display: none; }
  .auth-shell {
    grid-template-columns: 1fr;
    padding-top: 5.5rem;
  }
  .login-panel { justify-self: stretch; }
  .auth-visual { order: -1; }
}
