/* =========================================
   1. RESET & BASE VARIABLES
========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050a0f;
  --bg2: #080e15;
  --bg3: #0d1620;
  --card: #0a1018;
  --border: rgba(0,229,255,0.08);
  --border2: rgba(0,229,255,0.18);
  --text: #d4f5ff;
  --muted: #5a8090;
  --accent: #00e5ff;
  --accent2: #00b8cc;
  --accent-glow: rgba(0,229,255,0.25);
  --gold: #f59e0b;
  --font-pixel: 'Press Start 2P', monospace;
  --font: 'Nunito', sans-serif;
  --radius: 12px;
  --radius-lg: 18px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

#particles {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: 0.5;
}

.gradient-text {
  background: linear-gradient(135deg, #00e5ff 0%, #00b8cc 50%, #7ee8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================
   2. NAVIGATION
========================================= */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 9999;
    background: rgba(5,10,15,.92); backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0,229,255,.12);
}
.nav-inner {
    max-width: 1300px; margin: auto; height: 80px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { width: 50px; height: 50px; object-fit: contain; }
.logo-text { font-family: 'Press Start 2P', cursive; color: #ffffff; font-size: 14px; }
.logo-accent { color: #00e5ff; }

.nav-links { display: flex; align-items: center; gap: 25px; list-style: none; }
.nav-links a { text-decoration: none; color: #d4f5ff; font-weight: 700; font-size: 15px; transition: .3s; }
.nav-links a:hover, .nav-links a.active { color: #00e5ff; }

.discord-btn {
    background: linear-gradient(135deg, #5865F2, #7289DA);
    color: white !important; padding: 10px 18px;
    border-radius: 12px; font-weight: 700; transition: .3s;
}
.discord-btn:hover { transform: translateY(-3px); box-shadow: 0 0 20px rgba(88,101,242,.5); }

.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
}
.hamburger span { width: 25px; height: 3px; background: #fff; border-radius: 999px; }
.mobile-menu { display: none; }

/* =========================================
   3. HERO SECTION
========================================= */
.hero {
  min-height: 100vh; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding-top: 80px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(0,229,255,.16), transparent 55%), linear-gradient(135deg,#050a0f,#020509);
  z-index: 0;
}
.hero-content-center { position: relative; z-index: 2; text-align: center; margin-top: -40px; }
.main-hero-logo { width: 560px; max-width: 90vw; filter: drop-shadow(0 0 60px rgba(0,229,255,.5)); }

.hero-bottom {
    position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
    width: 80%; max-width: 1100px;
    display: flex; justify-content: space-between; align-items: center; z-index: 5;
}
.hero-action { display: flex; align-items: center; gap: 18px; text-decoration: none; color: white; transition: .3s; }
.hero-action:hover { transform: translateY(-4px); }
.action-icon { width: auto; height: auto; background: none; box-shadow: none; }
.action-icon img {
    width: 70px; height: 70px; object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0,229,255,.7)) drop-shadow(0 0 25px rgba(0,229,255,.4));
    transition: .3s;
}
.hero-action:hover .action-icon img { transform: scale(1.1); }
.action-text h4 { font-size: 15px; font-weight: 900; color: #00e5ff; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; }
.action-text .big-text { font-size: 22px; font-weight: 900; color: #fff; text-transform: uppercase; line-height: 1; }
.action-text p { font-size: 11px; color: #fff; opacity: .8; font-weight: 800; letter-spacing: 1px; margin-top: 6px; }
.hero-right { text-align: right; }

.btn-primary, .btn-discord {
    text-decoration: none; color: #fff; padding: 15px 30px;
    border-radius: 12px; font-weight: 800; transition: .3s;
}
.btn-primary { background: #8b5cf6; }
.btn-discord { background: #5865F2; }
.btn-primary:hover, .btn-discord:hover { transform: translateY(-3px); }

/* =========================================
   4. SECTIONS (GAMEMODES, VOTE, RULES)
========================================= */
.gamemodes { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 6rem 2rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 0.5rem; }
.section-header h2 { font-family: var(--font-pixel); font-size: clamp(16px, 3vw, 26px); line-height: 1.6; }

.modes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.25rem; }
.mode-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.75rem; position: relative; transition: all 0.3s; overflow: hidden;
}
.mode-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); opacity: 0; transition: opacity 0.3s;
}
.mode-card:hover { transform: translateY(-5px); border-color: var(--border2); }
.mode-card:hover::before { opacity: 1; }
.mode-card.featured {
  border-color: rgba(0,229,255,0.25); background: linear-gradient(135deg, #0a1018 0%, #051018 100%);
  box-shadow: 0 0 40px rgba(0,229,255,0.06);
}
.mode-card.featured::before { opacity: 1; }
.mode-badge {
  position: absolute; top: 1rem; right: 1rem; background: rgba(0,229,255,0.12); color: var(--accent);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 100px; border: 1px solid rgba(0,229,255,0.25);
}
.mode-icon { font-size: 34px; margin-bottom: 1rem; display: block; }
.mode-card h3 { font-family: var(--font-pixel); font-size: 12px; color: var(--text); margin-bottom: 0.75rem; line-height: 1.6; }
.mode-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }

.vote-section { padding: 100px 8%; }
.vote-subtitle { color: #a0a0a0; max-width: 700px; margin: 15px auto 0; text-align: center; }
.vote-grid { margin-top: 50px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.vote-card {
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 20px;
    padding: 35px; text-align: center; transition: .3s; backdrop-filter: blur(15px);
}
.vote-card:hover { transform: translateY(-8px); border-color: #8b5cf6; box-shadow: 0 15px 40px rgba(139,92,246,.25); }
.vote-icon { font-size: 3rem; margin-bottom: 15px; }
.vote-card h3 { font-size: 1.6rem; margin-bottom: 12px; }
.vote-card p { color: #b0b0b0; line-height: 1.7; margin-bottom: 25px; }
.vote-btn {
    display: inline-block; padding: 14px 30px; background: linear-gradient(135deg,#8b5cf6,#00e5ff);
    color: #fff; text-decoration: none; border-radius: 12px; font-weight: 700; transition: .3s;
}
.vote-btn:hover { transform: scale(1.05); }

.rules-section { padding: 100px 2rem; background: var(--bg2); }
.rules-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.rule-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 30px; transition: .3s; }
.rule-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 0 25px rgba(0,229,255,.15); }
.rule-icon { font-size: 40px; display: block; margin-bottom: 15px; }
.rule-card h3 { font-size: 22px; margin-bottom: 10px; color: var(--text); }
.rule-card p { color: var(--muted); line-height: 1.7; }

/* =========================================
   5. CRATES & STORE
========================================= */
.crates-section { padding: 80px 20px; }
.crates-grid { max-width: 1400px; margin: 50px auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.crate-card {
    background: #08111c; border: 1px solid rgba(255,255,255,.08); border-radius: 22px;
    padding: 30px; text-align: center; position: relative; transition: .3s; overflow: hidden; cursor: pointer;
}
.crate-card:hover { transform: translateY(-8px); box-shadow: 0 0 25px rgba(0,229,255,.15); }
.crate-key { width: 140px; height: auto; display: block; margin: 0 auto 20px; transition: .3s; }
.crate-card:hover .crate-key { transform: scale(1.08) rotate(-5deg); }
.crate-card h3 { font-size: 24px; color: #fff; margin-bottom: 15px; font-weight: 800; }
.crate-price { font-size: 48px; font-weight: 900; color: #00e5ff; margin-bottom: 25px; }
.common { border-top: 4px solid #22c55e; }
.spawner { border-top: 4px solid #3b82f6; }
.crimson { border-top: 4px solid #ef4444; }
.soul { border-top: 4px solid #00e5ff; }
.amethyst { border-top: 4px solid #a855f7; }
.popular-badge {
    position: absolute; top: 18px; right: 18px; background: #ff8400; color: #fff;
    padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.crate-bottom { text-align: center; margin-top: 40px; }
.crate-card:nth-child(4) { grid-column: 1 / 2; }
.crate-card:nth-child(5) { grid-column: 2 / 3; }

.store-cta { padding: 120px 20px; background: linear-gradient(180deg, rgba(0,229,255,.02), transparent); }
.store-inner { max-width: 1200px; margin: auto; }
.rank-layout { display: grid; grid-template-columns: 380px 1fr; gap: 40px; align-items: center; }
.rank-card {
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px; padding: 40px; backdrop-filter: blur(10px);
}
.rank-badge {
    display: inline-block; padding: 10px 18px; border-radius: 999px;
    background: rgba(255,215,0,.15); border: 1px solid rgba(255,215,0,.4);
    color: #ffd700; font-weight: 800; margin-bottom: 20px;
}
.rank-title { font-size: 42px; font-weight: 900; margin-bottom: 10px; }
.soul-price {
    font-size: 100px; font-weight: 900; line-height: 1; color: #00A4FC;
    margin: 25px 0; text-shadow: 0 0 40px rgba(0,164,252,0.7);
}
.rank-desc { color: var(--muted); margin-bottom: 25px; }
.btn-buy {
    display: inline-block; padding: 16px 30px; background: var(--accent); color: #000;
    font-weight: 800; border-radius: 12px; text-decoration: none; transition: .3s;
}
.btn-buy:hover { transform: translateY(-3px); box-shadow: 0 0 25px rgba(0,229,255,.4); }
.rank-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.rank-feature {
    padding: 18px; border-radius: 14px; background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08); transition: .3s; font-weight: 700;
}
.rank-feature:hover { transform: translateY(-5px); border-color: #ffd700; }

/* =========================================
   6. FOOTER
========================================= */
.footer {
  position: relative; z-index: 1; background: var(--bg);
  border-top: 1px solid var(--border); padding: 4rem 2rem 2rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; display: flex; gap: 4rem; flex-wrap: wrap;
  justify-content: space-between; margin-bottom: 3rem;
}
.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { font-size: 13px; color: var(--muted); max-width: 220px; line-height: 1.7; }
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); font-weight: 700; margin-bottom: 4px;
}
.footer-col a { text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted);
}
.footer-bottom a { color: var(--muted); text-decoration: none; cursor: pointer;}
.footer-bottom a:hover { color: var(--accent); }

/* =========================================
   7. MODALS (CRATES & LEGAL)
========================================= */
/* Crate Modal */
.crate-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none;
  align-items: center; justify-content: center; z-index: 99999; padding: 20px;
}
.crate-modal.active { display: flex; }
.crate-modal-box {
  width: 100%; max-width: 650px; background: #111; border-radius: 8px;
  color: white; position: relative; overflow: hidden; box-shadow: 0 0 40px rgba(0,0,0,.7);
}
.crate-close {
  position: absolute; top: 18px; right: 20px; background: none; border: none;
  color: #888; font-size: 28px; font-weight: 900; cursor: pointer;
}
.crate-modal-box h2 { padding: 22px; font-size: 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.crate-modal-content { padding: 35px 22px 28px; }
.modal-list { list-style: none; margin: 8px 0 18px; }
.modal-list li { font-size: 16px; line-height: 1.45; color: white; }
.modal-crate-img { width: 320px; max-width: 100%; display: block; margin: 14px 0; border: 2px solid #ccc; }
.modal-description { font-size: 15px; color: white; line-height: 1.3; }

/* Legal Modal (Privacy Policy & ToS) */
.legal-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: none;
  align-items: center; justify-content: center; z-index: 99999; padding: 20px;
  opacity: 0; transition: opacity 0.3s ease;
}
.legal-modal.active { display: flex; opacity: 1; }
.legal-modal-box {
  width: 100%; max-width: 650px; max-height: 85vh; background: #111; border-radius: 8px;
  color: white; position: relative; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.7); transform: scale(0.95); transition: transform 0.3s ease;
}
.legal-modal.active .legal-modal-box { transform: scale(1); }
.legal-close {
  position: absolute; top: 18px; right: 20px; background: none; border: none;
  color: #888; font-size: 28px; font-weight: 900; cursor: pointer; z-index: 2;
}
.legal-modal-box h2 {
  padding: 22px; font-size: 24px; border-bottom: 1px solid rgba(255,255,255,0.08);
  margin: 0; flex-shrink: 0;
}
.legal-modal-content {
  padding: 22px; overflow-y: auto; font-size: 15px; color: #d4d4d4; line-height: 1.6;
}
.legal-modal-content h3 { color: #00e5ff; margin: 15px 0 10px; font-size: 18px; }
.legal-modal-content p { margin-bottom: 15px; }

/* =========================================
   8. MEDIA QUERIES (Consolidated)
========================================= */

@media (max-width: 1400px) {
    .crates-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1100px) {
    .hero-title { font-size: 58px; }
}

@media (max-width: 1000px) {
    .crates-grid { grid-template-columns: repeat(2, 1fr); }
    .crate-card:nth-child(4), .crate-card:nth-child(5) { grid-column: auto; }
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .mobile-menu {
        display: none; flex-direction: column; background: #0a1018;
        padding: 20px; border-top: 1px solid rgba(255,255,255,.08);
        position: absolute; top: 80px; left: 0; width: 100%;
    }
    .mobile-menu.open { display: flex; }
    .mobile-menu a { text-decoration: none; color: white; padding: 12px 0; font-weight: 600; }
    .mobile-discord-btn {
        background: #5865F2; color: white !important; text-align: center;
        margin-top: 10px; border-radius: 10px; padding: 12px;
    }
    
    .hero-bottom { position: relative; width: 100%; margin-top: 40px; flex-direction: column; gap: 25px; }
    .hero-right { text-align: left; }
    .action-icon img { width: 55px; height: 55px; }
    .action-text .big-text { font-size: 18px; }
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-title { font-size: 48px; }
    
    .crates-grid { grid-template-columns: repeat(2, 1fr); }
    .rank-layout { grid-template-columns: 1fr; }
    .soul-price { font-size: 80px; }
    .rank-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .gamemodes, .vote-section, .rules-section, .crates-section, .store-cta { padding: 60px 5%; }
    .modes-grid, .rules-grid, .vote-grid { grid-template-columns: 1fr; }
    .nav-inner { padding: 0 15px; }
    .main-hero-logo { width: 90%; }
    .action-text .big-text { font-size: 16px; }
    
    .hero { flex-direction: column; align-items: flex-start; gap: 2rem; padding-top: 100px; }
    
    .soul-price { font-size: 65px; }
    .rank-title { font-size: 32px; }
    .rank-card { padding: 25px; }
    
    .crate-modal-box, .legal-modal-box { width: 95%; max-width: 100%; margin: 0 auto; }
    
    .footer-inner { flex-direction: column; gap: 2rem; }
    .footer-links { gap: 1.5rem; flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
    .crates-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .gamemodes, .vote-section, .rules-section, .crates-section, .store-cta { padding: 40px 15px; }
    .hero-action { flex-direction: column; text-align: center; gap: 10px; }
    .hero-right { text-align: center; }
    .action-icon img { width: 45px; height: 45px; }
    .soul-price { font-size: 50px; }
    .footer-brand p { max-width: 100%; }
    .section-header h2 { font-size: 20px; }
}