:root {
    --scale: 1;
    --font-size: 64px;
    --button-size: 256px;
    --buttons-per-row: 3;
    --gap: 8px;
    --mobile-gap: 4px;
    --border-radius: 8px;
    --mobile-border-radius: 4px;
    --padding: 32px;
    --mobile-padding: 8px;
    --margin: 8px;
    --mobile-margin: 0px;

    --primary-color: #002F6C;
    --text-color: #ffffff;
    --link-color: #8097B6;
    --body-bg-color: #000000;
    --container-bg-color: #111111;
    --box-bg-color: #222222;
    --border: 2px solid #333333;
    --mobile-border: 1px solid #333333;
    --win-color: #406391;

    --icon-filter: invert(1) brightness(2);
}

body {
    box-sizing: border-box;
    background-color: var(--body-bg-color);
    color: var(--text-color);
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--padding) * 2);
    flex-direction: column;
    padding: var(--padding);
}

.container {
    background: linear-gradient(135deg, #000000, #222222);
    width: 90%;
    max-width: 600px;
    border-radius: calc(var(--border-radius) * 4);
    padding: var(--padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    border: var(--border);
    gap: var(--gap);
}

.bingo-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: var(--margin);
    margin-right: var(--margin);
}

.headers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    margin: var(--margin);
    margin-top: 0;
    border-radius: var(--border-radius);
    gap: var(--gap);
}

.headers .b-header,
.headers .i-header,
.headers .n-header,
.headers .g-header,
.headers .o-header {
    border: var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #001836, #0046a2);
    color: var(--text-color);
    font-weight: bold;
    border-radius: var(--border-radius);
    font-size: var(--font-size);
}

.bingo-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: var(--gap);
    width: 100%;
    aspect-ratio: 1;
    max-width: 100%;
    max-height: 100%;
    justify-items: stretch;
    align-items: stretch;
}

.bingo-board div {
    border: var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: calc(var(--font-size) * 0.75);
    user-select: none;
    box-sizing: border-box;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    background: linear-gradient(135deg, #111111, #333333);
    border-radius: var(--border-radius);
}

.bingo-board div:hover {
    background: linear-gradient(135deg, #001836, #0046a2);
    transform: scale(1.05);
}

.bingo-board div.marked {
    background: linear-gradient(135deg, #001836, #0046a2) !important;
}

.bingo-board div.marked:hover {
    background: linear-gradient(135deg, #001836, #0046a2);
    transform: scale(1.05);
}

.free-space {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 0;
}

.free-space img.logo-img {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.marked {
    background: linear-gradient(135deg, #001836, #0046a2);
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60%;
    margin: var(--margin);
    margin-bottom: 0;
    gap: var(--gap);
}

.button-container > * {
    width: 100%;
    box-sizing: border-box;
}

#resetBtn {
    width: 100%;
    display: flex;
    padding: calc(var(--padding) / 2) var(--padding);
    background: linear-gradient(135deg, #111111, #333333);
    border: var(--border);
    border-radius: calc(var(--border-radius) * 4);
    color: var(--text-color);
    font-size: calc(var(--font-size) / 2);
    cursor: pointer;
    transition: transform 0.2s ease;
    justify-content: center;
}

#resetBtn:hover {
    background: linear-gradient(135deg, #001836, #0046a2);
    transform: scale(1.05);
}

#winMessage {
    width: 100%;
    display: none;
    padding: calc(var(--padding) / 2) var(--padding);
    background: linear-gradient(135deg, #001836, #0046a2);
    color: var(--text-color);
    border: var(--border);
    border-radius: calc(var(--border-radius) * 4);
    font-size: calc(var(--font-size) / 2);
    font-weight: bold;
    animation: pop 0.5s ease-in-out forwards;
    text-align: center;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: var(--mobile-padding);
        margin: var(--mobile-margin);
    }

    .container {
        padding: var(--mobile-padding);
        width: 100%;
        max-width: none;
        border-radius: var(--mobile-border-radius);
        border: var(--mobile-border);
        background: linear-gradient(90deg, #000000, #222222);
    }

    .bingo-container {
        gap: var(--mobile-gap);
    }

    .headers {
        gap: var(--mobile-gap);
        margin: var(--mobile-margin);
    }

    .headers .b-header,
    .headers .i-header,
    .headers .n-header,
    .headers .g-header,
    .headers .o-header {
        width: 100%;
        font-size: calc(var(--font-size) / 2);
        border-radius: var(--mobile-border-radius);
        width: 100%;
        aspect-ratio: 1;
        border: var(--mobile-border);
        background: linear-gradient(90deg, #001836, #0046a2);
    }

    .bingo-board {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(5, 1fr);
        gap: var(--mobile-gap);
        width: 100%;
        aspect-ratio: 1;
    }

    .bingo-board div {
        font-size: calc(var(--font-size) / 3);
        border-radius: var(--mobile-border-radius);
        border: var(--mobile-border);
        background: linear-gradient(90deg, #111111, #333333);
    }

    .bingo-board div:hover {
        background: linear-gradient(90deg, #001836, #0046a2);
    }

    .bingo-board div.marked {
        background: linear-gradient(90deg, #001836, #0046a2) !important;
    }

    .bingo-board div.marked:hover {
        background: linear-gradient(90deg, #001836, #0046a2);
    }

    .marked {
        background: linear-gradient(90deg, #001836, #0046a2);
    }

    .button-container {
        margin: var(--mobile-margin);
        gap: var(--mobile-gap);
    }

    #resetBtn {
        padding: var(--mobile-padding);
        font-size: calc(var(--font-size) / 4);
        margin: var(--mobile-margin);
        border: var(--mobile-border);
        border-radius: var(--mobile-border-radius);
        background: linear-gradient(90deg, #111111, #333333);
    }

    #resetBtn:hover {
        background: linear-gradient(90deg, #001836, #0046a2);
    }

    .free-space img.logo-img {
        border-radius: var(--mobile-border-radius);
    }

    #winMessage {
        font-size: calc(var(--font-size) / 4);
        border: var(--mobile-border);
        padding: var(--mobile-padding);
        margin: var(--mobile-margin);
        border-radius: var(--mobile-border-radius);
        background: linear-gradient(90deg, #001836, #0046a2);
    }
}
