/* Globalny system modali i toastow dla gry oraz panelu admina */

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 4, 10, 0.74);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 12000;
}

.modal-overlay.modal-visible {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    width: min(92vw, 500px);
    padding: 28px 28px 24px;
    border-radius: 18px;
    border: 1px solid rgba(200, 168, 75, 0.38);
    background: linear-gradient(180deg, rgba(24, 24, 38, 0.98), rgba(18, 18, 30, 0.98));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(10px) scale(0.985);
    transition: transform 0.18s ease;
    color: #f2f0ec;
}

.modal-overlay.modal-visible .modal-box {
    transform: translateY(0) scale(1);
}

.modal-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 14px;
    border: 1px solid rgba(200, 168, 75, 0.32);
    background: rgba(255, 255, 255, 0.03);
    color: #e0c15f;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-title {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
    color: #f2f0ec;
}

.modal-body {
    margin: 0 0 22px;
    color: #a9a4ba;
    font-size: 14px;
    line-height: 1.65;
}

.modal-input-label {
    display: block;
    margin-bottom: 8px;
    color: #a9a4ba;
    font-size: 13px;
    font-weight: 600;
}

.modal-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(200, 168, 75, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: #f2f0ec;
    font: inherit;
    box-sizing: border-box;
    outline: none;
}

.modal-input:focus {
    border-color: rgba(200, 168, 75, 0.45);
    box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    min-width: 132px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

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

.modal-btn--cancel {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    color: #b8b4c8;
}

.modal-btn--confirm,
.modal-btn--ok {
    border-color: rgba(79, 201, 122, 0.48);
    background: transparent;
    color: #4ec97a;
}

.modal-btn--danger {
    border-color: rgba(224, 85, 85, 0.48);
    background: transparent;
    color: #e05555;
}

.modal-box--warning .modal-icon,
.modal-box--warning .modal-title {
    color: #e0c15f;
}

.modal-box--danger .modal-icon,
.modal-box--danger .modal-title {
    color: #e57373;
}

.modal-box--info .modal-icon,
.modal-box--info .modal-title {
    color: #82b6ff;
}

.app-toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    width: min(420px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 13000;
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: 42px 1fr 24px;
    align-items: start;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    border-radius: 14px;
    border: 1px solid rgba(200, 168, 75, 0.18);
    background: rgba(20, 20, 32, 0.96);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    color: #f2f0ec;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
    cursor: pointer;
}

.app-toast--show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast--hide {
    opacity: 0;
    transform: translateY(-8px);
}

.app-toast__icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(200, 168, 75, 0.2);
    background: rgba(255, 255, 255, 0.03);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.app-toast__content {
    min-width: 0;
}

.app-toast__title {
    margin-bottom: 2px;
    color: #f2f0ec;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-toast__message {
    color: #b7b2c4;
    font-size: 13px;
    line-height: 1.5;
}

.app-toast__close {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #8d889f;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.app-toast--success {
    border-color: rgba(78, 201, 122, 0.26);
}

.app-toast--success .app-toast__icon,
.app-toast--success .app-toast__title {
    color: #4ec97a;
}

.app-toast--error {
    border-color: rgba(224, 85, 85, 0.26);
}

.app-toast--error .app-toast__icon,
.app-toast--error .app-toast__title {
    color: #e05555;
}

.app-toast--warning {
    border-color: rgba(224, 193, 95, 0.26);
}

.app-toast--warning .app-toast__icon,
.app-toast--warning .app-toast__title {
    color: #e0c15f;
}

.app-toast--info {
    border-color: rgba(130, 182, 255, 0.24);
}

.app-toast--info .app-toast__icon,
.app-toast--info .app-toast__title {
    color: #82b6ff;
}

@media (max-width: 640px) {
    .modal-box {
        width: calc(100vw - 24px);
        padding: 22px 18px 18px;
        border-radius: 16px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }

    .app-toast-stack {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
    }
}
