/* ─── Crux Gaming — Global Styles ───────────────────────────────────────── */
:root {
  --bg:       #0a0a0f;
  --bg2:      #12121a;
  --bg3:      #1a1a26;
  --card:     #16162050;
  --border:   #2a2a40;
  --green:    #00ff88;
  --purple:   #7c3aed;
  --orange:   #ff6b35;
  --blue:     #3b82f6;
  --red:      #ef4444;
  --text:     #e2e8f0;
  --muted:    #6b7280;
  --font:     'Rajdhani', 'Segoe UI', sans-serif;
  --mono:     'Share Tech Mono', 'Courier New', monospace;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0,255,136,.08);
  --glow:     0 0 20px rgba(0,255,136,.25);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ─── Typography ─── */
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: .5px; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
a { color: var(--green); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }
p { color: var(--muted); }

/* ─── Layout ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title span { color: var(--green); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }

/* ─── Navbar ─── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: .8rem 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-brand { font-size: 1.5rem; font-weight: 900; color: var(--green); font-family: var(--mono); letter-spacing: 2px; }
.nav-brand span { color: var(--purple); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: 1px; padding: .3rem 0; border-bottom: 2px solid transparent; transition: all .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--green); border-bottom-color: var(--green); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.nav-cart { position: relative; }
.nav-cart .badge { position: absolute; top: -6px; right: -6px; background: var(--orange); color: #fff; font-size: .65rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: .5rem; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.4rem; border-radius: var(--radius); font-weight: 700;
  font-size: .9rem; cursor: pointer; border: none; transition: all .2s; text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary { background: var(--green); color: #0a0a0f; }
.btn-primary:hover { box-shadow: var(--glow); transform: translateY(-1px); color: #0a0a0f; }
.btn-secondary { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-secondary:hover { background: var(--green); color: #0a0a0f; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #6d28d9; color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #e55a2b; color: #fff; }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

/* ─── Cards ─── */
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: rgba(0,255,136,.3); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text); }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: .4rem; font-size: .85rem; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: .5px; }
.form-control {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: .7rem 1rem; border-radius: 8px; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s; font-family: var(--font);
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,255,136,.1); }
.form-control::placeholder { color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; cursor: pointer; }
.form-error { color: var(--red); font-size: .8rem; margin-top: .3rem; }
.form-hint  { color: var(--muted); font-size: .8rem; margin-top: .3rem; }

/* ─── Alerts ─── */
.alert { padding: .9rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.alert-success { background: rgba(0,255,136,.1); border: 1px solid rgba(0,255,136,.3); color: var(--green); }
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: var(--red); }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: var(--blue); }
.alert-warning { background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.3); color: var(--orange); }

/* ─── Badge ─── */
.badge-pill { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge-green  { background: rgba(0,255,136,.15); color: var(--green); }
.badge-purple { background: rgba(124,58,237,.2); color: #a78bfa; }
.badge-orange { background: rgba(255,107,53,.15); color: var(--orange); }
.badge-red    { background: rgba(239,68,68,.15);  color: var(--red); }
.badge-blue   { background: rgba(59,130,246,.15); color: var(--blue); }

/* ─── Product Card ─── */
.product-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .25s; }
.product-card:hover { border-color: rgba(0,255,136,.4); transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card .thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg3); display: block; }
.product-card .thumb-placeholder { width: 100%; aspect-ratio: 4/3; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.product-card .info { padding: 1rem; }
.product-card .title { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .price { color: var(--green); font-size: 1.1rem; font-weight: 700; }
.product-card .compare { color: var(--muted); font-size: .85rem; text-decoration: line-through; margin-left: .5rem; }
.product-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: .75rem; }

/* ─── Post Card ─── */
.post-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.post-card .author { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.post-card .author .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: #0a0a0f; flex-shrink: 0; }
.post-card .author img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.post-card .author .name { font-weight: 700; font-size: .9rem; }
.post-card .author .time { font-size: .75rem; color: var(--muted); }
.post-card .post-title { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.post-card .post-body { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.post-card .actions { display: flex; align-items: center; gap: 1.5rem; }
.post-card .action-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .85rem; display: flex; align-items: center; gap: .4rem; transition: color .2s; }
.post-card .action-btn:hover, .post-card .action-btn.liked { color: var(--green); }

/* ─── Tournament Card ─── */
.tournament-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.tournament-card .banner { width: 100%; height: 140px; object-fit: cover; background: linear-gradient(135deg, var(--purple), #1a0a2e); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.tournament-card .info { padding: 1.25rem; }
.tournament-card .game { color: var(--purple); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.tournament-card .prize { color: var(--green); font-size: 1.4rem; font-weight: 900; }
.tournament-status { position: absolute; top: 1rem; right: 1rem; }

/* ─── Leaderboard ─── */
.lb-row { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); transition: background .2s; }
.lb-row:hover { background: rgba(0,255,136,.03); }
.lb-rank { width: 32px; font-weight: 900; font-size: 1.1rem; font-family: var(--mono); text-align: center; }
.lb-rank.gold   { color: #fbbf24; }
.lb-rank.silver { color: #9ca3af; }
.lb-rank.bronze { color: #d97706; }
.lb-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.lb-name { flex: 1; font-weight: 700; }
.lb-score { font-family: var(--mono); color: var(--green); font-weight: 700; }

/* ─── Café station card ─── */
.station-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; transition: all .25s; }
.station-card:hover { border-color: var(--purple); box-shadow: 0 4px 24px rgba(124,58,237,.15); }
.station-card .station-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.station-card .station-name { font-size: 1.1rem; font-weight: 800; margin-bottom: .3rem; }
.station-card .station-rate { color: var(--green); font-size: 1.3rem; font-weight: 700; }
.station-card .station-specs { color: var(--muted); font-size: .8rem; margin: .5rem 0 1rem; }

/* ─── Hero ─── */
.hero { min-height: 92vh; display: flex; align-items: center; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 50%, rgba(124,58,237,.2) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(0,255,136,.1) 0%, transparent 50%); }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,255,136,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,255,136,.04) 1px, transparent 1px); background-size: 60px 60px; }
.hero-content { position: relative; z-index: 1; }
.hero-tag { display: inline-flex; align-items: center; gap: .5rem; background: rgba(0,255,136,.1); border: 1px solid rgba(0,255,136,.2); color: var(--green); padding: .4rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 700; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1px; }
.hero h1 { color: var(--text); margin-bottom: 1rem; }
.hero h1 .accent { color: var(--green); }
.hero .sub { font-size: 1.1rem; color: var(--muted); margin-bottom: 2rem; max-width: 540px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat .num { font-size: 2rem; font-weight: 900; color: var(--green); font-family: var(--mono); }
.hero-stat .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }

/* ─── Page header ─── */
.page-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 2.5rem 0; margin-bottom: 2.5rem; }
.page-header h1 { font-size: 2rem; }
.page-header p { color: var(--muted); margin-top: .3rem; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--green); }

/* ─── Sidebar ─── */
.sidebar-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }
.sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-section { margin-bottom: 2rem; }
.sidebar-section h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 1rem; }
.filter-list { list-style: none; }
.filter-list li { padding: .5rem .75rem; border-radius: 6px; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: space-between; transition: all .2s; }
.filter-list li:hover, .filter-list li.active { background: rgba(0,255,136,.08); color: var(--green); }
.filter-list li .count { font-size: .75rem; color: var(--muted); background: var(--bg3); padding: .1rem .5rem; border-radius: 999px; }

