/* Detail-page components. Shared media and gallery rules remain in styles.css. */
.game-page {
    --eshop-accent: #e60012;
    --eshop-panel: #fff2f3;
    --eshop-sale-strip: #ffe0e3;
    --related-background: #e9ebee;
    padding-bottom: 0;
}

.game-page > .game-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 0 0 24px;
    padding: 40px 24px 32px;
    background: #263039;
    color: white;
    text-align: center;
}

.game-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}

.game-hero-backdrop {
    position: absolute;
    inset: -30px;
    width: calc(100% + 60px);
    height: calc(100% + 60px);
    object-fit: cover;
    filter: blur(28px) brightness(0.55);
    z-index: -2;
}

.game-hero-cover {
    width: clamp(128px, 34vw, 176px);
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.game-hero-title {
    max-width: 560px;
    font-size: clamp(1.4rem, 4.5vw, 2rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.game-page > .game-hero-with-dates {
    margin-bottom: 0;
}

.game-page .game-detail-summary {
    font-size: 1rem;
    line-height: 1.6;
}

.game-page > .game-eshop-editions {
    display: grid;
    gap: 12px;
    width: calc(100% - 40px);
    max-width: 540px;
    margin: 28px auto;
}

.eshop-card {
    padding: 6px;
    border: 2px solid var(--eshop-accent);
    border-radius: 16px;
    background: var(--eshop-panel);
}

.eshop-sale-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    border-radius: 9px;
    background: var(--eshop-sale-strip);
    font-size: 0.72rem;
    line-height: 1.4;
}

.eshop-discount {
    font-weight: 700;
    white-space: nowrap;
}

.eshop-sale-strip time {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.eshop-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 6px;
}

.eshop-card-label {
    display: grid;
    gap: 4px;
    min-width: 0;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.eshop-card-label > span {
    color: var(--secondaryLabel);
    font-size: 0.8rem;
}

.eshop-buy-link {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 9px 12px;
    border-radius: 12px;
    background: #e60012;
    color: white;
    text-decoration: none;
}

.eshop-buy-link:hover {
    color: white;
    text-decoration: none;
    opacity: 0.85;
}

.eshop-buy-link:focus-visible,
.game-external-links a:focus-visible,
.game-related a:focus-visible {
    outline: 3px solid var(--switch-blue-highlight);
    outline-offset: 3px;
}

.eshop-prices {
    display: grid;
    text-align: right;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.eshop-prices s {
    font-size: 0.7rem;
    font-weight: 400;
}

.game-detail-footer {
    padding-top: 24px;
    border-top: 1px solid var(--separator);
}

.game-external-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.game-external-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--systemFill);
    color: var(--label);
    font-size: 0.85rem;
    text-decoration: none;
}

.game-external-links a:hover {
    background: var(--secondarySystemFill);
}

.game-detail-footer > p {
    margin-top: 18px;
    padding-bottom: 24px;
    color: var(--secondaryLabel);
    font-size: 0.75rem;
    text-align: center;
}

.game-page > .game-related {
    margin: 20px 0 0;
    padding: 28px 20px;
    background: var(--related-background);
    border-top: 1px solid var(--separator);
}

.game-related h2 {
    font-size: 1.2rem;
}

.game-related .games-carousel {
    gap: 16px;
    padding-bottom: 8px;
}

.game-related .games-carousel > a {
    flex: 0 0 clamp(100px, 26vw, 130px);
    min-width: 0;
    color: var(--label);
    font-size: 0.8rem;
    line-height: 1.35;
    text-decoration: none;
}

.game-related .game-cover-image {
    display: block;
    width: 100%;
    max-width: none;
    margin-top: 0;
    border-radius: 10px;
}

.game-related a > span {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

@media (prefers-color-scheme: dark) {
    .game-page {
        --eshop-accent: #ff3348;
        --eshop-panel: #351719;
        --eshop-sale-strip: #55141b;
        --related-background: #141414;
    }
}
