/* --- Background and Main Site --- */
body {
    margin: 0;
    height: 100vh;
    width: 100vw;
    background: url('lain.png') no-repeat center center fixed;
    background-size: cover;
    background-color: #000;
    color: #00ffff;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden; /* Stops page scroll */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- The 500x500 Box --- */
.container {
    background-color: rgba(0, 0, 0, 0.85);
    width: 500px;
    height: 500px;
    border: 2px solid #00ffff;
    padding: 30px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 20px #00ffff;
    position: relative;
    z-index: 1; /* Low z-index so images can go ABOVE it */
}

/* --- Thumbnail Gallery --- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.gallery-img {
    width: 100%;
    border: 1px solid #00ffff;
    cursor: pointer;
    transition: 0.3s;
}

/* --- THE BREAKOUT FIX (The Modal) --- */
.modal {
    display: none; 
    position: fixed; /* TAKES IT OUT OF THE BOX FLOW */
    z-index: 9999;   /* HIGHEST LAYER */
    left: 0;
    top: 0;
    width: 100vw;    /* FULL SCREEN WIDTH */
    height: 100vh;   /* FULL SCREEN HEIGHT */
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.modal-content {
    /* Large initial size on the screen */
    max-width: 80vw;
    max-height: 80vh;
    border: 2px solid #00ffff;
    box-shadow: 0 0 40px #00ffff;
    transition: transform 0.4s ease;
    cursor: zoom-in;
}

/* Second Click Zoom */
.modal-content.zoomed {
    transform: scale(1.3);
    cursor: zoom-out;
}