/* For Mobile */
@media screen and (max-width: 540px) {
    .view {
        width: 400px;
    }
}

/* For Tablets */
@media screen and (min-width: 540px) and (max-width: 780px) {
    .view {
        width: 600px;
    }
}

html {
    margin: 0px;
    padding: 0px;
}

body {
    background-color: #6a90c6;
    font-family: Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-variant: small-caps;
    text-rendering: geometricPrecision;
    margin: 0px;
    padding: 0px;
    font-size: clamp(9px, 1.8vh, 24px)
}


a {
color: cyan;
}
#bottom_menu {

    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    /* Ensure it does not overflow the viewport */
    box-sizing: border-box;
    /* Include padding and borders in the width */
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;

}

img {
    image-rendering: pixelated;
    /* For pixel-perfect scaling */
    image-rendering: crisp-edges;
    /* For sharper edges */
}

#screen-container {
    top: 8vh;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 201px;
    Overflow: hidden
}


#screen {
    position: fixed;
    top: 8vh;
    align-items: center;
    justify-content: center;

    max-width: 100vw;
    /* Ensure it does not overflow the viewport */
    ;

}



.game-container {

    margin: 0px;
    padding: 0px;
   
    width: auto;
    height: 480px;


}


.image-container {
    background: black;
    margin: 0px;
    padding: 10px;
    height: auto !important;
    position: relative;
    overflow: visible;

    text-align: center;
    /* Existing Border */
    border: 10px double rgb(103, 205, 225);
    /* Add this line for rounded corners */
    border-radius: 15px;

}

.image-container.enlarged {

    width: 100vw;
    height: 82vh;
    transform-origin: top center;
    transition: transform 250ms ease-in-out, filter 1000ms ease-in;
}


.image-container img {
    padding: 1vw;
    background-color: black;
    display: block;
    /* Remove inline spacing */
    margin: 0px;
    padding: 0px;

    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
   image-rendering: pixelated;

}



/* Scanline Overlay */
#scanline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0px,
        rgba(0, 0, 0, 0.5) 1px,
        transparent 1px,
        transparent 2px
    );
    image-rendering: pixelated;
}

/* Hidden by default */
#scanline-overlay.hidden {
    display: none;
}

 

/* Controls: Float above */
#scale {
padding-right: 17px; 
   z-index: 2000;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0;
    margin-left: 10px; /* match .image-container's border-width so it aligns with the right edge */
}   

/* #game sizing — set by JS, default 1x */
#game {
    padding: 0;
    margin: 0;
    width: 320px;
    height: 240px;
    overflow: hidden;
}

#game canvas,
#game > div {
    width: 100% !important;
    height: 100% !important;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}   

/* Scanline overlay covers .image-container */
#scanline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
        background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.1)
    );
    
    /* Adjust size to match the zoomed pixel height (e.g., 2px or 4px) */
    background-size: 100% 4px; 
    /* Optional: Add a slight CRT curve vignette */
    box-shadow: inset 0 0 10rem rgba(0,0,0,0.9);
}

#scanline-overlay.hidden {
    display: none;
}   

/* Tab Styles */
.size {
    margin-right: 2px;
}

.size a {
    background: grey;
    padding: 4px 8px;
    margin: 0px;
    border-left: 1px solid #ccc;

    border-top: none;
    border-bottom-left-radius: 10px;

    cursor: pointer;
    text-decoration: none;
    color: black;
    display: inline-block;
    font-size: 13px;
}

.size a:hover {
    background: orange;
}

.size.active a {
    background: #fff;
    font-weight: bold;
    border-color: #666;
}

/* Scanline Button */
.scanline-btn {
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 0px 0 1px 10px;
    cursor: pointer;

    font-size: 13px;
    color: #ccc;
}


.scanline-btn:hover {
    background: #555;
    color: #fff;
}

.scanline-btn.active {
    background: #00bcd4;
    color: #fff;
    border-color: #008ba3;
}
