html, body {
    overscroll-behavior: none;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #0d0d10;
    color: #3ddc84;
    font-family: system-ui, sans-serif;
}

h1 {
    letter-spacing: 4px;
    margin: 0 0 12px;
    font-size: clamp(20px, 4vw, 32px);
}

#snake {
    display: block;
    width: 100%;
    max-width: min(800px, calc((100vh - 160px) * (800 / 448)));
    height: auto;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(61, 220, 132, 0.15);
    touch-action: none;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 12px;
}

.controls label {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="range"] {
    accent-color: #3ddc84;
}

.controls button {
    background: transparent;
    color: #3ddc84;
    border: 1px solid #3ddc84;
    border-radius: 6px;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.controls button:hover {
    background: rgba(61, 220, 132, 0.12);
}

.controls button.on {
    background: rgba(255, 71, 87, 0.15);
    border-color: #ff4757;
    color: #ff7b86;
}

.controls button.muted {
    color: #888;
    border-color: #555;
}

.controls button.muted:hover {
    background: rgba(136, 136, 136, 0.12);
}

.controls.diff button.active {
    background: rgba(61, 220, 132, 0.22);
    color: #fff;
    font-weight: 600;
}

.controls select {
    background: #0d0d10;
    color: #3ddc84;
    border: 1px solid #3ddc84;
    border-radius: 6px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.controls select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(61, 220, 132, 0.25);
}

.controls.diff {
    margin-bottom: 4px;
}

:fullscreen {
    background: #0d0d10;
    padding: 0;
    margin: 0;
    overflow: hidden;
    min-height: 100vh;
    height: 100vh;
}

:fullscreen h1,
:fullscreen .controls {
    display: none;
}

:fullscreen #snake {
    width: auto;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    box-shadow: none;
    border-radius: 0;
}