/*
 * TRSS Blackjack Game — presentation layer.
 *
 * Portrait-first (9:16) premium casino-tech skin on the TRSS palette: the
 * supplied #001132 point-gradient background inside a hairline frame, #D64000
 * accent, branded TRSS card artwork, the TRSS logo, a slowly rotating circular
 * waypointer table ring and a hairline footer row.
 * Motion is limited to slide + scale transitions. Everything here is scoped
 * to .trss-bjg, so the plugin cannot restyle anything else on the page.
 *
 * Accent contrast (measured): #D64000 is used for
 * fills, CTAs and decoration (white ink on #D64000 = 4.57:1). Small accent
 * TEXT on navy uses the brand's dark-mode variant #E85520 (5.1:1), because
 * #D64000 text on navy falls below 4.5:1.
 *
 * Heading colours are asserted at 3-class specificity because the TRSS child
 * theme forces `[class*="trss-"] h1..h4 { color:#fff }` at (0,2,1).
 */

.trss-bjg {
    --bjg-navy-900: #04091a;
    --bjg-navy-800: #0a1733;
    --bjg-navy-700: #102244;
    --bjg-navy-600: #17305c;

    /* navy family; the landing/game surface is the supplied background art */
    --bjg-blue-hi: #0b2452;
    --bjg-blue: #001132;
    --bjg-blue-lo: #000816;
    --bjg-bg: var(--bjg-blue) url(../img/table-background.svg) center / cover no-repeat;
    /* Structural hairlines (app frame, top-bar divider, footer divider). */
    --bjg-hairline: rgba(255, 255, 255, 0.3);

    /* accent (replaces the former gold) */
    --bjg-accent: #d64000;
    --bjg-accent-deep: #b83700;     /* CTA gradient base, keeps white ink AA */
    --bjg-accent-text: #e85520;     /* accent text/lines on navy */
    --bjg-accent-glow: #ff9b6e;     /* highlight stop for gradient text */

    --bjg-ink: #f4f7ff;
    --bjg-muted: rgba(244, 247, 255, 0.64);
    --bjg-line: rgba(214, 64, 0, 0.36);
    --bjg-red: #ff7a68;
    --bjg-radius: 18px;
    --bjg-ease: cubic-bezier(0.22, 0.75, 0.3, 1);
    --bjg-card-ratio: 5 / 7;

    /* ---- motion durations (calm, approved pacing) ---- */
    --bjg-t-btn: 320ms;    /* button press / hover      (was 160) */
    --bjg-t-card: 760ms;   /* card slide-in             (was 420) */
    --bjg-t-flip: 420ms;   /* half a hole-card flip     (was 220) */
    --bjg-t-panel: 840ms;  /* result overlay panel      (was 420) */
    --bjg-t-rise: 920ms;   /* landing entrance          (was 460) */
    --bjg-t-zoom: 560ms;   /* card zoom scale           (was 280) */
    --bjg-t-fade: 480ms;   /* overlay fades             (was 240) */
    --bjg-t-ring: 25.092s; /* one waypointer turn — the designer's render: 180° per 12.546 s loop */

    position: relative;
    display: block;
    box-sizing: border-box;
    color: var(--bjg-ink);
    font-family: var(--trss-font, "Clario", system-ui, -apple-system, "Segoe UI", sans-serif);
    font-size: 16px;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

.trss-bjg *,
.trss-bjg *::before,
.trss-bjg *::after { box-sizing: inherit; }

/* Panels below set `display`, which would otherwise beat the UA's [hidden]
   rule and leave an invisible full-screen overlay swallowing taps. */
.trss-bjg [hidden] { display: none !important; }

.trss-bjg p { margin: 0 0 10px; }
.trss-bjg .trss-bjg__boot { padding: 40px 16px; text-align: center; color: var(--bjg-muted); }

.trss-bjg .bjg-sr {
    position: absolute !important;
    width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================================================ buttons */
/* No drop shadows: hierarchy comes from fill, shape, border and type. */
.trss-bjg .bjg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 14px 26px;
    border: 1px solid var(--bjg-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    color: var(--bjg-ink);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform var(--bjg-t-btn) var(--bjg-ease), background-color var(--bjg-t-btn) var(--bjg-ease), opacity var(--bjg-t-btn);
}
.trss-bjg .bjg-btn:active { transform: scale(0.97); }
.trss-bjg .bjg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.trss-bjg .bjg-btn--accent {
    border-color: transparent;
    background: linear-gradient(180deg, var(--bjg-accent) 0%, var(--bjg-accent-deep) 100%);
    color: #fff;
}
.trss-bjg .bjg-btn--ghost { background: rgba(255, 255, 255, 0.04); }
.trss-bjg .bjg-btn--wide { width: 100%; }
/* The Elementor kit paints `button:hover`; restate our own hover so the game's
   buttons keep their palette (sticky hover is real on touch devices). */
.trss-bjg .bjg-btn:hover,
.trss-bjg .bjg-btn:focus { background: rgba(255, 255, 255, 0.1); color: var(--bjg-ink); box-shadow: none; }
.trss-bjg .bjg-btn--accent:hover,
.trss-bjg .bjg-btn--accent:focus {
    background: linear-gradient(180deg, #e24a0b 0%, #c43b00 100%);
    color: #fff;
}
.trss-bjg .bjg-exit:hover,
.trss-bjg .bjg-exit:focus,
.trss-bjg .bjg-sound:hover,
.trss-bjg .bjg-sound:focus { background: transparent; color: var(--bjg-ink); box-shadow: none; opacity: 0.78; }
.trss-bjg .bjg-btn:focus-visible,
.trss-bjg .bjg-card:focus-visible,
.trss-bjg .bjg-sound:focus-visible,
.trss-bjg .bjg-exit:focus-visible,
.trss-bjg input:focus-visible,
.trss-bjg select:focus-visible { outline: 3px solid var(--bjg-accent-text); outline-offset: 3px; }

/* ============================================================ status chip */
.trss-bjg .bjg-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid rgba(244, 247, 255, 0.18);
    border-radius: 999px;
    background: rgba(4, 9, 26, 0.6);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--bjg-muted);
    white-space: nowrap;
}
.trss-bjg .bjg-chip::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.trss-bjg .bjg-chip.is-live { color: var(--bjg-accent-text); border-color: rgba(214, 64, 0, 0.6); }

/* ============================================================ landing */
.trss-bjg .bjg-landing {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: min(86vh, 760px);
    padding: 30px 22px 0;
    border: 1px solid var(--bjg-hairline);
    border-radius: var(--bjg-radius);
    background: var(--bjg-bg);
    text-align: center;
}
/* Spare height goes above the fan, so the cards always sit on the footer line. */
.trss-bjg .bjg-landing__inner { position: relative; z-index: 2; margin-bottom: auto; }

.trss-bjg .bjg-logo {
    width: clamp(120px, 36vw, 168px);
    aspect-ratio: 751.69 / 413.73;
    margin: 0 auto 22px;
    background: url(../img/trss-logo.svg) center / contain no-repeat;
}

.trss-bjg.trss-bjg .bjg-landing__title {
    margin: 20px 0 12px;
    font-size: clamp(28px, 7.8vw, 42px);
    line-height: 1.14;
    font-weight: 700;   /* Clario ships 700 and 900; the former 800 rendered as 900 */
    letter-spacing: -0.015em;
    color: var(--bjg-ink);
    text-wrap: balance;
}
/*
 * The accent line is painted with `background-clip: text`, so the gradient only
 * covers the element's own box. Room is reserved below the baseline so the
 * descenders of "Higher Intelligence" are never clipped, and a negative margin
 * keeps the headline size and rhythm.
 */
.trss-bjg .bjg-landing__title em {
    display: block;
    font-style: normal;
    padding-bottom: 0.18em;
    margin-bottom: -0.12em;
    background: linear-gradient(100deg, var(--bjg-accent-text) 6%, var(--bjg-accent-glow) 46%, var(--bjg-accent) 94%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.trss-bjg .bjg-landing__sub {
    font-size: clamp(16px, 4.4vw, 19px);
    font-weight: 600;
    color: var(--bjg-ink);
}
.trss-bjg .bjg-landing__note {
    max-width: 30em;
    margin: 0 auto 22px;
    font-size: 14px;
    color: var(--bjg-muted);
}
.trss-bjg .bjg-landing .bjg-btn--accent { min-width: 230px; font-size: 16px; }
.trss-bjg .bjg-landing__foot {
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--bjg-muted);
}
.trss-bjg .bjg-landing__foot a { color: var(--bjg-accent-text); }

/*
 * Branded card fan: about twice the original size, in normal flow under the
 * content (never behind the CTA). No fade: the cards are fully opaque and sit
 * on the footer line, cut only along that bottom edge. Width, spread and tilt
 * keep every card's sides inside the frame at every width (asserted by E2E).
 */
.trss-bjg .bjg-fan {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    max-width: 440px;
    height: clamp(170px, 50vw, 250px);
    margin: 18px auto 0;
    pointer-events: none;
    clip-path: inset(-40% -40% 0 -40%);   /* clip the bottom edge only */
}
.trss-bjg .bjg-fan img {
    position: absolute;
    left: 50%;
    top: 0;
    width: 43%;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    transform-origin: 50% 100%;
}
.trss-bjg .bjg-fan img:nth-child(1) { transform: translateX(-50%) translateX(-30%) translateY(12%) rotate(-11deg); }
.trss-bjg .bjg-fan img:nth-child(2) { transform: translateX(-50%) translateX(-12%) translateY(3%) rotate(-4deg); }
.trss-bjg .bjg-fan img:nth-child(3) { transform: translateX(-50%) translateX(12%) translateY(3%) rotate(4deg); }
.trss-bjg .bjg-fan img:nth-child(4) { transform: translateX(-50%) translateX(30%) translateY(12%) rotate(11deg); }

/* ---- footer row (landing + game): hairline on top, no fill ---- */
.trss-bjg .bjg-footer {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 14px;
    padding: 10px 16px;
    border-top: 1px solid var(--bjg-hairline);
    background: none;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.03em;
    text-align: left;
    color: rgba(244, 247, 255, 0.6);
}
.trss-bjg .bjg-landing > .bjg-footer {
    margin: 0 -22px;             /* full width inside the landing padding */
    padding-left: 22px;
    padding-right: 22px;
}
.trss-bjg.trss-bjg .bjg-footer__site,
.trss-bjg.trss-bjg .bjg-footer__site:visited {
    color: rgba(244, 247, 255, 0.72);
    text-decoration: none;
}
.trss-bjg.trss-bjg a.bjg-footer__site:hover,
.trss-bjg.trss-bjg a.bjg-footer__site:focus { color: var(--bjg-ink); text-decoration: underline; }
.trss-bjg a.bjg-footer__site:focus-visible { outline: 2px solid var(--bjg-accent-text); outline-offset: 2px; }
@media (max-width: 299px) {
    .trss-bjg .bjg-footer { justify-content: center; text-align: center; }
}

/* entrance motion (slide + scale only) */
.trss-bjg .bjg-rise {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    transition: opacity var(--bjg-t-rise) var(--bjg-ease), transform var(--bjg-t-rise) var(--bjg-ease);
}
.trss-bjg .bjg-rise.is-in { opacity: 1; transform: none; }

/* ============================================================ game shell */
.trss-bjg .bjg-game {
    position: relative;
    display: flex;
    flex-direction: column;
    height: min(86vh, 760px);
    border-radius: var(--bjg-radius);
    overflow: hidden;
    border: 1px solid var(--bjg-hairline);
    background: var(--bjg-bg);
}

/* full-screen / immersive mode */
.trss-bjg.is-playing .bjg-game {
    position: fixed;
    inset: 0;
    z-index: 999999;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
.trss-bjg.is-playing .bjg-landing { visibility: hidden; }

.trss-bjg .bjg-top {
    position: relative;
    z-index: 7;              /* EXIT + SOUND stay reachable above the overlay */
    /* Equal side columns keep the status chip on the frame's centre line,
       whatever the widths of EXIT and SOUND. */
    display: grid;
    grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr);
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--bjg-hairline);
}
.trss-bjg .bjg-top > .bjg-exit { justify-self: start; }
.trss-bjg .bjg-top > .bjg-chip {
    justify-self: center;
    display: block;          /* allows an ellipsis if a label is ever too long */
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trss-bjg .bjg-top > .bjg-chip::before {
    display: inline-block;
    margin: 0 7px 1px 0;
    vertical-align: middle;
}
.trss-bjg .bjg-top > .bjg-sound { justify-self: end; }
.trss-bjg .bjg-top__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bjg-muted);
    white-space: nowrap;
    display: none;           /* the centred chip carries the status; no room for a title */
}
.trss-bjg .bjg-exit,
.trss-bjg .bjg-sound {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;        /* touch target stays 44px without the capsule */
    padding: 8px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--bjg-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity var(--bjg-t-btn) var(--bjg-ease);
}
.trss-bjg .bjg-sound { font-size: 18px; letter-spacing: 0; }
.trss-bjg .bjg-sound[aria-pressed="false"] { color: var(--bjg-muted); }

