body{
    padding: 0;
    margin: 0;
}

::-webkit-scrollbar {
    width: 10px;
    background: transparent;
    height: 7px;
}
  
  /* Track */
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.327);
    height: 7px;
    border-radius: 100px;
}
  /* Handle */
::-webkit-scrollbar-thumb {
    background: #8ec3de;
    border-radius: 100px;
}

#full-area{
    width: 100%;
    height: 100vh;
    background: #000;
    position: absolute;
    overflow: hidden;
    user-select: none;
    font-family: f;
}

#game-area{
    position: absolute;
    width: 1280px;
    height: 720px;
    left:50%;
    top:50%;
    transform: translate(-50%,-50%) scale(1) !important;
}

#gameContainer {
    width: 1280px;
    height: 720px;
    position: absolute;
    overflow: hidden;
    margin: 0 auto;
    left:50%;
    top:50%;
    transform: translate(-50%,-50%);
}

#home-section {
    width: 1280px;
    height: 720px;
    position: absolute;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('/media/games/chicken-eggscape/images/parallax/1.png');
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0 auto;
    left:50%;
    top:50%;
    transform: translate(-50%,-50%);
}

#home-right{
    position: absolute;
    left:50%;
    top: 50%;
    transform: translate(-50%,-50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

#logo{
    height: 200px;
    justify-content: center;
    display: flex;
    animation: logoAnim 1.3s infinite;
}

/* Canvas */
#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    display: block;
}

/* Start Screen */
#startScreenHTML {
   position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    pointer-events: auto;
    border: none;
}

#startVideo {
    position: relative;
    width: 650px;
    max-height: 430px;
    object-fit: contain;
    border-radius: 70px;
    margin: 0;
    margin-top: 30px;
}

#chickenIcon {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-bottom: 0;
    margin-top: -70px;
}

#chickenIcon:hover {
    transform: scale(1.1);
}

#tooltipText {
    color: black;
    font-size: 24px;
    font-family: "Fox Diego", sans-serif;
    text-align: center;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    white-space: nowrap;
    margin-top: 0px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#tooltipText::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    width: 0;
    height: 0;
}

#playButton {
    width: 250px;
    height: auto;
    padding-top: 0px;
    margin-top: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

#playButton:hover {
    transform: scale(1.05);
}

#micSensitivityContainer {
    position: absolute;
    top: 40px;
    right: 60px;
    padding: 12px 20px 16px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fde9c8, #fbdab0);
    border: 2px solid #c54526;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 240px;
    z-index: 40;
}

#micSensitivityIcon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

#micSensitivityLabel {
    font-family: "Fox Diego", sans-serif;
    font-size: 18px;
    color: #7a0f08;
    margin: 0;
}

#micSensitivityValue {
    font-family: "Fox Diego", sans-serif;
    font-size: 16px;
    color: #c0291a;
}

#micSensitivitySlider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(to right, #d4281f 0%, #7c0d08 100%);
    outline: none;
    cursor: pointer;
}

#micSensitivitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8d120c;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

#micSensitivitySlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8d120c;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

#micSensitivityHUD {
    position: absolute;
    bottom: 100px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde9c8, #fbdab0);
    border: 2px solid #c54526;
    z-index: 35;
}

#micSensitivityHUDSlider {
    width: 140px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(to right, #d4281f 0%, #7c0d08 100%);
    outline: none;
    cursor: pointer;
}

#micSensitivityHUDSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8d120c;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

#micSensitivityHUDSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8d120c;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

#micSensitivityHUDIcon {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* Game Over Screen */
#gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

#gameOverContainer {
    position: relative;
    width: 900px;
    height: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.8);
    animation: popUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#containerBackground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#highScorePanel, #yourScorePanel {
    position: absolute;
    top: 70px;
    height: 90px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 1;
    margin: 0 35px;
    text-align: center;
}

#highScorePanel {
    top: 190px;
    width: 500px;
    background: #8B0000;
    box-shadow: 2px 4px 0px #420707;

}

#yourScorePanel {
    width: 600px;
    background: #4d0000;
    box-shadow: 2px 4px 0px #8B0000;
}

#highScoreText, #yourScoreText {
    color: white;
    font-size: 32px;
    font-family: "Fox Diego", sans-serif;
    font-weight: 400;
        width: 100%;

}
#highScoreText {
    font-size: 50px;
}
#yourScoreText {
    font-size: 60px;
}

#coinIcon {
    position: absolute;
    top: 317px;
    left: 210px;
    width: 50px;
    height: 50px;
    z-index: 1;
}

