/* The one ad renderer's styles (AdSlide.razor). Linked by the TV, Web and Admin hosts.
   Units: --u is 1% of the SLIDE's width, so every size scales with the slide - a phone preview and a 4K TV
   are the same picture. Container units (cqw) where the browser has them; older TV WebViews without them
   fall back to vw, which is exactly right there because the slide fills the screen. The values match the
   TV's pre-2026-10-27 display.css, so existing ads look the same as before. */

.ad365-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    container-type: inline-size;
    background: #000;
    overflow: hidden;
    border-radius: inherit;
}

.ad365-frame.ad365-fill {
    aspect-ratio: auto;
    height: 100%;
}

.ad365 {
    --u: 1vw;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ad-text, #fff);
    font-family: inherit;
    line-height: 1.2;
}

@supports (width: 1cqw) {
    .ad365 { --u: 1cqw; }
}

.ad365-empty {
    color: #777;
    font-size: calc(var(--u) * 2.4);
    text-align: center;
    padding: calc(var(--u) * 3);
}

.ad365-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

/* Info card */
.ad365-card {
    width: 80%;
    max-height: 92%;
    background: var(--ad-bg);
    border-radius: calc(var(--u) * 1.6);
    padding: calc(var(--u) * 3);
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 2);
    box-sizing: border-box;
    overflow: hidden;
}

.ad365-card-image {
    width: 100%;
    height: calc(var(--u) * 22);
    object-fit: cover;
    border-radius: calc(var(--u) * 1.1);
    display: block;
}

.ad365-card-text { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.ad365-headline {
    font-size: calc(var(--u) * 3.5);
    font-weight: 700;
    color: var(--ad-text);
    margin-bottom: calc(var(--u) * 1);
}

.ad365-description {
    font-size: calc(var(--u) * 2);
    color: var(--ad-muted);
    line-height: 1.4;
}

.ad365-business {
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 1);
    margin-top: calc(var(--u) * 1.6);
    color: var(--ad-muted);
    font-size: calc(var(--u) * 1.5);
}

.ad365-logo {
    width: calc(var(--u) * 3);
    height: calc(var(--u) * 3);
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

/* QR coupon */
.ad365-coupon {
    width: 82%;
    background: var(--ad-bg);
    border-radius: calc(var(--u) * 1.6);
    padding: calc(var(--u) * 3) calc(var(--u) * 4);
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 4);
    box-sizing: border-box;
}

.ad365-coupon-text { flex: 1; min-width: 0; }

.ad365-offer {
    font-size: calc(var(--u) * 5);
    font-weight: 800;
    color: var(--ad-accent);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.ad365-coupon-business {
    font-size: calc(var(--u) * 2.4);
    font-weight: 700;
    color: var(--ad-text);
    margin-top: calc(var(--u) * 1.2);
}

.ad365-fineprint {
    font-size: calc(var(--u) * 1.5);
    color: var(--ad-muted);
    margin-top: calc(var(--u) * 1);
}

.ad365-scan {
    font-size: calc(var(--u) * 1.8);
    color: var(--ad-accent);
    margin-top: calc(var(--u) * 2);
    font-weight: 600;
}

.ad365-coupon-qr {
    background: #fff;
    border-radius: calc(var(--u) * 1.1);
    padding: calc(var(--u) * 1.2);
    flex-shrink: 0;
}

.ad365-coupon-qr img {
    display: block;
    width: calc(var(--u) * 22);
    height: auto;
    image-rendering: pixelated;
}

.ad365-qr-placeholder {
    width: calc(var(--u) * 22);
    height: calc(var(--u) * 22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: calc(var(--u) * 3);
    font-weight: 700;
    border: calc(var(--u) * 0.3) dashed #ccc;
    box-sizing: border-box;
}

/* Corner QR (optional, image / info card / video) */
.ad365-corner-qr {
    position: absolute;
    right: calc(var(--u) * 2);
    bottom: calc(var(--u) * 2);
    background: #fff;
    border-radius: calc(var(--u) * 1);
    padding: calc(var(--u) * 0.8);
    text-align: center;
    box-shadow: 0 calc(var(--u) * 0.3) calc(var(--u) * 1.5) rgba(0, 0, 0, .45);
}

.ad365-corner-qr img {
    display: block;
    width: calc(var(--u) * 13);
    height: auto;
    image-rendering: pixelated;
}

.ad365-corner-caption {
    color: #111;
    font-size: calc(var(--u) * 1.3);
    font-weight: 700;
    margin-top: calc(var(--u) * 0.4);
    max-width: calc(var(--u) * 13);
}

/* ── Sponsor bar (phase 3): a 16:1 strip, drawn from an image or from logo + headline + theme. ── */
.ad365-bar-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 1;
    max-width: 100%;
    container-type: inline-size;
    background: #000;
    overflow: hidden;
    border-radius: inherit;
}
.ad365-bar-frame.ad365-bar-fill { aspect-ratio: auto; height: 100%; container-type: size; }
.ad365-bar {
    --bu: 1vw;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: calc(var(--bu) * 1.2);
    padding: 0 calc(var(--bu) * 2);
    background: var(--ad-bg, #111);
    color: var(--ad-text, #fff);
    font-family: inherit;
    line-height: 1.15;
}
@container (min-width: 0) {
    .ad365-bar { --bu: 1cqw; }
    /* Fill (the court TV) is wider than 16:1 - 7.5 % of a 16:9 screen is ~24:1 - so the units follow whichever side runs
       out first (1cqw = 16cqh at exactly 16:1). By width alone the business line fell off the bottom (2026-10-30). */
    .ad365-bar-fill .ad365-bar { --bu: min(1cqw, 16cqh); }
}
.ad365-bar-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ad365-bar-empty { color: #777; font-size: calc(var(--bu) * 2.2); width: 100%; text-align: center; }
.ad365-bar-prefix {
    font-size: calc(var(--bu) * 1.6);
    letter-spacing: calc(var(--bu) * 0.3);
    font-weight: 800;
    color: var(--ad-accent, #fbbf24);
    white-space: nowrap;
}
.ad365-bar-logo { height: 72%; max-width: 18%; object-fit: contain; flex-shrink: 0; }
.ad365-bar-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.ad365-bar-headline {
    font-size: calc(var(--bu) * 2.6);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad365-bar-business { font-size: calc(var(--bu) * 1.5); color: var(--ad-muted, #cbd5e1); white-space: nowrap; }

/* Business strip over full-bleed image / video (previews only) */
.ad365-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .7);
    color: #ddd;
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 1);
    padding: calc(var(--u) * 0.8) calc(var(--u) * 1.6);
    font-size: calc(var(--u) * 1.6);
}
