/* ── Crossword Grid ─────────────────────────────────── */
#cw-grid {
    display: grid;
    gap: 2px;
    background: #374151;
    border: 3px solid #374151;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    user-select: none;
}

.cw-black {
    background: #1f2937;
    aspect-ratio: 1;
}

.cw-cell {
    position: relative;
    background: #fff;
    aspect-ratio: 1;
    cursor: pointer;
}

.cw-cell.cw-highlight { background: #e0e7ff; }
.cw-cell.cw-active    { background: #fde047; box-shadow: inset 0 0 0 2px #ea580c; z-index: 5; }

.cw-num {
    position: absolute;
    top: 1px; left: 2px;
    font-size: clamp(6px, 1.2vw, 10px);
    font-weight: 700;
    color: #374151;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.cw-input {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: none; outline: none;
    background: transparent;
    text-align: center;
    font-size: clamp(10px, 2vw, 18px);
    font-weight: 800;
    text-transform: uppercase;
    color: #1f2937;
    cursor: pointer;
    caret-color: transparent;
    padding-top: clamp(8px,1.5vw,14px);
}

.cw-input.cw-wrong    { color: #ef4444 !important; }
.cw-input.cw-correct  { color: #16a34a !important; background: #f0fdf4; }
.cw-input.cw-revealed { color: #2563eb !important; }

/* ── Clue Lists ────────────────────────────────────── */
.cw-clues-panel {
    font-size: 13px;
    line-height: 1.5;
}

.cw-clues-panel h3 {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #374151;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.cw-clues-panel li {
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    list-style: none;
    color: #4b5563;
    transition: background .1s;
}
.cw-clues-panel li:hover  { background: #f3f4f6; }
.cw-clues-panel li.cw-clue-active { background: #fef08a; color: #1f2937; font-weight: 600; }

.cw-clue-num   { font-weight: 800; color: #2563eb; margin-right: 4px; }
.cw-letters    { color: #9ca3af; font-style: normal; font-size: 11px; }

@media (max-width: 640px) {
    .cw-clues-panel { font-size: 12px; }
}
