/* ============================================================
   YORI-TAP YORI-ADS — TOAST POPUP STYLES
   Version: 2.3 — Smaller mobile card
   ------------------------------------------------------------
   Desktop/tablet: bottom-right toast, 220px wide.
   Mobile: bottom-right compact card (~50% viewport width).
   ============================================================ */

.yta-root {
    /* ----- theme tokens ----- */
    --yta-bg:            #0f1620;
    --yta-bg-2:          #0a1017;
    --yta-border:        rgba(255, 255, 255, 0.10);
    --yta-text:          #eef5fa;
    --yta-text-muted:    rgba(232, 240, 245, 0.62);
    --yta-accent:        #14b8a6;
    --yta-accent-2:      #5eead4;
    --yta-close-bg:      rgba(0, 0, 0, 0.55);
    --yta-close-hover:   rgba(0, 0, 0, 0.82);
    --yta-shadow:
        0 18px 45px -14px rgba(0, 0, 0, 0.7),
        0 6px 18px -8px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    --yta-radius:        14px;
    --yta-radius-sm:     9px;
    --yta-enter-ease:    cubic-bezier(0.34, 1.4, 0.5, 1);

    position: fixed;
    z-index: 99990;
    bottom: 18px;
    right: 18px;
    width: 220px;
    max-width: calc(100vw - 36px);

    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.45;
    color: var(--yta-text);
    color-scheme: dark;

    opacity: 0;
    transform: translateX(calc(100% + 30px));
    transition:
        opacity   0.4s ease,
        transform 0.5s var(--yta-enter-ease);
    pointer-events: none;
    will-change: transform, opacity;
}

.yta-root.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.yta-backdrop {
    display: none !important;
}

/* ============================================================
   THE TOAST
   ============================================================ */
.yta-modal {
    position: relative;
    width: 100%;
    background: var(--yta-bg);
    border: 1px solid var(--yta-border);
    border-radius: var(--yta-radius);
    box-shadow: var(--yta-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

/* ============================================================
   CLOSE BUTTON
   ============================================================ */
.yta-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: var(--yta-close-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: background 0.2s ease, transform 0.25s ease, border-color 0.2s ease;
}

.yta-close:hover {
    background: var(--yta-close-hover);
    border-color: rgba(255, 255, 255, 0.32);
    transform: rotate(90deg) scale(1.05);
}

.yta-close:focus-visible {
    outline: 2px solid var(--yta-accent);
    outline-offset: 2px;
}

.yta-close svg {
    width: 11px;
    height: 11px;
    display: block;
}

/* ============================================================
   BANNER
   ============================================================ */
.yta-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #060a0f;
    overflow: hidden;
    flex-shrink: 0;
}

.yta-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.yta-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.yta-banner-link:hover .yta-banner img {
    transform: scale(1.03);
}

/* ============================================================
   TEXT BODY
   ============================================================ */
.yta-body {
    padding: 10px 12px 2px;
}

.yta-title {
    margin: 0 0 3px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--yta-text);
    font-family: 'Inter', system-ui, sans-serif;
    padding-right: 24px;
}

.yta-desc {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.5;
    color: var(--yta-text-muted);
    font-weight: 400;
}

/* ============================================================
   ACTION
   ============================================================ */
.yta-actions {
    padding: 8px 12px 12px;
}

.yta-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: var(--yta-radius-sm);
    background: linear-gradient(120deg, var(--yta-accent), var(--yta-accent-2));
    color: #02110d;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 16px -8px rgba(20, 184, 166, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-family: inherit;
    border: 0;
    cursor: pointer;
}

.yta-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgba(20, 184, 166, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    filter: brightness(1.05);
}

.yta-cta svg {
    width: 11px;
    height: 11px;
}

.yta-cta:focus-visible {
    outline: 2px solid var(--yta-accent);
    outline-offset: 3px;
}

/* ============================================================
   SHAPE VARIANTS
   ============================================================ */
.yta-root.yta-banner-cta .yta-actions {
    padding: 8px 12px 12px;
}

.yta-root.yta-image-only {
    width: 260px;
}

.yta-root.yta-image-only .yta-banner {
    aspect-ratio: auto;
}

