body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #1a1a1a, #2c3e50, #34495e, #1a1a1a);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
}

/* Sections (scroll + hover combined properly) */
section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.4s ease;
    will-change: opacity, transform;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hover raise ONLY when visible (fixes glitching) */
section.visible:hover {
    transform: translateY(-10px) scale(1.015);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

/* Smooth floating animation (replaces bounce) */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Fade animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 1s ease-out;
}

/* Links hover */
a:hover,
button:hover {
    transform: translateY(-3px);
    transition: transform 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
}

/* Background animation */
@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Cards */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Rules */
.rules-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* Discord icon */
.fab.fa-discord {
    transition: transform 0.3s ease;
}

.fab.fa-discord:hover {
    transform: scale(1.2);
}

/* FAQ */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-content {
    max-height: 180px;
    opacity: 1;
}

.faq-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* Particles */
#particles-js {
    position: absolute;
    height: 700px;
    margin: 0 auto;
    left: 0;
    right: 0;
    pointer-events: none;
    width: 100%;
    z-index: 1;
}

canvas {
    display: block;
    vertical-align: bottom;
}

/* ============================================================
   HAMBURGER MENU — 3-line icon (top-left, MOBILE ONLY) + drawer
   ============================================================ */

/* Hidden on desktop, visible on mobile/tablet */
#hamburger-btn {
    display: none !important;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 1px;
    transform-origin: center;
    transition: transform 0.3s ease, opacity 0.25s ease, background-color 0.3s ease;
}

#hamburger-btn {
    position: fixed !important;
    top: 1rem;
    left: 1rem;
    z-index: 9999; /* below notification bar (10000) */
    width: 2.75rem;
    height: 2.75rem;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#hamburger-btn:hover {
    background-color: rgba(0, 0, 0, 0.85);
    border-color: rgba(249, 115, 22, 0.5);
}

#hamburger-btn:hover .hamburger-line {
    background-color: #f97316; /* orange-500 */
}

/*
   X animation — symmetric.
   Lines: 20px wide, 2px tall, gap 5px.
   The button uses flexbox with align-items: center and gap: 5px.
   Center-to-center distance = line height + gap = 2 + 5 = 7px.
   Line 1 needs to move DOWN by 7px to reach center.
   Line 3 needs to move UP by 7px to reach center.
   transform-origin: center ensures rotation is around each line's midpoint.
*/
#hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Overlay covering the rest of the page when drawer is open */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-out drawer */
#nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    height: 100dvh;
    width: 18rem;
    max-width: 80vw;
    background-color: rgba(17, 24, 39, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9995;
    transform: translateX(-100%);
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
}

#nav-drawer.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s;
}

/* Drawer link tap target (mobile-friendly) */
.nav-drawer-link {
    -webkit-tap-highlight-color: transparent;
}

/* Drawer inner layout */
.drawer-inner {
    padding: 1rem 1.25rem 1.5rem;
}

/*
   Drawer header — sits at the very top of the drawer, aligned with the
   hamburger button (which is at top:1rem left:1rem, size 2.75rem).
   The header is pushed right by (hamburger width + gap) so the logo+title
   appear visually next to the hamburger when the drawer is open.
*/
.drawer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    /* 2.75rem hamburger + 1rem left pos + 0.5rem gap = 4.25rem */
    padding-left: 4.25rem;
    min-height: 2.75rem;
}

.drawer-logo {
    height: 2.25rem;
    width: auto;
}

.drawer-title {
    color: #f97316; /* orange-500 */
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

.drawer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-drawer-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-drawer-link i {
    width: 1.5rem;
    margin-right: 0.75rem;
    color: #f97316; /* orange-500 */
    text-align: center;
}

.nav-drawer-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f97316; /* orange-500 */
}

.drawer-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.drawer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.drawer-btn-store {
    background-color: #3b82f6; /* blue-500 */
}
.drawer-btn-store:hover {
    background-color: #2563eb; /* blue-600 */
}

