:root {
    --g4b-accent: #31d07a;
}

.g4b-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.g4b-body main {
    flex: 1 0 auto;
}

.g4b-pre {
    max-height: 220px;
    overflow: auto;
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.navbar-brand {
    letter-spacing: 0.02em;
}

.card {
    border-color: rgba(255, 255, 255, 0.08);
}

code {
    color: var(--g4b-accent);
}

/* Colori dei posti condivisi da pedine e giocatori. */
.g4b-seat-1 {
    --g4b-seat-color: #3d8bfd;
    background-color: var(--g4b-seat-color);
}

.g4b-seat-2 {
    --g4b-seat-color: #f4b942;
    background-color: var(--g4b-seat-color);
}

.g4b-seat-3 {
    --g4b-seat-color: #e4647a;
    background-color: var(--g4b-seat-color);
}

.g4b-seat-4 {
    --g4b-seat-color: #8f6bde;
    background-color: var(--g4b-seat-color);
}

.g4b-play {
    --play-accent: #b4a8ff;
    --play-accent-ink: #201449;
    --play-glow: #9278f5;
    --play-ink: #f3f3fc;
    --play-muted: #a7b0c6;
    --play-line: #2b354b;
    --play-surface: #151c2b;
    --play-deep: #101624;
    color: var(--play-ink);
}

.g4b-play[data-game="battleship"] {
    --play-accent: #87e6db;
    --play-accent-ink: #0a2f36;
    --play-glow: #30bba9;
}

.g4b-play[data-game="holdem"] {
    --play-accent: #f3d9a5;
    --play-accent-ink: #312213;
    --play-glow: #b79466;
}

.g4b-play[data-game="holdem"] .g4b-play-emblem span {
    display: grid;
    place-items: center;
    background: none;
    font-size: clamp(1rem, 3vw, 1.8rem);
    line-height: 1;
}

.g4b-play[data-game="holdem"] .g4b-play-emblem span::after {
    content: "♠";
}

.g4b-play[data-game="conquest"] {
    --play-accent: #f0c46a;
    --play-accent-ink: #241a05;
    --play-glow: #c98f2b;
}

.g4b-play-emblem-art {
    display: block;
    width: 74%;
    height: auto;
}

.g4b-play [hidden] {
    display: none !important;
}

.g4b-play-hero,
.g4b-play-arena,
.g4b-play-panel,
.g4b-play-join {
    border: 1px solid var(--play-line);
    border-radius: 1.1rem;
    background: var(--play-surface);
}

.g4b-play-hero {
    display: flex;
    align-items: center;
    gap: clamp(.8rem, 2.3vw, 2rem);
    margin-bottom: 1.25rem;
    padding: clamp(1rem, 2.8vw, 2.25rem);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 4% 15%, color-mix(in srgb, var(--play-glow) 27%, transparent), transparent 56%),
        linear-gradient(115deg, #1b2133, #121827 75%);
}

.g4b-play-identity {
    display: flex;
    align-items: center;
    gap: clamp(.7rem, 1.7vw, 1.25rem);
    flex: 1 1 auto;
}

.g4b-play-hero h1 {
    margin: .15rem 0 0;
    font-size: clamp(1.75rem, 4vw, 3.15rem);
    font-weight: 780;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.g4b-play-kicker {
    margin: 0;
    color: var(--play-muted);
    font-size: .82rem;
    font-weight: 720;
    letter-spacing: .085em;
    text-transform: uppercase;
}

.g4b-play-emblem {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: clamp(2.75rem, 6vw, 4.5rem);
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--play-accent) 36%, transparent);
    border-radius: 25%;
    background: color-mix(in srgb, var(--play-glow) 13%, var(--play-deep));
    color: var(--play-accent);
}

.g4b-play-emblem span {
    position: relative;
    width: 60%;
    aspect-ratio: 1;
    border: 1px solid currentColor;
    border-radius: 20%;
    background: radial-gradient(circle, currentColor 22%, transparent 26%) 0 0 / 33.333% 33.333%;
}

.g4b-play[data-game="battleship"] .g4b-play-emblem span {
    border-radius: 50%;
    background:
        radial-gradient(circle, currentColor 8%, transparent 10% 34%, currentColor 36% 39%, transparent 41%),
        linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
        linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

.g4b-play-stats {
    display: flex;
    gap: clamp(.5rem, 1.6vw, 1.15rem);
    margin: 0;
}

.g4b-play-stats div {
    padding-left: clamp(.65rem, 1.6vw, 1.35rem);
    border-left: 1px solid var(--play-line);
}

.g4b-play-stats dt,
.g4b-play-stats small {
    color: var(--play-muted);
    font-size: .84rem;
    font-weight: 600;
}

.g4b-play-stats dd {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.g4b-play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: .44rem .8rem;
    border: 1px solid #414d65;
    border-radius: .62rem;
    background: #1d2638;
    color: var(--play-ink);
    font: inherit;
    font-size: .9rem;
    font-weight: 660;
    text-decoration: none;
    cursor: pointer;
}

.g4b-play-button:hover:not(:disabled) {
    border-color: var(--play-accent);
    color: var(--play-ink);
}

.g4b-play-button[aria-pressed="true"] {
    border-color: var(--play-accent);
    background: color-mix(in srgb, var(--play-glow) 22%, var(--play-deep));
    color: var(--play-accent);
}

.g4b-play-button-primary,
.g4b-play-button-primary:hover:not(:disabled) {
    border-color: var(--play-accent);
    background: var(--play-accent);
    color: var(--play-accent-ink);
}

.g4b-play-button-primary:hover:not(:disabled) {
    filter: brightness(1.12);
}

.g4b-play-button:disabled {
    opacity: .6;
    cursor: default;
}

.g4b-play button:focus-visible,
.g4b-play a:focus-visible,
.g4b-play summary:focus-visible {
    outline: 2px solid var(--play-accent);
    outline-offset: 3px;
}

.g4b-play-join {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
}

.g4b-play-join p,
.g4b-play-join form {
    margin: 0;
}

.g4b-play-join span {
    display: block;
    color: var(--play-muted);
    font-size: .9rem;
}

.g4b-play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
}

.g4b-play-arena,
.g4b-play-sidebar {
    min-width: 0;
}

.g4b-play-arena {
    padding: clamp(.65rem, 1.6vw, 1.25rem);
    background: linear-gradient(155deg, var(--play-surface), var(--play-deep) 72%);
}

.g4b-play-phase {
    --phase-color: var(--play-muted);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(.55rem, 1.5vw, 1rem);
    min-height: 5.4rem;
    padding: clamp(.65rem, 1.7vw, 1.05rem);
    border: 1px solid var(--play-line);
    border-left: 3px solid var(--phase-color);
    border-radius: .8rem;
    background: color-mix(in srgb, var(--phase-color) 8%, var(--play-deep));
}

.g4b-play-phase[data-tone="you"] {
    --phase-color: #8af0b6;
}

.g4b-play-phase[data-tone="other"],
.g4b-play-phase[data-tone="end"] {
    --phase-color: var(--play-accent);
}

.g4b-play-phase[data-tone="setup"] {
    --phase-color: #f6cb86;
}

.g4b-play-phase-icon {
    display: grid;
    place-items: center;
    width: clamp(2rem, 4vw, 2.8rem);
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--phase-color) 40%, transparent);
    border-radius: .65rem;
    background: color-mix(in srgb, var(--phase-color) 12%, var(--play-deep));
    color: var(--phase-color);
    font-size: 1.25rem;
    line-height: 1;
}

.g4b-play-phase[data-tone="you"] .g4b-play-phase-icon {
    animation: g4b-turn-highlight .6s ease-out;
}

@keyframes g4b-turn-highlight {
    from { box-shadow: 0 0 0 .4rem #8af0b65e; }
    to { box-shadow: 0 0 0 .75rem transparent; }
}

.g4b-play-phase .g4b-play-kicker {
    color: var(--phase-color);
}

#play-turn {
    margin: .05rem 0 0;
    font-size: clamp(1.18rem, 2.4vw, 1.65rem);
    font-weight: 750;
    line-height: 1.12;
    letter-spacing: -.02em;
}

#play-phase-detail {
    margin: .3rem 0 0;
    color: var(--play-muted);
    font-size: .9rem;
    line-height: 1.35;
}

.g4b-play-clock {
    display: grid;
    justify-items: end;
    gap: .1rem;
    padding-left: clamp(.55rem, 1.6vw, 1.2rem);
    border-left: 1px solid var(--play-line);
}

.g4b-play-clock span {
    color: var(--play-muted);
    font-size: .78rem;
    white-space: nowrap;
}

.g4b-play-clock strong {
    color: var(--play-ink);
    font-size: clamp(1.25rem, 3vw, 1.95rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.g4b-play-clock.is-low strong {
    color: #ffaaa9;
}

.g4b-board-wrap {
    margin-top: clamp(.8rem, 2vw, 1.5rem);
}

.g4b-board-wrap[aria-busy="true"],
.g4b-board-wrap[aria-busy="true"] button {
    cursor: progress;
}

.g4b-play-empty {
    display: grid;
    min-height: 12rem;
    place-items: center;
    margin: 0;
    padding: 1rem;
    border: 1px dashed var(--play-line);
    border-radius: .8rem;
    color: var(--play-muted);
    text-align: center;
}

.g4b-play-sidebar {
    display: grid;
    gap: 1rem;
}

.g4b-play-panel {
    padding: 1rem;
}

.g4b-play-panel h2,
.g4b-play-panel > summary {
    margin: 0;
    font-size: 1rem;
    font-weight: 720;
}

.g4b-play-roster {
    display: grid;
    gap: .45rem;
    margin: .8rem 0 0;
    padding: 0;
    list-style: none;
}

.g4b-play-player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    padding: .5rem;
    border: 1px solid #2b3549;
    border-radius: .65rem;
    background: var(--play-deep);
    line-height: 1.2;
}

.g4b-play-player.is-current {
    border-color: #477c6c;
    background: #162928;
}

.g4b-play-player.is-empty {
    border-style: dashed;
    color: var(--play-muted);
    font-size: .9rem;
}

.g4b-play-seat {
    display: grid;
    flex: 0 0 auto;
    width: 2rem;
    aspect-ratio: 1;
    place-items: center;
    border-radius: .48rem;
    color: #101623;
    font-size: .9rem;
    font-weight: 820;
}

.g4b-play-player.is-empty .g4b-play-seat {
    border: 1px dashed var(--play-line);
    color: var(--play-muted);
}

.g4b-play-player-name {
    display: grid;
    gap: .14rem;
    margin-right: auto;
    overflow-wrap: anywhere;
    font-size: .95rem;
}

.g4b-play-player-name small,
.g4b-play-player-status {
    color: var(--play-muted);
    font-size: .8rem;
}

.g4b-play-player.is-current .g4b-play-player-status {
    color: #a7f2c8;
}

.g4b-play-meta,
.g4b-play-details {
    color: var(--play-muted);
    font-size: .88rem;
    overflow-wrap: anywhere;
}

.g4b-play-details summary {
    color: var(--play-ink);
    cursor: pointer;
}

.g4b-play-details p,
.g4b-play-details ul {
    margin: .55rem 0 0;
}

.g4b-play-details ul {
    padding-left: 1.2rem;
}

.g4b-play-result,
.g4b-result-dialog {
    --result-color: var(--play-accent);
}

.g4b-play [data-tone="win"] {
    --result-color: #84efae;
}

.g4b-play [data-tone="loss"] {
    --result-color: #ff9a9d;
}

.g4b-play-result {
    border-top: 2px solid var(--result-color);
}

#play-result-summary {
    margin-top: .55rem;
    color: var(--play-muted);
}

.g4b-result-summary-title {
    margin: 0;
    color: var(--play-ink);
    font-weight: 700;
}

#play-result-open,
#play-settlement {
    margin-top: .75rem;
}

.g4b-result-dialog {
    width: min(29rem, calc(100% - 1.5rem));
    max-height: calc(100% - 1.5rem);
    padding: clamp(1.6rem, 5vw, 2.5rem);
    border: 1px solid color-mix(in srgb, var(--result-color) 48%, var(--play-line));
    border-radius: 1.25rem;
    background: radial-gradient(ellipse at top, color-mix(in srgb, var(--result-color) 17%, transparent), transparent 70%),
        var(--play-deep);
    box-shadow: 0 1.5rem 5rem #050812bc;
    color: var(--play-ink);
    text-align: center;
}

.g4b-result-dialog::backdrop {
    background: #080b16c9;
    backdrop-filter: blur(5px);
}

