.app-modal[hidden] {
    display: none !important;
}

.app-modal {
    align-items: flex-start;
    box-sizing: border-box;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 72px 8px 16px;
    position: fixed;
    z-index: 1000;
}

.app-modal__overlay {
    background: rgb(0 43 70 / 46%);
    inset: 0;
    position: absolute;
}

.app-modal__box {
    background: rgb(238 250 255 / 96%);
    border: 1px solid rgb(182 213 255 / 86%);
    border-radius: 22px;
    box-shadow: 0 8px 24px rgb(0 43 70 / 28%);
    box-sizing: border-box;
    color: #2f5d6b;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 88px);
    max-height: calc(100svh - 88px);
    max-width: 560px;
    overflow: hidden;
    padding: 12px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.app-modal--dialog.app-modal--open .app-modal__box {
    animation: app-modal-dialog-in 0.48s cubic-bezier(0.2, 1.18, 0.32, 1) both;
}

.app-modal--dialog.app-modal--closing .app-modal__box {
    animation: app-modal-dialog-out 0.22s cubic-bezier(0.66, 0, 1, 0.42) both;
}

.app-modal--dialog.app-modal--closing .app-modal__overlay {
    animation: app-modal-overlay-out 0.18s ease both;
}

.app-modal--top-sheet {
    align-items: flex-start;
    padding: 0;
}

.app-modal--top-sheet .app-modal__box {
    border-radius: 0 0 22px 22px;
    max-height: 38vh;
    max-height: 38svh;
    max-width: 560px;
    min-height: 30vh;
    min-height: 30svh;
    width: 100%;
}

.app-modal--top-sheet .app-modal__footer {
    justify-content: flex-end;
}

.app-modal--word-hint .app-modal__box {
    max-height: 28vh;
    max-height: 28svh;
    min-height: 24vh;
    min-height: 24svh;
}

.app-modal--word-hint .app-modal__content {
    padding-top: 10px;
}

.app-modal--word-hint .app-modal-word {
    align-items: flex-start;
    padding: 8px 0 0 12px;
    text-align: left;
}

.app-modal--progress-reset .app-modal__box {
    max-height: 34vh;
    max-height: 34svh;
    min-height: 28vh;
    min-height: 28svh;
}

.app-modal--progress-reset .app-modal__head {
    padding-right: 0;
}

.app-modal--top-sheet.app-modal--open .app-modal__box {
    animation: app-modal-sheet-in 0.42s cubic-bezier(0.2, 1.14, 0.32, 1) both;
}

.app-modal--top-sheet.app-modal--closing .app-modal__box {
    animation: app-modal-sheet-out 0.2s cubic-bezier(0.66, 0, 1, 0.42) both;
}

.app-modal--top-sheet.app-modal--closing .app-modal__overlay {
    animation: app-modal-overlay-out 0.18s ease both;
}

.app-modal--screen {
    padding: 0;
}

.app-modal--screen .app-modal__box {
    border-radius: 0;
    max-height: 100vh;
    max-height: 100svh;
    max-width: 1200px;
    min-height: 100vh;
    min-height: 100svh;
}

.app-modal--access .app-modal__box {
    gap: 14px;
    justify-content: center;
    padding: 20px;
}

.app-modal--access .app-modal__head {
    align-items: center;
    gap: 8px;
    padding-right: 0;
    text-align: center;
}

.app-modal--access .app-modal__title {
    font-size: clamp(24px, 7vw, 34px);
}

.app-modal--access .app-modal__subtitle {
    color: #009587;
    font-size: clamp(15px, 4.2vw, 18px);
    max-width: 520px;
}

.app-modal--access .app-modal__content {
    align-items: center;
    flex: 0 0 auto;
    overflow: visible;
}

.word-access-lead {
    color: #2f5d6b;
    font-size: clamp(14px, 4vw, 17px);
    font-weight: 800;
    line-height: 1.32;
    max-width: 520px;
    text-align: center;
}

.word-access-features {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-width: 440px;
    width: 100%;
}

.word-access-feature {
    align-items: center;
    background: rgb(220 244 255 / 88%);
    border: 1px solid rgb(119 199 255 / 72%);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 14%);
    box-sizing: border-box;
    color: #174ea6;
    display: flex;
    flex-direction: column;
    font-size: clamp(11px, 3.2vw, 13px);
    font-weight: 900;
    gap: 6px;
    justify-content: center;
    line-height: 1.05;
    min-height: 72px;
    padding: 8px 4px;
    text-align: center;
}

