/* Realest AR Cards — front end */

/* centered wrapper — the button sits centered wherever the shortcode goes */
.rlst-ar-wrap {
    display: flex;
    justify-content: center;
}

/* quiet, editorial button — no gradients, no glow */
.rlst-ar-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 30px;
    border: 1px solid #111;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.rlst-ar-launch:hover  { background: #000; }
.rlst-ar-launch:active { background: #2a2a2a; }
.rlst-ar-launch.rlst-ar-loading { opacity: .55; pointer-events: none; }
.rlst-ar-launch svg { width: 16px; height: 16px; }

/* ---- fullscreen overlay ------------------------------------------------- */
.rlst-ar-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #000;
    /* the overlay (never transformed) does the clipping */
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
body.rlst-ar-lock { overflow: hidden; }

.rlst-ar-stage,
.rlst-ar-stage a-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* IMPORTANT: the stage must NOT clip — overflow clips in local coords
   BEFORE the cover-fit transform, which would drag clipped-off edges into
   view as black bars. The overlay above clips at the viewport instead. */
.rlst-ar-stage { overflow: visible; }
/* The browser does the cover-fit natively: a full-bleed video with
   object-fit:cover produces the exact center-crop MindAR's own layout math
   aims for — but it can never go stale, so no bars on any device. The
   !important flags beat MindAR's inline positioning. */
.rlst-ar-stage video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    background: #000;
}

/* top bar: title left, close right, readable over any camera image */
.rlst-ar-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: calc(10px + env(safe-area-inset-top)) 16px 26px;
    background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
    pointer-events: none;
}
.rlst-ar-close {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.rlst-ar-close:active { background: rgba(255,255,255,.3); }

/* centered state block: spinner / scan frame / message */
.rlst-ar-center {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    pointer-events: none;
    text-align: center;
}
/* the !importants shield the bubble from theme styles — Divi and friends
   add margins/padding/line-height to <p>, which pushed the text off-center */
.rlst-ar-msg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    text-align: center;
    max-width: 78%;
    padding: 13px 22px !important;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 15px !important;
    font-weight: 600;
    line-height: 1.3 !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: opacity .35s ease;
}

.rlst-ar-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    animation: rlst-ar-spin .9s linear infinite;
}
@keyframes rlst-ar-spin { to { transform: rotate(360deg); } }

/* pulsing card-shaped corner frame shown while scanning */
.rlst-ar-frame {
    position: relative;
    width: min(64vw, 300px);
    aspect-ratio: 63 / 88;              /* trading-card proportions */
    animation: rlst-ar-pulse 1.8s ease-in-out infinite;
}
.rlst-ar-frame i {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255,255,255,.9);
    border-radius: 6px;
}
.rlst-ar-frame i:nth-child(1) { top: 0;    left: 0;    border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.rlst-ar-frame i:nth-child(2) { top: 0;    right: 0;   border-left: 0;  border-bottom: 0; border-radius: 0 10px 0 0; }
.rlst-ar-frame i:nth-child(3) { bottom: 0; left: 0;    border-right: 0; border-top: 0;    border-radius: 0 0 0 10px; }
.rlst-ar-frame i:nth-child(4) { bottom: 0; right: 0;   border-left: 0;  border-top: 0;    border-radius: 0 0 10px 0; }
@keyframes rlst-ar-pulse {
    0%, 100% { transform: scale(1);    opacity: .95; }
    50%      { transform: scale(1.05); opacity: .55; }
}

/* state switching: which pieces are visible when */
.rlst-ar-center[data-state="loading"]  .rlst-ar-frame   { display: none; }
.rlst-ar-center[data-state="scanning"] .rlst-ar-spinner { display: none; }
.rlst-ar-center[data-state="error"]    .rlst-ar-spinner,
.rlst-ar-center[data-state="error"]    .rlst-ar-frame   { display: none; }
.rlst-ar-center[data-state="found"] { opacity: 0; transition: opacity .4s ease; }
