@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:      #0c0a1a;
  --surface: #12102a;
  --card:    #1a1535;
  --card2:   #211c40;
  --border:  #2d2655;
  --primary: #8b5cf6;
  --primary2:#7c3aed;
  --accent:  #e879f9;
  --gold:    #f59e0b;
  --green:   #22c55e;
  --red:     #ef4444;
  --text:    #e2d9f3;
  --sub:     #9d8ec4;
  --dim:     #5c5280;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
#particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12,10,26,.88); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; display: flex; align-items: center; gap: 2rem; height: 64px;
}
.nav-logo { font-family: 'Press Start 2P', monospace; font-size: .7rem; color: var(--primary); text-decoration: none; letter-spacing: 1px; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.nav-logo .accent { color: var(--accent); }
.nav-links { display: flex; gap: .25rem; flex: 1; }
.nav-links a { color: var(--sub); text-decoration: none; padding: .5rem .9rem; border-radius: 8px; font-size: .85rem; font-weight: 500; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--card); }
.nav-right { display: flex; align-items: center; gap: .75rem; }
.nav-search { display: flex; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0 .8rem; gap: .5rem; position: relative; }
.nav-search input { background: none; border: none; outline: none; color: var(--text); font-size: .875rem; width: 180px; padding: .5rem 0; }
.nav-search input::placeholder { color: var(--dim); }

/* HERO */
.hero { position: relative; z-index: 1; text-align: center; padding: 6rem 2rem 4rem; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; background: rgba(139,92,246,.15); border: 1px solid rgba(139,92,246,.3); border-radius: 999px; padding: .35rem 1rem; font-size: .75rem; color: var(--primary); margin-bottom: 1.5rem; }
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; display: inline-block; }
.hero h1 { font-family: 'Press Start 2P', monospace; font-size: clamp(1.1rem, 3.5vw, 2.2rem); line-height: 1.7; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 1rem; }
.hero p { color: var(--sub); font-size: 1rem; max-width: 520px; margin: 0 auto 2.5rem; line-height: 1.7; }

/* SEARCH */
.search-wrap { position: relative; max-width: 520px; margin: 0 auto 1rem; }
.search-wrap input { width: 100%; padding: 1rem 3.5rem 1rem 1.2rem; background: var(--card); border: 1px solid var(--border); border-radius: 14px; color: var(--text); font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,.2); }
.search-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; font-size: 1.1rem; }
.search-dropdown { position: absolute; top: calc(100% + .4rem); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; z-index: 50; display: none; box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.search-dropdown.open { display: block; }
.search-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; cursor: pointer; transition: background .15s; text-decoration: none; color: inherit; }
.search-item:hover { background: var(--card2); }
.search-item img { width: 32px; height: 32px; border-radius: 4px; image-rendering: pixelated; }
.si-name { font-weight: 600; font-size: .9rem; }
.si-stats { font-size: .75rem; color: var(--sub); }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; max-width: 900px; margin: 0 auto 4rem; padding: 0 1.5rem; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem 1.2rem; text-align: center; position: relative; overflow: hidden; transition: border-color .2s, transform .2s; }
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(139,92,246,.08) 0%, transparent 60%); pointer-events: none; }
.sc-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.sc-value { font-family: 'Press Start 2P', monospace; font-size: 1.1rem; color: var(--primary); margin-bottom: .3rem; }
.sc-label { font-size: .73rem; color: var(--sub); }

/* SECTIONS */
.section { max-width: 1100px; margin: 0 auto 3rem; padding: 0 1.5rem; }
.section-title { font-family: 'Press Start 2P', monospace; font-size: .82rem; color: var(--text); margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.card-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; overflow: auto; }