.word-access-feature {
    grid-column: span 2;
}

.word-access-feature:nth-child(4) {
    grid-column: 2 / span 2;
}

.word-access-feature:nth-child(5) {
    grid-column: 4 / span 2;
}

.word-access-feature__icon {
    align-items: center;
    background: rgb(255 255 255 / 72%);
    border: 1px solid rgb(119 199 255 / 50%);
    border-radius: 12px;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.word-access-feature__icon img {
    display: block;
    height: 27px;
    object-fit: contain;
    width: 27px;
}

.word-access-divider {
    border-top: 1px solid rgb(119 199 255 / 52%);
    margin: 8px auto 0;
    max-width: 560px;
    width: 100%;
}

.word-access-footer {
    flex-direction: column;
    margin: 0 auto;
    max-width: 360px;
    width: 100%;
}

.word-access-primary {
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 900;
    min-height: 52px;
    width: 100%;
}

.word-access-home {
    background: rgb(238 250 255 / 90%);
    width: 100%;
}

.app-modal__head {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 40px;
    padding-right: 48px;
}

.app-modal__title {
    color: #174ea6;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.15;
    margin: 0;
}

.app-modal__subtitle {
    color: #2f5d6b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.app-modal__content {
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
}

.app-modal__content p {
    margin: 0;
}

.app-modal__footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.modal-action-button {
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    background: rgb(58 139 255 / 12%);
    border: 2px solid rgb(58 139 255 / 50%);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 32%);
    box-sizing: border-box;
    color: #0463c9;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    padding: 8px 15px;
    text-align: center;
    text-decoration: none;
}

.modal-action-button--primary {
    background: rgb(178 238 109);
}

.modal-action-button--danger {
    background: #ff7d73;
    border-color: rgb(255 166 154 / 88%);
    color: #fff;
}

.modal-close-button {
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    background: rgb(255 255 255 / 50%);
    border: 2px solid rgb(255 255 255 / 68%);
    border-radius: 13px;
    box-sizing: border-box;
    color: #13aee7;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 28px;
    font-weight: 900;
    height: 40px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 3px;
    position: absolute;
    right: 10px;
    top: 10px;
    transition: transform 0.08s ease, filter 0.08s ease;
    width: 40px;
}

.modal-action-button:active,
.modal-close-button:active {
    filter: brightness(0.96);
    transform: translateY(1px) scale(0.98);
}

.app-modal-word {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
    text-align: center;
}

.app-modal-word__value {
    color: #ff634f;
    font-family: "Nunito", Arial, sans-serif;
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

.app-modal-word__transcription {
    color: #a583bb;
    font-family: "Nunito", Arial, sans-serif;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.app-modal-word__translate {
    color: #174ea6;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.2;
}

body.app-modal-open {
    overflow: hidden;
}

@keyframes app-modal-dialog-in {
    0% {
        opacity: 0;
        transform: translateY(calc(-100vh - 120px));
    }

    68% {
        opacity: 1;
        transform: translateY(14px);
    }

    84% {
        transform: translateY(-6px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes app-modal-dialog-out {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(calc(-100vh - 120px));
    }
}

@keyframes app-modal-sheet-in {
    0% {
        opacity: 0;
        transform: translateY(-105%);
    }

    70% {
        opacity: 1;
        transform: translateY(10px);
    }

    86% {
        transform: translateY(-4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes app-modal-sheet-out {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-105%);
    }
}

@keyframes app-modal-overlay-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}
