/* ECDS Word Search v2.0 */

.ecds-ws-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ecds-ws-board {
    position: relative;
    flex: 0 0 auto;
    border: 2px solid var(--ecds-border-dark);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    max-width: 100%;
}

/* PLACEHOLDER GRID */
.ecds-ws-placeholder {
    width: 440px;
    height: 440px;
    background:
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px);
    background-size: 36px 36px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ecds-ws-placeholder::before {
    content: 'Press Start to begin';
    color: var(--ecds-text-muted);
    font-size: 15px;
    font-weight: 600;
}

.ecds-wordsearch-table {
    border-collapse: collapse;
    position: relative;
    z-index: 1;
    user-select: none;
}

.ecds-wordsearch-table td {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    color: var(--ecds-text);
    transition: background .1s;
    font-family: var(--ecds-font-mono);
}

@media (max-width: 640px) {
    .ecds-wordsearch-table td {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .ecds-ws-placeholder { width: 340px; height: 340px; }
}

.ecds-ws-selecting { background: #e0e7ff !important; }
.ecds-ws-found     { background: #d1fae5 !important; color: #065f46; }

.ecds-wordsearch-overlay {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 2;
}

/* WORD LIST */
.ecds-ws-wordlist {
    min-width: 180px;
    flex: 0 0 auto;
}

.ecds-ws-wordlist h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ecds-text-muted);
    margin: 0 0 12px;
}

.ecds-ws-wordlist ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ecds-ws-wordlist li {
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid var(--ecds-border);
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    color: var(--ecds-text);
    transition: background .15s, color .15s;
    letter-spacing: .5px;
}

.ecds-ws-wordlist li.ecds-word-done {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
    text-decoration: line-through;
}

.ecds-ws-wordlist li.ecds-word-done::before {
    content: '✓ ';
    font-weight: 900;
}

@media (max-width: 700px) {
    .ecds-ws-layout { flex-direction: column; }
    .ecds-ws-wordlist { display: flex; flex-wrap: wrap; gap: 6px; }
    .ecds-ws-wordlist ul { flex-direction: row; flex-wrap: wrap; }
}

/* Wrong selection flash */
.ecds-ws-wrong {
    background: #fee2e2 !important;
    color: #b91c1c;
}
