/* ============================================
   GLOBAL STYLES & RESET
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-purple: #8b5cf6;
    --dark-purple: #6d28d9;
    --light-purple: #a78bfa;
    --accent-purple: #c4b5fd;
    --bg-dark: #0f0f1e;
    --bg-darker: #0a0a14;
    --bg-card: rgba(139, 92, 246, 0.05);
    --text-primary: #e0e7ff;
    --text-secondary: #c4b5fd;
    --border-color: rgba(139, 92, 246, 0.3);
    --glow-color: rgba(139, 92, 246, 0.5);
}

@font-face {
    font-family: "Minecraftia";
    src: url("Minecraftia.ttf");
}

body {
    margin: 0;
    font-family: "Minecraftia", 'Courier New', monospace;
    background: var(--bg-darker);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Animated gradient background */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(109, 40, 217, 0.15) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
    z-index: -2;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5%, -5%) rotate(180deg); }
}

/* Smoke overlay - LEFT SIDE */
body::after {
    content: "";
    position: fixed;
    top: -40%;
    left: -40%;
    width: 180%;
    height: 180%;
    background-image: url("smoke.png");
    background-size: cover;
    background-position: left center;
    opacity: 0.2;
    filter: blur(3px);
    animation: smokeLeft 80s linear infinite;
    z-index: -1;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
}

/* Smoke overlay - RIGHT SIDE */
body::before {
    content: "";
    position: fixed;
    top: -40%;
    left: -40%;
    width: 180%;
    height: 180%;
    background-image: url("smoke.png");
    background-size: cover;
    background-position: right center;
    opacity: 0.2;
    filter: blur(3px);
    animation: smokeRight 80s linear infinite reverse;
    z-index: -1;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0) scaleX(-1);
}

@keyframes smokeLeft {
    0% { transform: translate(0, 0) rotate(0deg) translateZ(0); }
    25% { transform: translate(-100px, -80px) rotate(-10deg) translateZ(0); }
    50% { transform: translate(-150px, 0) rotate(-15deg) translateZ(0); }
    75% { transform: translate(-100px, 80px) rotate(-10deg) translateZ(0); }
    100% { transform: translate(0, 0) rotate(0deg) translateZ(0); }
}

@keyframes smokeRight {
    0% { transform: scaleX(-1) translate(0, 0) rotate(0deg) translateZ(0); }
    25% { transform: scaleX(-1) translate(-100px, -80px) rotate(-10deg) translateZ(0); }
    50% { transform: scaleX(-1) translate(-150px, 0) rotate(-15deg) translateZ(0); }
    75% { transform: scaleX(-1) translate(-100px, 80px) rotate(-10deg) translateZ(0); }
    100% { transform: scaleX(-1) translate(0, 0) rotate(0deg) translateZ(0); }
}

/* Floating particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-purple);
    border-radius: 50%;
    opacity: 0.8;
    animation: float-particle 15s infinite;
    box-shadow: 0 0 15px var(--glow-color);
    will-change: transform, opacity;
    transform: translateZ(0);
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   NAVIGATION BAR
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    z-index: 1000;
    padding: 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-purple), var(--light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px var(--glow-color);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-purple);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    width: 80%;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 2rem 4rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 1200px;
}

/* Title with 3D Minecraft effect */
.title-container {
    margin-bottom: 3rem;
    perspective: 1000px;
}

.title-inner {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 50%, #5b21b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
    display: inline-block;
    transform: perspective(500px) rotateX(15deg) translateZ(0);
    animation: titleFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--glow-color))
            drop-shadow(6px 6px 0 #1a0033)
            drop-shadow(12px 12px 0 #0d0019);
    will-change: transform;
}

@keyframes titleFloat {
    0%, 100% { transform: perspective(500px) rotateX(15deg) translateY(0) translateZ(0); }
    50% { transform: perspective(500px) rotateX(15deg) translateY(-15px) translateZ(0); }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: -1rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   IP CONTAINER
   ============================================ */

.ip-container {
    margin: 3rem 0;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.ip-box {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 3rem;
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.ip-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary-purple);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ip-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ip {
    font-size: 1.8rem;
    color: var(--primary-purple);
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 20px var(--glow-color);
}

.copy-btn {
    background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
    border: none;
    color: white;
    font-family: "Minecraftia", monospace;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, var(--light-purple), var(--primary-purple));
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-icon {
    font-size: 1.2rem;
}

/* ============================================
   PLAYER COUNT
   ============================================ */

.player-count {
    margin-top: 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-secondary);
    animation: fadeInUp 1s ease 0.4s backwards;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px #10b981;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.player-count .count {
    color: var(--primary-purple);
    font-weight: 700;
    font-size: 1.4rem;
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, transparent 0%, var(--bg-dark) 100%);
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, var(--primary-purple), var(--light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.features-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-purple);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.3);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px var(--glow-color));
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about {
    padding: 6rem 2rem;
    background: var(--bg-dark);
    position: relative;
    z-index: 1;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 3rem;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-purple), var(--light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   LEADERBOARD PAGE
   ============================================ */

.leaderboard-hero {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
    padding-bottom: 2rem;
}

.page-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px var(--glow-color));
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.leaderboard-section {
    padding: 3rem 2rem 6rem;
    position: relative;
    z-index: 1;
}

.leaderboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.leaderboard-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.leaderboard-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Podium Display */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 5rem;
    flex-wrap: wrap;
}

.podium-place {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    min-width: 200px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.podium-place:hover {
    transform: translateY(-10px);
    border-color: var(--primary-purple);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.podium-place.first {
    order: 2;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(139, 92, 246, 0.1));
    border-color: #fbbf24;
    transform: scale(1.1);
}

.podium-place.second {
    order: 1;
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1), rgba(139, 92, 246, 0.1));
    border-color: #9ca3af;
}

.podium-place.third {
    order: 3;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(139, 92, 246, 0.1));
    border-color: #cd7f32;
}

.podium-rank {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.podium-place.first .podium-rank {
    color: #fbbf24;
    font-size: 2rem;
}

.podium-place.second .podium-rank {
    color: #9ca3af;
}

.podium-place.third .podium-rank {
    color: #cd7f32;
}

.podium-faction {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.podium-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Table Styles */
.table-container {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, var(--dark-purple), var(--primary-purple));
}

.leaderboard-table th {
    padding: 1.5rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.1);
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

.leaderboard-table td {
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.rank-col {
    width: 80px;
    text-align: center !important;
}

.faction-col {
    font-weight: 700;
    color: var(--text-primary) !important;
    font-size: 1.2rem !important;
}

.power-col,
.money-col {
    text-align: right !important;
}

/* Rank badges */
.rank-badge {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dark-purple), var(--primary-purple));
    color: white;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #e5e7eb, #9ca3af);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #f97316, #cd7f32);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--bg-darker);
    border-top: 2px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.footer p {
    margin: 0.5rem 0;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-purple);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .ip-box {
        flex-direction: column;
        padding: 1.5rem 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .stats-row {
        gap: 2rem;
    }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-place.first {
        order: 1;
        transform: scale(1);
    }

    .podium-place.second {
        order: 2;
    }

    .podium-place.third {
        order: 3;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 1rem 0.5rem;
        font-size: 0.85rem;
    }

    .faction-col {
        font-size: 1rem !important;
    }
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-in {
    animation: fadeInUp 0.8s ease;
}