@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@500;700&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    font-family: 'Barlow', sans-serif;
}

body {
    --green: #005832;
    --white: #FFF;
    --yellow: #FFC511;

    background: linear-gradient(135deg, #135B3C 0%, #022D1A 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Rainbow on the left */
.rainbow {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: auto;
    z-index: 1;
    pointer-events: none;
    object-fit: cover;
    object-position: right center;
    transition: opacity 0.5s ease;
}

.rainbow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Game container */
.GameContainer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    aspect-ratio: 3 / 4;
    height: 100vh;
    width: auto;
    max-width: 100vw;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Page overlay (intro & game over) */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #135B3C 0%, #022D1A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease-out;
}

/* Content wrapper inside pages */
.page .content {
    position: relative;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 90vw;
    padding: 2vh 0;
}

/* Logo */
.page .logo {
    width: clamp(100px, 12vw, 200px);
    height: auto;
    margin-bottom: clamp(20px, 4vh, 50px);
}

/* Title image (Basket Corner logo) */
.page .title-img {
    width: clamp(220px, 30vw, 460px);
    height: auto;
    margin-bottom: clamp(16px, 3vh, 36px);
}

/* Info box wrapper: transparent on desktop/tablet, semi-transparent box only on mobile (see media query) */
.page .infoBox {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Title */
.page .title {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 64px);
    line-height: 100%;
    text-align: center;
    margin-bottom: clamp(10px, 2vh, 24px);
}

/* Text container */
.page .textContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1vh, 12px);
    width: 100%;
}

/* Subtitle */
.page .subtitle {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: clamp(12px, 1.5vw, 22px);
    line-height: 120%;
    margin: 0;
    opacity: 0.9;
}

.page .subtitle span {
    color: var(--yellow);
}

.page .subtitle span#max-shots-gameover {
    color: var(--white);
}

/* Description */
.page .description {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: clamp(12px, 1.5vw, 22px);
    line-height: 140%;
    max-width: 600px;
    opacity: 0.85;
    margin: 0;
}

/* Button */
.button {
    font-family: 'Barlow', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: clamp(16px, 2vw, 32px);
    background-color: var(--white);
    color: var(--green);
    padding: clamp(10px, 1.5vh, 20px) clamp(32px, 5vw, 80px);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: clamp(20px, 4vh, 50px);
}

.button:hover {
    background-color: var(--yellow);
}

/* Page z-index */
#pageIntro {
    z-index: 9999;
}

#pageGameOver {
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
}

/* In-game header */
.pageGameHeader {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: clamp(100px, 12vw, 200px);
    height: auto;
}

.pageGameHeader img {
    width: 100%;
    height: auto;
}

/* Shots counter */
#shotsCounter {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 88, 50, 0.8);
    color: var(--white);
    font-size: clamp(18px, 2.5vw, 48px);
    padding: 5px 10px;
    border-radius: 10px;
    z-index: 1002;
}

#currentShots {
    font-weight: bold;
}

/* Footer */
.footer .footerDesc {
    font-family: 'Barlow', sans-serif;
    font-size: clamp(12px, 1.5vw, 24px);
    color: var(--white);
    text-align: center;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

/* Transitions */
.fade-out {
    opacity: 0;
}

#pageGameOver.show {
    opacity: 1;
    visibility: visible;
}

/* Tablet (max 1024px) */
@media screen and (max-width: 1024px) {
    .page .logo {
        width: clamp(160px, 25vw, 280px);
    }

    .page .title-img {
        width: clamp(240px, 50vw, 420px);
    }

    .page .title {
        font-size: clamp(28px, 5vw, 52px);
    }

    .page .subtitle {
        font-size: clamp(14px, 2.5vw, 20px);
    }

    .page .description {
        font-size: clamp(14px, 2.5vw, 20px);
        max-width: 80vw;
    }

    .button {
        font-size: clamp(18px, 3vw, 28px);
    }
}

/* Mobile (max 600px) */
@media screen and (max-width: 600px) {
    .page .infoBox {
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 16px;
        padding: clamp(16px, 3vh, 28px) clamp(16px, 4vw, 28px);
        margin-bottom: clamp(10px, 2vh, 20px);
        max-width: 90vw;
    }

    .page .infoBox .title {
        margin-bottom: clamp(8px, 1.5vh, 16px);
    }

    .page .logo {
        width: clamp(160px, 45vw, 240px);
    }

    .page .title-img {
        width: clamp(220px, 70vw, 360px);
    }

    .page .title {
        font-size: clamp(24px, 7vw, 40px);
    }

    .page .subtitle {
        font-size: clamp(12px, 3.5vw, 18px);
        margin-bottom: 10px;
    }

    .page .description {
        font-size: clamp(12px, 3.5vw, 18px);
        max-width: 85vw;
    }

    .button {
        font-size: clamp(14px, 4vw, 22px);
        margin-top: 20px;
    }

    .footer .footerDesc {
        font-size: clamp(10px, 3vw, 16px);
    }

    #shotsCounter {
        font-size: clamp(14px, 4vw, 24px);
    }

    .pageGameHeader {
        width: clamp(80px, 25vw, 160px);
    }
}