#coinsEarnedText {
    position: absolute;
    top: 305px;
    color: #8B0000;
    font-size: 50px;
    margin-left: 25px;
    font-family: "Fox Diego", sans-serif;
    font-weight: 400;
    z-index: 1;
}

#gameOverPlayButton, #shareButton {
    position: absolute;
    bottom:85px;

    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1;
        width: 280px;
    height: 120px;
}

#gameOverPlayButton {
    left: 100px;

}

#shareButton {
    right: 100px;

}

#gameOverPlayButton:hover, #shareButton:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popUp {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Portrait */
 @media ( max-width : 600px ) {
    #home-section {
        width: 800px;
        height: 1180px;
        position: absolute;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #gameContainer {
        width: 800px;
        height: 1180px;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }


        #renderCanvas {
        width: 800px ;
        height: 1180px ;
        touch-action: none;
        display: block;
    }

    #scoreContainer {
        top: 5px ;
        right: 5px ;
    }

    #highScorePanel, #yourScorePanel {
        width: 600px;
    }

    #coinsEarnedText{
        top: 320px;
        font-size: 50px;
    }
    #coinIcon {
    top: 330px;
    left: 165px;
}

    .buffContainer {
        transform: scale(0.6) ;
        top: 5px ;
        left: 5px ;
    }

    #startVideo {
        width: 700px;
        border-radius: 100px;
    }

    #chickenIcon{
        width: 120px;
        height: 120px;
    }

    #tooltipText {
        font-size: 28px;
    }

    #gameOverPlayButton, #shareButton {
        right: 100px;
        height: 110px;
        bottom: 72px;
    }

}


        .babylon-button, .babylon-textblock {
            font-family: 'Fox Diego', sans-serif !important;
        }

        #loadingScreen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.9);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            display: none;
        }

        #loadingScreen img {
            width: 150px;
            height: 150px;
            margin-bottom: 20px;
        }

        #loadingText {
            color: white;
            font-family: 'Fox Diego', sans-serif;
            font-size: 24px;
            margin-bottom: 10px;
        }

        #loadingProgress {
            color: white;
            font-family: 'Fox Diego', sans-serif;
            font-size: 18px;
        }

        @media (max-width: 600px) {
            #loadingScreen img {
                width: 100px;
                height: 100px;
            }

            #loadingText {
                font-size: 20px;
            }

            #loadingProgress {
                font-size: 16px;
            }

            #micSensitivityHUDSlider {
                width: 180px;
                -webkit-appearance: none;
                appearance: none;
                height: 12px;
                border-radius: 8px;
                background: linear-gradient(to right, #d4281f 0%, #7c0d08 100%);
                outline: none;
                cursor: pointer;
            }

            #micSensitivityHUDSlider::-webkit-slider-thumb {
                -webkit-appearance: none;
                appearance: none;
                width: 25px;
                height: 25px;
                border-radius: 50%;
                background: #ffffff;
                border: 2px solid #8d120c;
                box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
            }

            #micSensitivityHUDSlider::-moz-range-thumb {
                width: 20px;
                height: 20px;
                border-radius: 50%;
                background: #ffffff;
                border: 2px solid #8d120c;
                box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
            }

            #micSensitivityHUDIcon {
                width: 26px;
                height: 26px;
                filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
            }
        }

        /* Pause Screen */
        #pauseOverlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 10000;
            pointer-events: auto;
        }

        #pauseContent {
            text-align: center;
            padding: 40px 60px;
            border-radius: 20px;
            color: #fff;
        }

        #pauseTitle {
            font-family: 'Fox Diego', sans-serif;
            font-size: 48px;
            color: #fff;
            margin: 0 0 30px 0;
        }

        #resumeBtn {
            font-family: 'Fox Diego', sans-serif;
            font-size: 24px;
            padding: 15px 40px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.2s ease;
        }

        #resumeBtn:hover {
            background-color: #45a049;
            transform: scale(1.05);
        }

        #resumeBtn:active {
            transform: scale(0.98);
        }

        #score-container {
            position: absolute;
            top: 40px;
            right: 20px; 
            width: 250px;
            height: 100px;
            overflow: hidden;
            }

            #score-image {
            width: 100%;
            height: 100%;
            object-fit: fill; 
            position: absolute;
            top: 0;
            left: 0;
            }

            #score-box {
            position: relative;
            width: 100%;
            height: 100%;
            font-family: "Fox Diego", sans-serif;
            font-size: 42px;
            color: black;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            }

            #buff-container {
                position: absolute;
                top: 20px;
                left: 20px;
                width: 200px;
                height: 150px;
                display: flex;
                flex-direction: column;
                gap: 10px;

                font-family: "Fox Diego", sans-serif;
                pointer-events: none;
            }

            .buff-item {
                position: relative;
                width: 200px;
                height: auto;
                pointer-events: none;
            }

            .buff-icon {
                width: 100%;
                height: auto;
                display: block;
                object-fit: fill;
            }

            .buff-timer {
                position: absolute;
                inset: 0;
                z-index: 2;

                display: flex;
                align-items: center;
                justify-content: center;

                font-size: 38px;
                color: black;
                text-align: center;

                line-height: 1;
                transform: translate(0, 0);
            }

            .buff-item[data-buff="speed"] .buff-timer {
                transform: translate(10px, -3px);
            }

            .buff-item[data-buff="slow"] .buff-timer {
                transform: translate(28px, 2px);
            }

            .buff-item[data-buff="invincible"] .buff-timer {
                transform: translate(20px, 8px);
            }

            #loudnessHUDContainer{
            position: absolute;
            left: 30px;
            bottom: 100px;
            display: flex;
            flex-direction: column;     /* title on top, bar under */
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            border-radius: 14px;        /* pill not needed anymore, but ok */
            background: linear-gradient(135deg, #fde9c8, #fbdab0);
            border: 2px solid #c54526;
            z-index: 35;
            pointer-events: none;
            }

            #loudnessHUDTitle{
                font-family: "Fox Diego", Arial, sans-serif;
                font-weight: 700;
                font-size: 24px;
                line-height: 1;
                margin-bottom: 15px;
                color: #000000;
                text-shadow: 0 1px 2px rgba(0,0,0,0.25);
                text-align: center;
                width: 100%;
                user-select: none;
            }

            #loudnessHUDIcon{
                width: 26px;
                height: 26px;
                filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
                flex: 0 0 auto;
            }

        /* Horizontal bar container */
        #loudness-wrap{
        position: relative;
        width: 55vw;            /* represents screen height mapped onto X */
        max-width: 420px;
        min-width: 220px;
        height: 18px;
        background: rgba(1, 37, 65, 0.75);
        border-radius: 999px;
        overflow: hidden;
        }

        /* Fill grows to the right */
        #loudness-fill{
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 0%;
        background: rgba(0, 223, 255, 0.9);
        border-radius: 999px;
        }

        /* Markers become vertical lines */
        #loudness-marker-fixed,
        #loudness-marker-live{
        position: absolute;
        top: -6px;
        height: calc(100% + 12px);
        width: 2px;
        background: rgba(255, 212, 0, 0.95);
        }

        /* Live marker */
        #loudness-marker-live{
        background: rgba(255, 255, 255, 0.95);
        }

        /* Target band (optional) */
        #loudness-target{
        position: absolute;
        top: 0;
        height: 100%;
        left: 0%;
        width: 0%;
        background: rgba(0, 255, 120, 0.25);
        border: 1px solid rgba(0, 255, 120, 0.75);
        box-sizing: border-box;
        }

        @media (max-width: 600px) {
            #pauseContent {
                padding: 30px 40px;
            }

            #pauseTitle {
                font-size: 36px;
            }

            #resumeBtn {
                font-size: 20px;
                padding: 12px 30px;
            }
        }

        @keyframes logoAnim {
            0% {
                transform: scale(1) rotate(-5deg)

            }
            50% {
                transform: scale(.96)  rotate(0deg)

            }
            100% {
                transform: scale(1) rotate(-5deg)

            }
        }

        #gameContainer {
            position: relative;
        }

        #make-noise-prompt {
            position: absolute;
            left: 50%;
            top: 18%;
            transform: translateX(-50%);
            z-index: 20;
            font-family: "Fox Diego", sans-serif;
            font-size: 42px;
            color: #fff;
            text-shadow:
                0 2px 0 rgba(0,0,0,0.7),
                0 0 12px rgba(0,0,0,0.45);
            pointer-events: none;
            user-select: none;
            white-space: nowrap;
        }

        @media (max-width: 1180px) {
            #make-noise-prompt {
                font-size: 32px;
                top: 16%;
            }
        }

        @media (max-width: 800px) and (orientation: portrait) {
            #make-noise-prompt {
                font-size: 52px;
                top: 14%;
            }
        }