.game-detail-page {
    padding: 1.5rem 0 3rem;
    color: #f0f0ec;
    font-family: "Inter", system-ui, sans-serif;
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: #7aa2ff;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.game-detail-hero {
    display: flex;
    gap: 1.5rem;
    background: #17181d;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.game-detail-cover {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
    flex-shrink: 0;
}

.game-detail-cover-button {
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 8px;
}

.game-detail-cover-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.game-detail-cover-button .game-detail-cover {
    display: block;
}

.cover-dialog {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: 95vw;
    max-height: 95vh;
    cursor: zoom-out;
}

.cover-dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

/* Natural size; only shrinks if the image is bigger than the screen. */
.cover-dialog img {
    display: block;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 8px;
}

@media (min-width: 900px) {
    .game-detail-page {
        max-width: 1100px;
    }

    .game-detail-cover {
        width: 440px;
        height: 440px;
    }
}

.game-detail-info h1 {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
    line-height: 1.25;
}

.game-detail-publisher {
    color: #63656d;
    margin: 0 0 0.9rem;
}

.game-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.game-detail-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
}

.game-detail-badges .badge-keycard {
    background: rgba(214, 108, 100, 0.08);
    border: 1px solid rgba(214, 108, 100, 0.4);
    color: #d97066;
}

.game-detail-badges .badge-cart {
    background: rgba(53, 212, 136, 0.08);
    border: 1px solid rgba(53, 212, 136, 0.35);
    color: #35d488;
}

.game-detail-badges .badge-codebox {
    background: rgba(255, 149, 0, 0.08);
    border: 1px solid rgba(255, 149, 0, 0.4);
    color: #ff9500;
}

.game-detail-badges .badge-preorder {
    background: rgba(255, 204, 51, 0.08);
    border: 1px solid rgba(255, 204, 51, 0.4);
    color: #ffcc33;
}

.game-detail-badges .badge-genre {
    background: rgba(122, 162, 255, 0.08);
    border: 1px solid rgba(122, 162, 255, 0.35);
    color: #7aa2ff;
}

.game-detail-meta {
    display: flex;
    gap: 2rem;
    margin: 0 0 1rem;
}

.game-detail-meta dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #63656d;
    margin-bottom: 2px;
}

.game-detail-meta dd {
    margin: 0;
    font-weight: 600;
}

.game-detail-meta .detail-median {
    margin-left: 6px;
    color: #63656d;
    font-weight: 400;
    text-decoration: line-through;
}

.game-detail-meta .badge-discount {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(53, 212, 136, 0.08);
    border: 1px solid rgba(53, 212, 136, 0.35);
    color: #35d488;
}

/* eShop price stacked under "Lägsta pris" in the same column */
.game-detail-meta .detail-prices dd + dt {
    margin-top: 0.75rem;
}

.game-detail-meta .badge-eshop-sale {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(214, 108, 100, 0.08);
    border: 1px solid rgba(214, 108, 100, 0.4);
    color: #d97066;
}

.game-detail-meta .detail-eshop-link {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
}

.game-detail-meta .detail-eshop-ends {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 400;
    color: #63656d;
}

.game-detail-section {
    margin-bottom: 2rem;
}

.game-detail-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.price-history-table {
    margin-top: 1rem;
}

.price-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    background: #17181d;
    border-radius: 12px;
}

.price-chart {
    position: relative;
}

.chart-point {
    cursor: pointer;
}

.chart-point:hover .chart-dot {
    r: 5;
}

.chart-tooltip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 10px));
    padding: 6px 10px;
    background: #23252c;
    border: 1px solid #33363f;
    border-radius: 8px;
    color: #e6e7eb;
    font-size: 13px;
    font-family: "Inter", system-ui, sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

.chart-tooltip span {
    display: block;
    color: #8b8d95;
    font-size: 12px;
}

.chart-gridline {
    stroke: #23252c;
    stroke-width: 1;
}

.chart-axis-label {
    fill: #63656d;
    font-size: 11px;
    font-family: "Inter", system-ui, sans-serif;
}

/* ---------- Phones: box art on top, text below it ---------- */

@media (max-width: 600px) {
    .game-detail-hero {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .game-detail-cover-button {
        align-self: center;
        width: 100%;
        max-width: 340px;
    }

    .game-detail-cover-button .game-detail-cover,
    .game-detail-hero > .game-detail-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    /* placeholder (no cover image) sits directly in the card */
    .game-detail-hero > .game-detail-cover {
        align-self: center;
        max-width: 340px;
    }

    .game-detail-info h1 {
        font-size: 1.35rem;
    }

    .game-detail-meta {
        flex-wrap: wrap;
        gap: 0.75rem 2rem;
    }

    /* The stores section already has its own Metacritic link above the table */
    .game-detail-info .metacritic-link {
        display: none;
    }
}
