/* Lights Out (/lights-out): only what is the game's own - the board of lamps and their amber glow. Tiles,
   buttons, fields and the accent come from the app kit (css/app-kit, docs/app-kit.md), the button row from
   css/app-kit/games.css (every game). Loaded only on this page (StylePaths). */

.lights-out-board {
    display: grid;
    grid-template-columns: repeat(var(--lo-n, 5), 1fr);
    gap: clamp(6px, 1.6vw, 12px);
    width: min(100%, 560px, calc(100vh - 300px));
    min-width: min(100%, 240px);
    margin-inline: auto;
    padding: clamp(10px, 2vw, 18px);
    border-radius: 18px;
    background: var(--ak-panel, #efe9dc);
    box-shadow: inset 0 0 0 1px var(--ak-border, #ddd4c2);
}

.lo-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 18%;
    cursor: pointer;
    background: var(--ak-hover, #ddd4c2);
    box-shadow: inset 0 2px 5px rgba(60, 45, 10, 0.18);
    transition: background 120ms ease, box-shadow 120ms ease, transform 80ms ease;
    -webkit-tap-highlight-color: transparent;
}

/* A lit lamp: warm amber with a bright heart and a halo. */
.lo-cell.is-on {
    background: radial-gradient(circle at 50% 38%, #ffe9a8 0%, #f5b921 55%, #d98a06 100%);
    box-shadow: 0 0 18px rgba(245, 185, 33, 0.65), 0 0 42px rgba(245, 185, 33, 0.3), inset 0 -3px 8px rgba(146, 90, 0, 0.35);
}

.lo-cell::after {
    content: "";
    position: absolute;
    inset: 31%;
    border-radius: 50%;
    background: rgba(120, 85, 10, 0.22);
}

.lo-cell.is-on::after {
    background: rgba(255, 246, 205, 0.85);
    box-shadow: 0 0 10px rgba(255, 240, 180, 0.9);
}

.lo-cell:hover {
    transform: translateY(-1px);
}

.lo-cell:active {
    transform: scale(0.96);
}

.lo-cell:focus-visible {
    outline: 3px solid var(--ak-accent);
    outline-offset: 2px;
}

/* The hinted lamp pulses until it is pressed. */
.lo-cell.is-hint {
    animation: lo-hint-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes lo-hint-pulse {
    from { box-shadow: 0 0 0 2px var(--ak-accent), 0 0 10px rgba(245, 185, 33, 0.4); }
    to { box-shadow: 0 0 0 4px var(--ak-accent), 0 0 26px rgba(245, 185, 33, 0.8); }
}

/* Solve playback: the board ignores clicks, and the lamp being pressed dips in. */
.lights-out-board.is-solving {
    pointer-events: none;
}

.lo-cell.is-solving-press {
    transform: scale(0.92);
    box-shadow: 0 0 0 3px var(--ak-accent), 0 0 18px rgba(245, 185, 33, 0.55);
}

@media (prefers-reduced-motion: reduce) {
    .lo-cell { transition: none; }
    .lo-cell.is-hint { animation: none; box-shadow: 0 0 0 3px var(--ak-accent); }
    .lo-cell.is-solving-press { transform: none; }
}

/* Solved: the dark board settles with a soft green rim. */
.lights-out-board.is-solved {
    box-shadow: inset 0 0 0 2px var(--ak-success, #3d9970), 0 0 24px rgba(61, 153, 112, 0.35);
}

.lights-out-status {
    min-height: 1.4em;
    margin: 0;
    text-align: center;
}

.lights-out-status.is-solved {
    color: var(--ak-success);
    font-weight: 600;
}
