/* ==========================================================================
   freegame7 — components
   ========================================================================== */

.game-card,
.game-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: transparent;
    overflow: hidden;
    width: 100%;
    color: #000;
    transition: transform 0.3s, border-color 0.3s;
}

.game-card:hover,
.game-tile:hover {
    transform: translateY(-10px);
    color: #000;
}

.game-card .card-link-wrapper,
.game-tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.game-card .card-image-wrapper,
.game-tile__img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 16px;
    background: #eee;
}

.game-card .card-image,
.game-tile__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.game-card .card-content {
    padding: 0;
}

.card-tag {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    background: none;
    padding: 0;
    text-transform: none;
    letter-spacing: 0;
}

.game-card .card-title,
.game-tile__name {
    color: #000;
    font-size: 18px;
    font-weight: 400;
    line-height: 58px;
    overflow: hidden;
    padding: 0 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.badge-hot {
    display: none;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.8rem;
    font-weight: 500;
    font-size: 16px;
    color: #fff;
    background: var(--color-primary);
    border-radius: 999px;
}

.btn-primary:hover {
    color: #fff;
    background: var(--color-primary-dark);
}

.play-overlay {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.play-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.play-overlay .btn-primary {
    position: relative;
    z-index: 2;
}

.related-card {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #000;
    margin-bottom: 30px;
    transition: transform 0.3s;
}

.related-card:hover {
    transform: translateY(-8px);
    color: #000;
}

.related-card img {
    width: 118px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 9px;
    flex-shrink: 0;
}

.related-card h4 {
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card span {
    display: none;
}

.ad-slot,
.ad-container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 20px;
    overflow: hidden;
}

.ad-slot:empty,
.ad-slot[hidden] {
    display: none;
    margin: 0;
}

.ad-slot > ins.adsbygoogle {
    display: block;
    width: 100%;
    min-width: 0;
}

.search-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(400px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    z-index: 250;
    max-height: 360px;
    overflow: auto;
}

.search-panel.is-open {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #000;
    border-bottom: 1px solid #f0f0f0;
}

.search-item:hover {
    background: var(--color-primary-soft);
    color: #000;
}

.search-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
}

.search-empty {
    padding: 16px;
    color: #999;
    font-size: 14px;
}

@media (max-width: 1334px) {
    .header-search.mobile-search .search-panel {
        left: 0;
        right: 0;
        width: 100%;
        max-height: min(360px, calc(100dvh - var(--header-h) - 70px));
    }

    .game-card,
    .game-tile {
        background: #fff;
        border-radius: 14px;
        max-width: 100%;
    }

    .game-card:hover,
    .game-tile:hover {
        transform: none;
    }

    .game-card .card-image-wrapper,
    .game-tile__img-wrap {
        aspect-ratio: 16 / 9;
        border-radius: 0;
    }

    .game-card .card-image,
    .game-tile__img {
        border-radius: 0;
    }

    .game-card .card-title,
    .game-tile__name {
        font-size: 16px;
        line-height: 40px;
        padding: 0 14px;
        text-align: left;
    }

    .game-card .card-tag {
        display: none;
    }
}

@media (max-width: 1024px) {
    .related-card {
        margin-bottom: 16px;
        background: #fff;
        border-radius: 14px;
        padding: 10px;
    }

    .related-card:hover {
        transform: none;
    }

    .related-card img {
        width: 96px;
        border-radius: 8px;
    }
}

@media (max-width: 768px) {
    .related-card {
        margin-bottom: 16px;
    }
}
