.elg-word-search {
    max-width: 980px;
    margin: 24px auto;
    padding: 18px 14px 28px;
    background: #fff;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: center;
    box-sizing: border-box;
}
.elg-word-search *, .elg-word-search *::before, .elg-word-search *::after {
    box-sizing: border-box;
}
.elg-ws-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}
.elg-ws-title {
    margin: 0;
    color: #111827;
    font-size: 1.35rem;
    font-weight: 800;
}
.elg-ws-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d7dce3;
    border-radius: 8px;
    background: #fff;
    color: #2563eb;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease;
}
.elg-ws-icon-btn:hover,
.elg-ws-icon-btn:focus-visible {
    background: #eff6ff;
    outline: none;
}
.elg-ws-icon-btn:active {
    transform: scale(.96);
}
.elg-ws-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.elg-ws-help {
    max-width: 820px;
    margin: 0 auto 14px;
    color: #475569;
    font-size: .92rem;
    line-height: 1.45;
}
.elg-ws-keywords-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.elg-ws-keywords {
    width: 100%;
    min-height: 58px;
    padding: 12px 22px;
    border: 1px solid #d7dce3;
    border-radius: 12px;
    background: #fff;
    color: #20242c;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.elg-ws-keywords:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.elg-ws-range-label {
    display: block;
    margin: 18px 0 10px;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
}
.elg-ws-range {
    width: 100%;
    height: 16px;
    margin: 0 auto 10px;
    accent-color: #2563eb;
}
.elg-ws-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 8px auto 10px;
}
.elg-ws-btn {
    min-width: 112px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    color: #0f172a;
    font: inherit;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: transform .12s ease, filter .2s ease, opacity .2s ease;
}
.elg-ws-btn:hover:not(:disabled) {
    filter: brightness(.96);
}
.elg-ws-btn:active:not(:disabled) {
    transform: scale(.96);
}
.elg-ws-btn:disabled {
    cursor: default;
    opacity: .55;
}
.elg-ws-btn-small {
    flex-basis: 100%;
    max-width: 112px;
    min-width: 102px;
    min-height: 36px;
    padding: 8px 14px;
    background: #ffcf00;
    font-size: .78rem;
}
.elg-ws-btn-small:not(.active) {
    background: #e5e7eb;
    color: #475569;
}
.elg-ws-btn-create {
    background: #e90046;
    color: #fff;
}
.elg-ws-btn-answer {
    background: #ffcf00;
}
.elg-ws-btn-answer.active {
    background: #2563eb;
    color: #fff;
}
.elg-ws-btn-save {
    background: #16a34a;
    color: #fff;
}
.elg-ws-message {
    min-height: 22px;
    margin: 4px 0 8px;
    color: #dc2626;
    font-size: .95rem;
    font-weight: 700;
}
.elg-ws-board-wrap {
    display: flex;
    justify-content: center;
    min-height: 360px;
    padding-top: 34px;
}
.elg-ws-board {
    --size: 20;
    --cell-font: 18px;
    display: grid;
    grid-template-columns: repeat(var(--size), minmax(0, 1fr));
    width: min(88vw, 560px);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
}
.elg-ws-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    color: #020617;
    font-size: var(--cell-font);
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    transform: rotate(var(--rot));
    user-select: none;
}
.elg-ws-cell.outside {
    color: transparent;
    transform: none;
}
.elg-ws-cell.answer {
    color: #0438ff !important;
    font-weight: 900 !important;
    text-shadow: 0 0 0 #0438ff;
}

@media (max-width: 640px) {
    .elg-word-search {
        margin: 16px auto;
        padding: 14px 10px 22px;
    }
    .elg-ws-title {
        font-size: 1.15rem;
    }
    .elg-ws-help {
        font-size: .86rem;
    }
    .elg-ws-keywords {
        min-height: 50px;
        padding: 10px 12px;
        font-size: 1rem;
    }
    .elg-ws-range-label {
        font-size: 1.15rem;
    }
    .elg-ws-board-wrap {
        min-height: 280px;
        padding-top: 24px;
    }
}

.elg-word-search:fullscreen,
.elg-word-search.is-fullscreen {
    width: 100vw;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    overflow: auto;
}
.elg-word-search:fullscreen .elg-ws-board-wrap,
.elg-word-search.is-fullscreen .elg-ws-board-wrap {
    min-height: auto;
    padding-top: 18px;
}
.elg-word-search:fullscreen .elg-ws-board,
.elg-word-search.is-fullscreen .elg-ws-board {
    width: min(86vw, 72vh, 820px);
}