/* ============================================================ table */
.trss-bjg .bjg-table {
    position: relative;
    z-index: 1;
    overflow: hidden;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 6px;
    padding: 14px 14px 6px;
    min-height: 0;
}

/*
 * Rotating waypointer table ring — the designer's render
 * (Waypointer-Circle-loop): one rigid artwork turning clockwise at a constant
 * 180° per 12.546 s. The artwork is a still frame from that render
 * (img/waypointer-ring.webp, soft alpha) and this rule turns it at the same
 * rate, so the motion matches the supplied loop exactly (tools/build-waypointer.mjs
 * re-verifies that). Decorative only; stopped for prefers-reduced-motion.
 * Sizing: the square takes the smaller of the table layer's width and height;
 * all of the artwork lies inside the square's inscribed circle, so turning it
 * can never push the ring or its dots out of the table.
 */
.trss-bjg .bjg-ring-layer {
    position: absolute;
    inset: 10px 16px;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    container-type: size;
    pointer-events: none;
}
.trss-bjg .bjg-ring {
    position: relative;
    flex: 0 0 auto;
    width: min(100%, 420px);                /* fallback without container units */
    width: min(100cqw, 100cqh, 420px);
    aspect-ratio: 1;
    background: url(../img/waypointer-ring.webp) center / contain no-repeat;
    animation: bjg-ring-turn var(--bjg-t-ring) linear infinite;
    will-change: transform;
}
@keyframes bjg-ring-turn {
    to { transform: rotate(360deg); }
}

