.app-download-ad {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 1200;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: min(760px, calc(100vw - 36px));
    min-height: 84px;
    padding: 12px 52px 12px 12px;
    color: #f7fff6;
    background: rgba(19, 24, 19, 0.98);
    border: 2px solid var(--minecraft-green, #44bd32);
    border-radius: 4px;
    box-shadow: 0 6px 0 rgba(18, 82, 25, 0.8), 0 20px 42px rgba(0, 0, 0, 0.42);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.app-download-ad.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-download-ad[hidden] {
    display: none;
}

.app-download-ad__icon {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 3px;
}

.app-download-ad__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.app-download-ad__eyebrow {
    color: var(--minecraft-green, #44bd32);
    font-family: "VT323", monospace;
    font-size: 0.88rem;
    line-height: 1;
    letter-spacing: 0.12em;
}

.app-download-ad__title {
    overflow: hidden;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-download-ad__text {
    overflow: hidden;
    color: #b7c2b6;
    font-size: 0.84rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-download-ad__action {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    color: #ffffff;
    background: var(--minecraft-green, #44bd32);
    border: 1px solid #6ed65d;
    border-radius: 2px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 150ms ease, transform 150ms ease;
}

.app-download-ad__action img,
.app-download-ad__close img {
    display: block;
    filter: brightness(0) invert(1);
}

.app-download-ad__action:hover {
    color: #ffffff;
    background: #35a826;
    transform: translateY(-1px);
}

.app-download-ad__action:focus-visible,
.app-download-ad__close:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.app-download-ad__close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    cursor: pointer;
}

.app-download-ad__close:hover {
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 640px) {
    .app-download-ad {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        grid-template-columns: 46px minmax(0, 1fr) auto;
        gap: 9px;
        width: calc(100vw - 16px);
        min-height: 68px;
        padding: 9px 42px 9px 9px;
    }

    .app-download-ad__icon {
        width: 46px;
        height: 46px;
    }

    .app-download-ad__eyebrow,
    .app-download-ad__text {
        display: none;
    }

    .app-download-ad__title {
        font-size: 0.88rem;
        white-space: normal;
    }

    .app-download-ad__action {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .app-download-ad__action img {
        width: 16px;
        height: 16px;
    }

    .app-download-ad__close {
        top: 5px;
        right: 5px;
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 430px) {
    .app-download-ad {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .app-download-ad__action {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-download-ad,
    .app-download-ad__action {
        transition: none;
    }
}
