/* Jungle toast — Noty alerts. Frame is 9-slice; text has no extra box.
   Stack grows downward from the top of the screen (below the village HUD). */

.me-toast-host {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(420px, calc(100vw - 24px));
    pointer-events: none;
}

body.me-village-page .me-toast-host {
    top: calc(120px + 8px);
}

.me-toast {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 0;
    overflow: hidden;
    pointer-events: auto;
    cursor: pointer;
    opacity: 1;
    transform: translateY(0);
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .72));
    transition: opacity .28s ease, transform .28s ease, max-height .28s ease, margin .28s ease;
}

.me-toast.is-in {
    opacity: 0;
    transform: translateY(8px);
}

.me-toast:last-child {
    margin-bottom: 0;
}

.me-toast.is-out {
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    transform: translateY(-8px);
}

.me-toast-plaque {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    min-height: 0;
    box-sizing: border-box;
    border-style: solid;
    border-color: transparent;
    border-width: 32px;
    border-radius: 0;
    /* Leather fill so text never floats if 9-slice `fill` is skipped (WebView). */
    background-color: #1c140c;
    background-clip: padding-box;
    -webkit-border-image: url('../img/ui/toast-frame.png') 80 fill / 32px / 0 stretch;
    border-image: url('../img/ui/toast-frame.png') 80 fill / 32px / 0 stretch;
}

.me-toast .alert {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 4px 16px 2px !important;
    line-height: 1 !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-image: none !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: 0 !important;
    color: #f3e6c8 !important;
    font-family: 'TrajanPro-Regular', Georgia, serif !important;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .1em;
    text-align: center;
    text-indent: .1em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
}

.me-toast .alert b,
.me-toast .alert strong {
    color: inherit !important;
    font-weight: 400;
    text-transform: uppercase;
    font-size: inherit;
}

.me-toast .alert b.me-toast-amt,
.me-toast .alert .me-toast-amt {
    font-weight: 700;
    letter-spacing: .12em;
}

.me-toast-amt--gold { color: #f0c43a !important; }
.me-toast-amt--banana { color: #f5d031 !important; }
.me-toast-amt--ore { color: #e8d7b4 !important; }
.me-toast-amt--gem { color: #7eecff !important; }

.me-toast .alert a,
.me-toast .alert .alert-link {
    color: #e4c36a !important;
    text-decoration: underline;
}

.me-toast .alert-danger { color: #f2d2a4 !important; }
.me-toast .alert-warning { color: #f0d48a !important; }
.me-toast .alert-success { color: #dce8b8 !important; }
.me-toast .alert-info,
.me-toast .alert-primary { color: #e4c36a !important; }

@media (max-width: 767px) {
    .me-toast-host {
        width: calc(100vw - 20px);
    }
    body.me-village-page .me-toast-host {
        top: calc((100vw * 230 / 1531) + 8px);
    }
    .me-toast-plaque {
        min-width: 0;
        border-width: 28px;
        -webkit-border-image: url('../img/ui/toast-frame.png') 80 fill / 28px / 0 stretch;
        border-image: url('../img/ui/toast-frame.png') 80 fill / 28px / 0 stretch;
    }
    .me-toast .alert {
        padding: 4px 10px 2px !important;
        font-size: 12px;
        letter-spacing: .08em;
        text-indent: .08em;
    }
}

.me-ask {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 10, 4, .42);
}

.me-ask[hidden] { display: none !important; }

.me-ask__box {
    width: min(420px, calc(100% - 8px));
    max-width: 100%;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, .7));
}

.me-ask__box.me-frame { --me-frame: 36px; }

.me-ask__plaque {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    padding: 22px 18px 16px;
    text-align: center;
    border-style: solid;
    border-color: transparent;
    border-width: 32px;
    background-color: #1c140c;
    background-clip: padding-box;
    -webkit-border-image: url('../img/ui/toast-frame.png') 80 fill / 32px / 0 stretch;
    border-image: url('../img/ui/toast-frame.png') 80 fill / 32px / 0 stretch;
}

.me-ask__box.me-frame .me-ask__plaque {
    border: 0;
    border-image: none;
    background: transparent;
    padding: 6px 4px 2px;
}

.me-ask__title {
    margin: 0;
    color: #ffe7a0;
    font-family: TrajanPro-Regular, Trajan, Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.me-ask__copy {
    margin: 0;
    color: #d8c48a;
    font-size: 14px;
    line-height: 1.45;
}

.me-ask__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.me-ask .me-enter,
.me-ask__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 132px;
    height: 36px;
    padding: 0 18px;
    border: 0;
    background: transparent url('../img/charselect/enter-button.png') center / 100% 100% no-repeat;
    color: #f0d48a;
    font-family: TrajanPro-Regular, Trajan, Georgia, serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .85);
    cursor: pointer;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
}

.me-ask .me-enter:hover,
.me-ask .me-enter:focus,
.me-ask__btn:hover,
.me-ask__btn:focus {
    color: #fff6d8;
    filter: brightness(1.1) drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
}

/* Building locks use the existing game dialog and artwork, not transient toasts. */
.me-ask.has-building-requirements .me-ask__box{width:min(560px,100%);max-height:calc(100dvh - 24px);overflow:auto}
.me-ask.has-building-requirements .me-ask__copy{width:100%;font-size:15px;color:#f2e4c3}
.me-lock-requirements{display:grid;gap:10px;margin-top:16px;text-align:left}
.me-lock-requirement{display:flex;align-items:center;gap:12px;padding:10px;background:#17170feF;border:1px solid #967141;border-radius:8px}
.me-lock-requirement>img{flex:0 0 64px;width:64px;height:64px;object-fit:contain}
.me-lock-requirement>span{min-width:0;display:grid;gap:4px;overflow-wrap:anywhere}
.me-lock-requirement strong{color:#ffe7a0;font-size:16px;line-height:1.3}
.me-lock-requirement b{font-size:13px;color:#ffc391}
.me-lock-requirement.is-met{border-color:#647d42}
.me-lock-requirement.is-met b{color:#c0e89a}
.me-ask.has-building-requirements [hidden]{display:none!important}
@media(max-width:480px){.me-ask.has-building-requirements{padding:10px}.me-ask.has-building-requirements .me-ask__box.me-frame{--me-frame:20px}.me-lock-requirement{padding:8px;gap:8px}.me-lock-requirement>img{width:48px;height:56px;flex-basis:48px}.me-ask.has-building-requirements .me-ask__title{font-size:17px}}

/* Hidden informational-dialog actions must override themed button display. */
.me-ask .me-ask__actions > button[hidden]{display:none!important}