.trss-bjg .bjg-zone {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 0;
    z-index: 1;
}

.trss-bjg .bjg-zone__label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--bjg-muted);
}
.trss-bjg .bjg-total {
    min-width: 40px;
    padding: 3px 11px;
    border-radius: 999px;
    border: 1px solid rgba(244, 247, 255, 0.18);
    background: rgba(4, 9, 26, 0.72);
    color: var(--bjg-ink);
    font-size: 14px;
    letter-spacing: 0.02em;
    text-align: center;
}
.trss-bjg .bjg-zone--player .bjg-total { border-color: rgba(214, 64, 0, 0.7); color: var(--bjg-accent-text); }

/* deck / dealing origin */
.trss-bjg .bjg-deck {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    transform: rotate(6deg);
    aspect-ratio: var(--bjg-card-ratio);
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), 3px -3px 0 -1px rgba(255, 255, 255, 0.10);
    opacity: 0.9;
    z-index: 0;
}

/* ============================================================ cards */
.trss-bjg .bjg-hand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    flex: 0 1 auto;
}
/* Cards keep their depth shadow: they are playing cards, not UI buttons. */
.trss-bjg .bjg-card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: var(--bjg-card-w, 84px);
    aspect-ratio: var(--bjg-card-ratio);
    padding: 0;
    border: 0;
    border-radius: 9px;
    overflow: hidden;
    background: var(--bjg-navy-700);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(214, 64, 0, 0.26);
    cursor: zoom-in;
    touch-action: manipulation;
    transition: transform var(--bjg-t-card) var(--bjg-ease), opacity calc(var(--bjg-t-card) * 0.7) var(--bjg-ease);
}
.trss-bjg .bjg-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.trss-bjg .bjg-card.is-dealing {
    opacity: 0;
    transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.82);
}
/* hole-card reveal: scale shut, swap the face, scale open */
.trss-bjg .bjg-card.is-flipping {
    transform: scaleX(0.04);
    transition-duration: var(--bjg-t-flip);
}
.trss-bjg .bjg-card:not(.is-back):active { transform: scale(0.96); }

