﻿.banner {
    margin-top: -2em;
    /* Full-bleed banner: stretch to viewport width while keeping content centered */
    width: 100vw; /* full viewport width */
    margin-left: calc(50% - 50vw); /* center the full-bleed element */
    overflow: hidden;
    position: relative;
    z-index: 0; /* keep banner below cards */
    /* ensure banner has a height so absolutely positioned children are visible */
    min-height: 320px;
    box-sizing: border-box;
}

/* banner image */
.banner img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Buttons placed on the banner, stacked vertically on the far left and centered on Y axis */
.banner .buttons {
    position: absolute;
    top: 50%;
    left: 1.25rem;                /* far left inside banner */
    transform: translateY(-50%);  /* center on Y axis only */
    display: flex;
    flex-direction: column;       /* stack under each other */
    gap: 0.6rem;
    z-index: 10;                  /* above title (title has z-index:5) */
    pointer-events: auto;
    align-items: flex-start;      /* align buttons to left edge */
    justify-content: center;
}

/* Small-screen: make banner buttons horizontal and centered at the bottom */
@media (max-width: 520px) {
    .banner .buttons {
        flex-direction: row;
        left: 50%;
        top: auto;
        bottom: 1rem;
        transform: translateX(-50%); /* center horizontally */
        align-items: center;
        gap: 0.5rem;
        padding: 0 0.5rem;
        width: auto;
        justify-content: center;
    }

    .buttons .btn {
        height: 40px;
        padding: 0.35rem 0.75rem;
        border-radius: 12px;
        white-space: nowrap;
        min-width: 44px;
    }

    /* ensure stacked spacing doesn't apply when horizontal */
    .banner .buttons > * + * {
        margin-left: 0;
    }

    /* Small-screen: position the title centered above the banner buttons (horizontal layout) */
    .title {
        position: absolute;
        left: 50%;
        top: auto;
        bottom: 4.75rem; /* sit above the buttons row (buttons bottom:1rem + button height) */
        transform: translateX(-50%);
        text-align: center;
        font-size: clamp(1rem, 6vw, 1.6rem);
        line-height: 1.1;
        margin: 0;
        z-index: 9; /* below buttons (11) but above banner */
        pointer-events: none;
        width: calc(100% - 2rem); /* avoid edge overflow */
        white-space: normal;
        padding: 0 0.5rem;
    }

    .title2 {
        position: absolute;
        left: 50%;
        top: auto;
        bottom: 3.5rem; /* slightly above the title to keep spacing if needed */
        transform: translateX(-50%);
        text-align: center;
        font-size: clamp(0.9rem, 4.5vw, 1.2rem);
        z-index: 9;
        pointer-events: none;
        width: calc(100% - 2rem);
        padding: 0 0.5rem;
    }
}

/* Button visual styles */
.buttons .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px; /* allow compact width but keep tappable area */
    padding: 0.5rem 0.85rem; /* tighter padding for stacked layout */
    height: 48px; /* fixed comfortable tap area */
    border-radius: 21px;
    z-index: 11;
    background-color: rgba(46, 46, 46, 0.18);
    border: 1px solid rgba(0,0,0,0.2);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-sizing: border-box;
    white-space: nowrap;
}

/* Hover / focus states */
.buttons .btn:hover,
.buttons .btn:focus {
    background-color: rgb(86, 77, 73);
    border-color: rgb(27, 14, 10);
    color: #fff;
}

/* Prevent horizontal scrolling on all devices */
html, body {
    overflow-x: hidden;
    margin: 0;
}

/* Centered overlay title (responsive) */
.title {
    margin-top:-100%;
    font-family: 'Press Start 2P', monospace;
    position: relative;
    left: 50%;
    top: -40vh;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(0.8rem, 4vw, 2rem);
    text-align: center;
    margin: 0;
    z-index: 5;
    pointer-events: none;
}

.title2 {
    color: white;
    margin-top: 0.5rem;
    font-size: clamp(0.8rem, 2vw, 3rem);
    text-align: center;
}

/* Page background */
body {
    background-position: center 0vh;
    background-image: url('../lib/home_assets/background.png');
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Trailer videos layout — row on wide screens, wrap/stack on small screens */
/* Reduced top margin so trailer blocks sit higher on the page */
.trailer-videos {
    display: flex;
    justify-content: center;
    gap: clamp(1.5rem, 5vw, 1rem);  /* slightly bigger gaps */
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
    padding: 3rem 1rem; /* align padding with game-block */
    margin: 0 auto; /* center within page */
    margin-top: -12vh; /* moved higher (was 12vh) */
    box-sizing: border-box;
    z-index: 1;
    max-width: 1100px; /* align width with game grid */
}

/* Make each trailer card center within the trailer container */
.trailer-videos .one,
.trailer-videos .two,
.trailer-videos .three {
    margin: 0 auto;
    flex: 1 1 30%;
    width: 100%;
    max-width: 420px; /* keep consistent with game cards */
}

/* Each card: let them size responsively and stay in flow (no absolute positioning) */
.one, .two, .three {
    position: relative;
    flex: 1 1 30%;                          /* two-per-row on wide screens */
    width: clamp(360px, 46vw, 800px);      /* min 360px, grows with viewport, caps at 800px */
    min-width: 300px;
    max-width: 800px;
    border-radius: 15px;
    height: auto;
    background-color: rgba(37, 35, 35, 0.32);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.06);
    box-sizing: border-box;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure sensible fallbacks if container is too narrow */
.one, .two, .three {
    max-width: 420px;
}

/* Video wrapper uses modern aspect-ratio for consistent sizing */
.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 60vh;        /* prevents video from growing beyond viewport height */
    height: auto;
    position: relative;
    overflow: hidden;
    border-radius: 9px;
    display: block;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
    border-radius: 9px;
}