.g4b-result-dialog[open] {
    animation: g4b-result-reveal .25s ease-out;
}

@keyframes g4b-result-reveal {
    from { opacity: 0; transform: translateY(.6rem) scale(.98); }
    to { opacity: 1; transform: none; }
}

.g4b-result-close {
    position: absolute;
    top: .65rem;
    right: .65rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--play-line);
    border-radius: 50%;
    background: var(--play-surface);
    color: var(--play-ink);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.g4b-result-icon {
    display: grid;
    width: 3.6rem;
    place-items: center;
    aspect-ratio: 1;
    margin: 0 auto .85rem;
    border: 1px solid currentColor;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--result-color) 11%, var(--play-deep));
    color: var(--result-color);
    font-size: 1.8rem;
    line-height: 1;
}

.g4b-result-dialog h2 {
    margin: .35rem 0 0;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.04em;
}

.g4b-result-amount {
    margin: .2rem 0 0;
    color: var(--result-color);
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.g4b-result-dialog .g4b-result-amount {
    margin-top: .6rem;
    font-size: clamp(1.55rem, 6vw, 2.65rem);
    letter-spacing: -.03em;
}

.g4b-result-detail {
    margin: .45rem 0 0;
    color: var(--play-muted);
    font-size: .95rem;
}

.g4b-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
    margin-top: 1.35rem;
}

/* Texas Hold'em */
.g4b-poker {
    container-type: inline-size;
}

.g4b-poker-felt {
    position: relative;
    display: grid;
    gap: .7rem;
    padding: clamp(.7rem, 2.5vw, 1.5rem);
    border: 1px solid #a88457;
    border-radius: 2rem;
    background: radial-gradient(ellipse at center, #206750, #153e37 72%, #112d29);
    box-shadow: inset 0 0 0 .3rem #0f2629, inset 0 0 0 .38rem #7f684b;
}

.g4b-poker-seats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.45rem, 1fr));
    gap: .38rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.g4b-poker-seat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .05rem .2rem;
    padding: .35rem .45rem;
    border: 1px solid #35675f;
    border-radius: .55rem;
    background: #102a29;
    color: #f4f4df;
    font-size: .83rem;
}

.g4b-poker-stack,
.g4b-poker-stack-share,
.g4b-poker-seat > small,
.g4b-poker-seat-cards {
    grid-column: 1 / -1;
    color: #c5d9cf;
}

.g4b-poker-seat.is-you > strong {
    color: #adf4da;
}

.g4b-poker-seat .g4b-poker-hand {
    color: #f6dfac;
    font-weight: 700;
}

.g4b-poker-own-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: .35rem;
    min-width: 0;
    padding: .32rem .4rem;
    border: 1px solid #377567;
    border-radius: .38rem;
    background: #0c2220;
}

.g4b-poker-own-stack span {
    color: #adcebe;
    font-size: .72rem;
}