.trss-bjg .bjg-zone--player .bjg-hand { --bjg-card-w: clamp(96px, 33vw, 150px); }
.trss-bjg .bjg-zone--dealer .bjg-hand { --bjg-card-w: clamp(84px, 28vw, 130px); }
.trss-bjg .bjg-hand[data-count="3"] { --bjg-card-w: clamp(82px, 26vw, 120px); }
.trss-bjg .bjg-hand[data-count="4"] { --bjg-card-w: clamp(70px, 21vw, 104px); }
.trss-bjg .bjg-hand[data-count="5"] { --bjg-card-w: clamp(60px, 17.5vw, 88px); }
.trss-bjg .bjg-hand[data-count="6"],
.trss-bjg .bjg-hand[data-count="7"],
.trss-bjg .bjg-hand[data-count="8"] { --bjg-card-w: clamp(50px, 14.5vw, 74px); }

.trss-bjg .bjg-hint {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(244, 247, 255, 0.45);
    transition: opacity var(--bjg-t-fade) var(--bjg-ease);
}

/* ============================================================ actions */
.trss-bjg .bjg-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    padding: 12px 14px 26px;             /* clear gap above the footer divider */
    border-top: 0;
    background: none;
}
.trss-bjg .bjg-actions .bjg-btn { flex: 1 1 0; min-height: 58px; font-size: 15px; }

