/* CSS fixes for game card layout */
.card {
    float: left;
    width: 20%;
    background: transparent;
    border: none;
    text-align: center;
    position: relative;
}

.card-content {
    margin: 7px;
    color: var(--text-color);
    font-size: 12px;
    border: 1px solid var(--accent-color);
    overflow: hidden;
    position: relative;
    background: var(--secondary-color);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.img-container {
    height: 0;
    padding-bottom: 100%; /* Creates a square aspect ratio */
    position: relative;
    overflow: hidden;
}

.img-zoom {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures the image covers the area without stretching */
}

.game-info {
    padding: 8px 5px;
}

.m-hide {
    display: block;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make sure the hover button is properly positioned */
.hover-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.hover-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.7);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--accent-color);
}

.play-btn {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Percentage bar styling */
.percent {
    height: 22px !important; /* Increased height */
    margin: 8px 5px !important;
    border-radius: 4px !important;
    position: relative !important;
}

.percent p {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 12px !important;
    z-index: 20 !important;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8) !important;
    color: var(--text-color) !important;
}

.percent-bar {
    height: 22px !important;
    border-radius: 4px !important;
}

/* Color-specific text styling */
.percent-bar.red + p {
    color: white !important;
}

.percent-bar.yellow + p {
    color: white !important;
}

.percent-bar.green + p {
    color: white !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .card {
        width: 33.33%; /* 3 cards per row on tablets */
    }
}

@media (max-width: 480px) {
    .card {
        width: 50%; /* 2 cards per row on mobile */
    }
}
