:root {
    --ground: #231a1d;
    --ink: #f4efe6;
    --glass: rgb(35 26 29 / 0.72);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: var(--ground);
    color: var(--ink);
    font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

#sand {
    position: fixed;
    left: 0;
    bottom: 0;
    display: block;
    image-rendering: pixelated;
    touch-action: none;
    cursor: crosshair;
}

.home {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--glass);
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
    backdrop-filter: blur(6px);
}

.home:hover {
    text-decoration: underline;
}

.hint {
    position: fixed;
    top: 30%;
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.6s;
}

.hint.gone {
    opacity: 0;
}

.bar {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(6px);
    transform: translateX(-50%);
}

.swatches {
    display: flex;
    gap: 6px;
}

button {
    font: inherit;
    cursor: pointer;
}

button:focus-visible,
.home:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

.swatch {
    width: 36px;
    height: 36px;
    flex: none;
    border: 3px solid transparent;
    border-radius: 50%;
    background: var(--c) padding-box;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.25);
}

.swatch.rainbow {
    background: conic-gradient(#f2c14e, #f78154, #b4436c, #3e7cb1, #4d9078, #7fb069, #f2c14e) padding-box;
}

.swatch[aria-pressed="true"] {
    border-color: var(--ink);
}

.empty {
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
}

.empty:hover {
    background: var(--ink);
    color: var(--ground);
}

@media (max-width: 460px) {
    .bar {
        gap: 8px;
    }

    .swatches {
        gap: 3px;
    }

    .swatch {
        width: 30px;
        height: 30px;
    }

    .empty {
        padding: 0 12px;
    }
}
