/**
 * Game Cards - Modern Design
 * With proper badge positioning to avoid overlap
 */

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

/* Game Card */
.game-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Card Image */
.card-image-wrapper {
    position: relative;
    padding-top: 100%;
    background: linear-gradient(135deg, #f7fef9 0%, #f3f4f6 100%);
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .card-image {
    transform: scale(1.05);
}

.card-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #cbd5e1 100%);
}

.card-image-placeholder i {
    font-size: 40px;
    color: #94a3b8;
}

/* Card Badge (NEW / UPD) - top left */
.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.card-badge.new {
    background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
    color: white;
}

.card-badge.updated {
    background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
    color: white;
}

/* Rating Bar - bottom of image, no overlap */
.card-rating-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.card-rating i {
    color: #fbbf24;
    font-size: 11px;
}

.card-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #dcfce7;
}

.card-likes i {
    font-size: 10px;
}

/* Card Content */
.card-content {
    padding: 14px;
}

.card-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.game-card:hover .card-title {
    color: #16a34a;
}

/* Card Meta - Category & MOD tag */
.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.card-category {
    font-size: 12px;
    color: #6b7280;
}

.card-mod-tag {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
}

/* Card Features */
.card-features {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.card-feature {
    display: inline-block;
    padding: 3px 8px;
    background: #f7fef9;
    border-radius: 6px;
    font-size: 10px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.card-android {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.card-android i {
    color: #16a34a;
    font-size: 14px;
}

.card-version {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}

/* ===================== GRID VARIATIONS ===================== */

/* 5 columns */
.games-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* 4 columns */
.games-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* List view */
.games-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.games-grid.list-view .game-card {
    display: flex;
    flex-direction: row;
}

.games-grid.list-view .card-image-wrapper {
    width: 80px;
    height: 80px;
    padding-top: 0;
    flex-shrink: 0;
    border-radius: 12px;
}

.games-grid.list-view .card-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
}

.games-grid.list-view .card-title {
    flex: 1;
    min-height: auto;
    -webkit-line-clamp: 1;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
    }
}

@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-title {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .game-card {
        border-radius: 14px;
    }
    
    .card-content {
        padding: 10px;
    }
    
    .card-title {
        font-size: 12px;
        min-height: 32px;
        margin-bottom: 6px;
    }
    
    .card-meta {
        margin-bottom: 8px;
    }
    
    .card-category {
        font-size: 11px;
    }
    
    .card-features {
        display: none;
    }
    
    .card-footer {
        padding-top: 8px;
    }
    
    .card-android,
    .card-version {
        font-size: 10px;
    }
    
    .card-android i {
        font-size: 12px;
    }
    
    .card-badge {
        padding: 3px 6px;
        font-size: 8px;
    }
    
    .card-rating-bar {
        padding: 6px 8px;
    }
    
    .card-rating {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .game-card {
        border-radius: 10px;
    }
    
    .card-image-wrapper {
        border-radius: 10px 10px 0 0;
    }
    
    .card-content {
        padding: 8px;
    }
    
    .card-title {
        font-size: 11px;
        min-height: 28px;
        margin-bottom: 0;
    }
    
    .card-meta {
        margin-bottom: 4px;
    }
    
    .card-category {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .card-rating-bar {
        padding: 4px 6px;
    }
    
    .card-rating {
        font-size: 10px;
        gap: 3px;
    }
    
    .card-rating i {
        font-size: 9px;
    }
    
    .card-footer,
    .card-editor,
    .card-features {
        display: none;
    }
}

@media (max-width: 400px) {
    .games-grid {
        gap: 6px;
    }
    
    .card-content {
        padding: 6px 8px;
    }
    
    .card-title {
        font-size: 10px;
        min-height: 26px;
    }
    
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ===================== HORIZONTAL SCROLL SECTION ===================== */

.games-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    margin: 0 -20px;
    padding: 0 20px 10px;
}

.games-scroll::-webkit-scrollbar {
    display: none;
}

.games-scroll .game-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .games-scroll {
        margin: 0 -16px;
        padding: 0 16px 10px;
        gap: 12px;
    }
    
    .games-scroll .game-card {
        flex: 0 0 140px;
    }
}

/* ===================== EDITOR INFO IN CARD ===================== */

.card-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.card-editor__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #16a34a;
}

.card-editor__name {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .card-editor {
        display: none;
    }
}
