/* Canonical landing game logos rendered directly by assets/js/app.js. */
.discovery-item {
    --landing-tile-height: 88px;
    position: relative !important;
    flex: 0 0 auto !important;
    width: max-content !important;
    min-width: 116px;
    height: var(--landing-tile-height) !important;
    min-height: var(--landing-tile-height) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 0 !important;
    padding: 6px 12px 11px !important;
    text-align: center !important;
}

/*
 * One shared rule for every canonical artwork:
 * - primary target = 50% of tile height
 * - preserve aspect ratio
 * - center against the actual rendered tile width, including min-width cases
 */
.discovery-item .discovery-item-icon {
    grid-row: 1 !important;
    justify-self: stretch !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: calc(var(--landing-tile-height) * 0.5) !important;
    max-width: 100% !important;
    max-height: calc(var(--landing-tile-height) * 0.5) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    line-height: 1 !important;
    overflow: visible !important;
}

/* Keep every game title in normal flow so it still determines dynamic tile width. */
.discovery-item .discovery-item-label {
    grid-row: 2 !important;
    align-self: end !important;
    justify-self: center !important;
    width: auto !important;
    margin: 0 auto !important;
    font-size: clamp(13.5px, 3.42vw, 16.2px) !important;
    text-align: center !important;
    text-transform: uppercase !important;
    line-height: 1.05 !important;
}

.discovery-item-icon.has-canonical-logo {
    flex: 0 0 auto !important;
}

.discovery-game-logo {
    display: block;
    width: auto !important;
    height: 100% !important;
    max-height: 100% !important;
    margin-inline: auto !important;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* MAGDAGDON owns the complete landing tile artwork. The normal icon + title
 * treatment is bypassed, while the hidden title remains available as accessible
 * text. The refreshed artwork is height-driven: its visible frame always spans
 * the same canonical 88/82px tile height as neighbouring game tiles. Width is
 * intentionally allowed to grow to preserve the refreshed artwork aspect ratio. */
.discovery-item[data-game-id="magdagdon"] {
    width: calc(var(--landing-tile-height) * 1.42) !important;
    min-width: calc(var(--landing-tile-height) * 1.42) !important;
    height: var(--landing-tile-height) !important;
    min-height: var(--landing-tile-height) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: center / auto 100% no-repeat url("/assets/img/magdagdon_tile.png?v=magdagdon-full-tile-20260829-5") !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.discovery-item[data-game-id="magdagdon"] .discovery-item-icon {
    display: none !important;
}

.discovery-item[data-game-id="magdagdon"] .discovery-item-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* MISHIMASH artwork is a complete tile and owns all visible copy. */
.discovery-item[data-game-id="mishimash"] {
    width: calc(var(--landing-tile-height) * 1.40) !important;
    min-width: calc(var(--landing-tile-height) * 1.40) !important;
    height: var(--landing-tile-height) !important;
    min-height: var(--landing-tile-height) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: center / auto 100% no-repeat url("/assets/img/mishimas_tile.png?v=mishimash-tile-20260830-1") !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.discovery-item[data-game-id="mishimash"] .discovery-item-icon { display: none !important; }
.discovery-item[data-game-id="mishimash"] .discovery-item-label { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 430px) {
    .discovery-item {
        --landing-tile-height: 82px;
        min-width: 112px;
        padding: 6px 11px 11px !important;
    }

    .discovery-item .discovery-item-label {
        font-size: 13.5px !important;
    }

    .discovery-item[data-game-id="magdagdon"] {
        padding: 0 !important;
    }
}
