.puzzle-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols), 2.5rem);
    gap: 2px;
    width: max-content;
    padding: 0;
    border: none;
}

/* Purely visual pill/capsule path overlay, sized to match the grid exactly
   in JS. pointer-events: none so it never intercepts clicks/taps/drags --
   the cell buttons underneath keep handling all input. Positioned above
   the (position: static) cell buttons automatically since it's the only
   positioned element in the grid; cells sit above it in turn (see .cell)
   with a transparent background so their letters read on top of the
   capsules while the capsules still show through around them. */
.puzzle-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.cell {
    position: relative;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid #ccc;
    cursor: pointer;
    padding: 0;
    user-select: none;
    /* Custom pointer-based drag tracing needs to own touch gestures on the
       grid -- without this, touch browsers try to scroll/pan on drag. */
    touch-action: none;
}

.cell.invalid {
    background: #f28b82;
    border-color: #c5221f;
}

#word-list li.found {
    text-decoration: line-through;
    color: #888;
}

#word-list li.found::before {
    content: "";
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-right: 0.4em;
    border-radius: 2px;
    background: var(--word-color, #8fd694);
    vertical-align: middle;
}

.clear-attempt {
    margin-top: 0.75rem;
}

.clear-attempt[hidden] {
    display: none;
}
