:root {
    --neon-primary: #5b8def;
    --neon-secondary: #9b6dde;
    --bg-primary: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --glow-effect: 0 0 10px rgba(91, 141, 239, 0.2), 0 0 20px rgba(91, 141, 239, 0.1);
    --boss-red: #8b0000;
    --boss-shadow: rgba(139, 0, 0, 0.8);
}

body {
    margin: 0;
    padding: 0;
}

#lobbies_page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
    /* background: linear-gradient(135deg, var(--bg-primary), #e2e8f0); */
    min-height: 100vh;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    transition: filter 0.6s ease;
}

#lobbies_page h1 {
    font-size: 3.2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
    margin: 1rem 0;
    margin-bottom: 2rem;
    /* background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary)); */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    height: 7%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #5a5a5a;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#lobbies {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 670px;
    height: 92%;
    overflow-y: auto;
    gap: 25px;
}


.lobby-entry {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 100px;
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s, width 0.3s;
    width: 650px;
    height: 220px;
    min-height: 220px;
    box-sizing: border-box;
    position: relative;
}

.lobby-entry:hover {
    /* transform: translateY(-5px); */
    box-shadow: 0 6px 12px rgba(0,0,0,0.17);
}

.lobby-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #5a5a5a;
    /* margin-bottom: 10px; */
    text-align: center;
    position: absolute;
    width: 40%;
    top: 18px;
    left: 30%;
}

/* .lobby-players {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 10px;
} */

.lobby-player-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: absolute;
    width: 110px;
    height: 140px;
    top: 65px;
}

.lobby-player-slot-1 {
    left: 35px;
}

.lobby-player-slot-2 {
    right: 35px;
}

.lobby-player-slot img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 2px solid #ccc;
}

.lobby-player-slot span {
    font-size: 1rem;
    color: #555;
}

.lobby-vs-text {
    font-size: 4.4rem;
    font-weight: bold;
    color: #5a5a5a;
    position: absolute;
    top: 58px;
}

.lobby-meta-info {
    display: flex;
    justify-content: space-around;
    width: 80%;
    font-size: 1rem;
    color: #666;
    /* border-top: 1px solid #eee; */
    position: absolute;
    top: 140px;
}

.lobby-meta-info span {
    padding: 0 5px;
    text-transform: lowercase;
}

.lobby-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    position: absolute;
    bottom: 10px;
}

.join-button.nice-button {
    padding: 9px 22px;
    font-size: 0.8rem;
}

/* Styling for the lobby information section */
.lobby-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
}

.lobby-name {
    width: 70%;
    font-size: 1.5em;
    color: var(--primary-color, #333);
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    /* color: var(--neon-primary); */
    font-size: 1.8em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 3px rgba(74, 144, 226, 0.3);
}

.lobby-info-param {
    width: 70%;
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 1em;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    background: rgba(91, 141, 239, 0.05);
    padding: 8px 15px;
    border-radius: 5px;
    margin: 5px 0;
    border-left: 2px solid rgba(91, 141, 239, 0.3);
}

.lobby-info-param:hover {
    transform: scale(1.05);
    background: rgba(91, 141, 239, 0.1);
}

/* Styling for the join button */
.lobby-join {
    display: flex;
    align-items: center;
}

.join-button {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    /* font-size: 1em; */
    transition: background-color 0.3s;
    position: relative;
    overflow: hidden;
    /* background: linear-gradient(45deg, rgba(91, 141, 239, 0.9), rgba(155, 109, 222, 0.9)); */
    border: none;
    padding: 12px 30px;
    /* font-weight: bold; */
    /* letter-spacing: 1px; */
    text-transform: lowercase;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.join-button:hover {
    /* background-color: var(--button-hover-color, #0056b3); */
    transform: translateY(-2px);
    /* box-shadow: 0 4px 12px rgba(91, 141, 239, 0.2); */
}

.join-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: skewX(-20deg);
    transition: left 0.3s ease;
}

.join-button:hover::after {
    left: 100%;
}

.nice-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 80%;
    width: auto;
    height: 70%;
    background-size: 200% 200%;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 15px 40px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 30px;
    margin: 5px 10px;
    font-size: 1.2rem;
}

.nice-button:hover {
    transform: translateY(-2px);
    /* filter: brightness(1.2); */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Scrollbar styling */
#lobbies::-webkit-scrollbar {
    width: 8px;
}

#lobbies::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#lobbies::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.0);
}

/* #lobbies::-webkit-scrollbar-thumb:hover {
    background: var(--neon-secondary);
} */

#lobbies:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.45);
}

.button-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /* margin: 2px 0; */
    padding-top: 3px;
    width: 65%;
}

.pre-bottom-button-row {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    width: 15%;
    height: 30vh;
    top: 35vh;
    right: 0%;
}

