body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #2a2a2a;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    min-height: 100vh;
    width: 100%;
    padding: 20px 0;
}

html {
    height: 100%;
    width: 100%;
}


.game-container {
    max-width: 430px;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 90vh;
    background-image: url('./assets/Shopping_Bag_Exterior_baseColor (1).png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #3a1a1a;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 8px #1a1a1a, 0 0 0 10px #444;
    z-index: 1;
}

/* Header Styling (McCain branding) */
.header {
    background-color: #1a1a1a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 70px;
    z-index: 9999;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Header logo styling */
.header-logo {
    height: 50px;
    width: auto;
    margin-left: 15px;
    user-select: none;
    mix-blend-mode: screen;
}

/* Container for Score & Time */
.header-info {
    display: flex;
    align-items: center;
    gap: 20px; /* Keep gap small */
    position: absolute;
    left: 65%;
}

/* Score and Time Box Styling */
.score-box, .time-box {
    background-color: #2a2a2a;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    border-radius: 8px;
    font-size: 18px;
    min-width: 50px; /* Prevent overflow issues */
    height: 40px; /* Keep consistent height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid #FFC425; /* McCain yellow border */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Labels for Score & Time */
.label {
    font-size: 14px;
    display: block;
    font-weight: normal;
}

/* Values inside Score & Time */
.score-value, .time-value {
    font-size: 22px;
    font-weight: bold;
    line-height: 1; /* Remove extra space inside */
}

/* Move Time Box Slightly Left */
.time-box {
    margin-left: -5px; /* Shift left without affecting alignment */
}

/* Time styling */
.time-value span {
    font-weight: bold;
    color: #ffffff;
}

.start-sec {
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d1810 30%, #3a1a0a 60%, #1a1a1a 100%);
    border-radius: 20px;
    transition: opacity 0.2s ease-out;
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.start-logo {
    width: 180px;
    height: auto;
    margin-bottom: 20px;
    user-select: none;
}

.start-title {
    font-family: Arial, sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: #FFC425;
    text-align: center;
    line-height: 1.1;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.start-subtitle {
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #ffffff;
    text-align: center;
    margin: 0 0 25px 0;
    line-height: 1.4;
    opacity: 0.9;
}

.start-bag {
    width: 130px;
    height: auto;
    margin-bottom: 25px;
    user-select: none;
    object-fit: contain;
}

#play-button {
    background: linear-gradient(135deg, #FFC425 0%, #e6a800 100%);
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 900;
    padding: 16px 60px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    outline: none;
    z-index: 10001;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 6px 20px rgba(255, 196, 37, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 196, 37, 0.6);
}

#play-button:active {
    transform: scale(0.95);
}

.credit-line {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    margin-top: 15px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.shelf {
    position: absolute;
    width: 95%;
    height: 55%;
    top: 18%;
    left: 2.5%;
    overflow: hidden;
}

.shelf > img {
    width: 100%;
    height: 100%;
    transform: none;
    transform-origin: center;
    z-index: 5;
    object-fit: fill;
    user-select: none;
}

#cart {
    width: 30%;
    height: 16%;
    position: absolute;
    z-index: 5;
    bottom: 0%;
    user-select: none;
    left: 35%;
    cursor: grab;
    touch-action: none;
    display: none;
    object-fit: contain;
}

.row1 {
    position: absolute;
    top: 28%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 10;
    gap: 0px;
    box-sizing: border-box;
}

.row1 .items {
    width: 100px;
    height: 130px;
    max-width: 100px;
    max-height: 130px;
    z-index: 10;
    user-select: none;
    position: relative;
    object-fit: contain;
    mix-blend-mode: multiply;
    margin: 0 -15px;
}

/* Lays shelf image: keep same size as other items */
.lays-shelf {
    width: 95px !important;
    height: 95px !important;
    max-width: 95px !important;
    max-height: 95px !important;
    transform: none;
    display: block;
    object-fit: contain;
}

.row2 {
    position: absolute;
    top: 63.5%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 10;
    gap: 0px;
    box-sizing: border-box;
}

.row2 .items1 {
    width: 130px;
    height: 130px;
    max-width: 130px;
    max-height: 130px;
    z-index: 10;
    user-select: none;
    position: relative;
    object-fit: contain;
    mix-blend-mode: multiply;
    margin: 0 -15px;
}


.row4 {
    position: absolute; /* Position it over the shelf */
    top: 76%; /* Fourth shelf - sitting on shelf */
    width: 100%;
    display: flex;
    justify-content: space-evenly; /* Even spacing between items */
    align-items: flex-end; /* Align items to bottom of shelf */
    z-index: 10; /* Ensure this is above the shelf image */
    padding: 0 12%; /* Add padding to keep items within shelf frame */
}

.row4 .items3 {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    position: relative;
    z-index: 10;
    user-select: none;
    object-fit: contain; /* Keep aspect ratio without distortion */
}

.game-over-style {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    color: black;
    display: none;
    font-size: 20px;
    text-align: center;
    z-index: 10000;
    border-radius: 20px;
    backdrop-filter: blur(3px);
}

/* Game-Over Image - Hidden since using poster background */
#bag {
    display: none; /* Hide the logo as we're using poster background */
}

/* Media Queries for Responsiveness */

/* Desktop devices - optimized container */
@media only screen and (min-width: 769px) {
    body {
        padding: 10px 0;
    }

    .game-container {
        height: auto;
    }
}

/* Mobile devices - make fullscreen */
@media only screen and (max-width: 768px) {
    body {
        background-color: #1a1a1a;
        padding: 0;
        overflow: hidden;
        height: 100vh;
    }

    .game-container {
        max-width: 100%;
        max-height: 100%;
        height: 100vh;
        aspect-ratio: auto;
        border-radius: 0;
        box-shadow: none;
    }

    .header {
        border-radius: 0;
    }
}

/* Small Mobile Devices (up to 480px) */
@media only screen and (min-width: 300px) and (max-width: 400px) {
    .header {
        height: 45px;
    }

    .header-logo {
        height: 35px;
    }

    .header-info {
        gap: 30px;
    }

    .score-box, .time-box {
        font-size: 16px;
        height: 35px;
        min-width: 45px;
    }

    .score-value, .time-value {
        font-size: 18px;
    }

    .label {
        font-size: 12px;
    }

    .start-sec {
        border-radius: 0;
    }

    #cart {
        bottom: 3%;
    }

    .row1, .row2, .row4 {
        width: 100%;
    }

    .row1 .items, .row2 .items1, .row4 .items3 {
        width: 110px !important;
        height: 110px !important;
        max-width: 110px !important;
        max-height: 110px !important;
    }

    .lays-shelf {
        width: 110px !important;
        height: 110px !important;
        max-width: 110px !important;
        max-height: 110px !important;
    }

    .overlay-effect {
        width: 150px;
        top: 45%;
    }
}

/* Small Mobile Devices (400px to 450px) */
@media only screen and (min-width: 401px) {
    .header {
        height: 50px;
    }

    .header-logo {
        height: 45px;
    }

    .header-info {
        gap: 35px;
    }

    .score-box, .time-box {
        font-size: 17px;
        height: 38px;
        min-width: 48px;
    }

    .score-value, .time-value {
        font-size: 20px;
    }

    .label {
        font-size: 13px;
    }

    .start-sec {
        border-radius: 0;
    }

    #cart {
        bottom: 3%;
    }

    .row1, .row2, .row4 {
        width: 100%;
    }

    .row1 .items, .row2 .items1, .row4 .items3 {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }

    .lays-shelf {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }

    .overlay-effect { width: 150px; top: 50%; }
}

@media only screen and (min-height: 950px) {
    .row1 .items, .row2 .items1, .row4 .items3 {
        width: 110px !important;
        height: 110px !important;
        max-width: 110px !important;
        max-height: 110px !important;
    }
}