/* ─── Avatar ─── */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }
.avatar-placeholder { background: linear-gradient(135deg, var(--green), var(--purple)); display: flex; align-items: center; justify-content: center; color: #0a0a0f; font-weight: 900; }

/* ─── Tabs ─── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 2rem; gap: .25rem; }
.tab { padding: .75rem 1.25rem; font-weight: 700; font-size: .9rem; cursor: pointer; border: none; background: none; color: var(--muted); border-bottom: 2px solid transparent; transition: all .2s; text-transform: uppercase; letter-spacing: .5px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }

/* ─── Modal ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 480px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 1.5rem; }

/* ─── Progress / XP ─── */
.xp-bar { background: var(--bg3); border-radius: 999px; height: 6px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--purple)); border-radius: 999px; transition: width .4s; }

/* ─── Loader ─── */
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; margin: 3rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ─── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: .85rem 1.2rem; font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; min-width: 260px; animation: slideUp .3s ease; box-shadow: 0 4px 20px rgba(0,0,0,.4); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

/* ─── Footer ─── */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 4rem 0 2rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-brand .logo { font-size: 1.5rem; font-weight: 900; color: var(--green); font-family: var(--mono); margin-bottom: .75rem; }
.footer-brand p { font-size: .9rem; color: var(--muted); }
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text); margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul li a { color: var(--muted); font-size: .9rem; transition: color .2s; }
.footer-col ul li a:hover { color: var(--green); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.social-links { display: flex; gap: 1rem; }
.social-links a { color: var(--muted); transition: color .2s; font-size: 1.1rem; }
.social-links a:hover { color: var(--green); }

/* ─── Glow accent ─── */
.glow-text { text-shadow: 0 0 20px rgba(0,255,136,.5); }
.glow-border { box-shadow: 0 0 0 1px var(--green), var(--glow); }
.cyber-line { height: 2px; background: linear-gradient(90deg, transparent, var(--green), transparent); margin: .5rem 0; }

/* ─── Install PWA banner ─── */
#pwa-install { display: none; position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 999; background: var(--bg2); border: 1px solid var(--green); border-radius: var(--radius); padding: 1rem 1.25rem; max-width: 320px; box-shadow: var(--glow); }
#pwa-install p { color: var(--text); font-size: .9rem; margin-bottom: .75rem; }
#pwa-install .actions { display: flex; gap: .5rem; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: fixed; inset: 0 0 0 0; background: var(--bg); padding: 5rem 2rem 2rem; gap: 1rem; align-items: flex-start; z-index: 999; }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.2rem; }
  .hamburger { display: flex; z-index: 1000; }
  .hero { min-height: 80vh; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .hero-stats { gap: 1.5rem; }
  .hero-actions { flex-direction: column; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  .container { padding: 0 1rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
