/* Puzzles Page Styles */

/* Main Container */
.puzzles-container {
    padding: 15px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Section */
.puzzles-header p {
    color: var(--text-primary);
}

/* Quick Access Row - Grid Layout */
.puzzle-quick-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.puzzle-item-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 110px;
    padding: 15px;
    border-radius: 10px;
    background: var(--bg-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}

.puzzle-item-compact:hover {
    background: var(--bg-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--border-color);
}

.puzzle-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    border-radius: 16px;
}

.puzzle-item-compact:hover .puzzle-icon-container {
    transform: scale(1.1) rotate(3deg);
    background: var(--bg-secondary);
}

.puzzle-icon-container img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 16px;
    border: 2px solid var(--text-primary);
}

.puzzle-name-label {
    font-size: var(--font-15);
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    font-weight: 400;
}

/* Categories */
.puzzle-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: var(--font-sm);
    font-weight: 400;
    line-height: 1.3125;
    color: var(--text-primary);
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Grid Layout */
.puzzles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 20px;
}

/* Puzzle Card Design */
.puzzle-card {
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    border: 1px solid var(--border-color);
}

.puzzle-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.12);
    border-color: var(--border-color);
    background: var(--bg-primary);
    z-index: 2;
}

.puzzle-image {
    height: 150px;
    width: 100%;
    position: relative;
    /* Removed default background to emphasize icon look */
    background: var(--bg-secondary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add a subtle gradient detail or pattern behind the icon if desired, or keep clean */
.puzzle-image::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    opacity: 0.3;
    z-index: 0;
}

.puzzle-image img {
    position: relative;
    z-index: 1;
    width: 80px;
    /* Slightly smaller to fit in the 'icon box' look */
    height: 80px;
    object-fit: contain;
    background: var(--text-primary);
    /* Icon box background */
    border-radius: 20px;
    /* Super-ellipse / App icon shape */
    padding: 2px;
    /* Icon shadow */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.puzzle-card:hover .puzzle-image img {
    transform: scale(1.1) rotate(3deg);
}



.puzzle-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.puzzle-info h3 {
    font-size: var(--font-16);
    color: var(--text-primary);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.puzzle-info p {
    font-size: var(--font-15);
    color: var(--text-secondary);
    margin: 0 0 15px 0;
    line-height: normal;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3125;
}

/* Play Button & Actions */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 100%;
}

.play-button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-15);
    transition: all 0.2s ease;
}

.play-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.card-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.card-share-btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    color: var(--primary-color);
}

/* Placeholder Styling */
/* Placeholder Styling */
.placeholder-img {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 800;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .category-title {
        font-size: 1.1rem;
    }

    .puzzles-grid {
        gap: 15px;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        /* Smaller cards on mobile */
    }

    .puzzle-image {
        height: 120px;
    }

    .puzzle-info {
        padding: 16px;
    }

    .puzzle-info h3 {
        font-size: 1rem;
    }

    .puzzle-info p {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        margin-bottom: 16px;
    }

    .play-button {
        padding: 10px;
        font-size: 0.85rem;
    }

    .card-share-btn {
        width: 40px;
        height: 40px;
    }

    .card-actions {
        gap: 8px;
    }

    .puzzle-category {
        margin-bottom: 60px;
    }
}