.g4b-poker-own-stack strong {
    display: block;
    color: #effff7;
    font-size: 1.18rem;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.g4b-poker-stack-share {
    --share-color: #9cccf3;
    display: grid;
    grid-template-columns: minmax(.85rem, 1fr) auto;
    align-items: center;
    gap: .35rem;
    margin: .23rem 0 .1rem;
    color: var(--share-color);
    font-size: .73rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.g4b-poker-stack-share.is-low { --share-color: #f5b26d; }
.g4b-poker-stack-share.is-high { --share-color: #8feab5; }

.g4b-poker-stack-meter {
    display: block;
    height: .26rem;
    overflow: hidden;
    border-radius: 10rem;
    background: #e1f4ef27;
}

.g4b-poker-stack-meter::before {
    display: block;
    width: var(--stack-share);
    height: 100%;
    border-radius: inherit;
    background: var(--share-color);
    content: '';
}

.g4b-poker-chip-rack {
    display: flex;
    align-items: end;
    gap: .1rem;
    padding-bottom: .1rem;
}

.g4b-poker-chip-pile {
    display: flex;
    flex-direction: column-reverse;
}

.g4b-poker-chip-pile i {
    --chip-color: #278e64;
    display: block;
    width: .98rem;
    height: .46rem;
    margin-top: -.28rem;
    border: 1px solid #d1e5d5;
    border-bottom-width: 2px;
    border-radius: 50%;
    background: radial-gradient(ellipse, var(--chip-color) 53%, transparent 55%),
        repeating-conic-gradient(#e3eee3 0deg 30deg, var(--chip-color) 30deg 60deg);
}

.g4b-poker-chip-pile:nth-child(2) i { --chip-color: #236584; }
.g4b-poker-chip-pile:nth-child(3) i { --chip-color: #aa6331; }

.g4b-poker-seat.is-current {
    border-color: #e9c887;
    box-shadow: inset 0 0 0 1px #e9c8874d, 0 0 .9rem #e9c88745;
}

.g4b-poker-seat.is-out {
    border-color: #386058;
    background: #13322f;
}

.g4b-poker-seat.is-out .g4b-poker-card {
    opacity: .52;
}

.g4b-poker-seat.is-winner {
    border-color: #f1d893;
    background: #284633;
    animation: g4b-poker-win 430ms ease-out both;
}

.g4b-poker-seat.is-winner small {
    color: #aef7c4;
    font-weight: 700;
}

@keyframes g4b-poker-win {
    from { box-shadow: 0 0 0 .25rem #f1d89280; }
    to { box-shadow: 0 0 0 .08rem #f1d89270; }
}

.g4b-poker-position {
    display: inline-flex;
    align-items: center;
    gap: .24rem;
    color: var(--play-accent);
    font-size: .72rem;
    font-weight: 750;
}

.g4b-poker-dealer {
    display: inline-grid;
    width: 1.22rem;
    height: 1.22rem;
    place-items: center;
    border: 1px solid #f6e4ae;
    border-radius: 50%;
    background: #f8db91;
    color: #30250d;
    font-weight: 800;
    box-shadow: 0 .13rem .25rem #0917159c;
}

.g4b-poker-center {
    text-align: center;
}

.g4b-poker-center p {
    margin: 0 0 .3rem;
    color: #d4ede2;
    font-size: .86rem;
}

.g4b-poker-center .g4b-poker-blinds {
    margin: .55rem 0 0;
    color: #d0e0d6;
    font-size: .72rem;
}

.g4b-poker-center .g4b-poker-blind-clock {
    margin: .35rem 0 0;
    color: #d5eee2;
    font-size: .8rem;
}

.g4b-poker-blind-clock strong { font-variant-numeric: tabular-nums; }
.g4b-poker-center .g4b-poker-blind-clock.is-due { color: #f8db91; }

.g4b-poker-pot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .23rem .55rem;
    border: 1px solid #e0c48272;
    border-radius: .45rem;
    background: #0e352f;
    color: var(--play-accent);
    font-variant-numeric: tabular-nums;
}

.g4b-poker-pot .g4b-poker-chip-rack:empty { display: none; }

.g4b-poker-wager {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: .33rem;
    padding: .32rem .48rem;
    border: 1px solid #f4d398;
    border-radius: .45rem;
    background: #18372e;
    box-shadow: 0 .25rem .6rem #07221bb8;
    color: #fff1cf;
    font-size: .77rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.g4b-poker-wager .g4b-poker-chip-pile i { --chip-color: #c17f42; }
.g4b-poker-wager.is-pending { opacity: .7; border-style: dashed; }

[data-collecting-wagers] .g4b-poker-controls {
    opacity: .58;
    pointer-events: none;
}

.g4b-poker-cards {
    display: flex;
    justify-content: center;
    gap: clamp(.24rem, 1.2vw, .6rem);
    margin-top: .5rem;
}

.g4b-poker-card {
    display: grid;
    width: clamp(2.1rem, 7vw, 3.45rem);
    place-content: center;
    aspect-ratio: 5 / 7;
    border: 1px solid #d0c8ba;
    border-radius: .42rem;
    background: linear-gradient(150deg, #fffefa, #eae5d9);
    box-shadow: 0 .22rem .3rem #102422a6;
    color: #182733;
    font-size: clamp(1rem, 2.4vw, 1.48rem);
    line-height: 1;
    text-align: center;
}

.g4b-poker-card.is-red {
    color: #aa2234;
}

.g4b-poker-card.is-empty {
    border-color: #7aaa97;
    border-style: dashed;
    background: #092d264f;
    box-shadow: none;
}

.g4b-poker-seat-cards {
    justify-content: flex-start;
    gap: .17rem;
    min-height: 2.3rem;
    margin-top: .25rem;
}

.g4b-poker-seat-cards .g4b-poker-card {
    width: 2rem;
    border-radius: .26rem;
    font-size: .84rem;
}

.g4b-poker-card.is-back {
    border: .12rem solid #eadab7;
    background:
        radial-gradient(circle, #daad6259 15%, transparent 16%) center / .42rem .42rem,
        repeating-linear-gradient(135deg, #d1a46834 0 1px, transparent 1px .29rem),
        #153545;
    box-shadow: inset 0 0 0 1px #0b212d, 0 .15rem .35rem #0a201c99;
}

.g4b-poker-back-logo {
    padding: .1rem .05rem;
    border-radius: .12rem;
    background: #0e2935;
    color: #f5f9fa;
    font-size: .45rem;
    font-weight: 800;
    letter-spacing: -.035em;
    white-space: nowrap;
}

.g4b-poker-back-logo b {
    padding: .015rem .08rem;
    border-radius: .1rem;
    background: #31d07a;
    color: #062316;
}

@container (max-width: 32.99rem) {
    .g4b-poker-seat.is-you {
        grid-column: 1 / -1;
        width: min(10rem, 100%);
        justify-self: center;
        order: 1;
    }
}

@container (min-width: 33rem) {
    .g4b-poker-felt {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: auto minmax(8.15rem, auto) auto;
        align-items: center;
        border-radius: 4.25rem;
    }

    .g4b-poker-seats { display: contents; }
    .g4b-poker-seat {
        grid-column: var(--poker-col) / span 2;
        grid-row: var(--poker-row);
        min-width: 0;
    }

    .g4b-poker-center {
        grid-column: 3 / -3;
        grid-row: 2;
    }
}

.g4b-poker-controls,
.g4b-poker-raise {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .5rem;
}

.g4b-poker-controls {
    margin-top: .9rem;
}

.g4b-poker-quick-actions {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    max-width: 100%;
}

.g4b-poker-commit-button {
    --commit-edge: #78e6b4;
    --commit-fill: #14533d;
    display: inline-grid;
    align-content: center;
    gap: .06rem;
    min-width: 5.4rem;
    min-height: 3.05rem;
    border-color: var(--commit-edge);
    background: linear-gradient(150deg, var(--commit-fill), #192a2c);
    color: #fff;
    text-align: center;
    transition: transform 160ms ease, filter 160ms ease;
    animation: g4b-poker-commit 1.35s ease-out 2;
}

.g4b-poker-all-in-button {
    --commit-edge: #ffbd77;
    --commit-fill: #773624;
    animation-delay: 120ms;
}

.g4b-poker-commit-button strong { font-size: .94rem; text-transform: uppercase; }
.g4b-poker-commit-button small { color: var(--commit-edge); font-size: .75rem; }
.g4b-poker-commit-button:hover:not(:disabled) {
    border-color: var(--commit-edge);
    filter: brightness(1.18);
    transform: translateY(-2px);
}
.g4b-poker-commit-button:active:not(:disabled) { transform: translateY(1px); }
.g4b-poker-commit-button:focus-visible { outline: 2px solid var(--commit-edge); outline-offset: 3px; }

@keyframes g4b-poker-commit {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    45% { box-shadow: 0 0 .9rem color-mix(in srgb, var(--commit-edge) 38%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .g4b-poker-commit-button { animation: none; transition: none; }
    .g4b-poker-commit-button:hover:not(:disabled),
    .g4b-poker-commit-button:active:not(:disabled) { transform: none; }
}

.g4b-poker-raise {
    align-items: center;
    padding: .3rem;
    border: 1px solid var(--play-line);
    border-radius: .75rem;
}

.g4b-poker-raise label {
    padding-left: .25rem;
    color: var(--play-muted);
    font-size: .83rem;
}

.g4b-poker-raise input {
    width: 7rem;
    min-height: 2.5rem;
    padding: .3rem .45rem;
    border: 1px solid #525c6b;
    border-radius: .45rem;
    background: var(--play-deep);
    color: var(--play-ink);
}

.g4b-poker-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: .28rem;
}

.g4b-poker-size,
.g4b-poker-filters button {
    padding: .4rem .63rem;
    border: 1px solid #425952;
    border-radius: .45rem;
    background: #172a29;
    color: #d9eadf;
    font-size: .83rem;
}

.g4b-poker-size:hover,
.g4b-poker-filters button:hover {
    border-color: #82c3a9;
}

.g4b-poker-last {
    margin-top: .9rem;
    padding: .7rem .9rem;
    border: 1px solid var(--play-line);
    border-radius: .65rem;
    color: var(--play-muted);
}

.g4b-poker-shown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .55rem;
    margin: .7rem 0 0;
    padding: 0;
    text-align: center;
    list-style: none;
}

.g4b-poker-shown .g4b-poker-card {
    width: 1.85rem;
    font-size: .9rem;
}

.g4b-poker-variant { color: #d9c393; font-size: .82rem; }

.g4b-games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

@media (min-width: 70rem) { .g4b-games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 42rem) { .g4b-games-grid { grid-template-columns: 1fr; } }

.g4b-game-tile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .85rem;
    align-items: center;
    min-height: 6.5rem;
    padding: 1rem;
    border: 1px solid #405249;
    border-radius: .9rem;
    background: linear-gradient(135deg, #1e362c, #192324);
    color: #edf7ef;
    text-decoration: none;
}

.g4b-game-tile:hover, .g4b-game-tile:focus-visible {
    border-color: #8dd4b3;
    color: #fff;
}

.g4b-game-tile strong, .g4b-game-tile small { display: block; }
.g4b-game-tile small { margin-top: .25rem; color: #c1d5c9; }
.g4b-game-tile-icon, .g4b-game-tile-arrow { color: #d8c28f; font-size: 1.65rem; line-height: 1; }
.g4b-game-tile-icon {
    display: grid;
    width: 2.8rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #526d59;
    border-radius: .55rem;
    background: #20392f;
}

.g4b-poker-lobby {
    --poker-line: #334740;
    color: #e9f3ee;
}

.g4b-poker-lobby-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 11rem;
    margin-bottom: 1.35rem;
    padding: clamp(1rem, 4vw, 2.2rem);
    overflow: hidden;
    border: 1px solid #6c8667;
    border-radius: 1rem;
    background: radial-gradient(ellipse at 90% 20%, #306a50, #163b30 55%, #102823);
}

.g4b-poker-lobby-hero h1 {
    margin: 0 0 .85rem;
    font-size: clamp(1.65rem, 5.6vw, 2.8rem);
    font-weight: 750;
}

.g4b-poker-hero-cards {
    display: flex;
    flex: 0 0 auto;
    margin: 0 clamp(0rem, 3vw, 2rem) 0 .2rem;
}

.g4b-poker-hero-cards span {
    display: grid;
    width: clamp(2.6rem, 10vw, 5.6rem);
    aspect-ratio: 5 / 7;
    align-content: center;
    text-align: center;
    border: 1px solid #d0c8ba;
    border-radius: .55rem;
    background: linear-gradient(145deg, #fffbf2, #e1d7c7);
    box-shadow: 0 .5rem 1.2rem #051b15aa;
    color: #212c30;
    font-size: clamp(1rem, 3vw, 2.25rem);
    line-height: 1.08;
    transform: rotate(var(--card-angle, -16deg));
    animation: g4b-poker-hero-deal 480ms ease-out both;
}

.g4b-poker-hero-cards span + span {
    --card-angle: 12deg;
    margin-left: -22%;
    color: #a52d3a;
    animation-delay: 100ms;
}

@keyframes g4b-poker-hero-deal {
    from { opacity: 0; transform: translateY(1.3rem) rotate(0); }
    to { opacity: 1; transform: rotate(var(--card-angle, -16deg)); }
}

.g4b-poker-list {
    overflow: hidden;
    border: 1px solid var(--poker-line);
    border-radius: .85rem;
    background: #141e1e;
}

.g4b-poker-list header,
.g4b-poker-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

.g4b-poker-list header {
    justify-content: space-between;
    gap: .75rem;
    padding: .95rem 1.05rem;
}

.g4b-poker-filters button[aria-pressed=true] {
    border-color: #80c6a8;
    background: #245440;
    color: #f3fff6;
}

.g4b-poker-filters select {
    width: auto;
    padding-block: .4rem;
    border-color: #425952;
    background-color: #172a29;
    font-size: .83rem;
}

.g4b-poker-list .table {
    --bs-table-bg: #172323;
    --bs-table-border-color: #30413a;
    --bs-table-hover-bg: #202f2b;
    white-space: nowrap;
}

.g4b-poker-list .table-responsive { position: relative; }
.g4b-poker-list .table small { display: block; color: #b6c6bf; font-weight: 400; }
.g4b-poker-list tbody th { display: flex; align-items: center; gap: .55rem; }
.g4b-poker-list tr[hidden] { display: none; }

.g4b-poker-suit {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid #526d59;
    border-radius: .45rem;
    background: #243c32;
    color: #d9c393;
}

.g4b-poker-empty { margin: 0; padding: 1.15rem; color: #bed1c8; }

.g4b-poker-dialog {
    width: min(41rem, calc(100% - 1.35rem));
    max-height: calc(100dvh - 1.35rem);
    padding: 0;
    border: 1px solid #547062;
    border-radius: .95rem;
    background: #152220;
    color: #edf7f1;
    box-shadow: 0 1.25rem 4rem #020e0bc4;
    color-scheme: dark;
}

.g4b-poker-dialog::backdrop { background: #050d0bca; backdrop-filter: blur(3px); }
.g4b-poker-dialog[open] { animation: g4b-poker-open 210ms ease-out both; }

@keyframes g4b-poker-open {
    from { opacity: 0; transform: translateY(.4rem); }
    to { opacity: 1; transform: none; }
}

.g4b-poker-dialog header,
.g4b-poker-dialog footer {
    position: sticky;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 1rem;
    background: #152220;
}

.g4b-poker-dialog header { top: 0; justify-content: space-between; border-bottom: 1px solid #334740; }
.g4b-poker-dialog footer { bottom: 0; justify-content: flex-end; border-top: 1px solid #334740; }
.g4b-poker-dialog-body { display: grid; gap: .9rem; padding: 1rem; }
.g4b-poker-dialog legend { margin-bottom: .42rem; font-size: .9rem; font-weight: 700; }

.g4b-cash-dialog { width: min(30rem, calc(100% - 1.35rem)); }
.g4b-cash-bust-note { color: #f2ca82; }
.g4b-cash-summary { display: grid; gap: .6rem; margin: 0; }
.g4b-cash-summary div { display: flex; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.g4b-cash-summary dt { font-weight: 500; color: #bed1c8; }
.g4b-cash-summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.g4b-cash-summary [data-tone="win"] { color: #88e5b0; }
.g4b-cash-summary [data-tone="loss"] { color: #ffa9a9; }
.g4b-cash-summary .g4b-cash-credit { border-top: 1px solid #334740; padding-top: .7rem; }

.g4b-poker-formats,
.g4b-poker-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: .48rem;
}

.g4b-poker-fields[hidden] { display: none; }

.g4b-poker-formats label {
    position: relative;
    display: grid;
    align-content: start;
    gap: .25rem;
    padding: .55rem .66rem;
    border: 1px solid #435750;
    border-radius: .55rem;
    background: #192c26;
    cursor: pointer;
}

.g4b-poker-formats label:has(:checked) { border-color: #88cea6; background: #244838; }
.g4b-poker-formats label:has(:focus-visible) { outline: 2px solid #abedc8; outline-offset: 2px; }
.g4b-poker-formats span { font-weight: 650; }
.g4b-poker-formats b { color: #d9c393; }
.g4b-poker-formats small, .g4b-poker-fields small { color: #bdcec6; font-size: .76rem; }
.g4b-poker-fields label { font-size: .88rem; }
.g4b-poker-fields .form-control, .g4b-poker-fields .form-select { margin-top: .2rem; }
.g4b-poker-field-note { color: #bdcec6; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
    .g4b-poker-hero-cards span, .g4b-poker-dialog[open], .g4b-poker-seat.is-winner { animation: none; }
}

/* Forza 4 */
.g4b-c4-stage {
    --c4-gap: clamp(.13rem, .8vw, .5rem);
    --c4-pad: clamp(.25rem, 1.2vw, .85rem);
    width: min(100%, calc(var(--cols) * 4.15rem + 2 * var(--c4-pad)));
    margin-inline: auto;
    padding: var(--c4-pad);
    border: 1px solid #474276;
    border-radius: clamp(.6rem, 2vw, 1.2rem);
    background: linear-gradient(152deg, #383063, #23244b 80%);
    box-shadow: inset 0 1px 0 #a095f540, 0 .6rem 0 -.28rem #211d3b;
}

.g4b-c4 {
    display: grid;
    grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr));
    gap: var(--c4-gap);
}

.g4b-c4-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--c4-gap);
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: .6rem;
    background: transparent;
    cursor: pointer;
}

.g4b-c4-col:disabled {
    cursor: default;
}

.g4b-c4-trigger {
    display: grid;
    width: 100%;
    min-height: 1.55rem;
    place-items: center;
    border-radius: .4rem;
    background: #19193596;
    color: #c9c4e4;
    font: 700 .74rem/1 ui-monospace, monospace;
}

.g4b-c4-col:not(:disabled) .g4b-c4-trigger {
    background: #56498b;
    color: #fff;
}

.g4b-c4-col:not(:disabled):is(:hover, :focus-visible) .g4b-c4-trigger {
    background: var(--play-accent);
    color: var(--play-accent-ink);
}

.g4b-c4-cell {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 50%;
    background: #15182d;
    box-shadow: inset 0 2px .25rem #080b1cbd, 0 1px 0 #ad9ee745;
}

.g4b-c4-cell.is-disc {
    background: radial-gradient(circle at 34% 23%, #ffffff80, transparent 56%), var(--g4b-seat-color);
    box-shadow: inset 0 0 0 2px #10132630, inset 0 -.2rem .2rem #10132657;
}

.g4b-c4-col:is(:hover, :focus-visible) .g4b-c4-cell.is-landing {
    background: color-mix(in srgb, var(--g4b-seat-color, var(--play-accent)) 65%, #15182d);
    box-shadow: inset 0 0 0 2px var(--g4b-seat-color, var(--play-accent));
}

.g4b-c4-cell.is-winning {
    box-shadow: inset 0 0 0 2px #fff, 0 0 .55rem var(--g4b-seat-color);
}

/* Battaglia navale */
.g4b-bs-placement {
    width: min(100%, 29rem);
    margin-inline: auto;
}

.g4b-bs-duel {
    display: grid;
    gap: .75rem;
}

.g4b-bs-panel {
    min-width: 0;
    padding: clamp(.45rem, 1.35vw, .9rem);
    border: 1px solid #284951;
    border-radius: .8rem;
    background: linear-gradient(155deg, #172d39, #111f2b);
}

.g4b-bs-target.is-armed {
    border-color: #60b5a9;
    box-shadow: inset 0 2px 0 #60b5a963;
}

.g4b-bs-panel h3 {
    margin: 0;
    font-size: clamp(.94rem, 1.6vw, 1.08rem);
    font-weight: 720;
}

.g4b-bs-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .15rem .65rem;
    margin-bottom: .45rem;
}

.g4b-bs-title span {
    color: var(--play-muted);
    font-size: .82rem;
}

.g4b-bs-options {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .55rem;
}

.g4b-bs-options .g4b-play-button {
    min-height: 2.3rem;
    padding: .32rem .6rem;
}

.g4b-bs-ship span {
    margin-right: .25rem;
}

.g4b-bs-submit {
    width: 100%;
    margin-top: .75rem;
}

.g4b-bs {
    display: grid;
    grid-template-columns: clamp(.85rem, 1.6vw, 1.25rem) repeat(var(--cols, 10), minmax(0, 1fr));
    gap: clamp(1px, .33vw, 4px);
}

.g4b-bs-head {
    display: grid;
    place-items: center;
    min-height: 1rem;
    color: #a7bec8;
    font: 650 clamp(.65rem, 1.1vw, .8rem)/1 ui-monospace, monospace;
}

.g4b-bs-cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 1px solid #2c505b;
    border-radius: clamp(.1rem, .38vw, .28rem);
    background: linear-gradient(145deg, #203e4c, #1b323f);
}

.g4b-bs-cell.is-clickable {
    cursor: crosshair;
}

.g4b-bs-cell.is-clickable:is(:hover, :focus-visible) {
    border-color: var(--play-accent);
    background: #37686d;
    outline-offset: 0;
}

.g4b-bs-cell.is-ship {
    border-color: #80bbc9;
    background: repeating-linear-gradient(135deg, #82becd 0 3px, #6ba9b9 3px 6px);
}

.g4b-bs-cell.is-miss {
    background: #172b38;
    color: #bdcfdb;
}

.g4b-bs-cell.is-miss::after {
    content: "";
    width: 26%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: currentColor;
}

.g4b-bs-cell.is-hit {
    border-color: #c3844e;
    background: #f3bb79;
    color: #332015;
}

.g4b-bs-cell.is-sunk {
    border-color: #c86472;
    background: #f78694;
    color: #38151c;
}

.g4b-bs-cell.is-hit::after {
    content: "";
    width: 31%;
    aspect-ratio: 1;
    border: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.g4b-bs-cell.is-sunk::after {
    content: "";
    width: 54%;
    aspect-ratio: 1;
    background: linear-gradient(45deg, transparent 42%, currentColor 43% 57%, transparent 58%),
        linear-gradient(-45deg, transparent 42%, currentColor 43% 57%, transparent 58%);
}

.g4b-bs-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    margin: .8rem 0 0;
    padding: 0;
    color: var(--play-muted);
    font-size: .84rem;
    list-style: none;
}

.g4b-bs-legend li {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.g4b-bs-legend .g4b-bs-cell {
    width: .9rem;
}

/* Conquista */
.g4b-cq {
    --cq-gold: #f0c46a;
    --cq-soft: #cdd6ea;
    display: grid;
    gap: .85rem;
}

.g4b-cq-toolbar {
    display: grid;
    gap: .65rem;
    padding: clamp(.65rem, 1.6vw, 1rem);
    border: 1px solid #4a3d28;
    border-radius: .9rem;
    background: linear-gradient(150deg, #241d13, #151a26 78%);
}

/* chi sta giocando, in quale fase e cosa deve fare */
.g4b-cq-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    padding: .55rem .7rem;
    border: 1px solid #2f3a4f;
    border-radius: .7rem;
    background: #10151f;
}

.g4b-cq[data-turn="mine"] .g4b-cq-banner {
    border-color: color-mix(in srgb, #8af0b6 45%, transparent);
    background: color-mix(in srgb, #8af0b6 9%, #10151f);
}

.g4b-cq[data-turn="end"] .g4b-cq-banner {
    border-color: color-mix(in srgb, var(--play-accent) 50%, transparent);
}

.g4b-cq-banner-seat {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.15rem;
    aspect-ratio: 1;
    border-radius: 50%;
    color: #101623;
    font-size: .95rem;
    font-weight: 820;
    box-shadow: 0 0 0 2px #0b0f17;
}

.g4b-cq-banner-text {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.g4b-cq-banner-title {
    margin: 0;
    font-size: .98rem;
    font-weight: 760;
}

.g4b-cq-banner-hint {
    margin: 0;
    color: var(--play-muted);
    font-size: .84rem;
}

.g4b-cq-banner-hint b {
    color: var(--cq-gold);
}

/* percorso Rinforzi -> Attacchi -> Movimento */
.g4b-cq-steps {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.g4b-cq-step-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 0 .45rem;
    padding: .45rem .55rem;
    border: 1px solid #2f3a4f;
    border-radius: .6rem;
    background: #121825;
    font-size: .78rem;
}

.g4b-cq-step-item b {
    grid-column: 2;
    color: var(--cq-soft);
    font-size: .84rem;
    font-weight: 720;
}

.g4b-cq-step-item small {
    grid-column: 2;
    color: var(--play-muted);
    font-size: .72rem;
}

.g4b-cq-step-dot {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 1.55rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #26314a;
    color: #d7dff0;
    font-size: .78rem;
    font-weight: 820;
}

.g4b-cq-step-item.is-done {
    border-color: #2f5f45;
    background: #12211c;
}

.g4b-cq-step-item.is-done .g4b-cq-step-dot {
    background: #2f7a52;
    color: #eafff0;
}

.g4b-cq-step-item.is-current {
    border-color: var(--cq-gold);
    background: color-mix(in srgb, var(--cq-gold) 12%, #121825);
}

.g4b-cq-step-item.is-current b {
    color: #fff5df;
}

.g4b-cq-step-item.is-current .g4b-cq-step-dot {
    background: var(--cq-gold);
    color: #241a05;
}

.g4b-cq-meters {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.2rem;
}

.g4b-cq-meter {
    display: grid;
    line-height: 1.12;
}

.g4b-cq-meter b {
    color: #f6dfae;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.g4b-cq-meter small {
    color: var(--play-muted);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.g4b-cq-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}

.g4b-cq-actions .g4b-play-button {
    min-height: 2.4rem;
    padding: .3rem .7rem;
    font-size: .86rem;
}

/* dado attivo evidenziato */
.g4b-cq-actions .g4b-play-button[aria-pressed="true"] {
    border-color: var(--cq-gold);
    background: color-mix(in srgb, var(--cq-gold) 24%, #1d2638);
    color: #fff6e2;
}

.g4b-cq-actions-label {
    color: var(--play-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.g4b-cq-actions-note {
    padding: .3rem .55rem;
    border: 1px dashed #4a3d28;
    border-radius: .5rem;
    color: var(--cq-gold);
    font-size: .8rem;
}

.g4b-cq-hint {
    margin: 0;
    color: var(--cq-soft);
    font-size: .85rem;
    line-height: 1.45;
}

.g4b-cq-hint b {
    color: var(--cq-gold);
}

.g4b-cq-move-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.2rem;
    padding: .25rem .4rem;
    border: 1px solid #4a3d28;
    border-radius: .5rem;
    color: #f6dfae;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}

/* esito dell'ultimo scontro: dadi, perdite, conquista */
.g4b-cq-battle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .6rem;
    padding: .5rem .7rem;
    border: 1px solid #4a3d28;
    border-radius: .7rem;
    background: #171b24;
}

.g4b-cq-battle.is-conquered {
    border-color: #8a6a2a;
    background: linear-gradient(120deg, #241d13, #171b24 70%);
}

.g4b-cq-battle-title {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 700;
}

.g4b-cq-battle-seat {
    display: grid;
    place-items: center;
    width: 1.35rem;
    aspect-ratio: 1;
    border-radius: 50%;
    color: #101623;
    font-size: .74rem;
    font-weight: 820;
}

.g4b-cq-dice {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.g4b-cq-die {
    display: grid;
    place-items: center;
    width: 1.6rem;
    aspect-ratio: 1;
    border-radius: .35rem;
    background: #2b3448;
    font: 750 .85rem/1 ui-monospace, monospace;
    animation: g4b-cq-roll .25s ease-out;
}

.g4b-cq-dice-attacker .g4b-cq-die {
    background: #4f7a4b;
    color: #eafff0;
}

.g4b-cq-dice-defender .g4b-cq-die {
    background: #7a4343;
    color: #ffecec;
}

.g4b-cq-vs {
    color: var(--play-muted);
    font-size: .8rem;
    text-transform: uppercase;
}

.g4b-cq-battle-note {
    margin-left: auto;
    color: #f6dfae;
    font-size: .85rem;
}

@keyframes g4b-cq-roll {
    from { transform: translateY(-.25rem) scale(.9); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.g4b-cq-stage {
    display: grid;
    align-items: start;
    gap: .75rem;
}

.g4b-cq-boardwrap {
    padding: .3rem;
    border: 1px solid #2b354b;
    border-radius: .9rem;
    background: radial-gradient(circle at 30% 15%, #1b2434, #0c111a 78%);
    overflow: hidden;
}

.g4b-cq-map {
    display: block;
    width: 100%;
    height: auto;
    /* Il tabellone non e' testo: evita selezione/trascinamento accidentale. */
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* linee di adiacenza e anelli di selezione: decorativi, mai bersagli */
.g4b-cq-links,
.g4b-cq-halos {
    pointer-events: none;
}

.g4b-cq-link {
    stroke-width: .05;
    stroke-linecap: round;
    stroke-dasharray: .14 .12;
    stroke-opacity: .9;
}

.g4b-cq-link.is-enemy { stroke: #ff8f93; }
.g4b-cq-link.is-own { stroke: #8af0b6; }
.g4b-cq-link.is-muted { stroke: #6c7688; stroke-opacity: .55; }

.g4b-cq-halo {
    fill: none;
    stroke-width: .07;
    stroke-linecap: round;
    stroke-dasharray: .15 .13;
}

.g4b-cq-halo.is-selected { stroke: #ffe6ae; }
.g4b-cq-halo.is-target { stroke: #ff9a9d; }
.g4b-cq-halo.is-destination { stroke: #8af0b6; }

.g4b-cq-territory {
    cursor: pointer;
}

/* il bordo segue il colore del continente: la mappa resta leggibile */
.g4b-cq-territory polygon {
    fill: #223046;
    stroke: var(--cq-continent, #0c1320);
    stroke-width: .09;
    stroke-linejoin: round;
    transition: fill .12s ease, stroke .12s ease;
}

.g4b-cq-territory.is-seat-1 polygon { fill: #274f8f; }
.g4b-cq-territory.is-seat-2 polygon { fill: #8a6720; }
.g4b-cq-territory.is-seat-3 polygon { fill: #8a3b49; }
.g4b-cq-territory.is-seat-4 polygon { fill: #4f3b85; }

/* I territori propri usano la tonalita' piena del posto, ma senza
   `filter: brightness()`: un filtro CSS su un figlio SVG crea una superficie
   raster offscreen che su GPU puo' lasciare tile sporche (macchie enormi)
   sopra il tabellone. */
.g4b-cq-territory.is-mine.is-seat-1 polygon { fill: #3d8bfd; }
.g4b-cq-territory.is-mine.is-seat-2 polygon { fill: #d9a53c; }
.g4b-cq-territory.is-mine.is-seat-3 polygon { fill: #c65a6d; }
.g4b-cq-territory.is-mine.is-seat-4 polygon { fill: #7f64c8; }

/* 1 armata = solo difesa; i territori lontani dalla selezione si attenuano
   (fill-opacity agisce solo sul colore, nessun livello di compositing) */
.g4b-cq-territory.is-weak polygon { fill-opacity: .62; }
.g4b-cq-territory.is-dim polygon { fill-opacity: .38; stroke-opacity: .5; }

.g4b-cq-territory.is-placeable polygon {
    stroke: #f0c46a;
    stroke-width: .06;
}

.g4b-cq-territory.is-attacker polygon {
    stroke: #8af0b6;
    stroke-width: .055;
}

.g4b-cq-territory.is-neighbour polygon {
    stroke: #cbd6ff;
    stroke-width: .05;
}

.g4b-cq-territory.is-target polygon {
    stroke: #ff9a9d;
    stroke-width: .085;
}

/* nella fase di movimento la destinazione e' alleata: verde, non rossa */
.g4b-cq-territory.is-destination polygon {
    stroke: #8af0b6;
    stroke-width: .085;
}

.g4b-cq-territory.is-selected polygon {
    stroke: #ffe6ae;
    stroke-width: .13;
}

.g4b-cq-territory:is(:hover, :focus-visible) polygon {
    stroke: #ffffff;
    stroke-width: .09;
}

.g4b-cq-territory:focus,
.g4b-cq-territory:focus-visible {
    /* Il territorio selezionato ha gia' il bordo dedicato: nessun anello di
       focus del browser (su alcuni browser viene disegnato enorme sull'SVG). */
    outline: none;
}

.g4b-cq-name {
    fill: #f7faff;
    stroke: #0b1220;
    stroke-width: .028;
    paint-order: stroke;
    font-size: .25px;
    font-weight: 750;
    letter-spacing: .004px;
    text-anchor: middle;
    pointer-events: none;
}

.g4b-cq-troops {
    fill: #0b1220;
    fill-opacity: .8;
    stroke: #ffffff33;
    stroke-width: .025;
    /* Il badge non e' un bersaglio: il click resta sul territorio. */
    pointer-events: none;
}

.g4b-cq-count {
    fill: #ffffff;
    stroke: #0b1220;
    stroke-width: .035;
    paint-order: stroke;
    font-size: .38px;
    font-weight: 800;
    text-anchor: middle;
    pointer-events: none;
}

/* colonna laterale con continenti e legenda */
.g4b-cq-side {
    display: grid;
    gap: .6rem;
}

.g4b-cq-side-card {
    padding: .6rem .7rem;
    border: 1px solid #2b354b;
    border-radius: .8rem;
    background: #121826;
}

.g4b-cq-side-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .4rem;
    margin: 0 0 .45rem;
    color: var(--play-muted);
    font-size: .74rem;
    font-weight: 720;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.g4b-cq-side-title small {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: none;
}

.g4b-cq-continents {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .82rem;
}

.g4b-cq-continent {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: .12rem .45rem;
}

.g4b-cq-continent-name {
    font-weight: 660;
}

.g4b-cq-continent-name small {
    display: block;

    color: var(--play-muted);
    font-size: .72rem;
    font-weight: 500;
}

.g4b-cq-continent-bonus {
    color: #f6dfae;
    font-size: .78rem;
    font-weight: 720;
}

.g4b-cq-continent-bar {
    grid-column: 2 / -1;
    height: .32rem;
    border-radius: .2rem;
    background: #1f2735;
    overflow: hidden;
}

.g4b-cq-continent-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--cq-swatch, #6f8fd0);
}

.g4b-cq-continent.is-complete .g4b-cq-continent-name small {
    color: #f6dfae;
    font-weight: 700;
}

.g4b-cq-swatch {
    flex: 0 0 auto;
    width: .85rem;
    height: .85rem;
    border-radius: .22rem;
    background: var(--cq-swatch, #666);
}

.g4b-cq-legend {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    color: var(--play-muted);
    font-size: .8rem;
    list-style: none;
}

.g4b-cq-legend li {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.g4b-cq-chip {
    flex: 0 0 auto;
    width: .85rem;
    aspect-ratio: 1;
    border: 1px solid #ffffff2e;
    border-radius: .22rem;
    background: #223046;
}

.g4b-cq-chip.is-mine {
    background: var(--g4b-seat-color, #223046);
}

.g4b-cq-chip.is-attacker {
    background: #12301f;
    box-shadow: inset 0 0 0 2px #8af0b6;
}

.g4b-cq-chip.is-target {
    background: #2b1416;
    box-shadow: inset 0 0 0 2px #ff9a9d;
}

.g4b-cq-chip.is-selected {
    background: #2b220d;
    box-shadow: inset 0 0 0 2px #ffe6ae;
}

.g4b-cq-chip.is-weak {
    background: #223046;
    box-shadow: inset 0 0 0 2px #6c7688;
}

.g4b-cq-chip.is-placeable {
    background: #2b220d;
    box-shadow: inset 0 0 0 2px #f0c46a;
}

.g4b-cq-chip.is-destination {
    background: #0f2a1f;
    box-shadow: inset 0 0 0 2px #8af0b6;
}

/* il tabellone resta grande: la colonna laterale compare solo con spazio */
@media (min-width: 62rem) {
    .g4b-cq-stage {
        grid-template-columns: minmax(0, 1fr) 16rem;
    }
}

@media (max-width: 32rem) {
    .g4b-cq-steps {
        grid-auto-flow: row;
    }
}

/* badge dei giocatori (condivisi con la sidebar) */
.g4b-play-player.is-you {
    border-color: #3f5f9a;
}

.g4b-play-player.is-out {
    opacity: .6;
}

.g4b-play-player-status.is-turn {
    color: #a7f2c8;
    font-weight: 700;
}

.g4b-play-player-status.is-reserve {
    color: #f6dfae;
}

.g4b-play-player-status.is-out {
    color: #ff9a9d;
}

/* i badge ("In turno", "+12 in riserva") restano su una riga */
.g4b-play-player-status {
    white-space: nowrap;
}

@media (min-width: 48rem) {
    .g4b-bs-duel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 47.98rem) {
    .g4b-bs-duel .g4b-bs-target {
        order: -1;
    }
}

@media (min-width: 62rem) {
    .g4b-play-layout {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 25%);
    }
}

@media (max-width: 47.98rem) {
    .g4b-play-hero {
        flex-wrap: wrap;
    }

    .g4b-play-identity {
        flex-basis: 100%;
    }

    .g4b-play-stats {
        margin-right: auto;
    }
}

@media (max-width: 25rem) {
    .g4b-play-phase {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .g4b-play-phase-icon {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .g4b-play-phase[data-tone="you"] .g4b-play-phase-icon,
    .g4b-result-dialog[open] {
        animation: none;
    }
}

/* --- Lobby: scelta del tavolo e creazione del pool ---------------------- */

.g4b-pool-card {
    transition: border-color .15s ease;
}

.g4b-pool-card:hover,
.g4b-pool-card:focus-within {
    border-color: rgba(49, 208, 122, .45);
}

.g4b-pool-seats {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: .35rem;
}

.g4b-pool-seat {
    width: .85rem;
    height: .85rem;
    border: 1px solid #55607a;
    border-radius: 50%;
}

.g4b-pool-seat.is-taken {
    border-color: transparent;
}

.g4b-pool-seats-label {
    margin-left: .35rem;
    color: #a7b0c6;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.g4b-pool-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin: 0;
}

.g4b-pool-figures div {
    min-width: 0;
}

.g4b-pool-figures dt {
    color: #a7b0c6;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.g4b-pool-figures dd {
    margin: 0;
    font-size: .92rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* Modali condivisi da lobby pubblica e privata. */
.g4b-modal .modal-content {
    border: 1px solid #2b354b;
    background: #151c2b;
}

.g4b-modal-kicker {
    color: #a7b0c6;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.g4b-wizard {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
}

.g4b-wizard li {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: #7c869c;
    font-size: .82rem;
    font-weight: 650;
}

.g4b-wizard li + li::before {
    content: "";
    width: 1.2rem;
    height: 1px;
    margin-right: .15rem;
    background: #3a465e;
}

.g4b-wizard-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #3a465e;
    border-radius: 50%;
    font-size: .78rem;
}

.g4b-wizard li.is-current {
    color: #f3f3fc;
}

.g4b-wizard li.is-current .g4b-wizard-dot {
    border-color: var(--g4b-accent);
    background: rgba(49, 208, 122, .16);
    color: var(--g4b-accent);
}

.g4b-wizard li.is-done {
    color: #cfd6e6;
}

.g4b-wizard li.is-done .g4b-wizard-dot {
    border-color: #3f8f68;
    color: #6fe3a5;
}

.g4b-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .6rem;
}

.g4b-pick {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    height: 100%;
    margin: 0;
    padding: .8rem .85rem;
    border: 1px solid #2f3a51;
    border-radius: .8rem;
    background: #121a28;
    cursor: pointer;
}

.g4b-pick:hover {
    border-color: #46536e;
}

.g4b-pick-art {
    display: inline-flex;
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    padding: .35rem;
    border-radius: .6rem;
    background: #1c2433;
    color: #8af0b6;
}

.g4b-pick-art svg {
    width: 100%;
    height: 100%;
}

.g4b-pick-body {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.g4b-pick-name {
    font-weight: 700;
}

.g4b-pick-meta {
    color: #a7b0c6;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}

.g4b-pick-tagline {
    color: #7c869c;
    font-size: .78rem;
}

.g4b-pick-compact {
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    text-align: center;
}

.btn-check:checked + .g4b-pick {
    border-color: var(--g4b-accent);
    background: rgba(49, 208, 122, .1);
    box-shadow: inset 0 0 0 1px rgba(49, 208, 122, .35);
}

.btn-check:focus-visible + .g4b-pick {
    outline: 2px solid #8af0b6;
    outline-offset: 2px;
}

.g4b-field + .g4b-field {
    margin-top: .9rem;
}

.g4b-field-error {
    margin-top: .4rem;
    color: #ffb3b5;
    font-size: .82rem;
}

.g4b-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-top: .5rem;
}

.g4b-chip {
    min-width: 2.6rem;
    padding: .25rem .55rem;
    border: 1px solid #3a465e;
    border-radius: 999px;
    background: #1a2231;
    color: #dfe5f2;
    font-size: .82rem;
    font-weight: 650;
}

.g4b-chip:hover {
    border-color: var(--g4b-accent);
    color: #8af0b6;
}

.g4b-chips-label {
    color: #7c869c;
    font-size: .76rem;
}

.g4b-modal [data-fixed-pool][hidden],
.g4b-modal [data-cash-pool][hidden] {
    display: none !important;
}

.g4b-mini-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin-top: 1rem;
    padding: .7rem .8rem;
    border: 1px dashed #33405a;
    border-radius: .7rem;
    background: rgba(19, 26, 38, .7);
}

.g4b-mini-summary small {
    display: block;
    color: #93a0b8;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.g4b-mini-summary b {
    font-variant-numeric: tabular-nums;
}

.g4b-summary {
    margin: 0 0 .8rem;
    padding: 0;
}

.g4b-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem .1rem;
    border-bottom: 1px solid #232c3e;
}

.g4b-summary dt {
    color: #9aa6bd;
    font-size: .85rem;
    font-weight: 600;
}

.g4b-summary dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.g4b-summary dd.is-negative {
    color: #ff9a9d;
}

.g4b-note {
    color: #8d97ad;
    font-size: .82rem;
}

.g4b-join-headline {
    font-weight: 650;
}

.g4b-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: space-between;
}

.g4b-footer-actions {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

@media (max-width: 30rem) {
    .g4b-pick-grid,
    .g4b-pool-figures,
    .g4b-mini-summary {
        grid-template-columns: 1fr;
    }

    .g4b-wizard li {
        font-size: .76rem;
    }

    .g4b-wizard li + li::before {
        width: .6rem;
    }

    .g4b-modal-footer {
        flex-direction: column-reverse;
    }

    .g4b-modal-footer > .btn,
    .g4b-footer-actions {
        width: 100%;
    }

    .g4b-footer-actions .btn {
        flex: 1 1 auto;
    }
}
/* --- Grafica condivisa: header, selettore lingua, footer ----------------- */
/* I token duplicano quelli in cima al file: qui servono anche alle pagine
   pubbliche che non caricano il tema "play". */

:root {
    --g4b-accent: #31d07a;
    --g4b-accent-ink: #04170d;
    --g4b-surface: #131a28;
    --g4b-surface-2: #0f1522;
    --g4b-line: rgba(255, 255, 255, .09);
    --g4b-muted: #9aa6bd;
}

.g4b-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid var(--g4b-line);
    background: color-mix(in srgb, #0b1220 88%, transparent);
    backdrop-filter: blur(14px);
}

.g4b-nav {
    padding-block: .5rem;
}

.g4b-brand {
    display: inline-flex;
    align-items: center;
    gap: .08em;
    color: #f4f7fb;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -.025em;
    text-decoration: none;
}

.g4b-brand:hover,
.g4b-brand:focus-visible {
    color: #fff;
}

.g4b-brand-mark {
    padding: 0 .24em;
    border-radius: .35rem;
    background: linear-gradient(135deg, #4ee49a, #1fae63);
    box-shadow: 0 8px 20px -10px var(--g4b-accent);
    color: var(--g4b-accent-ink);
}

.g4b-nav-list {
    gap: .15rem;
}

.g4b-nav-link {
    position: relative;
    padding: .45rem .7rem;
    border-radius: .55rem;
    color: #c3cbdb;
    font-size: .92rem;
    font-weight: 600;
}

.g4b-nav-link:hover,
.g4b-nav-link:focus-visible {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.g4b-nav-link.is-active {
    background: color-mix(in srgb, var(--g4b-accent) 16%, transparent);
    color: #fff;
}

.g4b-nav-link.is-active:not(.dropdown-toggle)::after,
.g4b-nav-link.is-active.dropdown-toggle::before {
    content: "";
    position: absolute;
    right: .7rem;
    bottom: .12rem;
    left: .7rem;
    height: 2px;
    border-radius: 2px;
    background: var(--g4b-accent);
}

.g4b-nav-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .85rem;
}

@media (min-width: 62rem) {
    .g4b-nav-tools {
        margin-top: 0;
        margin-left: 1rem;
    }
}

.g4b-lang {
    display: inline-flex;
    padding: .15rem;
    border: 1px solid var(--g4b-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .03);
}

.g4b-lang-link {
    padding: .2rem .55rem;
    border-radius: 999px;
    color: #a9b4c8;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-decoration: none;
}

.g4b-lang-link:hover,
.g4b-lang-link:focus-visible {
    color: #fff;
}

.g4b-lang-link.is-active {
    background: var(--g4b-accent);
    color: var(--g4b-accent-ink);
}

.g4b-env {
    border: 1px solid var(--g4b-line);
    background: transparent;
    color: var(--g4b-muted);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.g4b-user {
    padding: .2rem .5rem;
    border: 1px solid var(--g4b-line);
    border-radius: .45rem;
    background: rgba(255, 255, 255, .03);
    color: #c3cbdb;
    font-family: var(--bs-font-monospace);
    font-size: .78rem;
}

.g4b-main {
    padding-top: 1.35rem;
}

.g4b-footer {
    margin-top: 2.5rem;
    border-top: 1px solid var(--g4b-line);
    background: var(--g4b-surface-2);
    color: var(--g4b-muted);
    font-size: .82rem;
}

.g4b-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1rem;
    padding-block: 1.1rem;
}

.g4b-footer-brand {
    color: #e7ecf5;
    font-weight: 800;
    letter-spacing: -.02em;
}

.g4b-footer a {
    text-decoration: none;
}

.g4b-footer a:hover,
.g4b-footer a:focus-visible {
    color: #fff;
}

.g4b-admin-close-dialog {
    box-sizing: border-box;
    width: min(28rem, calc(100vw - 2rem));
}

.g4b-admin-close-dialog::backdrop {
    background: rgb(0 0 0 / 65%);
}

/* --- Notifiche toast (basso a destra, auto-dissolvenza) ------------------- */
/* Il TTL arriva da `ui.js` in `--g4b-toast-ttl`: la barra in basso e' la
   stessa durata del timer, quindi si vede quanto manca alla chiusura. */

.g4b-toasts {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

.g4b-toast {
    --g4b-toast-accent: #3d8bfd;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: .6rem;
    padding: .75rem .8rem 1rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--g4b-toast-accent) 45%, transparent);
    border-radius: .75rem;
    background: linear-gradient(180deg, #182131, #121a27);
    box-shadow: 0 18px 38px -18px rgba(0, 0, 0, .85);
    color: #eaf0f8;
    font-size: .9rem;
    opacity: 0;
    transform: translate3d(0, .75rem, 0);
    transition: opacity .28s ease, transform .28s ease;
    pointer-events: auto;
}

.g4b-toast.is-visible {
    opacity: 1;
    transform: none;
}

.g4b-toast.is-leaving {
    opacity: 0;
    transform: translate3d(1rem, 0, 0);
}

.g4b-toast-icon {
    display: grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: .45rem;
    background: color-mix(in srgb, var(--g4b-toast-accent) 22%, transparent);
    color: var(--g4b-toast-accent);
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
}

.g4b-toast-text {
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.g4b-toast-close {
    margin: -.2rem -.2rem 0 0;
    padding: .05rem .35rem;
    border: 0;
    border-radius: .4rem;
    background: transparent;
    color: #93a0b7;
    font-size: 1.15rem;
    line-height: 1.2;
}

.g4b-toast-close:hover,
.g4b-toast-close:focus-visible {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.g4b-toast-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--g4b-toast-accent);
    transform-origin: left center;
    animation: g4b-toast-countdown var(--g4b-toast-ttl, 6s) linear forwards;
}

/* mouse o focus sopra la notifica: timer e barra in pausa */
.g4b-toast.is-paused .g4b-toast-bar {
    animation-play-state: paused;
}

.g4b-toast-success {
    --g4b-toast-accent: #31d07a;
}

.g4b-toast-info {
    --g4b-toast-accent: #3d8bfd;
}

.g4b-toast-warning {
    --g4b-toast-accent: #f4b942;
}

.g4b-toast-danger {
    --g4b-toast-accent: #ff6b74;
}

@keyframes g4b-toast-countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 30rem) {
    .g4b-toasts {
        right: .75rem;
        bottom: .75rem;
        left: .75rem;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .g4b-toast {
        transform: none;
        transition: none;
    }

    .g4b-toast-bar {
        animation: none;
        opacity: .4;
    }
}

/* --- Scommesse personalizzate (`custom`) ---------------------------------- */
.g4b-game-tile-custom {
    border-color: #6b5a86;
    background: linear-gradient(135deg, #2a2138, #1b1a26);
}

.g4b-custom-card {
    border-color: #3b3350;
}

.g4b-custom-card:hover,
.g4b-custom-card:focus-within {
    border-color: rgba(167, 132, 255, .5);
}

.g4b-custom-card .g4b-pool-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: .65rem;
}

.g4b-custom-pill {
    display: grid;
    width: 2rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #5d4b82;
    border-radius: .5rem;
    background: #2a2338;
    color: #d3c2ff;
    font-size: 1rem;
    line-height: 1;
}

.g4b-custom-question {
    margin: 0;
    font-size: clamp(1.2rem, 2.4vw, 1.7rem);
    line-height: 1.25;
}

.g4b-custom-rules {
    word-break: break-word;
}

.g4b-custom-side {
    display: inline-block;
    min-width: 2.2rem;
    padding: .1rem .45rem;
    border-radius: .4rem;
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
}

.g4b-custom-side.is-yes {
    background: rgba(49, 208, 122, .18);
    color: #7ff0b0;
}

.g4b-custom-side.is-no {
    background: rgba(255, 122, 122, .18);
    color: #ffa3a3;
}

.g4b-custom-compose > summary {
    cursor: pointer;
    list-style: none;
}

.g4b-custom-compose > summary::-webkit-details-marker {
    display: none;
}

.g4b-custom-compose[open] > summary {
    border-bottom: 1px solid #2b354b;
}

/* --- Hold'em: lobby, sit-out, tavolo ------------------------------------- */
.g4b-poker-row-sitout {
    background: #2a2415;
    box-shadow: inset 0 0 0 1px #e0b44b80;
}

.g4b-poker-row-sitout > * {
    background: transparent;
}

.g4b-poker-seat.is-sit-out {
    border-color: #b58a2f;
    background: #2b2516;
}

.g4b-poker-seat.is-sit-out > strong::after {
    content: " · sit out";
    color: #f0c86a;
    font-size: .72rem;
}

/* il posto del giocatore locale e' piu' grande: piu' informazioni e carte */
.g4b-poker-seat.is-you {
    padding: .55rem .7rem;
    border-width: 2px;
    font-size: .95rem;
    row-gap: .2rem;
    box-shadow: inset 0 0 0 1px #2f8a72, 0 .5rem 1.2rem #06141399;
}

.g4b-poker-seat.is-you .g4b-poker-seat-cards .g4b-poker-card {
    width: clamp(2.6rem, 9vw, 3.6rem);
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    border-radius: .38rem;
}

.g4b-poker-seat.is-you .g4b-poker-own-stack {
    min-height: 3rem;
}

/* logo di traverso sulla costa delle carte coperte, senza sbordare */
.g4b-poker-card.is-back {
    position: relative;
    overflow: hidden;
}

.g4b-poker-back-logo {
    max-width: 145%;
    overflow: hidden;
    transform: rotate(-32deg) scale(.95);
    transform-origin: center;
    white-space: nowrap;
    pointer-events: none;
}

/* fiches: taglio, rilievo e colore per denominazione */
.g4b-poker-chip-pile i {
    width: 1.15rem;
    height: .5rem;
    margin-top: -.3rem;
    border: 1px solid #10221c;
    border-bottom-width: 3px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 42%, #ffffff59 0 12%, transparent 13%),
        radial-gradient(ellipse at 50% 45%, #f7f7f7 0 26%, transparent 27%),
        repeating-conic-gradient(#f4f4f0 0deg 22.5deg, var(--chip-color) 22.5deg 45deg);
    box-shadow: 0 2px 3px #07120f8c, inset 0 1px 0 #ffffff40;
}

.g4b-poker-chip-pile:nth-child(1) i {
    --chip-color: #1d8a5c;
}

.g4b-poker-chip-pile:nth-child(2) i {
    --chip-color: #1f5f96;
}

.g4b-poker-chip-pile:nth-child(3) i {
    --chip-color: #b06a2c;
}

.g4b-play-button.is-muted {
    opacity: .62;
}

/* Texas Hold'em — tavolo in mogano, pelle scura e panno smeraldo. */
.g4b-play[data-game="holdem"] {
    --play-accent: #f4d277;
    --play-line: #b18b493f;
}

.g4b-play[data-game="holdem"] :is(.g4b-play-hero, .g4b-play-arena, .g4b-play-panel) {
    background: radial-gradient(ellipse at top, #1d222c, #0c0e14 78%);
}

.g4b-play[data-game="holdem"] .g4b-play-hero h1 {
    color: #f4d277;
    font-family: Georgia, serif;
    letter-spacing: .035em;
}

.g4b-play[data-game="holdem"] .g4b-play-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: .55rem .9rem;
    padding: .65rem .9rem;
    background: #0a0e17;
}

.g4b-play[data-game="holdem"] .g4b-play-emblem {
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    border: 1px solid #c79845;
    border-radius: .7rem;
    background: #0d1320;
    box-shadow: 0 3px 12px #ba851833;
}
.g4b-play[data-game="holdem"] .g4b-play-emblem span::after { color: #f3ca67; }
.g4b-play[data-game="holdem"] .g4b-play-identity { gap: .55rem; }
.g4b-poker-hud-title { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.g4b-play[data-game="holdem"] .g4b-poker-hud-title h1 { margin: 0; font-size: clamp(.87rem, 2vw, 1.1rem); text-transform: uppercase; }
.g4b-poker-hud-title .g4b-poker-variant {
    border: 1px solid #306b58;
    border-radius: 2rem;
    padding: .1rem .4rem;
    color: #92e4b8;
    background: #102d27;
    font-size: .65rem;
    font-weight: 700;
}
.g4b-play[data-game="holdem"] .g4b-play-kicker { margin: .15rem 0 0; font-size: .66rem; }
.g4b-poker-hud-blinds {
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: .48rem;
    padding: .32rem .65rem;
    border: 1px solid #b5975e62;
    border-radius: 2rem;
    background: #171d29;
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.g4b-poker-hud-blinds > strong { color: #f4d277; }
#play-hud-blind-clock { border-inline-start: 1px solid #526071; padding-inline-start: .5rem; color: #95e5b8; }
#play-hud-blind-clock.is-due { color: #f4d277; }
.g4b-poker-hud-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .3rem; }
.g4b-poker-hud-actions .g4b-play-button { margin: 0; min-height: 2rem; padding: .22rem .5rem; font-size: .73rem; }
.g4b-play[data-game="holdem"] .g4b-play-sidebar .g4b-play-stats { margin: 0; }
@media (max-width: 48rem) {
    .g4b-play[data-game="holdem"] .g4b-play-hero { grid-template-columns: minmax(0, 1fr) auto; }
    .g4b-poker-hud-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.g4b-play[data-game="holdem"] .g4b-poker-felt {
    isolation: isolate;
    padding: clamp(.95rem, 3.5cqi, 2.2rem);
    border-color: #ad8251;
    background: linear-gradient(145deg, #46271a, #26140e 50%, #120907);
    box-shadow: 0 .95rem 2.2rem #0009, inset 0 2px 4px #f7cf9455;
}

.g4b-poker-felt::before,
.g4b-poker-felt::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
}

.g4b-poker-felt::before {
    z-index: -2;
    inset: .35rem;
    border: 1px solid #c8a3605c;
    background: linear-gradient(#252930, #101217);
    box-shadow: inset 0 3px 8px #ffffff15, inset 0 -5px 12px #000c;
}

.g4b-poker-felt::after {
    z-index: -1;
    inset: .77rem;
    border: 1px solid #b7965488;
    background: radial-gradient(circle, #ffffff14 .55px, transparent .8px) 0 0 / 4px 4px,
        radial-gradient(ellipse at 50% 42%, #166449, #0b3b2d 63%, #052219);
    box-shadow: inset 0 0 2.6rem #000b, inset 0 0 0 .38rem #05291d, inset 0 0 0 .44rem #b795534d;
}

.g4b-poker-watermark {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: max-content;
    height: max-content;
    margin: auto;
    color: #f4d78820;
    font: 700 clamp(2.1rem, 6cqi, 4.5rem)/1 Georgia, serif;
    letter-spacing: .13em;
    text-transform: uppercase;
    text-align: center;
    pointer-events: none;
}

.g4b-poker-watermark small { display: block; margin-top: .3rem; font-size: .34em; }
.g4b-poker-felt :is(.g4b-poker-center, .g4b-poker-seat) { position: relative; z-index: 1; }
.g4b-poker-center .g4b-poker-street {
    width: fit-content;
    margin: .55rem auto 0;
    padding: .18rem .55rem;
    border-radius: 2rem;
    background: #061a14c9;
    color: #cee7da;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.g4b-poker-center .g4b-poker-pot {
    border-radius: 2rem;
    background: #0c1018f2;
    color: #f6d674;
    box-shadow: 0 .22rem .55rem #0006;
}

.g4b-poker-board { display: flex; align-items: center; justify-content: center; gap: clamp(.25rem, 1.1cqi, .65rem); }
.g4b-poker-deck {
    display: grid;
    flex: 0 0 auto;
    margin: .5rem .16rem 0 0;
}
.g4b-poker-board .g4b-poker-card { width: clamp(1.25rem, 7.6cqi, 3.45rem); }
.g4b-poker-deck .g4b-poker-card { grid-area: 1 / 1; }
.g4b-poker-deck .g4b-poker-card:nth-child(1) { translate: 4px 4px; }
.g4b-poker-deck .g4b-poker-card:nth-child(2) { translate: 2px 2px; }

.g4b-poker-board .g4b-poker-card:not(.is-empty) {
    box-shadow: 0 .28rem .55rem #0009, inset 0 0 0 1px #fff;
}
.g4b-poker-board .g4b-poker-card:not(.is-back) span { font-size: 1.22em; }
.g4b-poker-seat {
    background: linear-gradient(150deg, #1d2230, #0b0f16);
    border-color: #a1824b82;
    border-radius: .75rem;
    box-shadow: 0 .3rem .75rem #0007;
}
.g4b-poker-seat.is-you { border-color: #84ceac; }
.g4b-poker-seat.is-current {
    border-color: #f1cd75;
    box-shadow: 0 0 0 1px #f1cd755a, 0 0 1.2rem #efc56f58;
}
.g4b-poker-seat.is-winner { border-color: #f4d277; }
.g4b-poker-card.is-back {
    border-color: #e9d19a;
    background: repeating-linear-gradient(45deg, #ac8b4530 0 1px, transparent 1px 5px),
        linear-gradient(135deg, #292747, #101725);
}

.g4b-poker-controls {
    padding: .62rem;
    border: 1px solid #a1824b64;
    border-radius: .85rem;
    background: linear-gradient(160deg, #20232d, #0e1118);
    align-items: center;
}
.g4b-poker-controls button[data-act="poker-fold"] { border-color: #a6535f; background: linear-gradient(#732934, #411721); }
.g4b-poker-controls button[data-act="poker-check"] { border-color: #68af8e; background: linear-gradient(#24664d, #134536); }
.g4b-poker-controls .g4b-play-button-primary { border-color: #f1ce78; background: linear-gradient(#f0ce71, #b47826); color: #201507; }
.g4b-poker-controls .g4b-play-button:hover { filter: brightness(1.14); }
.g4b-poker-raise { flex: 1 1 19rem; }
.g4b-poker-raise .g4b-poker-slider {
    flex: 1 1 100%;
    width: 100%;
    min-height: 1.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: #e7b855;
}

@container (min-width: 33rem) {
    .g4b-play[data-game="holdem"] .g4b-poker-felt { border-radius: clamp(4rem, 12cqi, 7rem); }
    .g4b-poker-board .g4b-poker-card { width: clamp(1.78rem, 6cqi, 3.45rem); }
}

/* --- Poker room: HUD unico, tavolo 16:9, posti e fullscreen ---------------- */

.g4b-play[data-game="holdem"] {
    --poker-gold: #d4af37;
    --poker-gold-light: #f3e5ab;
    --poker-wood: #26140c;
    --poker-felt: #0d4a36;
}

.g4b-play[data-game="holdem"] .g4b-play-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, auto);
    align-items: center;
    gap: .55rem .9rem;
    margin-bottom: .5rem;
    padding: .65rem .85rem;
    border-radius: 1rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-hud-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .3rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-hud-actions form {
    margin: 0;
}

.g4b-play[data-game="holdem"] .g4b-poker-hud-actions .g4b-play-button {
    min-height: 2.1rem;
    padding: .28rem .55rem;
    font-size: .74rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-fullscreen-button[aria-pressed="true"] {
    border-color: var(--poker-gold);
    color: var(--poker-gold-light);
}

.g4b-poker-membership {
    margin-bottom: .55rem;
    padding: .48rem .75rem;
    border-radius: .8rem;
}

.g4b-poker-membership-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .7rem;
    margin: 0;
}

.g4b-poker-state,
.g4b-poker-countdown {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    padding: .1rem .55rem;
    border: 1px solid #49617b;
    border-radius: 999px;
    background: #101b2a;
    color: #b8c9df;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.g4b-poker-state[data-state="countdown"],
.g4b-poker-countdown {
    border-color: #d4af3780;
    background: #2a2415;
    color: var(--poker-gold-light);
    text-transform: none;
    letter-spacing: .02em;
}

.g4b-poker-state[data-state="running"] {
    border-color: #31d07a80;
    background: #0c2b22;
    color: #93efba;
}

.g4b-play[data-game="holdem"] .g4b-board-wrap {
    width: min(100%, max(20rem, calc((100dvh - 17rem) * 16 / 9)));
    margin-inline: auto;
    margin-top: .55rem;
}

.g4b-poker-room {
    width: 100%;
    margin-inline: auto;
}

.g4b-play[data-game="holdem"] .g4b-poker {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    container-type: inline-size;
    isolation: isolate;
}

.g4b-play[data-game="holdem"] .g4b-poker-felt {
    position: absolute;
    inset: 5% 4% 7%;
    display: block;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #c8a36080;
    background:
        radial-gradient(ellipse at 50% 30%, #ffffff14 0 1px, transparent 2px) 0 0 / 5px 5px,
        radial-gradient(ellipse at 50% 45%, #126349 0%, #0b4432 54%, #05241a 100%);
    box-shadow:
        0 1.4rem 3.2rem #000c,
        0 0 0 .35rem #120905,
        0 0 0 .55rem #3a1f12,
        0 0 0 .62rem #d4af3755,
        inset 0 0 3.2rem #000d,
        inset 0 0 0 .55rem #05291d;
    overflow: visible;
}

.g4b-play[data-game="holdem"] .g4b-poker-felt::before {
    inset: -2.7%;
    z-index: -2;
    border: 1px solid #d3ad6266;
    border-radius: 50%;
    background: linear-gradient(180deg, #1b1e24, #0e1014);
    box-shadow: inset 0 4px 10px #ffffff12, inset 0 -6px 14px #000e, 0 .5rem 1.4rem #000b;
}

.g4b-play[data-game="holdem"] .g4b-poker-felt::after {
    inset: 1.6%;
    z-index: -1;
    border: 1px solid #d4af3755;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 0 0 1px #d4af372e;
}

.g4b-play[data-game="holdem"] .g4b-poker-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(.2rem, 1cqi, .7rem);
    padding: 6% 12%;
    text-align: center;
}

.g4b-play[data-game="holdem"] .g4b-poker-center .g4b-poker-pot {
    padding: .28rem .8rem;
    border-color: #d4af3780;
    background: #081510e8;
    box-shadow: 0 .3rem .8rem #000a;
}

.g4b-play[data-game="holdem"] .g4b-poker-board .g4b-poker-card {
    width: clamp(1.2rem, 6.2cqi, 3.45rem);
}

.g4b-play[data-game="holdem"] .g4b-poker-street {
    margin-top: .15rem;
}

.g4b-poker-banner {
    position: absolute;
    z-index: 8;
    top: 1.5%;
    left: 50%;
    width: max-content;
    max-width: 88%;
    padding: .38rem .85rem;
    border: 1px solid #d4af37b0;
    border-radius: 999px;
    background: #07100de8;
    box-shadow: 0 .4rem 1.4rem #000b, 0 0 1.2rem #d4af3733;
    color: var(--poker-gold-light);
    font-size: clamp(.66rem, 1.5cqi, .9rem);
    font-weight: 750;
    letter-spacing: .02em;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
    animation: g4b-poker-banner-in 320ms cubic-bezier(.2,.8,.3,1) both;
}

@keyframes g4b-poker-banner-in {
    from { opacity: 0; transform: translate(-50%, -.5rem) scale(.96); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}


.g4b-poker-log {
    margin-top: .55rem;
    padding: .45rem .65rem;
    border: 1px solid #2f3a4d;
    border-radius: .7rem;
    background: #0a111be6;
    color: #aebdd0;
    font-size: .72rem;
}

.g4b-poker-log > summary {
    cursor: pointer;
    color: #d4af37;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.g4b-poker-log-status {
    margin: .3rem 0 .2rem;
    color: #8fa1b8;
}

.g4b-poker-log-list {
    max-height: 4.8rem;
    margin: 0;
    padding-left: 1rem;
    overflow-y: auto;
}

.g4b-play[data-game="holdem"] .g4b-poker-log-list::-webkit-scrollbar {
    width: 4px;
}

.g4b-play[data-game="holdem"] .g4b-poker-log-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #d4af3766;
}

/* Fullscreen: solo tavolo, HUD e controlli; niente header/footer del sito. */
body.g4b-poker-fs {
    overflow: hidden;
    background: #040507;
}

body.g4b-poker-fs .g4b-header,
body.g4b-poker-fs .g4b-footer {
    display: none !important;
}

body.g4b-poker-fs .g4b-main {
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
}

body.g4b-poker-fs .g4b-play-layout {
    display: block;
}

body.g4b-poker-fs .g4b-play-sidebar {
    display: none !important;
}

body.g4b-poker-fs .g4b-play-arena {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: .4rem;
    border: 0;
    border-radius: 0;
    background: radial-gradient(ellipse at top, #111720, #040507 78%);
}

body.g4b-poker-fs .g4b-play-hero {
    margin: 0 0 .35rem;
}

body.g4b-poker-fs .g4b-poker-room {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

body.g4b-poker-fs .g4b-play[data-game="holdem"] .g4b-board-wrap {
    width: 100%;
}

body.g4b-poker-fs .g4b-play[data-game="holdem"] .g4b-poker {
    width: min(100%, max(20rem, calc((100dvh - 16rem) * 16 / 9)));
    margin-inline: auto;
}

body.g4b-poker-fs .g4b-poker-log {
    width: min(100%, 52rem);
    margin: .35rem auto 0;
}

#play-app:fullscreen {
    overflow: auto;
    background: #040507;
}


/* Posti sul perimetro: 9 coordinate percentuali, sempre visibili. */
.g4b-play[data-game="holdem"] .g4b-poker-seats {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: none;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat {
    position: absolute;
    z-index: 2;
    left: var(--seat-x);
    top: var(--seat-y);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .05rem .2rem;
    width: clamp(4.1rem, 11.5cqi, 8rem);
    min-width: 0;
    padding: .32rem .4rem;
    border: 1px solid #a1824b90;
    border-radius: .72rem;
    background: linear-gradient(150deg, #1d2230, #0b0f16);
    box-shadow: 0 .3rem .75rem #000a;
    color: #f4f4df;
    font-size: clamp(.6rem, 1.35cqi, .82rem);
    transform: translate(-50%, -50%);
    transition: border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
    pointer-events: auto;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-empty {
    width: clamp(3.3rem, 8.5cqi, 6rem);
    border-style: dashed;
    border-color: #416a5c70;
    background: #071b1580;
    color: #7b9b8d;
    opacity: .72;
    box-shadow: none;
    pointer-events: none;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-empty strong {
    font-size: .64em;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-empty small {
    color: #6f8d80;
    font-size: .7em;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-you {
    width: clamp(5.4rem, 14.5cqi, 9.4rem);
    padding: .45rem .55rem;
    border-width: 2px;
    border-color: #84ceac;
    box-shadow: inset 0 0 0 1px #2f8a72, 0 .6rem 1.4rem #000b;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-out {
    opacity: .7;
    animation: g4b-poker-fold 240ms ease-out both;
}

@keyframes g4b-poker-fold {
    from { opacity: .32; filter: grayscale(.8); }
    to { opacity: .7; filter: grayscale(.25); }
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-winner {
    border-color: #f4d277;
    box-shadow: 0 0 0 2px #f4d27755, 0 0 1.4rem #f4d27766;
    animation: g4b-poker-win 430ms ease-out both;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-sit-out {
    border-color: #b58a2f;
    background: #2b2516;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat-cards {
    min-height: 1.4rem;
    margin-top: .1rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat-cards .g4b-poker-card {
    width: clamp(1.05rem, 2.8cqi, 2rem);
    border-radius: .2rem;
    font-size: clamp(.5rem, 1.15cqi, .84rem);
}

.g4b-play[data-game="holdem"] .g4b-poker-seat.is-you .g4b-poker-seat-cards .g4b-poker-card {
    width: clamp(1.55rem, 4.2cqi, 2.8rem);
    font-size: clamp(.7rem, 1.8cqi, 1.25rem);
}

.g4b-play[data-game="holdem"] .g4b-poker-own-stack {
    min-height: 0;
    padding: .2rem .3rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-own-stack strong {
    font-size: clamp(.78rem, 1.8cqi, 1.15rem);
}

.g4b-play[data-game="holdem"] .g4b-poker-stack-share {
    margin: .12rem 0 .05rem;
    font-size: .62em;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat > small {
    font-size: .68em;
}

.g4b-play[data-game="holdem"] .g4b-poker-dealer {
    animation: g4b-poker-dealer-in 280ms ease-out both;
}

@keyframes g4b-poker-dealer-in {
    from { opacity: 0; transform: scale(.4) rotate(-90deg); }
    to { opacity: 1; transform: none; }
}

.g4b-poker-wager.is-award {
    z-index: 9;
    border-color: #f4d277;
    background: #2a2110ee;
    color: #fff1cf;
    box-shadow: 0 0 1rem #f4d27788;
    animation: g4b-poker-award-glow 700ms ease-out both;
}

@keyframes g4b-poker-award-glow {
    from { filter: brightness(1.35); }
    to { filter: brightness(1); }
}

.g4b-play[data-game="holdem"] .g4b-poker-controls {
    width: min(100%, 62rem);
    margin: .55rem auto 0;
}

.g4b-play[data-game="holdem"] .g4b-poker-last {
    width: min(100%, 62rem);
    margin: .45rem auto 0;
}

@container (max-width: 38rem) {
    .g4b-play[data-game="holdem"] .g4b-poker-seat {
        width: clamp(3.4rem, 12cqi, 5.6rem);
        padding: .22rem .28rem;
        font-size: .56rem;
    }

    .g4b-play[data-game="holdem"] .g4b-poker-seat.is-you {
        width: clamp(4.4rem, 15cqi, 6.6rem);
    }

    .g4b-play[data-game="holdem"] .g4b-poker-seat .g4b-poker-stack-share {
        display: none;
    }

    .g4b-play[data-game="holdem"] .g4b-poker-seat-cards .g4b-poker-card {
        width: clamp(.82rem, 3.2cqi, 1.3rem);
        font-size: .48rem;
    }
}

@media (max-width: 48rem) {
    .g4b-play[data-game="holdem"] .g4b-play-hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .g4b-play[data-game="holdem"] .g4b-poker-hud-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .g4b-play[data-game="holdem"] .g4b-board-wrap {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .g4b-poker-banner,
    .g4b-play[data-game="holdem"] .g4b-poker-dealer,
    .g4b-play[data-game="holdem"] .g4b-poker-seat.is-winner,
    .g4b-poker-wager.is-award {
        animation: none;
    }
}


@media (min-width: 62rem) {
    .g4b-play[data-game="holdem"] .g4b-play-layout {
        grid-template-columns: minmax(0, 1fr) minmax(14rem, 20%);
    }
}

/* Pre-azioni (auto check/fold/call) e stabilita' del layout tra le mani. */
.g4b-poker-auto {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .45rem .8rem;
    width: max-content;
    max-width: 100%;
    margin: .5rem auto 0;
    padding: .35rem .7rem;
    border: 1px solid #33415580;
    border-radius: .65rem;
    background: #081019d9;
    color: #b9c8da;
    font-size: .72rem;
}

.g4b-poker-auto[hidden] {
    display: none !important;
}

.g4b-poker-auto-label {
    color: #d4af37;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.g4b-poker-auto label {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    cursor: pointer;
    white-space: nowrap;
}

.g4b-poker-auto input {
    width: .95rem;
    height: .95rem;
    accent-color: #d4af37;
}

.g4b-play[data-game="holdem"] .g4b-play-hero {
    min-height: 4.4rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-membership {
    min-height: 2.45rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-own-stack {
    min-height: 2.55rem;
}

.g4b-play[data-game="holdem"] .g4b-poker-stack-share {
    padding: .08rem .3rem;
    border-radius: .32rem;
    background: #071512cc;
}

.g4b-play[data-game="holdem"] .g4b-poker-stack-share > span:last-child {
    font-size: .74rem;
    font-weight: 850;
    text-shadow: 0 0 .4rem color-mix(in srgb, var(--share-color) 45%, transparent);
}

.g4b-play[data-game="holdem"] .g4b-poker-stack-meter {
    height: .2rem;
}

@container (max-width: 38rem) {
    .g4b-play[data-game="holdem"] .g4b-poker-stack-share {
        grid-template-columns: 1fr;
    }

    .g4b-play[data-game="holdem"] .g4b-poker-stack-meter {
        display: none;
    }

    .g4b-play[data-game="holdem"] .g4b-poker-pot .g4b-poker-chip-rack {
        display: none;
    }
}


/* --- Azioni sul tavolo, durata HUD e fullscreen senza scroll ------------- */
.g4b-poker-hud-elapsed {
    display: inline-flex;
    align-items: baseline;
    gap: .28rem;
    color: #c9d8e2;
    font-size: .7rem;
    white-space: nowrap;
}

.g4b-poker-hud-elapsed small {
    color: #8fa6b5;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.g4b-poker-hud-elapsed strong {
    color: #f1d37a;
    font-variant-numeric: tabular-nums;
}

.g4b-play[data-game="holdem"] .g4b-poker-seat {
    overflow: visible;
}

.g4b-poker-action-badge {
    position: absolute;
    left: 50%;
    top: -.78rem;
    z-index: 5;
    min-width: 2.55rem;
    padding: .13rem .42rem;
    border: 1px solid #e7c46b;
    border-radius: .4rem;
    background: linear-gradient(#3b3018, #171208);
    color: #ffe8a0;
    box-shadow: 0 .2rem .55rem #0009, 0 0 .8rem #e7c46b45;
    font-size: .58rem;
    font-weight: 850;
    letter-spacing: .08em;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    transform: translateX(-50%);
    animation: g4b-poker-action-badge var(--poker-badge-duration) ease-out both;
    pointer-events: none;
    white-space: nowrap;
}

.g4b-poker-action-badge.is-fold {
    border-color: #bd6674;
    color: #ffc3ca;
    background: linear-gradient(#3b1c24, #160b10);
}

.g4b-poker-action-badge.is-check {
    border-color: #6dcc9a;
    color: #c7ffe0;
    background: linear-gradient(#133b2b, #081a13);
}

.g4b-poker-action-badge.is-raise,
.g4b-poker-action-badge.is-all-in {
    border-color: #f0d36e;
    color: #fff0b8;
    background: linear-gradient(#4a3713, #1b1205);
}

@keyframes g4b-poker-action-badge {
    0% { opacity: 0; transform: translate(-50%, .35rem) scale(.78); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1.04); }
    72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -.35rem) scale(.95); }
}

body.g4b-poker-fs,
#play-app:fullscreen,
html:has(body.g4b-poker-fs) {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

body.g4b-poker-fs .g4b-main,
body.g4b-poker-fs .g4b-play-layout,
body.g4b-poker-fs .g4b-play-arena,
body.g4b-poker-fs .g4b-poker-room {
    min-height: 0 !important;
    height: 100dvh;
    overflow: hidden !important;
}

body.g4b-poker-fs .g4b-play-arena {
    padding: .28rem .45rem !important;
}

body.g4b-poker-fs .g4b-play-hero {
    flex: 0 0 auto;
    margin-bottom: .2rem !important;
}

body.g4b-poker-fs .g4b-play-phase {
    flex: 0 0 auto;
    min-height: 0 !important;
    padding-block: .28rem !important;
}

body.g4b-poker-fs .g4b-poker-room {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
}

body.g4b-poker-fs .g4b-play[data-game="holdem"] .g4b-board-wrap {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin-top: .2rem;
    overflow: hidden;
}

body.g4b-poker-fs .g4b-play[data-game="holdem"] .g4b-poker {
    width: min(100%, max(18rem, calc((100dvh - 14rem) * 16 / 9)));
    max-height: 100%;
    margin-inline: auto;
}

body.g4b-poker-fs .g4b-poker-log,
body.g4b-poker-fs .g4b-poker-last {
    display: none !important;
}

body.g4b-poker-fs .g4b-poker-auto {
    flex: 0 0 auto;
    margin-top: .2rem;
    padding-block: .2rem;
}

[data-poker-stack-value] {
    font-variant-numeric: tabular-nums;
}

/* Action rail persistente: pulsanti sempre visibili, disabilitati quando non usabili. */
.g4b-poker-table-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 15rem);
    gap: .55rem;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.g4b-poker-table-layout > .g4b-board-wrap {
    width: 100%;
    min-width: 0;
    margin-top: 0 !important;
}

.g4b-poker-action-rail {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
    min-height: 0;
}

.g4b-poker-action-rail .g4b-poker-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    padding: .45rem;
    border-radius: .75rem;
    background: #0b1119e8;
}

.g4b-poker-action-rail .g4b-poker-controls .g4b-play-button,
.g4b-poker-action-rail .g4b-poker-controls input,
.g4b-poker-action-rail .g4b-poker-controls select {
    width: 100%;
    min-height: 2rem;
    font-size: .72rem;
}

.g4b-poker-action-rail .g4b-poker-controls .g4b-poker-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem;
}

.g4b-poker-action-rail .g4b-poker-controls .g4b-poker-raise {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 0 0 auto;
}

.g4b-poker-action-rail .g4b-poker-controls .g4b-poker-sizes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .2rem;
}

.g4b-poker-action-rail .g4b-poker-controls :disabled,
.g4b-poker-action-rail .g4b-poker-controls .is-disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.35);
}

.g4b-poker-action-rail .g4b-poker-auto {
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    padding: .4rem .45rem;
    border-radius: .7rem;
    background: #081019e8;
}

.g4b-poker-action-rail .g4b-poker-auto label {
    width: 100%;
}

.g4b-poker-action-rail .g4b-poker-auto input:disabled {
    opacity: .45;
    cursor: not-allowed;
}

body.g4b-poker-fs .g4b-poker-table-layout {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
    align-items: stretch;
}

body.g4b-poker-fs .g4b-poker-action-rail {
    max-height: 100%;
    overflow: hidden;
}

body.g4b-poker-fs .g4b-poker-action-rail .g4b-poker-controls {
    overflow: auto;
    min-height: 0;
}

body.g4b-poker-fs .g4b-poker-table-layout > .g4b-board-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.g4b-poker-bet-tray { position:absolute; left:50%; bottom:-.85rem; z-index:4; display:inline-flex; align-items:center; gap:.2rem; padding:.1rem .35rem; border:1px solid #d4af3780; border-radius:1rem; background:#0b1119e8; color:#f6d674; font-size:.62rem; font-weight:800; white-space:nowrap; transform:translateX(-50%); box-shadow:0 .2rem .5rem #0009; }

.g4b-poker-subpot { position:absolute; left:50%; top:18%; z-index:6; display:inline-flex; align-items:center; gap:.25rem; padding:.18rem .5rem; border:1px solid #d4af37; border-radius:1rem; background:#191307f2; color:#ffe8a0; font-size:.72rem; font-weight:800; transform:translateX(-50%); box-shadow:0 0 1rem #d4af3755; }

.g4b-poker-subpot[hidden] { display:none !important; }

.g4b-poker-controls-slot { display:flex; flex-direction:column; min-height:0; }

.g4b-poker-list tr.g4b-poker-row-mine { background:#1d3b32 !important; box-shadow: inset 0 0 0 2px #84ceacaa; }
.g4b-poker-list tr.g4b-poker-row-mine > * { background:transparent !important; }
.g4b-poker-list tr.g4b-poker-row-mine:hover { background:#274c40 !important; }
.g4b-poker-resume[hidden] { display:none !important; }
/* La stanza poker occupa l'intera pagina. */
.g4b-table-page {
    background: radial-gradient(ellipse at 50% 28%, #172522, #0a1016 64%, #070a11);
}
.g4b-table-main { width: 100%; padding: clamp(.35rem, 1.3vw, 1.2rem); }
.g4b-table-page .g4b-play { max-width: 100rem; margin-inline: auto; }
.g4b-table-page .g4b-play-layout { grid-template-columns: minmax(0, 1fr); }
.g4b-table-page .g4b-play-sidebar > :not(.g4b-play-result) { display: none; }
.g4b-table-page .g4b-play-sidebar:not(:has(.g4b-play-result:not([hidden]))) { display: none; }
.g4b-table-page .g4b-play-hero .g4b-play-lobby {
    color: #f5d17a;
    border-color: #cda34c75;
    background: #b58b2d22;
    font-weight: 800;
    text-transform: uppercase;
}
.g4b-poker-card.g4b-poker-flight { position: absolute; z-index: 12; margin: 0; pointer-events: none; }
.g4b-poker-flight.is-burned { filter: brightness(.65); }
@media (max-width: 48rem) {
    .g4b-table-page .g4b-poker-table-layout { grid-template-columns: minmax(0, 1fr); }
}
