#game-wrapper {
    position: relative;
    width: 90vw;
    height: 85vh;
    margin: 0 auto;
    margin-top: 10px;
    margin-bottom: 10px;
    border: none;
    outline: 0px transparent;
    overflow: hidden;
    border: none;
    outline: 0px  transparent;
}
#game-container {
    position: relative;
    width: 90vw;
    height: 85vh;
    margin: 0 auto;  /* Centers the div horizontally */
    border: 1px solid black;
    overflow: hidden;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-repeat: repeat-x;
    background-position: 0 0;
    z-index: 0;
    background-size:  cover;
    background-position: center;
    overflow: hidden;
}
#avatar-container {
    position: absolute;
 
    z-index: 18;
    left: 100px;
    top: 100px;
    
    transform-origin: center center;
    display: inline-block;

   
}

#avatar {
    display: inline-block;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: 0 0;
    image-rendering: pixel-art; /* or crisp-edges for retro look */
}  

/* Per-avatar configurations */
#avatar-container[data-id="1"] {
    aspect-ratio: 333 / 302;
    width: 333px;
    --fit-margin-top: .22;
    --fit-margin-bottom: 0.23;
    --fit-margin-left: .03;
    --fit-margin-right: 0.03;
    --animation-duration: 0.5s;
    --animation-steps: 15;
    --total-width-px: 5000px;
    --animation-direction: normal;
    --base-scale: .85;    
}
#avatar-container[data-id="1"] #avatar {
    animation: avatarfly-1 var(--animation-duration) steps(var(--animation-steps)) infinite var(--animation-direction);
}

#avatar-container[data-id="2"] {
    aspect-ratio: 430 / 270;
    width: 430px;
    --fit-margin-top: 0.04;
    --fit-margin-bottom: 0.04;
    --fit-margin-left: 0.04;
    --fit-margin-right: 0.04;
    --animation-duration: 1.4s;
    --animation-steps: 24;/*48;*/
    --total-width-px: 10320px;/*20640px;*/
    --animation-direction: alternate;
    --base-scale: .51;    
}
#avatar-container[data-id="2"] #avatar {
    animation: avatarfly-2 var(--animation-duration) steps(var(--animation-steps)) infinite var(--animation-direction);
}

#avatar-container[data-id="3"] {
    aspect-ratio: 334 / 202;
    width: 334px;
    --fit-margin-top: 0.0;
    --fit-margin-bottom: 0.0;
    --fit-margin-left: 0.0;
    --fit-margin-right: 0.0;
    --animation-duration: 1.2s;
    --animation-steps: 23;
    --total-width-px: 7682px;
    --animation-direction: alternate;
    --base-scale: .70;    
}
#avatar-container[data-id="3"] #avatar {
    animation: avatarfly-3 var(--animation-duration) steps(var(--animation-steps)) infinite var(--animation-direction);
}

#avatar-container[data-id="4"] {
    aspect-ratio: 414 / 339;
    width: 414px;
    --fit-margin-top: 0.;
    --fit-margin-bottom: 0.;
    --fit-margin-left: 0.;
    --fit-margin-right: 0.;
    --animation-duration: 1s;
    --animation-steps: 35;/*70;*/
    --total-width-px: 14507px;/*29015px;*/
    --animation-direction: normal;
    --base-scale: .42;    
}
#avatar-container[data-id="4"] #avatar {
    animation: avatarfly-4 var(--animation-duration) steps(var(--animation-steps)) infinite var(--animation-direction);
}

/* Unique keyframes per avatar (to avoid conflicts) */
@keyframes avatarfly-1 {
    from { background-position: 0 0; }
    to { background-position: calc(-1 * var(--total-width-px)) 0; }
}
@keyframes avatarfly-2 {
    from { background-position: 0 0; }
    to { background-position: calc(-1 * var(--total-width-px)) 0; }
}
@keyframes avatarfly-3 {
    from { background-position: 0 0; }
    to { background-position: calc(-1 * var(--total-width-px)) 0; }
}
@keyframes avatarfly-4 {
    from { background-position: 0 0; }
    to { background-position: calc(-1 * var(--total-width-px)) 0; }
}

