/* ========================================
   GOOGLE FONTS
======================================== */

@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&display=swap");


/* ========================================
   RESET / BASE STYLES
======================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 30px 20px;

    background-image: url("vienna-reyes-qCrKTET_09o-unsplash.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    color: white;
    font-family:
        "Trebuchet MS",
        "Lucida Sans Unicode",
        "Lucida Grande",
        Arial,
        sans-serif;

    overflow-x: hidden;
}

button {
    font: inherit;
}


/* ========================================
   MAIN SCOREBOARD
======================================== */

.scoreboard {
    width: min(100%, 800px);
    margin-inline: auto;
}


/* ========================================
   MATCH TITLE
======================================== */

.match-title {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;

    padding: 8px 28px;

    background-color: black;
    border-radius: 20px;

    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: bold;
    font-style: italic;

    color: rgb(79, 186, 210);
    text-shadow: 0 0 20px whitesmoke;
}

.match-title p {
    margin: 0;
}


/* ========================================
   CLUBS / SCORES
======================================== */

.clubs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;

    margin-top: 0;
    padding: 28px 30px;

    background-color: rgb(26, 115, 135);

    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.club {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 20px;
}

.club h2 {
    margin: 0;

    font-size: clamp(1rem, 2.5vw, 1.55rem);
    line-height: 1.1;
}

#realmadrid-container {
    justify-content: flex-start;
}

#barcelona-container {
    justify-content: flex-end;
}

#realmadrid-logo,
#barcelona-logo {
    width: 82px;
    height: 100px;

    flex: 0 0 auto;

    object-fit: contain;
}

.scorebox {
    width: 65px;
    min-width: 65px;
    height: 82px;

    display: grid;
    place-items: center;

    background-color: black;

    color: cyan;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1;
}

#realmadrid-scorebox {
    margin-left: auto;
}

#barcelona-scorebox {
    margin-right: auto;
}


/* ========================================
   SCORE CONTROLS
======================================== */

.counts-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;

    padding: 20px 30px;

    background-color: rgb(26, 115, 135);

    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.score-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.score-control {
    width: 52px;
    height: 52px;

    padding: 0;

    border: 2px solid rgb(3, 89, 108);
    border-radius: 6px;

    background: transparent;
    color: rgb(35, 33, 33);

    font-size: 1.4rem;
    font-weight: bold;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.score-control:hover {
    background-color: white;
    color: rgb(26, 115, 135);
}

.score-control:active {
    background-color: rgb(61, 57, 57);
    transform: scale(0.94);
}

.new-game {
    padding: 10px 16px;

    border: 0;
    background-color: white;
    color: black;

    font-size: clamp(0.75rem, 2vw, 1rem);
    font-weight: bold;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.new-game:hover {
    background-color: red;
    color: white;
}

.new-game:active {
    background-color: #b71c1c;
    transform: scale(0.96);
}


/* ========================================
   MATCH STATISTICS
======================================== */

.info-container {
    width: min(100%, 540px);
    margin: 0 auto;

    display: grid;
    grid-template-columns: minmax(55px, 1fr) minmax(150px, 2.2fr) minmax(55px, 1fr);

    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);

    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;

    text-align: center;
}

.stats-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.stat-value,
.stat-label {
    min-height: 54px;

    display: grid;
    place-items: center;

    padding: 8px 5px;
}

.stat-value {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-label {
    color: rgb(68, 175, 199);
    font-size: clamp(0.65rem, 1.7vw, 0.95rem);
    font-weight: bold;
}


/* ========================================
   NEW GAME TOAST
======================================== */

#toast {
    position: fixed;
    top: 20px;
    right: 20px;

    max-width: calc(100vw - 40px);

    padding: 12px 20px;

    background-color: #28a745;
    color: white;

    border-radius: 10px;

    transform: translateX(calc(100% + 40px));

    transition: transform 0.4s ease;

    pointer-events: none;
}

#toast.show {
    transform: translateX(0);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 700px) {

    body {
        padding: 20px 14px;
    }

    .clubs-container {
        padding: 22px 18px;
        gap: 18px;
    }

    .club {
        gap: 10px;
    }

    #realmadrid-logo,
    #barcelona-logo {
        width: 60px;
        height: 76px;
    }

    .scorebox {
        width: 56px;
        min-width: 56px;
        height: 70px;
    }

    .counts-container {
        padding: 16px 18px;
        gap: 12px;
    }

    .score-controls {
        gap: 7px;
    }

    .score-control {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 520px) {

    body {
        padding: 14px 10px;
    }

    .match-title {
        padding: 7px 20px;
    }

    .clubs-container {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 22px 14px;
    }

    .club,
    #realmadrid-container,
    #barcelona-container {
        justify-content: center;
    }

    #realmadrid-container {
        flex-wrap: wrap;
    }

    #barcelona-container {
        flex-wrap: wrap;
    }

    #realmadrid-scorebox,
    #barcelona-scorebox {
        margin-inline: 0;
    }

    .counts-container {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px 12px;
    }

    .score-controls {
        order: 1;
    }

    .new-game {
        order: 2;
        justify-self: center;
    }

    .info-container {
        grid-template-columns: 0.8fr 1.8fr 0.8fr;
    }

    .stat-value,
    .stat-label {
        min-height: 48px;
        padding-inline: 3px;
    }

}


/* ========================================
   VERY SMALL SCREENS
======================================== */

@media (max-width: 360px) {

    .club h2 {
        font-size: 0.95rem;
    }

    #realmadrid-logo,
    #barcelona-logo {
        width: 50px;
        height: 64px;
    }

    .scorebox {
        width: 50px;
        min-width: 50px;
        height: 62px;
        font-size: 2.3rem;
    }

    .score-control {
        width: 40px;
        height: 40px;
    }

    .stat-value,
    .stat-label {
        min-height: 44px;
        font-size: 0.62rem;
    }

}
