#game-canvas-wrapper {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 24px;
}

#game-canvas-area {
    position: relative;
    width: min(80vw, 420px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    touch-action: manipulation;
}

.lights-grid {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
    padding: 3px;
}

.light-cell {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    transform: translate(var(--tile-shift-x, 0), var(--tile-shift-y, 0)) rotate(var(--tile-rotation, 0deg));
    transform-origin: 50% 50%;
    transition: filter 0.14s ease, transform 0.14s ease;
    -webkit-tap-highlight-color: transparent;
}

.light-cell:hover {
    filter: brightness(1.03);
}

.light-cell:active {
    transform: translate(var(--tile-shift-x, 0), var(--tile-shift-y, 0)) rotate(var(--tile-rotation, 0deg)) translateY(1px);
}

.light-on .light-tile-paper {
    filter: saturate(1.03);
}

.light-cell:focus-visible {
    outline: 3px solid rgba(52, 152, 219, 0.35);
    outline-offset: 3px;
}

.light-cell.hint-move::after {
    position: absolute;
    right: 9%;
    bottom: 9%;
    z-index: 2;
    width: 28%;
    height: 28%;
    background: var(--pen-blue);
    border-radius: 50%;
    box-shadow:
        0 0 0 3px rgba(37, 63, 143, 0.12),
        1px 1px 0 rgba(16, 27, 84, 0.18);
    content: "";
    pointer-events: none;
    transform: rotate(-8deg) scaleX(1.12);
}

.controls-key:disabled .controls-key-face,
.controls-key:disabled .controls-key-label {
    opacity: 0.72;
}

@media (max-width: 640px) {

    .controls-layer {
        --controls-grid-gap: 6px;
    }
}
