/* ============================================
   SBOCCIATURA - Hand Gesture Meadow
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* ---- Container ---- */
.container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ---- Webcam Video ---- */
#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    z-index: 1;
}

/* ---- Canvas Overlay ---- */
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
    z-index: 2;
    pointer-events: none;
}

/* ---- Loading Screen ---- */
.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a0a1e 0%, #0a0510 60%, #000 100%);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-flower {
    width: 80px;
    height: 80px;
    position: relative;
    margin-bottom: 30px;
}

.loading-flower::before {
    content: '✿';
    font-size: 60px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: bloom-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 120, 180, 0.8));
}

@keyframes bloom-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
        filter: drop-shadow(0 0 10px rgba(255, 120, 180, 0.5));
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 25px rgba(255, 120, 180, 1));
    }
}

.loading-text {
    color: rgba(255, 200, 220, 0.9);
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: text-fade 2s ease-in-out infinite;
}

.loading-subtext {
    color: rgba(255, 180, 200, 0.5);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-top: 10px;
}

@keyframes text-fade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ---- Instruction Toast ---- */
.instructions {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 150, 200, 0.2);
    border-radius: 16px;
    padding: 16px 28px;
    color: rgba(255, 220, 240, 0.9);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.6;
    max-width: 520px;
    transition: opacity 1s ease, transform 1s ease;
    box-shadow: 0 8px 32px rgba(255, 100, 150, 0.1);
}

.instructions.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.instructions span {
    color: rgba(255, 160, 200, 1);
    font-weight: 600;
}

/* ---- Vignette ---- */
.vignette {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
}
