/* The small popup at the bottom of the screen that shows a window's message (toast.js). It
   stays until it is swiped down or the window closes. */

.arcade-toast {
    position: fixed;
    inset: auto auto calc(env(safe-area-inset-bottom, 0px) + 18px) 50%;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    width: max-content;
    max-width: min(320px, calc(100vw - 48px));
    margin: 0;
    padding: 11px 14px 9px 9px;
    overflow: visible;
    color: #fff;
    background: linear-gradient(90deg, #2a1d4d, #1b1530 70%);
    border: 2px solid #c4a0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px #000a;
    font:
        600 0.82rem/1.3 Arial,
        sans-serif;
    text-align: left;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transform: translateX(-50%);
    animation: arcade-toast-arrive 0.25s ease-out;
}

.arcade-toast[hidden] {
    display: none;
}

/* A small handle on top, a hint that it can be swiped down. */
.arcade-toast::before {
    position: absolute;
    top: 4px;
    left: 50%;
    width: 26px;
    height: 3px;
    background: #ffffff4d;
    border-radius: 2px;
    transform: translateX(-50%);
    content: '';
}

.arcade-toast.is-dragging {
    cursor: grabbing;
}

.arcade-toast.is-leaving {
    translate: 0 60px;
    opacity: 0;
    transition:
        translate 0.2s ease-in,
        opacity 0.2s ease-in;
}

.arcade-toast-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 24px;
    height: 24px;
    color: #052e16;
    background: #86efac;
    border-radius: 50%;
    font:
        800 0.85rem Arial,
        sans-serif;
}

.arcade-toast.is-coins .arcade-toast-icon {
    background: url('../images/coin.svg?v=20261001') center / contain no-repeat;
    image-rendering: pixelated;
}

.arcade-toast.is-problem {
    background: linear-gradient(90deg, #4a1d2a, #1b1530 70%);
    border-color: #fca5a5;
}

.arcade-toast.is-problem .arcade-toast-icon {
    color: #450a0a;
    background: #fca5a5;
}

.arcade-toast.is-info .arcade-toast-icon,
.arcade-toast.is-wait .arcade-toast-icon {
    color: #1b1530;
    background: #c4a0e0;
    font-family: Georgia, serif;
}

/* The status line the popup copies stays for screen readers, out of sight. */
.arcade-toast-source {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@keyframes arcade-toast-arrive {
    from {
        opacity: 0;
        translate: 0 16px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .arcade-toast {
        animation: none;
    }

    .arcade-toast.is-leaving {
        translate: 0 0;
        transition: opacity 0.2s ease-in;
    }
}
