/* ── Voronoi Crystal Gallery – Styles ── */

.vcg-container {
    position: relative;
    width: 100%;
    height: 560px;
    overflow: hidden;
    background: #04080f;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    font-family: system-ui, -apple-system, sans-serif;
}

/* ── WebGL background canvas ── */
.vcg-canvas-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

/* ── SVG cell overlay ── */
.vcg-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: visible;
}

.vcg-cell {
    transition: opacity 0.25s;
}

.vcg-cell-fill {
    transition: fill 0.35s, opacity 0.35s;
    cursor: pointer;
}

.vcg-cell-fill.vcg-hovered {
    opacity: 0.55;
}

.vcg-cell-edge {
    fill: none;
    pointer-events: none;
    transition: stroke-width 0.25s, opacity 0.3s;
}

/* Glow filter (SVG feGaussianBlur defined inline) */
.vcg-cell-glow {
    fill: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s;
}
.vcg-cell:hover .vcg-cell-glow { opacity: 1; }

/* ── Image Cards ── */
.vcg-cards-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.vcg-card {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    transform: translate(-50%, -50%) scale(0.72);
    opacity: 0;
    transition:
        opacity  0.5s ease,
        transform 0.5s cubic-bezier(.34,1.56,.64,1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 0 0 2px rgba(255,255,255,0.4),
        0 0 24px 4px rgba(26,144,255,0.35),
        0 10px 36px rgba(0,0,0,0.75);
    /* Clipping to cell polygon applied via JS clip-path */
}

.vcg-card.vcg-card-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.vcg-card:hover {
    z-index: 20;
    box-shadow:
        0 0 0 3px #fff,
        0 0 40px 10px rgba(26,144,255,0.7),
        0 16px 56px rgba(0,0,0,0.9);
    transform: translate(-50%, -50%) scale(1.08) !important;
}

.vcg-card img {
    display: block;
    width: 140px;
    height: 105px;
    object-fit: cover;
}

.vcg-card-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255,255,255,0.85);
    font-size: 10px;
    text-align: center;
    padding: 3px 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Pulse ring on image cells */
.vcg-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    border: 2px solid rgba(26,144,255,0.3);
    animation: vcg-pulse 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes vcg-pulse {
    0%,100% { transform: scale(1);    opacity: 0.5; }
    50%      { transform: scale(1.09); opacity: 0.1; }
}

/* ── Shatter FX canvas ── */
.vcg-canvas-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

/* ── UI ── */
.vcg-ui {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 50;
    pointer-events: none;
}

.vcg-controls {
    display: flex;
    gap: 4px;
    pointer-events: all;
}

.vcg-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.11);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex; align-items: center; justify-content: center;
}
.vcg-btn:hover  { background: rgba(255,255,255,0.26); }
.vcg-btn:active { transform: scale(0.91); }

.vcg-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.38);
    white-space: nowrap;
}

/* ── Lightbox ── */
.vcg-lightbox {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vcg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.vcg-lb-content {
    position: relative;
    z-index: 1;
    max-width: 90%;
    text-align: center;
    animation: vcg-lb-in 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes vcg-lb-in {
    from { opacity:0; transform: scale(0.8) translateY(30px); }
    to   { opacity:1; transform: scale(1)   translateY(0); }
}

.vcg-lb-img {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 14px;
    box-shadow:
        0 0 0 2px rgba(26,144,255,0.5),
        0 40px 100px rgba(0,0,0,0.95);
    display: block;
    margin: 0 auto;
}

.vcg-lb-caption {
    color: rgba(255,255,255,0.72);
    margin-top: 14px;
    font-size: 14px;
}

.vcg-lb-close {
    position: absolute;
    top: -14px; right: -14px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.vcg-lb-close:hover { background: rgba(255,255,255,0.32); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .vcg-container { height: 400px; }
    .vcg-card img { width: 105px; height: 78px; }
}
@media (max-width: 480px) {
    .vcg-container { height: 300px; }
    .vcg-card img { width: 78px; height: 58px; }
    .vcg-hint { display: none; }
}
