/* =========================================================
ECDS Crossword v1.3 — Divi 4 compatible
EC Digital Services
========================================================= */

/* ── FORCE WHITE on crossword shell AND all Divi ancestors ───────────── */
.ecds-crossword-shell,
.ecds-crossword-shell .ecds-game-area,
.ecds-crossword-shell .ecds-game-area *,
.et_pb_module .ecds-crossword-shell .ecds-game-area,
.et_pb_section .ecds-crossword-shell .ecds-game-area,
.et_pb_row .ecds-crossword-shell .ecds-game-area {
    background-color: #ffffff !important;
    background-image: none !important;
}

/* Restore specific elements that SHOULD have colour */
.ecds-crossword-shell .ecds-shell-header {
    background: linear-gradient(135deg, #f0f4ff 0%, #fafafa 100%) !important;
    background-image: linear-gradient(135deg, #f0f4ff 0%, #fafafa 100%) !important;
}

.ecds-crossword-shell .ecds-cw-grid-outer {
    background-color: #ffffff !important;
    background-image: none !important;
}

/* Black crossword cells — must keep their colour */
.ecds-crossword-shell .ecds-cw-black,
.ecds-crossword-shell [data-cw-black="1"] {
    background-color: #2d3748 !important;
    background-image: none !important;
}

/* White letter cells */
.ecds-crossword-shell .ecds-cw-cell {
    background-color: #ffffff !important;
    background-image: none !important;
    cursor: pointer;
    transition: background-color .08s;
}

/* Highlight states must override the blanket white rule */
.ecds-crossword-shell .ecds-cw-cell.ecds-cw-active-word  { background-color: #bfdbfe !important; }
.ecds-crossword-shell .ecds-cw-cell.ecds-cw-active-cell  { background-color: #93c5fd !important; }
.ecds-crossword-shell .ecds-cw-cell.ecds-cw-active-cross { background-color: #eff6ff !important; }
.ecds-crossword-shell .ecds-cw-cell.ecds-cw-cell-correct { background-color: #bbf7d0 !important; }
.ecds-crossword-shell .ecds-cw-cell.ecds-cw-cell-correct .ecds-cw-input { color: #166534; }

/* ── LAYOUT ──────────────────────────────────────────────────────────── */
.ecds-cw-board {
    width: 100%;
    background-color: #ffffff !important;
    background-image: none !important;
}

.ecds-cw-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    background-color: #ffffff !important;
    background-image: none !important;
}

.ecds-cw-grid-wrap {
    flex: 0 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: fit-content;
    max-width: 100%;
    background-color: transparent !important;
    background-image: none !important;
}

.ecds-cw-clues {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
    max-height: 560px;
    overflow-y: auto;
    background-color: transparent !important;
    background-image: none !important;
}

@media (max-width: 720px) {
    .ecds-cw-layout { flex-direction: column; }
    .ecds-cw-clues  { max-width: 100%; max-height: 240px; }
}

/* ── GRID OUTER (the crossword frame) ───────────────────────────────── */
.ecds-cw-grid-outer {
    display: inline-block;
    background-color: #ffffff !important;
    background-image: none !important;
    line-height: 0;
    font-size: 0;
    vertical-align: top;
    position: relative;
}

/* ── INPUT FIELD ─────────────────────────────────────────────────────── */
.ecds-cw-input {
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ── PROGRESS BAR ────────────────────────────────────────────────────── */
.ecds-cw-progress-wrap {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent !important;
}
.ecds-cw-progress-track {
    flex: 1;
    height: 8px;
    background-color: #e2e8f0 !important;
    background-image: none !important;
    border-radius: 4px;
    overflow: hidden;
}
.ecds-cw-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #10b981) !important;
    border-radius: 4px;
    transition: width .4s ease;
}
.ecds-cw-progress-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

/* ── CLUES PANEL ─────────────────────────────────────────────────────── */
.ecds-cw-clue-section { margin-bottom: 18px; }

.ecds-cw-clue-heading {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #64748b;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e2e8f0;
    background: transparent !important;
}

.ecds-cw-clue-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ecds-cw-clue-item {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .1s;
    background-color: transparent !important;
    background-image: none !important;
}
.ecds-cw-clue-item:hover { background-color: #f0f4ff !important; border-color: #e0e7ff; }
.ecds-cw-clue-active      { background-color: #dbeafe !important; border-color: #93c5fd !important; }
.ecds-cw-clue-done        { background-color: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.ecds-cw-clue-done .ecds-cw-clue-txt { text-decoration: line-through; color: #94a3b8; }
.ecds-cw-clue-done .ecds-cw-clue-num { background-color: #10b981 !important; }

.ecds-cw-clue-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 17px;
    background-color: #4f46e5 !important;
    background-image: none !important;
    color: #fff;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
    padding: 0 3px;
}
.ecds-cw-clue-txt {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.3;
}
.ecds-cw-clue-len { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.ecds-cw-status {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    min-height: 18px;
    background: transparent !important;
}
.ecds-cw-empty {
    color: #64748b;
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    background-color: #f8fafc !important;
    background-image: none !important;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
}