/* ==================================================== result overlay */
/*
 * The only place results are announced visually: win, dealer win, push,
 * trivia, drawing entry and prize claim are all shown centre-centre over a
 * darkened table (no duplicate result text on the table itself).
 */
.trss-bjg .bjg-result {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 7, 20, 0.84);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--bjg-t-fade) var(--bjg-ease);
}
.trss-bjg.is-playing .bjg-result { position: fixed; }
.trss-bjg .bjg-result.is-open { opacity: 1; pointer-events: auto; }

.trss-bjg .bjg-result__panel {
    position: relative;
    width: min(430px, 100%);
    max-height: min(86%, 780px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* scrollable by touch / wheel / keyboard, without visible scrollbar chrome */
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
    border: 1px solid var(--bjg-line);
    border-radius: 22px;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(214, 64, 0, 0.14) 0%, transparent 62%),
        linear-gradient(180deg, var(--bjg-navy-700) 0%, var(--bjg-navy-900) 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
    text-align: center;
    transform: translateY(18px) scale(0.94);
    opacity: 0;
    transition: transform var(--bjg-t-panel) var(--bjg-ease), opacity var(--bjg-t-panel) var(--bjg-ease);
}
.trss-bjg .bjg-result__panel::-webkit-scrollbar { display: none; width: 0; height: 0; }
.trss-bjg .bjg-result.is-open .bjg-result__panel { transform: none; opacity: 1; }

.trss-bjg.trss-bjg .bjg-result__panel h3 {
    margin: 0 0 8px;
    font-size: clamp(20px, 5.6vw, 27px);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--bjg-ink);
}
.trss-bjg .bjg-result__panel p { color: var(--bjg-muted); font-size: 14px; }
.trss-bjg.trss-bjg .bjg-result__panel[data-tone="win"] h3 { color: var(--bjg-accent-text); }

