:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: #050914;
}

body {
    display: grid;
    place-items: center;
    overflow: hidden;
}

.game-shell {
    position: relative;
    width: 800px;
    height: 600px;
    overflow: hidden;
    background: #071528;
}

#gameCanvas {
    display: block;
    width: 800px;
    height: 600px;
    outline: none;
    touch-action: manipulation;
    user-select: none;
}

#gameCanvas:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(255, 215, 92, .86);
}

.game-actions {
    position: absolute;
    top: 14px;
    right: 16px;
    display: flex;
    gap: 7px;
    z-index: 8;
}

.game-actions button {
    min-width: 44px;
    height: 38px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px;
    background: rgba(5, 13, 28, .82);
    color: #f8fbff;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.game-actions button:hover:not(:disabled) {
    background: rgba(14, 31, 58, .96);
}

.game-actions button:focus-visible,
.color-picker button:focus-visible {
    outline: 2px solid #ffd75c;
    outline-offset: 2px;
}

.game-actions button:disabled {
    opacity: .38;
    cursor: default;
}

#drawButton.ready {
    border-color: rgba(255, 215, 92, .82);
    box-shadow: 0 0 18px rgba(255, 215, 92, .24);
    opacity: 1;
}

#unoButton {
    color: #fff4b0;
    border-color: rgba(255, 214, 71, .75);
    letter-spacing: .04em;
}

.color-picker {
    position: absolute;
    z-index: 12;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(4, 52px);
    gap: 10px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px;
    background: rgba(4, 10, 23, .95);
    box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.color-picker[hidden] {
    display: none;
}

.color-picker span {
    grid-column: 1 / -1;
    color: #fff;
    font-size: 14px;
    font-weight: 850;
    text-align: center;
}

.color-picker button {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(255,255,255,.72);
    border-radius: 16px;
    cursor: pointer;
}

.color-picker button:disabled {
    opacity: .2;
    cursor: default;
}

.color-picker button[data-color="red"] { background: #e84444; }
.color-picker button[data-color="yellow"] { background: #f2c33b; }
.color-picker button[data-color="green"] { background: #39a862; }
.color-picker button[data-color="blue"] { background: #3b7ee8; }

.powered-by {
    position: absolute;
    left: 16px;
    bottom: 8px;
    z-index: 6;
    color: rgba(255,255,255,.48);
    font-size: 10px;
    text-decoration: none;
    letter-spacing: .02em;
}

.powered-by:hover,
.powered-by:focus-visible {
    color: rgba(255,255,255,.84);
}

@media (max-width: 800px), (max-height: 600px) {
    .game-shell {
        transform-origin: top left;
    }
}
