/* .solver_bar styles now live in style.css so they are shared by the
   contact and word-submission pages too. */

.solver {
    max-width: 620px;
    margin: 0 auto;
}

.solver__hint {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
}

.solver__cells {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.solver__gap {
    width: 14px;
}

.solver__cell {
    width: 54px;
    height: 62px;
    border: 2px solid #d7d9e0;
    border-radius: 10px;
    background: #fff;
    font-family: Nunito, sans-serif;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    color: #161c2d;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.solver__cell:focus {
    outline: none;
    border-color: #e1cf1f;
    box-shadow: 0 0 0 3px rgba(255, 218, 24, .3);
}

.solver__cell--center {
    background: #ffda18;
    border-color: #e1cf1f;
}

.solver__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.solver__button {
    padding: 12px 26px;
    border: 2px solid #000;
    border-radius: 8px;
    background: #ffda18;
    font-family: Nunito, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: background-color .2s ease-in-out;
}

.solver__button:hover {
    background: #ffc518;
}

.solver__button[disabled] {
    opacity: .55;
    cursor: default;
}

.solver__button--ghost {
    background: transparent;
    border-color: #d7d9e0;
}

.solver__button--ghost:hover {
    background: #f1f2f5;
}

.solver__error {
    margin: 18px 0 0;
    text-align: center;
    font-weight: 600;
    color: #c0392b;
}

.solver__results {
    max-width: 720px;
    margin: 42px auto 0;
}

.solver__summary {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    padding-bottom: 18px;
    border-bottom: 1px solid #e7ebf1;
}

.solver__legend {
    text-align: center;
    font-size: 14px;
    color: #75798d;
    margin-top: 12px;
}

.solver__group {
    margin-top: 26px;
}

.solver__group-head {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.solver__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 6px 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.solver__word {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid #eef0f4;
    text-transform: uppercase;
    font-weight: 600;
}

.solver__word-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.solver__word--pangram {
    background: #fff6c2;
    border-radius: 6px;
    border-bottom-color: #ffda18;
}

.solver__points {
    font-size: 13px;
    font-weight: 400;
    color: #75798d;
    white-space: nowrap;
}

.solver__empty {
    text-align: center;
    font-size: 18px;
    margin-top: 26px;
}

@media (max-width: 520px) {
    .solver__cell {
        width: 42px;
        height: 52px;
        font-size: 22px;
    }

    .solver__gap {
        width: 0;
        flex-basis: 100%;
        height: 0;
    }
}

.solver__word--clickable {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.solver__word--clickable:hover {
    background-color: #f3f4f8;
    border-radius: 6px;
}

.solver__word--pangram.solver__word--clickable:hover {
    background-color: #ffef9e;
}

.solver__word--clickable:focus-visible {
    outline: 2px solid #ffda18;
    outline-offset: 1px;
    border-radius: 6px;
}

/* Definition popup, mirrors the in-game one. */
.def-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(15, 15, 15, 0.45);
    animation: def-fade 0.15s ease-out;
}

.def-popup {
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 18px 20px 16px 20px;
    background-color: #ffffff;
    color: #1a1a2b;
    border-radius: 16px;
    box-shadow: 0 18px 48px -12px rgba(20, 15, 5, 0.45);
    animation: def-pop 0.16s ease-out;
    font-family: 'Nunito', sans-serif;
}

.def__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.def__word {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: none;
}

.def__exit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #75798d;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.def__exit:hover {
    background-color: #eef0f4;
}

.def__derived {
    margin-bottom: 10px;
    font-size: 15px;
    font-style: italic;
    color: #75798d;
}

.def__baseword {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: 800;
    color: #1a1a2b;
    text-decoration: underline;
    text-decoration-color: #ffda18;
    cursor: pointer;
}

.def__senses {
    margin: 0;
    padding-left: 1.3em;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.def__sense {
    line-height: 1.5;
    font-size: 16px;
}

.def__pos {
    margin-right: 6px;
    font-size: 13px;
    font-style: italic;
    color: #75798d;
}

.def__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid #eef0f4;
    font-size: 13px;
}

.def__source {
    color: #9599ac;
}

.def__link {
    color: #75798d;
    text-decoration: underline;
}

.def__loading {
    padding: 8px 0 12px 0;
    color: #75798d;
}

.def__empty p {
    margin: 0 0 12px 0;
    color: #55596b;
    font-size: 16px;
}

@keyframes def-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes def-pop {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .def-backdrop,
    .def-popup {
        animation: none;
    }
}
