* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", system-ui, sans-serif;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #1a1a26, #0b0b10);
    color: #eaeaf2;
    display: flex;
    justify-content: center;
}

/* BOTÓN VOLVER */
.back-button {
    position: fixed;
    top: 16px;
    left: 16px;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.6);
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(30,30,45,0.4);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s ease;
    z-index: 10;
}

.back-button:hover {
    color: #fff;
    background: rgba(40,40,60,0.6);
}

/* CONTENEDOR */
.puzzle-container {
    width: 100%;
    max-width: 500px;
    padding: 72px 16px 48px;
}

/* TABLERO */
.puzzle-board {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
}


/* PIEZA */
.tile {
    position: absolute;
    width: calc(25% - 4.5px);
    height: calc(25% - 4.5px);
    border-radius: 14px;
    cursor: pointer;
    background-size: 400% 400%;
    transition: transform 0.25s ease;
}


.tile:hover {
    transform: scale(0.97);
}

/* PIEZA VACÍA */
.tile.empty {
    background: transparent;
    cursor: default;
}


/* ANIMACIÓN CAÍDA */
.tile.fall {
    animation: fall 0.8s ease forwards;
}

@keyframes fall {
    to {
        transform: translateY(120vh) rotate(12deg);
        opacity: 0;
    }
}

/* ========================= */
/* OVERLAY VICTORIA */
/* ========================= */

.victory-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,18,0.75);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    z-index: 20;
}

.victory-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.victory-card {
    text-align: center;
    padding: 36px 32px;
    border-radius: 22px;
    background: rgba(30,30,45,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: pop 0.6s ease;
}

@keyframes pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.victory-sub {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.victory-text {
    font-size: 3rem;
    margin: 12px 0 20px;
    letter-spacing: 0.15em;
}

.victory-btn {
    display: inline-block;
    margin-top: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #fff;
    padding: 10px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6a6aff, #8f8fff);
}