.pre-bottom-button-row button {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 30%;
    box-sizing: border-box;
    border-radius: 30px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(10px);
}

.pre-bottom-button-row button:hover {
    transform: translateX(0px);
}

.bottom-button-row {
    width: 80%;
}

.button-row button {
    width: 30%;
}

.bottom-button {
    font-size: 1.2rem;
    min-width: 17vw;
    border-radius: 15px 15px 0 0;
    margin: 0;
    transform: translateY(2px);
}

.bottom-button:hover {
    transform: translateY(0px);
}

/* Boss Text */
#boss-text {
    position: absolute;
    left: -20vw;
    top: 15vh;
    font-size: 4.5rem;
    font-weight: 900;
    font-family: 'Rajdhani', sans-serif;
    z-index: 10;
    letter-spacing: 8px;
    text-transform: uppercase;
    transition: all 0.5s ease;
    opacity: 0.7;
    color: rgb(55, 64, 83);
}

/* Boss encounter state - when Did Moroz is hovered */
#did-moroz:hover + #boss-text,
body.boss-encounter #boss-text {
    left: 0vw;
    opacity: 1;
}

/* Main screen blur during boss encounter */
body.boss-encounter #lobbies_page > *:not(#did-moroz):not(#snowman1):not(#boss-text) {
    filter: blur(2px);
    transition: filter 0.6s ease;
}

#did-moroz {
    position: absolute;
    left: -13vw;
    top: 20vh;
    width: 23vw;
    height: 60vh;
    transform: rotate(13deg);
    transition: left 0.3s ease;
    cursor: pointer;
    z-index: 15;
    filter: brightness(1.3) contrast(0.8);
}

#did-moroz:hover {
    left: -8vw;
    filter: brightness(1.2) contrast(0.9);
}

#did-moroz img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    display: block;
}

#snowman1 {
    position: absolute;
    left: -12vw;
    top: 34vh;
    width: 22vw;
    height: 43vh;
    transform: rotate(27deg);
    transition: left 0.3s ease;
    cursor: pointer;
}

#snowman1 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    display: block;
}

/* when did moroz is hovered, transform snowman */
#did-moroz:hover ~ #snowman1 {
    left: -1vw;
}

/* Quick Game Button - Light, Vibrant & Interactive Design */
#quick-game {
    position: relative;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 25%, #fecfef 75%, #ffc3a0 100%) !important;
    color: #2d3748 !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    box-shadow: 
        0 8px 20px rgba(255, 154, 158, 0.4),
        0 4px 8px rgba(255, 195, 160, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.6);
    border: 2px solid rgba(255,255,255,0.8);
    overflow: hidden;
    --float-duration: 4s;
    --shimmer-duration: 3.5s;
    --sparkle-duration: 2.8s;
    animation: quickGameFloat var(--float-duration) ease-in-out infinite;
    backdrop-filter: blur(10px);
    filter: drop-shadow(0 0 10px rgba(255, 154, 158, 0.3));
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animated gradient background */
#quick-game::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255,255,255,0.3) 40%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0.3) 60%, 
        transparent 70%);
    animation: shimmerSweep var(--shimmer-duration) ease-in-out infinite;
    transform: rotate(45deg);
    transition: all 0.4s ease;
}

/* Sparkle effect */
#quick-game::after {
    content: '✨';
    position: absolute;
    top: 10%;
    right: 15%;
    font-size: 0.9em;
    animation: sparkle var(--sparkle-duration) ease-in-out infinite;
    opacity: 0.8;
    transition: all 0.4s ease;
}

#quick-game:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 30px rgba(255, 154, 158, 0.6),
        0 8px 15px rgba(255, 195, 160, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 2px solid rgba(255,255,255,1);
    filter: drop-shadow(0 0 15px rgba(255, 154, 158, 0.5)) brightness(1.1) saturate(1.1);
    --float-duration: 2s;
    --shimmer-duration: 1.8s;
    --sparkle-duration: 1.5s;
}

#quick-game:hover::after {
    opacity: 1;
}

/* Floating animation - consistent for both states */
@keyframes quickGameFloat {
    0%, 100% { 
        transform: translateY(0px);
    }
    50% { 
        transform: translateY(-2px);
    }
}

/* Shimmer sweep effect */
@keyframes shimmerSweep {
    0% { transform: translateX(-150%) translateY(-150%) rotate(45deg); }
    100% { transform: translateX(50%) translateY(50%) rotate(45deg); }
}

/* Sparkle animation */
@keyframes sparkle {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1) rotate(0deg);
    }
    25% { 
        opacity: 1;
        transform: scale(1.2) rotate(90deg);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.1) rotate(180deg);
    }
    75% { 
        opacity: 1;
        transform: scale(1.3) rotate(270deg);
    }
}