.yta-root.yta-image-only .yta-banner img {
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    background: #060a0f;
}

/* ============================================================
   LIGHT MODE
   ============================================================ */
html[data-theme="light"] .yta-root,
.yta-root.yta-light {
    --yta-bg:          #ffffff;
    --yta-bg-2:        #f6f9f8;
    --yta-border:      rgba(0, 0, 0, 0.07);
    --yta-text:        #0b1a15;
    --yta-text-muted:  rgba(11, 26, 21, 0.62);
    --yta-close-bg:    rgba(255, 255, 255, 0.75);
    --yta-close-hover: rgba(0, 0, 0, 0.09);
    --yta-shadow:
        0 16px 40px -14px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    color-scheme: light;
}

html[data-theme="light"] .yta-root .yta-close,
.yta-root.yta-light .yta-close {
    color: #0b1a15;
    border-color: rgba(0, 0, 0, 0.10);
}

@media (prefers-color-scheme: light) {
    html:not([data-theme="dark"]) .yta-root {
        --yta-bg:          #ffffff;
        --yta-bg-2:        #f6f9f8;
        --yta-border:      rgba(0, 0, 0, 0.07);
        --yta-text:        #0b1a15;
        --yta-text-muted:  rgba(11, 26, 21, 0.62);
        --yta-close-bg:    rgba(255, 255, 255, 0.75);
        --yta-close-hover: rgba(0, 0, 0, 0.09);
        --yta-shadow:
            0 16px 40px -14px rgba(0, 0, 0, 0.22),
            0 0 0 1px rgba(0, 0, 0, 0.04);
        color-scheme: light;
    }
    html:not([data-theme="dark"]) .yta-root .yta-close {
        color: #0b1a15;
        border-color: rgba(0, 0, 0, 0.10);
    }
}

/* ============================================================
   MOBILE — extra-compact bottom-right card
   ------------------------------------------------------------
   ~26% narrower than the previous mobile build (68vw → 50vw),
   with proportional internal scaling so the card still reads
   cleanly at ~190px on a 375px-wide phone.
   ============================================================ */
@media (max-width: 640px) {
    .yta-root {
        left: auto;
        right: 10px;
        bottom: 10px;
        width: 50vw;
        max-width: 200px;
        min-width: 155px;
        transform: translateY(calc(100% + 30px));
    }

    .yta-root.is-open {
        transform: translateY(0);
    }

    .yta-root.yta-image-only {
        width: 54vw;
        max-width: 215px;
        min-width: 155px;
    }

    /* Tighter banner so vertical footprint shrinks too */
    .yta-banner {
        aspect-ratio: 16 / 10;
    }

    .yta-body {
        padding: 6px 8px 1px;
    }

    .yta-title {
        font-size: 0.65rem;
        margin-bottom: 1px;
        padding-right: 18px;
        line-height: 1.25;
    }

    .yta-desc {
        font-size: 0.55rem;
        line-height: 1.4;
    }

    .yta-actions {
        padding: 5px 8px 8px;
    }

    .yta-cta {
        min-height: 26px;
        padding: 5px 6px;
        font-size: 0.55rem;
        gap: 3px;
        border-radius: 7px;
    }

    .yta-cta svg {
        width: 9px;
        height: 9px;
    }

    .yta-close {
        top: 4px;
        right: 4px;
        width: 18px;
        height: 18px;
    }

    .yta-close svg {
        width: 8px;
        height: 8px;
    }

    .yta-root.yta-image-only .yta-banner {
        aspect-ratio: auto;
    }

    .yta-root.yta-image-only .yta-banner img {
        max-height: 32vh;
    }
}

/* ============================================================
   VERY NARROW PHONES (iPhone SE etc.)
   ============================================================ */
@media (max-width: 380px) {
    .yta-root {
        width: 54vw;
        right: 8px;
        bottom: 8px;
    }

    .yta-root.yta-image-only {
        width: 58vw;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .yta-root,
    .yta-root *,
    .yta-root *::before,
    .yta-root *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .yta-root { transform: none; opacity: 1; }
    .yta-root.is-open { transform: none; }
    .yta-close:hover { transform: none; }
    .yta-cta:hover { transform: none; }
}