* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fafafa;
    color: #333;
}

/* --------------------------------------
   Gallery wrapper
   -------------------------------------- */
.sim-gallery {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Main title */
.sim-gallery>h2 {
    font-size: 2.5rem;
    letter-spacing: 1.5px;
    text-align: center;
    margin-bottom: 1rem;
    color: #222;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* --------------------------------------
   Each simulator section
   -------------------------------------- */
.sim-section {
    margin: 3rem 0;
}

.sim-section>h3 {
    font-size: 1.75rem;
    text-align: center;
    color: #444;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.sim-section>h3::after {
    content: "";
    display: block;
    height: 3px;
    width: 50px;
    background: #007ACC;
    margin: 8px auto 0;
    border-radius: 2px;
}

.mosaic {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 120px;
    gap: 12px;
}

.mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: block;
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

.mosaic img:hover {
    transform: scale(1.05);
    z-index: 1;
    /* lift above neighbors so it doesn’t get clipped */
}

/* Responsive fallback: fewer columns on narrower viewports */
@media (max-width: 800px) {
    .mosaic {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 100px;
    }
}

@media (max-width: 500px) {
    .mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 80px;
    }
}

/* Modal backdrop + centering */
.modal {
    display: none;
    /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* When visible, use flex */
.modal.show {
    display: flex;
}

/* The large image */
.modal-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Caption text */
.modal-caption {
    margin-top: 12px;
    color: #fff;
    text-align: center;
    font-size: 1rem;
}

/* Close “×” */
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}