/* the big win headline */
.trss-bjg.trss-bjg .bjg-win-title {
    margin: 4px 0 6px;
    font-size: clamp(40px, 13vw, 60px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding-bottom: 0.14em;   /* background-clip needs room for descenders */
    background: linear-gradient(100deg, var(--bjg-accent-text) 8%, var(--bjg-accent-glow) 48%, var(--bjg-accent) 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* campaign copy under YOU WON! */
.trss-bjg.trss-bjg .bjg-result__panel .bjg-win-campaign {
    margin: 0 0 6px;
    font-size: clamp(17px, 4.8vw, 20px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--bjg-ink);
}
.trss-bjg.trss-bjg .bjg-result__panel .bjg-win-support {
    margin: 0 auto 12px;
    max-width: 24em;
    font-size: 14px;
    line-height: 1.45;
    color: var(--bjg-muted);
}
.trss-bjg.trss-bjg .bjg-result__panel .bjg-win-status {
    margin: 0 auto 4px;
    max-width: 24em;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--bjg-accent-text);
}

/* restrained accent stars: scale + fade + slide only */
.trss-bjg .bjg-stars {
    position: relative;
    height: 46px;
    margin: 2px 0 4px;
    pointer-events: none;
}
.trss-bjg .bjg-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    color: var(--bjg-accent-text);
    opacity: 0;
    transform: translate(var(--sx, 0px), 12px) scale(0.4);
    transition:
        transform calc(var(--bjg-t-panel) * 0.95) var(--bjg-ease),
        opacity calc(var(--bjg-t-panel) * 0.95) var(--bjg-ease);
    transition-delay: var(--sd, 0ms);
}
.trss-bjg .bjg-star svg { display: block; width: 100%; height: 100%; }
.trss-bjg .bjg-stars.is-in .bjg-star {
    opacity: var(--so, 1);
    transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(var(--ss, 1));
}

/* the CTA / state that follows the win presentation */
.trss-bjg .bjg-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--bjg-t-panel) var(--bjg-ease), transform var(--bjg-t-panel) var(--bjg-ease);
}
.trss-bjg .bjg-reveal.is-in { opacity: 1; transform: none; }

.trss-bjg .bjg-result__panel .bjg-btn { margin-top: 10px; }
.trss-bjg .bjg-result__row { display: flex; gap: 10px; }
.trss-bjg .bjg-result__row .bjg-btn { flex: 1 1 0; }

/* ---- dealer-win scorecard: the TRSS Tidbit takes centre stage ---- */
.trss-bjg .bjg-result__panel[data-variant="dealer"] {
    display: flex;
    flex-direction: column;
    min-height: min(66vh, 560px);
    padding-top: 30px;
}
.trss-bjg.trss-bjg .bjg-result__panel .bjg-lose-title {
    margin: 0 auto 6px;
    max-width: 22em;
    font-size: clamp(16px, 4.4vw, 19px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    color: var(--bjg-ink);
}

.trss-bjg .bjg-tidbit {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 18px 0 12px;
    padding: 8px 4px;
    border: 0;
    background: none;
    text-align: center;
}
.trss-bjg .bjg-result__panel .bjg-tidbit__label {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--bjg-accent-text);
}
.trss-bjg .bjg-result__panel .bjg-tidbit__text {
    margin: 0;
    max-width: 19em;
    font-size: clamp(19px, 5.4vw, 23px);
    font-weight: 600;
    line-height: 1.42;
    color: var(--bjg-ink);
    text-wrap: balance;
}

