/* Lobby Styles - Cartoonish & Engaging */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

:root {
    --primary-color: #FF6B6B;
    /* Vibrant Red/Coral */
    --secondary-color: #4ECDC4;
    /* Vibrant Teal */
    --accent-color: #FFE66D;
    /* Bright Yellow */
    --dark-color: #2C3E50;
    --light-color: #F7FFFF;
    --text-color: #2C3E50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Fredoka', sans-serif;
    /* Rounded, playful font */
}

body {
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    color: var(--text-color);
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Shapes Background */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    z-index: 0;
    animation: float 20s infinite linear;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.3);
    top: -50px;
    left: -50px;
    animation-duration: 25s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: rgba(78, 205, 196, 0.3);
    bottom: 10%;
    right: 10%;
    animation-duration: 18s;
    animation-direction: reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: rgba(255, 230, 109, 0.4);
    top: 20%;
    right: 20%;
    animation-duration: 22s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Main Container */
.lobby-container {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 900px;
    height: 600px;
    /* Fixed height to prevent layout shifts */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sections - Overlapping for smooth transitions */
.intro-section,
.events-section {
    position: absolute;
    width: 100%;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Intro Section */
.intro-section {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.intro-section.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
    pointer-events: none;
}

.main-logo {
    max-width: 250px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
    animation: bounce 3s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

h1 {
    font-size: 3.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    text-shadow: 3px 3px 0px rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

p.tagline {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: #555;
    font-weight: 600;
}

/* Big Button */
.btn-join {
    font-size: 2.5rem;
    padding: 1.2rem 5rem;
    border: none;
    border-radius: 60px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 0 #D94545, 0 20px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.btn-join:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 0 #D94545, 0 25px 35px rgba(0, 0, 0, 0.3);
    background: #FF7E7E;
    animation: none;
    /* Stop pulse on hover */
}

.btn-join:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #D94545, 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Events Section */
.events-section {
    opacity: 0;
    transform: translateY(100px) scale(0.9);
    pointer-events: none;
}

.events-section.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.events-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
    text-shadow: 2px 2px 0 white;
}

.events-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    perspective: 1000px;
}

/* Back Button in Lobby */
.lobby-back-btn {
    position: absolute;
    top: -80px;
    /* Position above content relative to container */
    left: 20px;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 20;
}

.lobby-back-btn:hover {
    transform: scale(1.2) rotate(-10deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: var(--primary-color);
    color: white;
}

/* Event Card */
.event-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 40px;
    padding: 2.5rem;
    width: 320px;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 6px solid white;
    cursor: pointer;
    text-decoration: none;
}

.event-card:hover {
    transform: translateY(-20px) scale(1.05) rotate(2deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.event-card:hover .card-logo {
    transform: scale(1.1) rotate(-5deg);
}

.card-superman:hover {
    background: linear-gradient(to bottom right, #ffffff, #e3f2fd);
    border-color: #3498db;
}

.card-sparks {
    filter: grayscale(1);
    opacity: 0.9;
    cursor: not-allowed;
    position: relative;
    border-color: #ddd;
}

.card-logo {
    max-width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    margin-bottom: 1rem;
    transition: transform 0.4s ease;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.5;
}

.card-btn {
    padding: 1rem 2.5rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-transform: uppercase;
    transition: 0.3s;
    border: none;
    letter-spacing: 1px;
}

.btn-superman {
    background: #3498db;
    box-shadow: 0 6px 0 #2980b9;
}

.event-card:hover .btn-superman {
    transform: scale(1.1);
    background: #5dade2;
    box-shadow: 0 8px 0 #2980b9;
}

.btn-sparks {
    background: #bbb;
    box-shadow: 0 6px 0 #999;
}

.coming-soon-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: #FF6B6B;
    color: white;
    padding: 0.8rem 2rem;
    font-size: 1.8rem;
    font-weight: 900;
    border: 4px solid white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    z-index: 10;
    animation: badge-float 4s infinite ease-in-out;
}

@keyframes badge-float {

    0%,
    100% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1);
    }

    50% {
        transform: translate(-50%, -70%) rotate(-10deg) scale(1.1);
    }
}

/* Mobile Responsiveness - Optimized & Premium */
@media (max-width: 768px) {

    /* Fixed mobile viewport handling */
    body {
        height: 100dvh;
        width: 100vw;
        overflow: hidden;
        /* Prevent scrolling if possible, let content scale */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .lobby-container {
        width: 100%;
        height: 100dvh;
        /* Use dynamic viewport height */
        padding: 0;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow: hidden;
    }

    .intro-section,
    .events-section {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        /* Limit width */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0;
        transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
        /* Premium bounce */
    }

    .intro-section {
        opacity: 1;
        pointer-events: all;
    }

    .intro-section.hidden {
        opacity: 0;
        transform: translate(-50%, -70%) scale(0.8);
        pointer-events: none;
    }

    .events-section {
        opacity: 0;
        transform: translate(-50%, 30%) scale(0.9);
        pointer-events: none;
        /* Glass panel style for mobile events */
        background: rgba(255, 255, 255, 0.35);
        /* Slightly more opaque for readability */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 40px;
        padding: 50px 20px 30px 20px;
        /* Top padding reserved for back button */
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.2);
    }

    .events-section.visible {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: all;
    }

    .main-logo {
        max-width: 140px;
        /* Slightly smaller for better fit */
        margin-bottom: 2rem;
        margin-top: 0;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    p.tagline {
        font-size: 0.95rem;
        margin-bottom: 2rem;
        padding: 0 10px;
    }

    .btn-join {
        font-size: 1.8rem;
        padding: 0.8rem 3rem;
    }

    .events-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .events-grid {
        gap: 1.5rem;
        max-height: 55vh;
        /* Slightly smaller to see bottom */
        overflow-y: auto;
        padding: 20px 10px;
        /* More breathing room */
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        scrollbar-width: none;
        /* Hide scrollbar for cleaner look */
        -ms-overflow-style: none;
        mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
        /* Fade out bottom */
        -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    }

    .events-grid::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar for Chrome/Safari */
    }

    .event-card {
        width: 100%;
        max-width: 280px;
        height: auto;
        min-height: auto;
        /* Allow card to shrink if needed */
        padding: 1.5rem;
        border-radius: 30px;
        flex-shrink: 0;
        /* Prevent cards from squishing */
    }

    .card-logo {
        max-height: 80px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .card-desc {
        font-size: 0.95rem;
    }

    .card-btn {
        padding: 0.8rem 1.5rem;
    }

    .lobby-back-btn {
        position: absolute;
        top: 20px;
        /* Safe distance inside the glass container */
        left: 20px;
        margin-bottom: 0;
        width: 36px;
        /* Sleek and small */
        height: 36px;
        font-size: 1rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        z-index: 20;
        background: white;
        color: #ff6b6b;
        /* Accent color */
        border: none;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .lobby-back-btn:active {
        transform: scale(0.9);
    }

    .events-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
        margin-top: 5px;
        /* Alignment with button area */
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Staggered Animation for Cards */
    .events-section.visible .event-card:nth-child(1) {
        animation: cardPopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
        opacity: 0;
    }

    .events-section.visible .event-card:nth-child(2) {
        animation: cardPopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
        opacity: 0;
    }

    @keyframes cardPopIn {
        from {
            opacity: 0;
            transform: translateY(20px) scale(0.95);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .coming-soon-badge {
        font-size: 1.2rem;
        padding: 0.4rem 1rem;
    }
}

/* Extra Small Screen Adjustments */
@media (max-width: 360px) {
    h1 {
        font-size: 1.8rem;
    }

    .main-logo {
        max-width: 150px;
    }

    .btn-join {
        font-size: 1.5rem;
        padding: 0.7rem 2rem;
    }
}