/* Battle Royale (Pages/BattleRoyale.razor, Pages/BattleLive.razor).
   Palette blu notte e oro dei mockup approvati; classi bx-* per non toccare
   il bundle Tailwind. Le animazioni pesanti stanno in lib/js/battle-fx.js. */

.bx {
    --bx-bg: #eef0f3;
    --bx-card: #ffffff;
    --bx-ink: #26283c;
    --bx-mute: #7d7d7d;
    --bx-line: #e2e8f0;
    --bx-blue: #2462e7;
    --bx-blue-d: #1748ab;
    --bx-navy: #0a254d;
    --bx-blue-l: #dce4fb;
    --bx-gold: #fbbf24;
    --bx-gold-d: #b7860b;
    --bx-green: #2ca85a;
    --bx-green-l: #e8f5e9;
    --bx-red: #e63946;
    --bx-red-l: #fff1f1;
    --bx-hero: linear-gradient(160deg, #4a8beb 0%, #2f6fd8 100%);
    --bx-night: radial-gradient(120% 90% at 50% 0%, #1748ab 0%, #0a254d 60%, #061733 100%);
    --bx-gold-grad: linear-gradient(135deg, #fde68a, #fbbf24 60%, #f2b70d);
    font-family: 'Nunito', 'Poppins', sans-serif;
    color: var(--bx-ink);
    /* A tutto schermo, fuori dal layout dell'app (EmptyLayout): il blu va da
       bordo a bordo, il contenuto resta in una colonna centrata. */
    --bx-col: 56rem;
    --bx-side: max(1.6rem, calc((100% - var(--bx-col)) / 2));
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bx-bg);
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
    position: relative;
}

.bx-hero {
    background: var(--bx-hero);
    color: #fff;
    border-radius: 0 0 2.4rem 2.4rem;
    padding: calc(5.4rem + env(safe-area-inset-top, 0px)) var(--bx-side) 2.4rem;
    position: relative;
    overflow: hidden;
}

/* Colonna del contenuto sotto la testata. */
.bx > .bx-stack, .bx-page > .bx-stack { margin-left: var(--bx-side); margin-right: var(--bx-side); }

.bx-exit {
    position: absolute;
    z-index: 5;
    top: calc(1.4rem + env(safe-area-inset-top, 0px));
    left: var(--bx-side);
    font: inherit;
    font-weight: 900;
    font-size: 1.4rem;
    color: #fff;
    background: #ffffff26;
    border: 0;
    border-radius: .6rem;
    padding: .6rem 1.4rem;
    text-decoration: none;
    cursor: pointer;
}
.bx-exit:hover { background: #ffffff40; }
.bx-hero.night { background: var(--bx-night); }
.bx-hero.ok { background: linear-gradient(160deg, #34c06a, #1f8a48); }
.bx-hero.ko { background: linear-gradient(160deg, #e63946, #b52432); }

.bx-kick { font-size: 1.3rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.bx-title { font-size: 3.2rem; font-weight: 900; line-height: 1.1; margin: .4rem 0 0; }
.bx-sub { font-size: 1.6rem; font-weight: 700; opacity: .9; }
.bx-num { font-variant-numeric: tabular-nums; }

.bx-stack { display: flex; flex-direction: column; gap: 1.4rem; margin-top: 1.4rem; }
.bx-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.bx-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.bx-card { background: var(--bx-card); border: 1px solid var(--bx-line); border-radius: 1.8rem; padding: 1.6rem; }
.bx-card.soft { background: #f5f8ff; border-color: var(--bx-blue-l); }
.bx-card.goldc { background: #fff8e1; border: 2px solid var(--bx-gold); }
.bx-h { font-weight: 900; font-size: 1.7rem; margin-bottom: .8rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.bx-h span { font-size: 1.3rem; color: var(--bx-mute); font-weight: 700; }
.bx-mute { color: var(--bx-mute); font-weight: 700; }
.bx-small { font-size: 1.35rem; }

.bx-pill { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.3rem; font-weight: 900; padding: .4rem 1.1rem; border-radius: .6rem; background: var(--bx-blue-l); color: var(--bx-blue-d); }
.bx-pill.w { background: #ffffff26; color: #fff; }
.bx-pill.live { background: #fff; color: var(--bx-red); }
.bx-pill.live::before { content: ""; width: .9rem; height: .9rem; border-radius: 50%; background: var(--bx-red); animation: bx-blink 1.2s infinite; }
.bx-pill.ok { background: var(--bx-green-l); color: var(--bx-green); }
@keyframes bx-blink { 50% { opacity: .25; } }

.bx-btn { display: block; width: 100%; text-align: center; font: inherit; font-weight: 900; font-size: 1.8rem; padding: 1.5rem; border-radius: 1.5rem; border: 0; background: var(--bx-blue); color: #fff; cursor: pointer; transition: transform .1s, opacity .2s; }
.bx-btn:active { transform: scale(.98); }
.bx-btn:disabled { opacity: .55; cursor: default; }
.bx-btn.hot { background: linear-gradient(135deg, #0a254d 0%, #1748ab 55%, #2462e7 100%); box-shadow: 0 .8rem 2.2rem #1748ab40, inset 0 0 0 .15rem #fbbf2466; }
.bx-btn.hot::after { content: " ›"; color: var(--bx-gold); }
.bx-btn.ghost { background: #fff; color: var(--bx-blue); border: .2rem solid var(--bx-blue); }
.bx-btn.off { background: #fff; color: #7d7d7d; border: .2rem solid #c3cbdc; opacity: .6; cursor: default; }
.bx-btn.small { font-size: 1.5rem; padding: 1rem; }
.bx-btn:focus-visible, .bx-ch:focus-visible, .bx-react button:focus-visible { outline: .3rem solid var(--bx-gold); outline-offset: .2rem; }

.bx-bar { height: 1rem; border-radius: .6rem; background: var(--bx-line); overflow: hidden; }
.bx-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1748ab, #2462e7); border-radius: .6rem; transition: width .6s; }

.bx-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.bx-prizes > div { text-align: center; border-radius: 1.2rem; padding: .9rem .4rem; background: var(--bx-bg); }
.bx-prizes > div:first-child { background: var(--bx-gold-grad); box-shadow: 0 .4rem 1.2rem #fbbf2455; }
.bx-prizes b { display: block; font-size: 1.8rem; font-weight: 900; }

.bx-kv { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--bx-line); font-weight: 800; font-size: 1.5rem; }
.bx-kv:first-of-type { border-top: 0; }

.bx-av { width: 3.4rem; height: 3.4rem; border-radius: 24%; flex: none; object-fit: cover; background: var(--bx-blue); }
.bx-avs { display: flex; }
.bx-avs .bx-av { border: .2rem solid #fff; margin-left: -1rem; }
.bx-avs .bx-av:first-child { margin-left: 0; }

/* Timer */
@property --bx-p { syntax: '<number>'; inherits: false; initial-value: 100; }
@property --bx-c { syntax: '<color>'; inherits: false; initial-value: #fbbf24; }
.bx-ring { --bx-p: 100; --bx-c: #fbbf24; width: 8rem; height: 8rem; border-radius: 50%; flex: none; background: conic-gradient(var(--bx-c) calc(var(--bx-p) * 1%), #ffffff2e 0); display: flex; align-items: center; justify-content: center; animation: bx-drain var(--bx-dur, 60s) linear forwards; }
.bx-ring > div { width: 6.4rem; height: 6.4rem; border-radius: 50%; background: #2f6fd8; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.bx-ring.hurry > div { color: #ffd6da; }
.bx-ring.beat { animation: bx-drain var(--bx-dur, 60s) linear forwards, bx-beat .5s ease-out; }
.bx-ring.stop { animation: none; --bx-p: 0; }
@keyframes bx-drain { 0% { --bx-p: 100; --bx-c: #fbbf24; } 66% { --bx-c: #fbbf24; } 74% { --bx-c: #ff8a00; } 83% { --bx-c: #e63946; } 100% { --bx-p: 0; --bx-c: #e63946; } }
@keyframes bx-beat { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

.bx-steps { display: flex; gap: .4rem; margin-top: 1.2rem; }
.bx-steps span { flex: 1; height: .6rem; border-radius: .4rem; background: #ffffff40; }
.bx-steps span.on { background: #fff; }
.bx-steps span.now { background: var(--bx-gold); box-shadow: 0 0 .8rem #fbbf24; }

/* Domanda e risposte */
.bx-q { font-size: 1.9rem; font-weight: 800; line-height: 1.4; }
.bx-q img { max-width: 100%; border-radius: 1rem; margin-top: 1rem; }
.bx-ch { position: relative; display: flex; gap: 1.2rem; align-items: center; width: 100%; text-align: left; font: inherit; background: #fff; border: .2rem solid var(--bx-line); border-radius: 1.5rem; padding: 1.1rem 1.3rem; font-weight: 700; font-size: 1.6rem; line-height: 1.35; overflow: hidden; color: var(--bx-ink); cursor: pointer; transition: border-color .15s, background .15s, opacity .3s; }
.bx-ch:disabled { cursor: default; }
.bx-ch > b { position: relative; z-index: 1; flex: none; width: 3rem; height: 3rem; border-radius: .9rem; background: var(--bx-bg); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.bx-ch > span { position: relative; z-index: 1; min-width: 0; }
.bx-ch .bx-pct { margin-left: auto; font-weight: 900; font-size: 1.35rem; color: var(--bx-mute); font-variant-numeric: tabular-nums; }
.bx-ch .bx-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #eef1f6; }
.bx-ch.sel { border-color: var(--bx-blue); background: #eef3fe; }
.bx-ch.sel > b { background: var(--bx-blue); color: #fff; }
.bx-ch.ok { border-color: var(--bx-green); background: var(--bx-green-l); }
.bx-ch.ok > b { background: var(--bx-green); color: #fff; }
.bx-ch.ok .bx-fill { background: #cdebd6; }
.bx-ch.ko { border-color: var(--bx-red); background: var(--bx-red-l); }
.bx-ch.ko > b { background: var(--bx-red); color: #fff; }
.bx-ch.ko .bx-fill { background: #fcd9dc; }
.bx-ch.dim { opacity: .45; }
.bx-chk { position: relative; z-index: 1; width: 2.6rem; height: 2.6rem; flex: none; margin-left: .6rem; }
.bx-chk path { fill: none; stroke: var(--bx-green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 0; }

.bx-sent { background: #fff; border: 1px solid var(--bx-line); border-radius: 1.8rem; padding: 1.4rem 1.6rem; box-shadow: 0 -.6rem 2rem rgba(10, 37, 77, .08); }

.bx-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.bx-stats b { display: block; font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.bx-stats small { font-size: 1.25rem; color: var(--bx-mute); font-weight: 700; }

/* Sala: pallini dei giocatori */
.bx-dots { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); gap: .6rem; }
.bx-dots.many { grid-template-columns: repeat(auto-fill, minmax(1.4rem, 1fr)); gap: .4rem; }
.bx-dot { aspect-ratio: 1; border-radius: 50%; background: var(--bx-green); }
.bx-dot.x { background: var(--bx-line); transform: scale(.7); }
.bx-dot.wait { background: #9db6ee; }
.bx-dot.me { outline: .3rem solid var(--bx-gold); outline-offset: .1rem; box-shadow: 0 0 1rem #fbbf24aa; }
.bx-dot.just { animation: bx-out .9s ease-out both; animation-delay: var(--d, 0s); }
.bx-dot.pop { animation: bx-pop .35s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--d, 0s); }
@keyframes bx-out { 0% { background: var(--bx-green); transform: scale(1); } 25% { background: var(--bx-red); transform: scale(1.35); } 100% { background: var(--bx-line); transform: scale(.7); } }
@keyframes bx-pop { from { transform: scale(0); } to { transform: scale(1); } }
.bx-legend { font-size: 1.25rem; color: var(--bx-mute); font-weight: 800; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.bx-legend i { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.1rem; }
.bx-wave { width: 100%; }
.bx-wave canvas { display: block; margin: 0 auto; max-width: 100%; }

/* Grande conto alla rovescia e VIA */
.bx-big { font-size: 9rem; font-weight: 900; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.bx-overlay { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.bx-go { font-size: 14rem; font-weight: 900; color: var(--bx-gold); text-shadow: 0 .6rem 3rem rgba(251, 191, 36, .7), 0 .2rem 0 #b7860b; opacity: 0; }
.bx-flash { position: fixed; inset: 0; z-index: 59; background: #fff; opacity: 0; pointer-events: none; }
.bx-redflash { position: fixed; inset: 0; z-index: 59; background: radial-gradient(circle at 50% 45%, rgba(230, 57, 70, .15), rgba(230, 57, 70, .7)); opacity: 0; pointer-events: none; }

/* Eliminato */
.bx-stamp { display: inline-block; font-size: 4.6rem; font-weight: 900; letter-spacing: .03em; color: #fff; background: var(--bx-red); padding: .6rem 2rem; border-radius: 1.4rem; border: .4rem solid #fff; box-shadow: 0 1.2rem 3rem rgba(155, 28, 42, .45); transform: rotate(-5deg); }
.bx-gray { transition: filter .8s; }
.bx-gray.on { filter: grayscale(1); }

/* Ultimi tre e podio */
.bx-beams { position: absolute; left: 50%; top: -18rem; width: 70rem; height: 70rem; margin-left: -35rem; background: conic-gradient(from 180deg, transparent 0 160deg, rgba(251, 191, 36, .18) 170deg, transparent 180deg, rgba(255, 255, 255, .12) 190deg, transparent 200deg 360deg); border-radius: 50%; pointer-events: none; }
.bx-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; position: relative; }
.bx-fin { background: #ffffff1f; border-radius: 1.4rem; padding: 1.2rem .4rem; text-align: center; font-weight: 900; font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; }
.bx-fin .bx-av { width: 5rem; height: 5rem; margin: 0 auto .6rem; display: block; }
.bx-fin.me .bx-av { outline: .3rem solid var(--bx-gold); box-shadow: 0 0 1.6rem #fbbf24; }
.bx-podium { display: flex; align-items: flex-end; justify-content: center; gap: .8rem; height: 24rem; position: relative; }
.bx-col { flex: 1; max-width: 14rem; border-radius: 1.2rem 1.2rem 0 0; color: #fff; text-align: center; font-weight: 900; font-size: 1.4rem; padding-top: 5.4rem; position: relative; transform-origin: bottom; }
.bx-col .bx-av { position: absolute; left: 50%; top: .8rem; margin-left: -2rem; width: 4rem; height: 4rem; border: .2rem solid #fff; }
.bx-col small { display: block; font-size: 1.25rem; }
.bx-col.r1 { background: var(--bx-gold-grad); color: #0a254d; height: 21rem; }
.bx-col.r2 { background: #8f9bb3; height: 15.5rem; }
.bx-col.r3 { background: #cd7f32; height: 13rem; }
.bx-crown { position: absolute; left: 0; right: 0; top: -4.4rem; text-align: center; font-size: 3.4rem; line-height: 1; z-index: 3; color: var(--bx-gold); }
.bx-coins { position: absolute; width: 26rem; height: 26rem; left: 50%; margin-left: -13rem; pointer-events: none; z-index: 2; }
.bx-prize { position: relative; z-index: 3; text-align: center; font-size: 4.6rem; font-weight: 900; color: var(--bx-gold); text-shadow: 0 .4rem 1.8rem rgba(251, 191, 36, .55); font-variant-numeric: tabular-nums; }
.bx-conf { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* Astensione */
.bx-lot { width: 14rem; height: 14rem; margin: 0 auto; }

/* Pubblico */
.bx-react { display: flex; gap: .6rem; }
.bx-react button { flex: 1; font-size: 2.2rem; background: #fff; border: 1px solid var(--bx-line); border-radius: 1.2rem; padding: .6rem 0; cursor: pointer; line-height: 1.2; }
.bx-floaty { position: fixed; font-size: 2.8rem; pointer-events: none; z-index: 65; animation: bx-float var(--t, 2.4s) ease-out forwards; }
@keyframes bx-float { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 12% { opacity: 1; transform: translate(calc(var(--dx) * .2), -3rem) scale(1.15); } 100% { transform: translate(var(--dx), -34rem) scale(.9); opacity: 0; } }
.bx-pbar { display: flex; align-items: center; gap: .8rem; font-weight: 800; font-size: 1.45rem; margin-top: .7rem; }
.bx-pbar > span { width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-pbar .bx-bar { flex: 1; height: 1.2rem; }
.bx-pbar em { font-style: normal; width: 4rem; text-align: right; font-variant-numeric: tabular-nums; }
.bx-picks { display: flex; flex-wrap: wrap; gap: .6rem; max-height: 16rem; overflow-y: auto; }
.bx-picks button { font: inherit; font-weight: 800; font-size: 1.4rem; border: .2rem solid var(--bx-blue-l); background: #fff; color: var(--bx-blue-d); border-radius: .6rem; padding: .5rem 1.2rem; cursor: pointer; }
.bx-picks button:hover { border-color: var(--bx-blue); }

.bx-offline { position: fixed; left: 50%; bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 81; background: var(--bx-red); color: #fff; font-weight: 900; font-size: 1.5rem; padding: 1rem 2rem; border-radius: .6rem; box-shadow: 0 .8rem 2.4rem rgba(155, 28, 42, .4); white-space: nowrap; animation: bx-offline-pulse 1.6s ease-in-out infinite; }
@keyframes bx-offline-pulse { 50% { transform: translateX(-50%) scale(1.04); } }
.bx-toast { position: fixed; left: 50%; bottom: 3rem; transform: translateX(-50%); z-index: 80; background: #26283c; color: #fff; font-weight: 800; font-size: 1.5rem; padding: 1.2rem 2rem; border-radius: 1.2rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3); max-width: 90vw; text-align: center; }

@media (min-width: 1024px) {
    /* Spettatore da computer: colonna larga, due colonne di contenuto. */
    .bx-hero.wide { padding-left: max(1.6rem, calc((100% - 110rem) / 2)); padding-right: max(1.6rem, calc((100% - 110rem) / 2)); }
    .bx-exit.wide { left: max(1.6rem, calc((100% - 110rem) / 2)); }
    .bx > .bx-live-grid { margin-left: max(1.6rem, calc((100% - 110rem) / 2)); margin-right: max(1.6rem, calc((100% - 110rem) / 2)); }
    .bx-live-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.8rem; align-items: start; }
    .bx-live-grid > * + * { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bx-dot.just, .bx-dot.pop, .bx-floaty, .bx-ring.beat { animation-duration: .01s !important; }
}

/* Moneta MedCoin dentro il testo */
.bx-coin { height: 1.15em; width: auto; vertical-align: -0.2em; display: inline-block; }

/* Ticket della partita: biglietto da cinema retrò, con la mezza luna sui
   margini destro e sinistro e la matrice da strappare. Carta crema, serif e
   oro come la busta della simulazione ufficiale. La forma (con le mezze
   lune) la ritaglia la maschera; il contorno blu notte la segue grazie alle
   quattro ombre del contenitore. */
.bx-ticket-wrap { filter: drop-shadow(2px 0 0 #0a254d) drop-shadow(-2px 0 0 #0a254d) drop-shadow(0 2px 0 #0a254d) drop-shadow(0 -2px 0 #0a254d); }
.bx-ticket { display: flex; color: #0a254d; font-family: 'Source Serif 4', Georgia, serif; background: #f7edd4; border-radius: 1rem;
    -webkit-mask: radial-gradient(circle 1.6rem at 0 50%, #0000 97%, #000 100%), radial-gradient(circle 1.6rem at 100% 50%, #0000 97%, #000 100%);
    -webkit-mask-composite: source-in;
            mask: radial-gradient(circle 1.6rem at 0 50%, #0000 97%, #000 100%), radial-gradient(circle 1.6rem at 100% 50%, #0000 97%, #000 100%);
            mask-composite: intersect; }
.bx-ticket-main { flex: 1; min-width: 0; padding: 1.4rem 1.4rem 1.4rem 2.8rem; }
.bx-ticket-kick { font-family: 'Nunito', sans-serif; font-size: 1.1rem; font-weight: 900; letter-spacing: .24em; text-transform: uppercase; color: #b7860b; }
.bx-ticket-title { font-size: 2.2rem; font-weight: 600; margin: .2rem 0 .9rem; line-height: 1.12; }
.bx-ticket-row { display: flex; gap: 1.6rem; border-top: 1px solid rgba(10, 37, 77, .3); padding-top: .7rem; }
.bx-ticket-row span { display: block; font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #7a6a45; }
.bx-ticket-row b { font-size: 1.6rem; font-weight: 600; }
.bx-ticket-stub { width: 10.4rem; flex: none; padding: 1rem 2rem 1rem .8rem; border-left: 2px dashed #0a254d; margin: .8rem 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center; }
.bx-ticket-stub span { font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 900; letter-spacing: .24em; text-transform: uppercase; color: #b7860b; }
.bx-ticket-stub b { font-size: 2.1rem; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.bx-ticket-stub em { font-family: 'Nunito', sans-serif; font-style: normal; font-weight: 900; font-size: 1.3rem; }

/* Spettatori */
.bx-letter { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; font-weight: 900; font-size: 1.3rem; background: var(--bx-line); color: var(--bx-ink); }
.bx-letter.ok { background: var(--bx-green); color: #fff; }
.bx-letter.ko { background: var(--bx-red); color: #fff; }
.bx-ini { width: 2.8rem; height: 2.8rem; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; background: var(--bx-blue-l); color: var(--bx-blue-d); }
.bx-reacts { display: flex; flex-wrap: wrap; gap: .6rem; }
.bx-reacts span { background: var(--bx-bg); border-radius: .6rem; padding: .45rem 1rem; font-size: 1.3rem; font-weight: 800; }

/* Vista spettatore: una schermata, niente scorrimento. */
.bx:has(.bx-spec) { padding-bottom: 0; }
.bx-spec { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.bx-spec-hero { padding: calc(1.4rem + env(safe-area-inset-top, 0px)) var(--bx-side) 1.4rem; flex: none; }
.bx-spec-top { display: flex; justify-content: flex-end; gap: .6rem; min-height: 3.2rem; align-items: center; }
.bx-ring.small { width: 5.8rem; height: 5.8rem; }
.bx-ring.small > div { width: 4.6rem; height: 4.6rem; font-size: 2rem; }
.bx-spec-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1rem; padding: 1rem var(--bx-side) calc(1rem + env(safe-area-inset-bottom, 0px)); max-width: calc(var(--bx-col) + 2 * var(--bx-side)); width: 100%; margin: 0 auto; box-sizing: border-box; }
.bx-spec-body .bx-card { padding: 1.1rem 1.3rem; }
.bx-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.bx-dist { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-top: .8rem; }
.bx-dist div { background: var(--bx-bg); border-radius: .8rem; text-align: center; padding: .4rem 0; font-size: 1.2rem; font-weight: 800; color: var(--bx-mute); }
.bx-dist div b { display: block; color: var(--bx-ink); font-size: 1.4rem; }
.bx-dist div.ok { background: var(--bx-green); color: #fff; }
.bx-dist div.ok b { color: #fff; }
.bx-grid10 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem .6rem; }
.bx-tile { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: flex; flex-direction: column; align-items: center; gap: .4rem; cursor: pointer; min-width: 0; }
.bx-tile .bx-ini { position: relative; width: 4.6rem; height: 4.6rem; font-size: 1.7rem; }
.bx-tile.out { opacity: .45; }
.bx-ini.more { background: var(--bx-ink); color: #fff; font-size: 1.4rem; }
.bx-tile-n { font-size: 1.1rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-badge { position: absolute; right: -.5rem; bottom: -.4rem; min-width: 2.1rem; height: 2.1rem; padding: 0 .3rem; box-sizing: border-box; border-radius: .6rem; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 1.1rem; font-weight: 900; background: var(--bx-line); color: var(--bx-ink); }
.bx-badge.ok { background: var(--bx-green); color: #fff; }
.bx-badge.ko { background: var(--bx-red); color: #fff; }
.bx-reacts.one { flex-wrap: nowrap; overflow: hidden; margin-bottom: .8rem; min-height: 2.6rem; align-items: center; }
.bx-reacts.one span { white-space: nowrap; flex: none; }
.bx-reacts.one span.bx-mute { background: none; padding: 0; font-size: 1.3rem; }
.bx-spec-react .bx-react button { font-size: 2rem; padding: .4rem 0; }
.bx-sheet-bg { position: fixed; inset: 0; background: rgba(6, 23, 51, .45); z-index: 20; }
.bx-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 56rem; margin: 0 auto; max-height: 82vh; max-height: 82dvh; overflow: auto; background: #fff; border-radius: 2rem 2rem 0 0; padding: 2rem 2rem calc(2rem + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.bx-hist { border-top: 1px solid var(--bx-line); padding: 1rem 0; }

/* Partita in corso come una diretta TV, con i colori dell'app: tabellone
   blu in alto, riquadri bianchi, giocatori come figurine. Domanda e risposte
   come nei blocchi di quiz (QuestionAnswerBlock, variante chiara). */
.bx.tv .bx-kick { color: #f2b70d; opacity: 1 !important; letter-spacing: .2em; }
.bx.tv .bx-title, .bx.tv .bx-big { font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; }
.bx.tv .bx-h { color: #26283c; }
.bx.tv .bx-q, .bx.tv .bx-clamp { color: #26283c; font-weight: 700; font-size: 1.65rem; line-height: 1.35; }
.bx.tv .bx-pill { background: #eaf1fd; color: #1748ab; }
.bx.tv .bx-ch { border: 2px solid #e2e8f0; border-radius: 1.6rem; background: #fff; box-shadow: 0 .2rem .6rem rgba(38, 40, 60, .05); font-weight: 500; font-size: 1.35rem; color: #26283c; padding: 1.1rem 1.3rem; }
.bx.tv .bx-ch > b { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: #fff; border: 1.5px solid #ccd2dd; color: #5b6274; font-size: 1.3rem; font-weight: 700; box-sizing: border-box; }
.bx.tv .bx-ch.sel { border-color: #2462e7; background: #eaf1fd; box-shadow: 0 .4rem 1.2rem rgba(36, 98, 231, .18); }
.bx.tv .bx-ch.sel > b { background: #2462e7; border-color: #2462e7; color: #fff; }
.bx.tv .bx-ch.ok { border-color: #2ca85a; background: #e8f5e9; }
.bx.tv .bx-ch.ok > b { background: #2ca85a; border-color: #2ca85a; color: #fff; }
.bx.tv .bx-ch.ko { border-color: #e63946; background: #fdecec; }
.bx.tv .bx-ch.ko > b { background: #e63946; border-color: #e63946; color: #fff; }
.bx.tv .bx-dist div { background: #fff; border: 2px solid #e2e8f0; color: #7d7d7d; }
.bx.tv .bx-dist div b { color: #5b6274; }
.bx.tv .bx-dist div.ok { background: #e8f5e9; border-color: #2ca85a; color: #2ca85a; }
.bx.tv .bx-dist div.ok b { color: #2ca85a; }
.bx.tv .bx-strong { color: #26283c; }
/* Tabellone: numero dei giocatori in gioco */
.bx-score { font-family: 'Source Serif 4', Georgia, serif; font-size: 2.6rem; font-weight: 600; margin-top: .2rem; display: flex; align-items: center; gap: .6rem; }
.bx-score small { font-family: 'Nunito', sans-serif; font-size: 1.5rem; font-weight: 700; opacity: .8; }
.bx-live-dot { width: 1rem; height: 1rem; border-radius: 50%; background: #34c06a; box-shadow: 0 0 0 .35rem rgba(52, 192, 106, .25); display: inline-block; flex: none; }
.bx-onair { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: #fff; background: #e63946; border-radius: .4rem; padding: .35rem .8rem; }
.bx-onair i { width: .7rem; height: .7rem; border-radius: 50%; background: #fff; display: inline-block; }
.bx-viewers { font-size: 1.4rem; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .16); border-radius: .4rem; padding: .35rem .8rem; }
/* Figurine dei giocatori */
.bx-fig { position: relative; background: #fff; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; min-width: 0; display: flex; flex-direction: column; border-radius: .8rem; overflow: hidden; box-shadow: 0 0 0 1px #dde2ea; }
.bx-fig-img { aspect-ratio: 1 / 1; width: 100%; display: flex; align-items: center; justify-content: center; background: #dce4fb; color: #2462e7; font-family: 'Source Serif 4', Georgia, serif; font-size: 2rem; font-weight: 600; overflow: hidden; }
.bx-fig-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bx-fig-img.more { background: #eef1f6; color: #0a254d; font-family: 'Nunito', sans-serif; font-size: 1.8rem; font-weight: 900; }
.bx-fig-n { display: block; background: #fff; color: #0a254d; border-top: 2px solid #f2b70d; font-size: 1rem; font-weight: 900; padding: .3rem .3rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-fig.out { opacity: .4; }
.bx-fig.out .bx-fig-n { border-top-color: #dde2ea; }
.bx-fig .bx-badge { right: .2rem; bottom: auto; top: .2rem; min-width: 1.8rem; height: 1.8rem; font-size: 1rem; }
.bx-mini .bx-fig-img { width: 3.6rem; height: 3.6rem; aspect-ratio: auto; border-radius: .6rem; font-size: 1.6rem; }

/* Scommesse: chi risponde giusto? */
.bt-invite { display: flex; align-items: center; gap: 1.2rem; width: 100%; border: 2px solid var(--bx-gold); background: #fff8e1; border-radius: 1.8rem; padding: 1.2rem 1.4rem; font: inherit; color: var(--bx-ink); cursor: pointer; }
.bt-invite b { display: block; font-size: 1.6rem; font-weight: 900; }
.bt-invite-ic { width: 4.4rem; height: 4.4rem; border-radius: 50%; background: var(--bx-gold-grad); color: #6b4a00; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex: none; }
.bt-stake { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.bt-chip { font: inherit; font-weight: 900; font-size: 1.4rem; min-width: 4.6rem; padding: .6rem 1rem; border-radius: 999px; border: 2px solid var(--bx-blue-l); background: #fff; color: var(--bx-blue-d); cursor: pointer; }
.bt-chip.on { background: var(--bx-blue); border-color: var(--bx-blue); color: #fff; }
.bt-input { font: inherit; font-weight: 900; font-size: 1.4rem; width: 7rem; padding: .6rem .8rem; border-radius: 1rem; border: 2px solid var(--bx-line); text-align: center; }
.bt-input.sm { width: 6rem; padding: .4rem .6rem; }
.bt-link { font: inherit; font-weight: 900; font-size: 1.3rem; color: var(--bx-blue); background: none; border: 0; cursor: pointer; padding: 0; }
.bt-pick.on { box-shadow: 0 0 0 3px var(--bx-blue); }
.bt-list { margin-top: 1.2rem; border-top: 1px solid var(--bx-line); padding-top: .8rem; display: grid; gap: .6rem; }
.bt-row { display: flex; align-items: center; gap: .8rem; padding: .3rem 0; }
.bt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.4rem; }
.bt-step { font: inherit; font-weight: 900; font-size: 1.6rem; width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 2px solid var(--bx-blue-l); background: #fff; color: var(--bx-blue-d); cursor: pointer; flex: none; }
.bt-win { min-width: 4.4rem; text-align: right; }
.bt-coin { font-weight: 900; font-size: 1.4rem; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.bt-coin.ok { color: var(--bx-green); }
.bt-coin.ko { color: var(--bx-red); }
.bt-c { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--bx-gold-grad); box-shadow: inset 0 0 0 1.5px #b7860b; display: inline-block; }
.bt-foot { position: sticky; bottom: calc(-2rem - env(safe-area-inset-bottom, 0px)); background: #fff; margin: 1.4rem -2rem -2rem; padding: 1.2rem 2rem calc(1.6rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--bx-line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bt-foot .bx-btn { width: auto; flex: none; padding-left: 2rem; padding-right: 2rem; }
.bt-err { color: var(--bx-red); font-weight: 800; margin-top: 1rem; }
.bt-tot { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; text-align: center; }
.bt-tot b { display: block; font-size: 2.4rem; font-weight: 900; }
.bt-tot small { color: var(--bx-mute); font-weight: 800; }
.bt-mine-res { margin-top: 1rem; border-top: 1px solid var(--bx-line); padding-top: .8rem; }
.bt-input.on { border-color: var(--bx-blue); }
.bt-pick.taken { opacity: .55; cursor: default; }
.bx-badge.bt-amt { background: var(--bx-gold); color: #4a3500; width: auto; padding: 0 .4rem; }
.bt-add { margin-top: 1.2rem; }
.bt-group { background: #f5f8ff; border: 1px solid var(--bx-blue-l); border-radius: 1.2rem; padding: .8rem 1rem; }
.bt-group b { font-size: 1.5rem; display: inline-flex; align-items: center; gap: .4rem; }
.bt-names { font-size: 1.3rem; font-weight: 700; color: var(--bx-mute); margin-top: .2rem; }
.bt-x { font: inherit; font-weight: 900; font-size: 1.6rem; line-height: 1; border: 0; background: none; color: var(--bx-red); cursor: pointer; margin-left: .4rem; }
.bt-out { border-width: 2px; }
.bt-out.win { border-color: var(--bx-green); background: #effaf3; }
.bt-out.lose { border-color: var(--bx-red); background: #fff1f2; }
.bt-out.even { border-color: var(--bx-line); }
.bt-out-head { display: flex; align-items: center; gap: 1.2rem; margin-bottom: .8rem; }
.bt-out-head > i { font-size: 3rem; }
.bt-out.win .bt-out-head > i, .bt-out.win .bt-out-net { color: var(--bx-green); }
.bt-out.lose .bt-out-head > i, .bt-out.lose .bt-out-net { color: var(--bx-red); }
.bt-out-title { font-weight: 900; font-size: 1.5rem; }
.bt-out-net { font-weight: 900; font-size: 2.6rem; line-height: 1.1; display: inline-flex; align-items: center; gap: .5rem; }
.bt-out-net .bt-c { width: 2rem; height: 2rem; }
.bt-invite-go { flex: none; font-weight: 900; font-size: 1.4rem; color: #fff; background: var(--bx-blue); border-radius: .6rem; padding: .6rem 1.4rem; }
.bt-out { border-width: 2px; overflow: hidden; position: relative; animation: bt-in .35s ease-out both; }
.bt-out-title { font-weight: 900; font-size: 1.6rem; }
.bt-out-net { font-weight: 900; font-size: 3rem; line-height: 1; display: inline-flex; }
.bt-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1.2rem 0 .8rem; padding: .8rem 0; border-top: 1px solid var(--bx-line); border-bottom: 1px solid var(--bx-line); text-align: center; }
.bt-sum small { display: block; color: var(--bx-mute); font-weight: 800; font-size: 1.1rem; }
.bt-sum b { font-size: 1.7rem; font-weight: 900; }
.bt-tag { font-weight: 900; font-size: 1.3rem; white-space: nowrap; padding: .2rem .8rem; border-radius: .6rem; background: #eef1f6; color: var(--bx-mute); }
.bt-tag.ok { background: #e3f6ea; color: var(--bx-green); }
.bt-tag.ko { background: #fde8ea; color: var(--bx-red); }
.bt-in { opacity: 0; animation: bt-row .35s ease-out forwards; animation-delay: calc(.5s + var(--i) * .15s); }
/* Vincita: la scheda si illumina e il saldo sale da zero. */
.bt-out.win { border-color: var(--bx-green); animation: bt-in .35s ease-out both, bt-glow 1.6s .3s ease-out 1; }
.bt-out.win .bt-out-net { color: var(--bx-green); }
.bt-out.win::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(44, 168, 90, .18) 50%, transparent 70%); transform: translateX(-100%); animation: bt-sweep 1.1s .4s ease-out 1; pointer-events: none; }
/* Perdita: breve scossone, saldo in rosso. */
.bt-out.lose { border-color: var(--bx-red); animation: bt-in .35s ease-out both, bt-shake .5s .4s ease-in-out 1; }
.bt-out.lose .bt-out-net { color: var(--bx-red); }
.bt-out.even { border-color: var(--bx-line); }
@property --n { syntax: '<integer>'; initial-value: 0; inherits: false; }
.bt-count { --n: var(--to); counter-reset: n var(--n); animation: bt-count 1.2s .35s cubic-bezier(.2, .7, .2, 1) both; }
.bt-count { font-size: 0; }
.bt-count::after { content: counter(n); font-size: 3rem; }
@keyframes bt-count { from { --n: 0; } to { --n: var(--to); } }
@keyframes bt-in { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }
@keyframes bt-row { from { opacity: 0; transform: translateX(-.8rem); } to { opacity: 1; transform: none; } }
@keyframes bt-glow { 0% { box-shadow: 0 0 0 0 rgba(44, 168, 90, .45); } 60% { box-shadow: 0 0 0 1.2rem rgba(44, 168, 90, 0); } 100% { box-shadow: none; } }
@keyframes bt-sweep { to { transform: translateX(100%); } }
@keyframes bt-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-.8rem); } 40% { transform: translateX(.7rem); } 60% { transform: translateX(-.5rem); } 80% { transform: translateX(.3rem); } }
@media (prefers-reduced-motion: reduce) { .bt-out, .bt-in, .bt-count, .bt-out::after { animation: none !important; opacity: 1; } }
/* MedCoin accanto alle cifre */
.bt-mc { width: 1.4em; height: 1.4em; vertical-align: -.3em; margin-left: .25em; display: inline-block; }
.bt-mc.lg { width: 1em; height: 1em; vertical-align: -.12em; }
.bt-out-net .bt-mc { align-self: center; width: 2.6rem; height: 2.6rem; margin-left: .4rem; }
.bt-amt-in { white-space: nowrap; }
.bt-add, .bt-chip, .bt-foot .bx-btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.bt-add .bt-mc, .bt-foot .bx-btn .bt-mc, .bt-chip .bt-mc { margin-left: 0; }
/* Premiazione: stesso azzurro delle altre schermate della partita. */
.bx-hero.bx-award .bx-kick { color: #fff; opacity: .9; }
.bx-hero.bx-award .bx-prize { color: #fff; text-shadow: 0 .3rem 1.2rem rgba(10, 37, 77, .35); }
/* Saldo delle scommesse in tutta la partita */
.bt-game { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: .9rem 1.1rem; border-radius: 1.2rem; background: #fff; border: 1px solid var(--bx-line); font-weight: 900; }
.bt-game span { font-size: 1.4rem; }
.bt-game b { font-size: 2rem; display: inline-flex; align-items: center; }
.bt-game.pos b { color: var(--bx-green); }
.bt-game.neg b { color: var(--bx-red); }
.bt-game-only { padding: .4rem; }
.bt-game-only .bt-game { margin-top: 0; border: 0; }
/* "altra" a pillola come le puntate */
.bt-stake .bt-input { border-radius: 999px; }
/* "altra" scelta: blu piena come le puntate fisse */
.bt-stake .bt-input.on { background: var(--bx-blue); border-color: var(--bx-blue); color: #fff; }
.bt-stake .bt-input.on::placeholder { color: #fff; }
.bt-stake .bt-input:focus { outline: none; box-shadow: 0 0 0 .3rem rgba(36, 98, 231, .3); }
/* Puntate oltre le monete rimaste: spente; "altra" oltre: rossa */
.bt-chip:disabled { opacity: .4; cursor: default; }
.bt-stake .bt-input.over { background: #fde8ea; border-color: var(--bx-red); color: var(--bx-red); }
/* Ultima domanda: avviso che entra dall'alto con un riflesso */
.bx-last { position: relative; overflow: hidden; margin-top: 1.2rem; padding: 1.1rem 1.4rem; border-radius: 1.2rem; background: var(--bx-gold-grad); color: #4a3500; font-size: 1.6rem; font-weight: 800; text-align: center; box-shadow: 0 .6rem 1.6rem rgba(242, 183, 13, .35); animation: bx-last-in .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.bx-last b { font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.bx-last::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%); transform: translateX(-100%); animation: bx-last-shine 1.1s .5s ease-out 2; }
@keyframes bx-last-in { from { opacity: 0; transform: translateY(-1.2rem) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bx-last-shine { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .bx-last, .bx-last::after { animation: none !important; } }
.bx-stack > .bx-last, .bx-spec-body > .bx-last { margin-top: 0; }

/* Pagina della partita in programma, dentro l'app: colonna più larga e
   testata senza sfondo azzurro. */
.bx.bx-lobby { --bx-col: 76rem; background: transparent; }
.bx-lobby .bx-hero { background: none; color: #0A254D; padding-top: 2rem; }