.word {
    position: absolute;
    white-space: nowrap;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.explode-effect {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none; /* No interference */
    animation: explode .6s ease-out forwards;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out; 
    opacity: 1;
} @keyframes explode {
    0% {
        /*transform: scale(1);*/
        opacity: 1;
    }
    50% {
        /*transform: scale(2);*/
        opacity: 0.6;
    }
    100% {
        /*transform: scale(3);*/
        opacity: 0;
    }
}

.foreground-object {
    position: absolute;
}

.flying-bird1 {
    width: 309px; /* 309 orig size of one frame */
    height: 252px;
    background-repeat: no-repeat;
    animation: flyingbird1 .4s steps(10) infinite; 
} @keyframes flyingbird1 {
    from { background-position: 0px 0; }
    to { background-position: -3075px 0; } 
}

.flying-bird2 {
    width: 137px; 
    height: 139px;
    background-repeat: no-repeat;
    animation: flyingbird2 0.35s steps(12) infinite; 
} @keyframes flyingbird2 {
    from { background-position: 0px 0; }
    to { background-position: -1644px 0; } 
}

#score-container {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    background-color: rgba(26, 72, 255, 0.3);
    padding: 10px;
    border-radius: 3px;
    height: 30px; 
    line-height: 40px; /* Ensures text stays aligned */
    z-index: 400;
}
#score {
    position: static;
    display: inline;
    top: 4px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    left: 10px;
    font-size: 28px;
    font-weight: bold;
    transition: transform 0.1s ease-in-out, font-size 0.1s ease-in-out;
    display: inline-block; /* Prevents layout shifting */
    background: none;
}

#category-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(26, 72, 255, 0.3);
    font-weight: bold;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}

#category {
    font-size: 26px;
    color: rgb(196, 252, 196);
	padding: 3px 8px;
	border: 1px solid #66cc6613;
	border-radius: 8px;
	display: inline-block;     /* lets padding/border take effect */
	white-space: nowrap;       /* keep on one line */
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#splash-menu {
    position: absolute;
    top:auto;
    left: 0;
    display: flex;
    width: 90vw;
    height: 85vh;
    background-color: rgba(10, 20, 10, 0.662); 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    touch-action: auto;
}

#lives-container {
    position: absolute;
    top: 40px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
    background-color: transparent;
    padding: 10px;
    border-radius: 3px;
}

.heart {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.75;
    transition: opacity 0.3s ease;
    position: relative;
    top: 0px;
    animation: heartbeat 1.3s infinite alternate;
}

.heart::before,
.heart::after {
    width: 30px;
    height: 30px;
    background-color: red;
    border-radius: 50%;
    position: absolute;
}

.heart.lost {
    filter: grayscale(100%);
    opacity: 0.85;
    animation: none;
}

.heart.lost::before,
.heart.lost::after {
    background-color: #555;
}

@keyframes heartbeat {
    0%, 100% { transform:  scale(1); }
    50% { transform:  scale(1.1); }
}

.game-title {
    font-size: 2rem;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #fff;
    margin-bottom: 9px;
    margin-top: 8px;
}

#menu-options {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 15px;
    background: #223322; /* darker green-gray */
    padding: 15px 20px;
    border-radius: 10px;
    align-items: center;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.5);

    position: relative;
    z-index: 2000;
    pointer-events: auto;
}

#menu-options label {
    display: grid;
    font-size: 19px;
    text-align: right;
    padding-right: 3px;
    color: #ffffff;
}
#menu-options select, #menu-options button {
    padding: 8px;
    font-size: 16px;
    color: #e4f7cd;
}

.menu-button-wrapper {
    grid-column: 1 / span 2;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 5px; /* Was margin-top: 10px */
    z-index: 889;
}