/* Mobile adjustments */
@media (max-width: 900px) {
    .one, .two, .three {
        flex: 1 1 90%;
        width: min(720px, 90%); /* keeps cards bigger on tablets/phones */
        max-width: 720px;
    }

    .trailer-videos {
        margin-top: 1.5vh; /* moved higher on smaller screens (was 2vh) */
        padding: 1.25rem;
    }

    .title {
        font-size: clamp(1.5rem, 6vw, 3rem);
    }

    .video-wrapper {
        max-height: 45vh;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: clamp(1rem, 6vw, 2rem);
        top: 40%;
        left: 50%; /* center title on small screens */
    }

    .title2 {
        margin-left: 0;
    }

    .video-wrapper {
        aspect-ratio: 16 / 9;
    }

    .one, .two, .three {
        padding: 0.5rem;
        border-radius: 10px;
    }
}

/* Game list / card layout */
.game-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(2.2rem, 5vw, 1rem);
    max-width: 1100px; /* allow space for three columns + gaps */
    margin: 0 auto; /* center the block */
    box-sizing: border-box;
    align-items: start;
    justify-items: stretch;
    padding: 0 1rem; /* prevent edge overflow on small screens */
}

/* ensure each card fills its grid cell and has no internal padding */
.game-card {
    width: 100%;
    background-color: rgba(37, 35, 35, 0.32);
    border-radius: 15px; /* match trailer corners */
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    box-sizing: border-box;
    position: relative; /* required so absolute buttons are inside the card */
    z-index: 5;         /* put cards above the banner but below banner buttons if needed */
    margin: 0; /* reset any left shifts */
}

.game-card__image {
    width: 100%;
    aspect-ratio: 15 / 9;
    height: auto;
    object-fit: cover;
    display: block;
}

.game-card__body {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    color: #fff;
}

.game-card__title {
    margin: 0;
    font-size: 1.05rem;
    color: #fff;
}

.game-card__price {
    font-weight: 700;
    color: #ffd166;
    margin: 0;
}

.game-card__desc {
    margin: 0;
    color: #d6d6d6;
    font-size: .95rem;
}

/* small-screen tweaks */
@media (max-width: 480px) {
    .game-card__image {
        height: 140px;
    }

    .game-card__title {
        font-size: 1rem;
    }
}

/* Ensure cart button is visible above card content */
/* Icon buttons: fixed square, no browser default background, centered SVG */
.add-cart-btn,
.delete-btn {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 38px;
    height: 38px;
    padding: 0;
    min-width: 0;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    position: absolute; /* ensure they are inside the .game-card */
    top: 8px;
    right: 8px;
    z-index: 20;        /* above the card contents */

    /* visual */
    background-color: #333;
    color: #fff;                  /* SVG uses currentColor for stroke/fill */
    box-shadow: 0 6px 14px rgba(0,0,0,0.35);
    z-index: 9999;
    visibility: visible;
    opacity: 1;
}

/* Cart button (right) */
.add-cart-btn {
    right: 8px;
}

/* Delete button (left of cart) */
.delete-btn {
    right: 56px; /* adjust spacing if needed */
    background-color: #e74c3c;
}

/* Ensure SVG uses currentColor and doesn't stretch */
.add-cart-btn svg,
.delete-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Small-screen adjustments */
@media (max-width: 480px) {
    .add-cart-btn,
    .delete-btn {
        width: 34px;
        height: 34px;
    }
    .add-cart-btn svg,
    .delete-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Delete button placed left of the cart button and styled red */
.delete-btn {
    position: absolute;
    top: 8px;
    right: 56px; /* small shift to sit left of cart button */
    background: #e74c3c;
    border: none;
    color: #fff;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* above cart button */
    box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

    .delete-btn:hover {
        background: #c0392b;
    }

    .delete-btn svg {
        width: 16px;
        height: 16px;
    }



/* Additional responsive adjustments for height */
@media (max-height: 700px) {
    .banner {
        min-height: 250px;
    }

    .title {
        top: -20vh;
        font-size: clamp(1rem, 2rem, 2rem);
    }

    .trailer-videos {
        margin-top: 1vh;
        padding: 1rem;
    }

    .game-block {
        margin-top: 1rem;
    }

    .video-wrapper {
        max-height: 40vh;
    }
}

@media (max-height: 500px) {
    .banner {
        min-height: 200px;
    }

    .buttons .btn {
        height: 6vh;
        width: 8vw;
        padding: 0.3rem 0.6rem;
    }

    .title {
        top: -15vh;
        font-size: clamp(0.8rem, 3vw, 1.5rem);
    }

    .trailer-videos {
        margin-top: 0.5vh;
        padding: 0.5rem;
    }

    .game-block {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }

    .video-wrapper {
        max-height: 30vh;
    }

    .game-card__image {
        height: 120px;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .game-block {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .trailer-videos {
        gap: 1.75rem;
    }

    .game-card {
        max-width: 350px;
    }

    .one, .two, .three {
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .game-block {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .trailer-videos {
        gap: 0.5rem;
    }

    .game-card {
        max-width: 280px;
        margin: 0 auto; /* center cards and avoid left/right scroll */
    }

    .one, .two, .three {
        max-width: 280px;
    }

    .game-card__image {
        aspect-ratio: 4 / 3;
    }

    .video-wrapper {
        aspect-ratio: 4 / 3;
    }

    .game-card__body {
        padding: 0.5rem 0.75rem;
        
    }

    .game-card__title {
        font-size: 0.9rem;
    }

    .game-card__price {
        font-size: 0.85rem;
    }

    .game-card__desc {
        font-size: 0.8rem;
    }
}









