/* Unscramble Words Tool */
.uwt-wrap {
    max-width: 860px;
    margin: 32px auto;
    font-family: inherit;
}

.uwt-card {
    background: #f7fbf8;
    border: 1px solid #d7eadc;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 12px 35px rgba(20, 65, 40, 0.08);
}

.uwt-title {
    margin: 0 0 8px;
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
}

.uwt-subtitle {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 24px;
    color: #405047;
    font-size: 1.05rem;
}

.uwt-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.uwt-input,
.uwt-options input,
.uwt-options select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bdd8c5;
    border-radius: 12px;
    padding: 14px 16px;
    font: inherit;
    background: #ffffff;
}

.uwt-input {
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.uwt-buttons {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.uwt-btn {
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.uwt-btn:hover {
    transform: translateY(-1px);
}

.uwt-btn-main {
    flex: 1;
    background: #2f7d4f;
    color: #ffffff;
}

.uwt-btn-options {
    background: #f4b431;
    color: #18230f;
    min-width: 140px;
}

.uwt-options {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #cfe6d5;
    border-radius: 18px;
    background: #ffffff;
}

.uwt-options h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.uwt-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    margin-bottom: 4px;
}

.uwt-checkbox-row input {
    width: auto;
    transform: scale(1.15);
}

.uwt-option-note {
    margin: 0 0 16px;
    color: #526159;
    font-size: 0.95rem;
}

.uwt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.uwt-grid label {
    font-weight: 700;
    color: #23362a;
}

.uwt-grid input,
.uwt-grid select {
    margin-top: 6px;
}

.uwt-status {
    margin-top: 16px;
    min-height: 24px;
    color: #405047;
}

.uwt-score {
    margin-top: 16px;
    padding: 16px;
    background: #e9f6ed;
    border-radius: 16px;
    border: 1px solid #cbe5d2;
}

.uwt-breakdown {
    margin-top: 6px;
}

.uwt-results {
    margin-top: 20px;
}

.uwt-result-group {
    margin-bottom: 20px;
}

.uwt-result-group h3 {
    margin-bottom: 10px;
    color: #183b24;
}

.uwt-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uwt-word {
    border: 1px solid #c7e2ce;
    background: #ffffff;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}

.uwt-word:hover {
    background: #e9f6ed;
}

.uwt-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 18px;
}

.uwt-modal[hidden] {
    display: none;
}

.uwt-modal-panel {
    position: relative;
    width: min(560px, 100%);
    max-height: 80vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.25);
}

.uwt-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: 0;
    background: transparent;
    font-size: 2rem;
    cursor: pointer;
}

.uwt-word-details,
.uwt-dictionary-links {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: #f1f8f3;
    border: 1px solid #d2e8d8;
}

.uwt-word-details h4,
.uwt-dictionary-links h4 {
    margin: 0 0 8px;
}

.uwt-word-details ul {
    margin: 0;
    padding-left: 20px;
}

.uwt-dictionary-links a {
    display: inline-block;
    margin: 6px 10px 0 0;
    color: #2f7d4f;
    font-weight: 800;
    text-decoration: underline;
}

.uwt-dictionary-links p {
    margin: 6px 0 0;
    color: #526159;
    font-size: 0.95rem;
}

@media (max-width: 680px) {
    .uwt-card {
        padding: 20px;
        border-radius: 18px;
    }

    .uwt-buttons {
        flex-direction: column;
    }

    .uwt-btn-options {
        width: 100%;
    }

    .uwt-grid {
        grid-template-columns: 1fr;
    }
}