/* Fix for volume sliders - replace your existing .volume-controls section */
.volume-controls {
    grid-column: 1 / span 2;
    display: block;
    margin: 10px 0 5px 0; /* Was margin: 15px 0 - reduced top/bottom margins */
    padding: 10px 15px; /* Was padding: 15px - reduced padding */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.volume-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.volume-group:last-child {
    margin-bottom: 0;
}

.volume-group label {
    flex: 0 0 140px; /* Was 120px - more width for longer text */
    text-align: right;
    margin-right: 15px;
    font-size: 18px; /* Slightly larger text */
    color: #e8d5a3;
    font-weight: 500; /* Slightly bolder */
}

/* COMPLETE SLIDER STYLING OVERRIDE */
.volume-group input[type="range"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: 28px !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
}

/* TRACK STYLING - Make it visible */
.volume-group input[type="range"]::-webkit-slider-runnable-track {
    width: 100% !important;
    height: 10px !important;
    background: linear-gradient(to right, 
        rgba(180, 140, 60, 0.3) 0%, 
        rgba(220, 180, 80, 0.9) 50%, 
        rgba(180, 140, 60, 0.3) 100%) !important;
    border-radius: 5px !important;
    border: 1px solid rgba(120, 90, 30, 0.8) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4) !important;
}

/* THUMB STYLING - Make it gold, not purple */
.volume-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(145deg, #ffd700, #b8860b) !important;
    border: 2px solid #8b6914 !important;
    border-radius: 50% !important;
    margin-top: -7px !important;
    box-shadow: 
        0 0 5px rgba(255, 215, 0, 0.8),
        0 2px 4px rgba(0,0,0,0.5) !important;
    cursor: grab !important;
    transition: all 0.2s ease !important;
}

.volume-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15) !important;
    box-shadow: 
        0 0 10px rgba(255, 215, 0, 1),
        0 3px 6px rgba(0,0,0,0.6) !important;
}

.volume-group input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing !important;
    transform: scale(1.1) !important;
    background: linear-gradient(145deg, #b8860b, #ffd700) !important;
}

/* FIREFOX STYLES */
.volume-group input[type="range"]::-moz-range-track {
    width: 100% !important;
    height: 10px !important;
    background: linear-gradient(to right, 
        rgba(180, 140, 60, 0.3) 0%, 
        rgba(220, 180, 80, 0.9) 50%, 
        rgba(180, 140, 60, 0.3) 100%) !important;
    border-radius: 5px !important;
    border: 1px solid rgba(120, 90, 30, 0.8) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4) !important;
}

.volume-group input[type="range"]::-moz-range-thumb {
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(145deg, #ffd700, #b8860b) !important;
    border: 2px solid #8b6914 !important;
    border-radius: 50% !important;
    box-shadow: 
        0 0 5px rgba(255, 215, 0, 0.8),
        0 2px 4px rgba(0,0,0,0.5) !important;
    cursor: grab !important;
    transition: all 0.2s ease !important;
}

.volume-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15) !important;
    box-shadow: 
        0 0 10px rgba(255, 215, 0, 1),
        0 3px 6px rgba(0,0,0,0.6) !important;
}

/* Add a glowing effect on focus for accessibility */
.volume-group input[type="range"]:focus {
    outline: none !important;
}

.volume-group input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 
        0 0 0 3px rgba(255, 215, 0, 0.3),
        0 0 10px rgba(255, 215, 0, 1) !important;
}

.volume-group input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 
        0 0 0 3px rgba(255, 215, 0, 0.3),
        0 0 10px rgba(255, 215, 0, 1) !important;
}

.opt, #start-game-btn, #resume-game-btn {
    padding: 6px 8px;
    font-size: 15px;
    border: 1px solid #55aa55;
    border-radius: 6px;
    background-color: #3a563a;
    color: #e8ffe8;
    
    width: 100%;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    touch-action: auto; 
    -webkit-appearance: menulist;
}

.opt option:disabled {
    color: #444444; 
    opacity: 0.8; 
}

.opt:hover {
    background-color: #4d964d;
    border-color: #66cc66;
}

.opt:focus, #start-game-btn:focus, #resume-game-btn:focus {
    outline: none;
    background-color: #65835b;
    border-color: #34642d;
}

#start-game-btn, #resume-game-btn {
    margin-top: 1px;
    background-color: #6d7d37;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    touch-action: manipulation;
    justify-content: center;
    width: auto;
    color:#0e180e
}
 #start-game-btn:hover, #resume-game-btn:hover {
    background-color: #a3bf65;
    border-color: #181d0c;
 }

#resume-game-btn {
    display: none; 
}   
/* Menu button inside the game */
#menu-button {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 32px;
    cursor: pointer;
    z-index: 30;
    background-color: #b9cdb984;
}