/* TABLE */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; padding: .75rem 1rem; font-size: .68rem; color: var(--sub); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lb-table td { padding: .8rem 1rem; font-size: .875rem; }
.lb-table tr:not(:last-child) td { border-bottom: 1px solid rgba(45,38,85,.5); }
.lb-table tr:hover td { background: rgba(139,92,246,.05); }
.lb-rank { font-weight: 700; color: var(--dim); min-width: 48px; }
.rank-1 { color: var(--gold) !important; }
.rank-2 { color: #94a3b8 !important; }
.rank-3 { color: #cd7c39 !important; }
.player-cell { display: flex; align-items: center; gap: .6rem; }
.player-cell img { width: 24px; height: 24px; border-radius: 3px; image-rendering: pixelated; }
.player-cell a { color: var(--text); text-decoration: none; font-weight: 600; }
.player-cell a:hover { color: var(--primary); }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 6px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.badge-red    { background: rgba(239,68,68,.15);  color: var(--red); }
.badge-green  { background: rgba(34,197,94,.15);  color: var(--green); }
.badge-purple { background: rgba(139,92,246,.15); color: var(--primary); }
.badge-gold   { background: rgba(245,158,11,.15); color: var(--gold); }
.badge-gray   { background: rgba(92,82,128,.2);   color: var(--sub); }

/* TABS */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab { padding: .5rem 1.1rem; border-radius: 9px; border: 1px solid var(--border); background: var(--card); color: var(--sub); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.tab:hover { color: var(--text); border-color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* PROFILE */
.profile-header { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 2rem; display: flex; align-items: center; gap: 2rem; margin-bottom: 1.5rem; position: relative; overflow: hidden; }
.profile-header::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(139,92,246,.12), transparent 60%); pointer-events: none; }
.profile-skin-wrap { position: relative; flex-shrink: 0; }
.profile-skin { width: 80px; height: 80px; image-rendering: pixelated; border-radius: 10px; display: block; }
.profile-info { position: relative; }
.profile-name { font-family: 'Press Start 2P', monospace; font-size: .95rem; margin-bottom: .5rem; line-height: 1.5; }
.profile-sub { color: var(--sub); font-size: .85rem; margin-bottom: .5rem; }
.profile-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.profile-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.pstat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1rem; text-align: center; transition: border-color .2s; }
.pstat:hover { border-color: var(--primary); }
.pstat .val { font-family: 'Press Start 2P', monospace; font-size: .85rem; color: var(--primary); margin-bottom: .3rem; }
.pstat .lbl { font-size: .7rem; color: var(--sub); }

/* BANS */
.bans-list { display: flex; flex-direction: column; gap: .75rem; }
.ban-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: 1rem; transition: border-color .2s; }
.ban-card:hover { border-color: rgba(239,68,68,.35); }
.ban-card img { width: 40px; height: 40px; border-radius: 6px; image-rendering: pixelated; flex-shrink: 0; }
.ban-info { flex: 1; min-width: 0; }
.ban-name { font-weight: 700; font-size: .9rem; }
.ban-reason { font-size: .78rem; color: var(--sub); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ban-meta { font-size: .7rem; color: var(--dim); margin-top: .3rem; }
.ban-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex-shrink: 0; }

/* PAGINATION */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pg-btn { padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--sub); cursor: pointer; font-size: .8rem; transition: all .2s; }
.pg-btn:hover { border-color: var(--primary); color: var(--text); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ADMIN */
.admin-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; position: relative; z-index: 1; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem 2rem; width: 100%; max-width: 380px; text-align: center; }
.login-card h2 { font-family: 'Press Start 2P', monospace; font-size: .82rem; margin-bottom: 1.5rem; color: var(--primary); line-height: 1.7; }
.login-logo { font-size: 2.5rem; margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { font-size: .75rem; color: var(--sub); display: block; margin-bottom: .35rem; font-weight: 500; }
.form-group input { width: 100%; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: .9rem; outline: none; transition: border-color .2s; font-family: inherit; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.5rem; border-radius: 10px; font-weight: 600; font-size: .875rem; cursor: pointer; border: none; transition: all .2s; text-decoration: none; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary2); transform: translateY(-1px); }
.btn-full { width: 100%; }
.error-msg { color: var(--red); font-size: .78rem; margin-top: .6rem; min-height: 1rem; }

/* ADMIN DASHBOARD */
.admin-nav { background: var(--surface); border-right: 1px solid var(--border); width: 220px; min-height: 100vh; padding: 1.5rem 1rem; position: fixed; left: 0; top: 0; }
.admin-content { margin-left: 220px; padding: 2rem; min-height: 100vh; }
.admin-nav .admin-logo { font-family: 'Press Start 2P', monospace; font-size: .65rem; color: var(--primary); margin-bottom: 2rem; line-height: 1.8; padding: 0 .5rem; }
.admin-menu a { display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; border-radius: 8px; color: var(--sub); text-decoration: none; font-size: .82rem; font-weight: 500; transition: all .2s; margin-bottom: .2rem; }
.admin-menu a:hover, .admin-menu a.active { background: var(--card); color: var(--text); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.3rem; }
.admin-card h4 { font-size: .72rem; color: var(--sub); margin-bottom: .5rem; font-weight: 500; }
.admin-card .big { font-family: 'Press Start 2P', monospace; font-size: 1.3rem; color: var(--primary); }

/* UTILS */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.loading { display: flex; align-items: center; justify-content: center; gap: .75rem; color: var(--sub); padding: 3rem; font-size: .85rem; }
.loading::before { content: ''; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
.not-found { text-align: center; padding: 4rem 2rem; color: var(--sub); }
.not-found .nf-icon { font-size: 3rem; margin-bottom: 1rem; }
.not-found h3 { font-family: 'Press Start 2P', monospace; font-size: .82rem; margin-bottom: .75rem; color: var(--text); }
footer { text-align: center; padding: 2rem; color: var(--dim); font-size: .75rem; border-top: 1px solid var(--border); margin-top: 4rem; }
footer a { color: var(--sub); text-decoration: none; }
footer a:hover { color: var(--primary); }

/* ANIMATIONS */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:none} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.fade-up { animation: fadeUp .55s ease forwards; opacity: 0; }
.float { animation: float 4s ease-in-out infinite; }

/* RESPONSIVE */
@media(max-width:768px){
  nav { padding: 0 1rem; gap: .75rem; }
  .nav-links { display: none; }
  .nav-search input { width: 120px; }
  .hero { padding: 3.5rem 1rem 2rem; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-badges { justify-content: center; }
  .admin-nav { display: none; }
  .admin-content { margin-left: 0; }
}
