:root {
    --pink: #fab9f4;
    --blue: #84a5f9;
    --white: #ffffff;
    --black: #000000;
}

/* =========================
   BASE
   ========================= */
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;

    background: linear-gradient(135deg, var(--pink), var(--blue));
    color: var(--black);

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;

    overflow: hidden;
}

/* =========================
   MAIN UI
   ========================= */
main {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

/* =========================
   STATUS
   ========================= */
#status {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;

    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;

    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* =========================
   VIDEO AREA
   ========================= */
.video-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-container {
    position: relative;

    border-radius: 20px;
    overflow: hidden;

    border: 6px solid var(--white);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

video {
    width: 500px;
    max-width: 90vw;
    display: block;
}

/* overlay */
#overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;

    background: rgba(0, 0, 0, 0.65);
    color: white;

    padding: 10px 14px;
    border-radius: 10px;

    font-size: 16px;
}

/* =========================
   CONTROLS
   ========================= */
.controls {
    width: 500px;
    max-width: 90vw;

    display: flex;
    justify-content: space-between;

    margin-top: 15px;
}

button {
    flex: 1;
    margin: 0 10px;

    padding: 14px;
    font-size: 16px;

    border: none;
    border-radius: 30px;

    cursor: pointer;

    background: var(--black);
    color: var(--white);

    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

button:hover {
    background: var(--pink);
    color: var(--black);
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* =========================
   EXPERIENCE LAYER
   ========================= */
#experience {
    position: fixed;
    inset: 0;
    z-index: 999;

    display: flex;
    justify-content: center;
    align-items: center;

    background: radial-gradient(circle at center, rgba(10, 10, 10, 0.95), rgba(0, 0, 0, 1));

    overflow: hidden;
}

/* Contenitore che garantisce stesse dimensioni */
.experience-inner {
    position: relative;

    width: min(90vw, 700px);
    height: min(90vh, 700px);

    display: flex;
    justify-content: center;
    align-items: center;
}

/* IMMAGINI E CANVAS: stessa dimensione, stesso box */
#topImage,
#bottomImage,
#breakCanvas {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;
    border-radius: 12px;
}

/* bottom image */
#bottomImage {
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#bottomImage.show {
    opacity: 1;
}

/* top image */
#topImage {
    z-index: 2;
}

/* canvas */
#breakCanvas {
    z-index: 3;
    pointer-events: none;
}
/* =========================
   BLU SELECTOR
   ========================= */
#bluSelector {
    position: fixed;
    inset: 0;
    z-index: 9999;

    background: rgba(0, 0, 0, 0.9);

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: auto; /* permette scrolling su schermi piccoli o troppo grandi */
    padding: 20px;
}

#bluContent {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    max-width: 700px;
}

#bluTitle {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 12px;
    text-transform: uppercase;
    text-align: center;
}

/* MATRICE 3×3 RESPONSIVE */
#bluGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;

    width: 100%;
    max-width: 600px;

    /* garantisce che entri su mobile */
    height: auto;
}

#bluGrid img {
    width: 100%;
    aspect-ratio: 1 / 1;

    object-fit: contain;
    border-radius: 10px;

    cursor: pointer;
    transition: transform 0.2s ease;
}

#bluGrid img:hover {
    transform: scale(1.03);
}

/* UTILS */
.hidden {
    display: none !important;
}