* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    height: 100%;
    width: 100%;
}

:root{
    /* Background color */
    --bg-primary-color: #141414;
    --snake-color: #00FF00;
    --food-color: #FF0000;
    --bg-modals-color:rgba(22, 22, 22, 0.911);

    /* Text color */
    --text-primary-color: #f2f2f2;

    /* Spaceing Variables */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 40px;
    --space-3xl: 48px;

    /* Border color */
    --border-color: #7c7c7c;

    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 24px;
    --border-radius-3xl: 32px;

    /* Cell Size */
    --cell-size: 50px;
}

html{
    background-color: var(--bg-primary-color);
    color:var(--text-primary-color);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

main,
section{
    height: 100%;
    width: 100%;
}

.btn{
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover{
    transform: scale(1.1);
}

section{
    height: 100%;
    padding: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

section .infos{
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.info{
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.board{
    border: 1px solid var(--border-color);
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(var(--cell-size),1fr));
    grid-template-rows: repeat(auto-fill,minmax(var(--cell-size),1fr));
    overflow: hidden;
    touch-action: none;
}

.block{
    border: 0px solid var(--border-color);
    border-radius: 50%;
}
.fill{
    background-color: var(--snake-color);
}

.food{
    background-color: var(--food-color);
}

.modals{
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modals .start-game, .modals .game-over{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
}

.modals .game-over{
    display: none;
}

@media (max-width: 768px) {
    :root {
        --cell-size: 25px;
    }
}