.colorfields-board {
    display: grid;
    grid-template-columns: repeat(var(--cf-cols), minmax(0, 1fr));
    gap: 1px;
    width: min(100%, 36rem);
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #334155;
    border-radius: 2px;
    background: #64748b;
    touch-action: none;
    user-select: none;
}

.colorfields-cell {
    position: relative;
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    container-type: inline-size;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: #ffffff;
    color: #183137;
    touch-action: none;
    cursor: pointer;
}

.colorfields-cell.is-clue { cursor: default; }
.colorfields-cell.is-green { background-color: #86efac; }
.colorfields-cell.is-blue { background-color: #93c5fd; }
.colorfields-cell:focus-visible {
    outline: 3px solid #6d28d9;
    outline-offset: -4px;
    z-index: 1;
}
.colorfields-clue-number {
    display: grid;
    place-items: center;
    width: 60%;
    aspect-ratio: 1;
    box-sizing: border-box;
    border: 1px solid #334155;
    border-radius: 50%;
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 3vw, 1.75rem);
    font-size: clamp(1rem, 42cqw, 2rem);
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}

.colorfields-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.8rem;
}

.colorfields-legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.colorfields-legend small { flex-basis: 100%; text-align: center; color: #64748b; }
.colorfields-swatch { width: 0.9rem; height: 0.9rem; border: 1px solid #64748b; border-radius: 0.2rem; }
.colorfields-swatch.is-green { background: #86efac; }
.colorfields-swatch.is-blue { background: #93c5fd; }

.colorfields-control {
    display: flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 150ms, color 150ms;
}

.colorfields-control:hover,
.colorfields-control.is-active { background: #ede9fe; color: #6d28d9; }