.drawer-btn-discord {
    background-color: #8b5cf6; /* purple-500 */
}
.drawer-btn-discord:hover {
    background-color: #7c3aed; /* purple-600 */
}

/* Body lock when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ============================================================
   RESPONSIVE — Mobile-first improvements
   ============================================================ */

/* Tablet and smaller */
@media only screen and (max-width: 1105px) {
    #particles-js {
        max-width: 100%;
        width: auto;
    }
}

/* Mobile breakpoint */
@media only screen and (max-width: 768px) {
    /* Show the hamburger button and drawer on mobile */
    #hamburger-btn {
        display: flex !important;
    }
    #nav-drawer {
        display: block !important;
    }

    /* Hide the desktop nav (Home/About/Rules/Vote/FAQ + Store + Discord) on mobile */
    .desktop-nav {
        display: none !important;
    }

    /* Header: shrink height so content fits without too much scrolling */
    .header-hero {
        height: auto !important;
        min-height: 100vh;
        padding-top: 5rem;
        padding-bottom: 3rem;
    }

    /* Logo: scale down dramatically */
    .header-logo {
        height: 16rem !important;
    }

    /* IP buttons: stack vertically and fill width */
    .ip-buttons-container {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: center;
        width: 100%;
    }

    .ip-button {
        width: 100% !important;
        max-width: 22rem;
    }

    /* Rules tabs: horizontally scrollable, no wrapping */
    .rules-tabs {
        flex-direction: row !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding-bottom: 0.5rem;
        white-space: nowrap;
        gap: 0.5rem;
    }
    .rules-tabs .tab-button {
        flex-shrink: 0;
        white-space: nowrap;
    }
    /* Hide scrollbar but keep functional */
    .rules-tabs::-webkit-scrollbar {
        height: 4px;
    }
    .rules-tabs::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
    }

    /* Section titles: smaller on mobile */
    .section-title {
        font-size: 2rem !important;
    }

    /* Footer: stack vertically with logo on top */
    .footer-flex {
        flex-direction: column-reverse !important;
        gap: 1.5rem;
        text-align: center;
        align-items: center;
    }
    .footer-flex > div {
        text-align: center !important;
    }
    .footer-logo {
        margin: 0 auto;
        height: 3.5rem !important;
    }

    /* Contact section: smaller Discord icon */
    .contact-icon {
        font-size: 6rem !important;
    }

    /* Notification bar: smaller text, leave room for hamburger */
    .notification-text {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    /* About/Vote grid: ensure single column with proper spacing */
    section .glass {
        padding: 1.25rem !important;
    }

    /* About images: stack cleanly */
    section .grid.grid-cols-2 {
        gap: 0.75rem;
    }

    /* Body padding so content isn't hidden behind fixed hamburger when scrolling */
    body {
        overflow-x: hidden;
    }
}

/* Very small phones */
@media only screen and (max-width: 480px) {
    .header-logo {
        height: 11rem !important;
    }

    .section-title {
        font-size: 1.75rem !important;
    }

    .ip-button {
        padding: 0.75rem 1rem !important;
    }

    .ip-button p {
        font-size: 1.125rem !important;
    }

    .contact-icon {
        font-size: 5rem !important;
    }

    /* Smaller hamburger on tiny phones */
    #hamburger-btn {
        width: 44px;
        height: 44px;
    }
    .hamburger-line {
        width: 20px;
        height: 2.5px;
    }
    /* Center-to-center = 2.5 + 5 = 7.5px */
    #hamburger-btn.active .hamburger-line:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    #hamburger-btn.active .hamburger-line:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }
}

/* Landscape phone: keep header from getting too short */
@media only screen and (max-width: 900px) and (orientation: landscape) {
    .header-hero {
        min-height: 700px;
    }
    .header-logo {
        height: 12rem !important;
    }
}
