body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #1a2a6c;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Game Container - Responsive Behavior */
#game-container {
    position: relative;
    overflow: hidden;
    background: transparent;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
}

/* Game Canvas */
#game-canvas {
    display: block;
    background: linear-gradient(to bottom, #0f9ed6, #E0F7FA);
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Mobile Controls */
#mobile-controls {
    display: none; /* hidden by default */
}


#game-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#wd{
    display: none;
}

/* Show mobile content  */
@media (max-width: 480px) {
    #game-container {
        height: 100%
        ;
        
    }

    #game-canvas {
        image-rendering: pixelated;
        object-fit: contain; /* <- Better than 'fill' */
        display: block;
        width: 100%;
        height: 100%;
        z-index: 0;
        pointer-events: none;
    }

    #mobile-controls {
        position: absolute;
        bottom: 71px;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-between;
        padding: 0 30px;
    }

    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        background: radial-gradient(circle at 30% 30%, #11afd6, #11afd9);
        border-radius: 50%;
        box-shadow:
            0 0 12px rgba(0, 140, 255, 0.8),
            0 0 25px rgba(255, 87, 34, 0.6),
            inset 0 0 10px rgba(167, 9, 9, 0.2);
        color: white;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        cursor: pointer;
        touch-action: manipulation;
    }

    .control-btn:active,
    .control-btn.pressed {
        transform: scale(0.92);
        background: radial-gradient(circle at 30% 30%, #F57C00, #EF6C00);
        box-shadow:
            0 0 5px rgba(255, 152, 0, 0.5),
            inset 0 0 5px rgba(0, 0, 0, 0.4);
    }
}


/* Menu, Game, Game Over Screens */
 #game-screen, #game-over-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    font-size: larger;
}

#menu-screen{
height: 100%;
width: 100%;;
display: block;
justify-items: center;
position: absolute;
top: 0px;
left: 0%;
bottom: 0;

}

#img{
    height: 271px;
width: 205px;
background-image: url(assets2/ice.jpg);
background-size: contain;
margin-top: 21px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0 20px;
}

button {
    padding: 11px 21px;
    font-size: 1.2em;
    background: #d0f114;
    color: rgb(129, 25, 25);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    pointer-events: auto;
    z-index: 221;
}

button:hover {
    background: #d38a1d;
    transform: scale(1.05);
}

#game-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1em;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-weight: bold;
}

#pause-btn {
    position: absolute;
    top: 70px;
    left: 10px;
    padding: 8px 15px;
    font-size: 1em;
    background: #FF9800;
    z-index: 100;
}

#character-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 15px;
    font-size: 1em;
    background: #2196F3;
    z-index: 100;
}

#character-selection {
    position: absolute;
    top: 50px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    display: none;
    z-index: 100;
}

.character {
    padding: 8px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    color: white;
}

.character:hover {
    background: rgba(255, 255, 255, 0.2);
}

.character-icon {
    width: 30px;
    height: 30px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    border: 2px solid white;
}

#game-over-screen {
    background: rgba(206, 72, 150, 0.8);
    display: none;
}

#menu-screen {
    background: linear-gradient(to bottom, #3a5FC8, #3f648f);
}

.distant-mountains {
    position: absolute;
    width: 100%;
    height: 200px;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.3));
    z-index: 1;
}

.control-btn:active,
.control-btn.pressed {
    transform: scale(0.85);
    background: #dcdcdc;
}

/* Prevent zooming on mobile */
html {
    touch-action: pan-x pan-y;
    height: 100%;
}

/* Prevent blue highlight on tap */
* {
    -webkit-tap-highlight-color: transparent;
}
