/* ============================================
   Mercury Lightbox — screenshots gallery
   Click image to open, swipe/arrows to navigate
   Matches hero section palette
   ============================================ */

/* === Thumbnail hover on screenshots === */
.kazino-ekransavini img {
    cursor: zoom-in;
    transition: transform 0.3s, box-shadow 0.3s, filter 0.3s;
}
.kazino-ekransavini img:hover {
    transform: translateY(-2px) scale(1.015);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    filter: brightness(1.03);
}

/* === Lightbox root === */
.merc-lb {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 2, 25, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 60px 20px 80px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.merc-lb.is-open {
    opacity: 1;
    visibility: visible;
}
.merc-lb * { box-sizing: border-box; }

/* === Image stage === */
.merc-lb-stage {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.merc-lb-img {
    max-width: 92vw;
    max-height: calc(100vh - 160px);
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
    transform: scale(0.92);
    opacity: 0;
    display: block;
    -webkit-user-drag: none;
    user-drag: none;
}
.merc-lb.is-open .merc-lb-img.is-ready {
    transform: scale(1);
    opacity: 1;
}
.merc-lb-img.is-swiping {
    transition: none;
}

/* Loading spinner */
.merc-lb-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #c4e538;
    border-radius: 50%;
    animation: mercLbSpin 0.9s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
}
.merc-lb-loader.is-visible {
    opacity: 1;
}
@keyframes mercLbSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === Caption === */
.merc-lb-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,0.75);
    font-size: 0.88em;
    font-weight: 500;
    padding: 0 20px;
    pointer-events: none;
    line-height: 1.4;
}

/* === Close button === */
.merc-lb-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    z-index: 2;
}
.merc-lb-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}
.merc-lb-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
}

/* === Nav arrows === */
.merc-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    z-index: 2;
}
.merc-lb-nav:hover {
    background: #c4e538;
    color: #1a0533;
    border-color: #c4e538;
}
.merc-lb-nav:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}
.merc-lb-nav svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.merc-lb-prev { left: 16px; }
.merc-lb-next { right: 16px; }

/* === Counter / dots === */
.merc-lb-counter {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50px;
    color: rgba(255,255,255,0.85);
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.05em;
    z-index: 2;
}
.merc-lb-counter strong {
    color: #c4e538;
    font-weight: 700;
}

/* Dots (bottom — alternative for small sets) */
.merc-lb-dots {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.merc-lb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.merc-lb-dot:hover { background: rgba(255,255,255,0.5); }
.merc-lb-dot.is-active {
    background: #c4e538;
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(196,229,56,0.5);
}

/* === Mobile === */
@media (max-width: 640px) {
    .merc-lb { padding: 50px 10px 70px; }
    .merc-lb-img { max-height: calc(100vh - 130px); border-radius: 8px; }
    .merc-lb-close { top: 10px; right: 10px; width: 40px; height: 40px; }
    .merc-lb-nav { width: 44px; height: 44px; }
    .merc-lb-prev { left: 8px; }
    .merc-lb-next { right: 8px; }
    .merc-lb-counter { top: 18px; font-size: 0.75em; padding: 5px 12px; }
    .merc-lb-caption { bottom: -32px; font-size: 0.78em; }
    .merc-lb-dots { bottom: 16px; }
}

/* No-motion preference */
@media (prefers-reduced-motion: reduce) {
    .merc-lb, .merc-lb-img, .merc-lb-close, .merc-lb-nav, .merc-lb-dot, .kazino-ekransavini img {
        transition: none !important;
        animation: none !important;
    }
}

/* Lock body scroll when open */
body.merc-lb-open {
    overflow: hidden;
}
