.simlab-racing-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.simlab-racing-gallery figure {
    position: relative;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
}

.simlab-gallery-link {
    display: block;
    aspect-ratio: 9 / 13;
    overflow: hidden;
    cursor: zoom-in;
}

.simlab-racing-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simlab-gallery-link:focus-visible {
    outline: 3px solid #dc9f48;
    outline-offset: -4px;
}

.simlab-lightbox-close:focus-visible {
    outline: 3px solid #dc9f48;
    outline-offset: 2px;
}

.simlab-racing-gallery figure:nth-child(1) img {
    object-position: center 68%;
}

.simlab-racing-gallery figure:nth-child(2) img {
    object-position: center 63%;
}

.simlab-racing-gallery figure:nth-child(3) img {
    object-position: center 25%;
}

.simlab-racing-gallery figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0.65rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    pointer-events: none;
}

.simlab-lightbox {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem 1rem;
}

.simlab-lightbox:target {
    display: flex;
}

.simlab-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    cursor: zoom-out;
}

.simlab-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    max-height: calc(100vh - 4.5rem);
    text-align: center;
}

.simlab-lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 7rem);
    margin: auto;
    border-radius: 4px;
}

.simlab-lightbox-caption {
    margin: 0.6rem 0 0;
    color: #fff;
    font-weight: bold;
}

.simlab-lightbox-close {
    position: fixed;
    z-index: 2;
    top: 0.75rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    color: #fff;
    font: 2.5rem/1 sans-serif;
    text-decoration: none;
}

.simlab-lightbox-close:hover {
    color: #dc9f48;
}

.simlab-games summary {
    color: #1f517d;
    font-weight: bold;
    cursor: pointer;
}

.simlab-games summary::marker,
.simlab-games summary:hover,
.simlab-games summary:focus-visible {
    color: #dc9f48;
}

.simlab-games[open] summary {
    margin-bottom: 0.4rem;
}

@media (max-width: 620px) {
    .simlab-racing-gallery {
        grid-template-columns: 1fr;
    }

    .simlab-gallery-link {
        aspect-ratio: 4 / 5;
    }
}