/* prize claim */
.trss-bjg.trss-bjg .bjg-prize__label {
    margin: 2px 0 10px;
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 800;
    color: var(--bjg-accent-text);
}
.trss-bjg .bjg-countdown {
    font-size: clamp(38px, 12vw, 54px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--bjg-ink);
}
.trss-bjg .bjg-countdown.is-urgent { color: var(--bjg-red); }
.trss-bjg .bjg-warn {
    margin: 10px 0;
    padding: 10px 13px;
    border-radius: 10px;
    background: rgba(214, 64, 0, 0.14);
    border: 1px solid rgba(214, 64, 0, 0.35);
    color: var(--bjg-ink);
    font-size: 13px;
    text-align: left;
}

/* ============================================================ forms */
.trss-bjg .bjg-form { display: grid; gap: 12px; margin-top: 14px; text-align: left; }
.trss-bjg .bjg-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bjg-muted);
}
.trss-bjg .bjg-field input,
.trss-bjg .bjg-field select {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid rgba(244, 247, 255, 0.22);
    border-radius: 12px;
    background: rgba(4, 9, 26, 0.55);
    color: var(--bjg-ink);
    font: inherit;
    font-size: 16px; /* prevents iOS zoom */
}
.trss-bjg .bjg-field input::placeholder { color: rgba(244, 247, 255, 0.35); }
.trss-bjg .bjg-field input[aria-invalid="true"] { border-color: var(--bjg-red); }
.trss-bjg .bjg-error { margin: 5px 0 0; font-size: 12px; color: var(--bjg-red); }
.trss-bjg .bjg-error:empty { display: none; }
.trss-bjg .bjg-consent { font-size: 11px; color: rgba(244, 247, 255, 0.5); }
.trss-bjg .bjg-consent a { color: var(--bjg-accent-text); }

/* ============================================================ zoom overlay */
.trss-bjg .bjg-zoom {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
    background: rgba(2, 6, 16, 0.88);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity var(--bjg-t-fade) var(--bjg-ease);
}
.trss-bjg .bjg-zoom.is-open { opacity: 1; }
.trss-bjg .bjg-zoom img {
    max-width: min(92vw, 460px);
    max-height: 74vh;
    width: auto;
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
    transform: scale(0.9);
    transition: transform var(--bjg-t-zoom) var(--bjg-ease);
}
.trss-bjg .bjg-zoom.is-open img { transform: scale(1); }
.trss-bjg .bjg-zoom__caption { color: var(--bjg-muted); font-size: 13px; text-align: center; }

/* ============================================================ responsive */
@media (min-width: 720px) {
    /* Desktop keeps the mobile-first game, centred in a phone-like frame. */
    .trss-bjg .bjg-landing,
    .trss-bjg .bjg-game {
        max-width: 460px;
        margin-inline: auto;
        height: min(88vh, 860px);
    }
    .trss-bjg .bjg-landing { height: auto; min-height: min(88vh, 860px); }
    .trss-bjg.is-playing .bjg-game {
        inset: 50% auto auto 50%;
        transform: translate(-50%, -50%);
        width: min(440px, 94vw);
        height: min(92vh, 900px);
        border-radius: 26px;
    }
    .trss-bjg.is-playing::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 999998;
        background: radial-gradient(60% 60% at 50% 40%, rgba(10, 23, 51, 0.92), rgba(2, 5, 14, 0.97));
    }
}

@media (prefers-reduced-motion: reduce) {
    .trss-bjg * {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
    }
    /* A 1ms infinite spin would flicker: stop the ring instead. */
    .trss-bjg .bjg-ring {
        animation: none !important;
        will-change: auto;
    }
}
