/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(92, 124, 250, 0.2);
    }

    50% {
        box-shadow: 0 0 30px rgba(92, 124, 250, 0.4);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out both;
}

/* ========== Upload Zone ========== */
.upload-zone.drag-over {
    border-color: #748ffc !important;
    background: rgba(76, 110, 245, 0.1) !important;
    box-shadow: 0 0 40px rgba(76, 110, 245, 0.15), inset 0 0 40px rgba(76, 110, 245, 0.05);
}

/* ========== Difficulty Buttons ========== */
.diff-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.6);
    color: #94a3b8;
}

.diff-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: #748ffc;
    color: #bac8ff;
    transform: translateY(-1px);
}

.diff-btn.active {
    background: linear-gradient(135deg, #4c6ef5, #7c3aed);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(76, 110, 245, 0.3);
}

/* ========== Puzzle Board ========== */
.puzzle-board {
    display: grid;
    gap: 2px;
    background: rgba(15, 23, 42, 0.6);
}

/* ========== Board Slot ========== */
.board-slot {
    aspect-ratio: 1;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    position: relative;
    transition: transform 0.15s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ========== Sliding Piece ========== */
.slide-piece {
    cursor: pointer;
    border-radius: 2px;
}

.slide-piece:hover {
    border-color: rgba(116, 143, 252, 0.6);
    box-shadow: inset 0 0 15px rgba(116, 143, 252, 0.12);
    z-index: 2;
}

.slide-piece:active {
    transform: scale(0.96);
}

.slide-piece.correct {
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: inset 0 0 8px rgba(52, 211, 153, 0.1);
}

/* ========== Blank Cell ========== */
.blank-cell {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px dashed rgba(71, 85, 105, 0.3) !important;
    cursor: default;
}

/* ========== Win Modal ========== */
.win-card {
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* ========== Misc ========== */
.screen-leave {
    animation: fadeIn 0.4s ease reverse both;
}

.slot-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.25);
    pointer-events: none;
    user-select: none;
}

/* Piece Tray (hidden in sliding mode, kept for compatibility) */
.piece-tray .puzzle-piece {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.4);
}

@media (min-width: 768px) {
    .piece-tray .puzzle-piece {
        width: 85px;
        height: 85px;
    }
}