/* ==========================================================
   La Mesa — Ruleta en Vivo
   Paleta: azul oscuro (gradiente) + amarillo de crupier (gradiente)
   Sin sombras/blurs/transparencias innecesarias -- colores sólidos
   para mantener el render liviano.
   ========================================================== */

:root {
    --felt-900: #050f24;
    --felt-800: #0a1c3d;
    --felt-700: #123056;
    --felt-600: #1a4270;
    --gold-500: #c9a227;
    --gold-400: #e0bd4a;
    --gold-200: #f3e3ac;
    --cream: #f4efe2;
    --ink: #0a1512;
    --ruby: #a8324a;
    --ruby-bright: #d94862;
    --emerald-bright: #3ecf8e;
    --line: #1e3a5c;
    --line-strong: #2c4d78;
    --panel-soft: #152544;
    --panel: #21314e;
    --panel-strong: #2b3a54;

    --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
input, textarea { user-select: text; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: radial-gradient(ellipse at top, var(--felt-700) 0%, var(--felt-900) 65%);
    color: var(--cream);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------
   Precarga -- se muestra hasta que la app decide qué pantalla
   mostrar (mesa o acceso), luego se oculta.
   --------------------------------------------------------- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.3rem;
    background: var(--felt-900);
    transition: opacity 0.3s ease;
}
.preloader.preloader-hidden {
    opacity: 0;
    pointer-events: none;
}
.preloader-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 3px solid var(--gold-500);
    background: linear-gradient(160deg, var(--gold-400), var(--gold-500));
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 3.4rem;
    animation: preloader-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes preloader-pop {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.preloader-title {
    font-family: var(--font-display);
    font-size: 3.2rem;
    letter-spacing: 0.05em;
    color: var(--cream);
}
.preloader-title span {
    background: linear-gradient(180deg, var(--gold-200), var(--gold-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.preloader-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 5px solid var(--line-strong);
    border-top-color: var(--gold-400);
    animation: preloader-spin 0.8s linear infinite;
}
@keyframes preloader-spin { to { transform: rotate(360deg); } }
.preloader-text {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: var(--gold-200);
    opacity: 0.9;
}

@media (max-width: 500px) {
    .preloader-mark { width: 96px; height: 96px; font-size: 2.5rem; }
    .preloader-title { font-size: 2.3rem; }
    .preloader-spinner { width: 40px; height: 40px; }
    .preloader-text { font-size: 0.9rem; }
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------------------------------------------------------
   Botones
   --------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--cream);
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease;
    letter-spacing: 0.02em;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
    border-color: var(--gold-500);
    color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--gold-200), var(--gold-400)); }

.btn-gold {
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
    border: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    padding: 0.85rem 2rem;
}
.btn-gold:hover:not(:disabled) { }

.btn-ghost { background: var(--panel-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--panel); }

.btn-small { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

/* ---------------------------------------------------------
   Pantalla de acceso
   --------------------------------------------------------- */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.85rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--felt-800);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
}

.auth-brand { text-align: center; margin-bottom: 2rem; }

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--gold-500);
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--gold-400);
    margin-bottom: 0.75rem;
}

.auth-brand h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    letter-spacing: 0.04em;
    margin: 0.25rem 0 0.1rem;
    color: var(--cream);
}

.auth-tagline {
    margin: 0;
    color: var(--gold-200);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--cream);
    opacity: 0.5;
    padding: 0.6rem 0;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.auth-tab.active {
    opacity: 1;
    border-bottom-color: var(--gold-500);
    color: var(--gold-400);
}

.auth-form { display: none; flex-direction: column; gap: 1rem; }
.auth-form.active { display: flex; }

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--gold-200);
}

.auth-form input {
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    color: var(--cream);
    font-size: 0.95rem;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--gold-500);
    background: var(--panel);
}

.auth-error {
    color: var(--ruby-bright);
    font-size: 0.82rem;
    margin: -0.4rem 0 0;
    min-height: 1.1em;
}

/* ---------------------------------------------------------
   Modal: entrar como invitado
   --------------------------------------------------------- */
.guest-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(5, 15, 36, 0.75);
}
.guest-box {
    width: 100%;
    max-width: 380px;
    background: var(--felt-800);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
}
.guest-brand { text-align: center; margin-bottom: 1rem; }
.guest-brand h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.03em;
    margin: 0.6rem 0 0;
    color: var(--cream);
}
.guest-modal-text {
    text-align: center;
    color: var(--gold-200);
    opacity: 0.85;
    font-size: 0.88rem;
    margin: 0 0 1.5rem;
}
.guest-form { display: flex; flex-direction: column; gap: 0.9rem; }
.guest-form input {
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    color: var(--cream);
    font-size: 0.95rem;
    text-align: center;
}
.guest-form input:focus { outline: none; border-color: var(--gold-500); background: var(--panel); }
.guest-form-error {
    color: var(--ruby-bright);
    font-size: 0.82rem;
    text-align: center;
    margin: -0.4rem 0 0;
}
.guest-modal-link {
    display: block;
    text-align: center;
    margin-top: 1.1rem;
    font-size: 0.8rem;
    color: var(--gold-200);
    opacity: 0.75;
}

/* ---------------------------------------------------------
   Mesa de juego
   --------------------------------------------------------- */
.game-screen { display: none; min-height: 100vh; flex-direction: column; }

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--felt-900);
    position: sticky;
    top: 0;
    z-index: 10;
}

.player-id { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.player-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--gold-400), var(--gold-500));
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.05rem;
}
.player-name {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.wallet-balance-bubble {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cream);
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
.wallet-balance-bubble:hover { background: var(--panel-strong); }

.table-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0.85rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ---------------------------------------------------------
   Paño de la mesa (números)
   --------------------------------------------------------- */
.table-felt {
    background: radial-gradient(ellipse at center, var(--felt-600) 0%, var(--felt-800) 100%);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.round-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dashed var(--line-strong);
}

.round-id {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--gold-200);
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
}
.round-id .round-id-number {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--gold-400);
    opacity: 1;
    letter-spacing: 0.03em;
    margin-left: 0.25rem;
}
.round-id .round-participants {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--emerald-bright);
    opacity: 0.85;
    margin-left: 0.3rem;
}

.my-numbers-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--gold-200);
    opacity: 0.85;
}
.my-numbers-row .my-numbers-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
    font-size: 0.68rem;
}
.my-numbers-row .my-number-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(62, 207, 142, 0.12);
    border: 1px solid rgba(62, 207, 142, 0.4);
    color: var(--emerald-bright);
    font-family: var(--font-mono);
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
}

.round-phase {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--emerald-bright);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.round-timer {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold-400);
    min-width: 3ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.round-timer.urgent { color: var(--ruby-bright); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Arco de números tipo borde de ruleta */
.numbers-arc {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.55rem;
}

.number-chip {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--panel-soft);
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
}
.number-chip:hover:not(:disabled) {
    border-color: var(--gold-400);
    background: rgba(201, 162, 39, 0.12);
    transform: scale(1.05);
}
.number-chip.selected {
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500)) !important;
    border-color: var(--gold-400) !important;
    color: var(--ink) !important;
    animation: none !important;
    transform: scale(1.08);
    z-index: 2;
}
.number-chip:disabled { cursor: not-allowed; }

/* ---------------------------------------------------------
   Estado ABIERTO: fichas amarillas, invitando a jugar
   (sin animación continua -- estático, más liviano)
   --------------------------------------------------------- */
.numbers-arc.phase-open .number-chip {
    border-color: rgba(224, 189, 74, 0.55);
    background: rgba(224, 189, 74, 0.1);
    color: var(--gold-200);
}
.numbers-arc.phase-open .number-chip:hover:not(:disabled) {
    background: rgba(224, 189, 74, 0.2);
    border-color: var(--gold-400);
}
/* Al llegar al máximo de 3 números (venta sigue abierta), atenuar un
   poco las fichas restantes -- distinto del bloqueo por sorteo, que
   nunca se atenúa. */
.numbers-arc.phase-open .number-chip:disabled {
    opacity: 0.45;
}

/* ---------------------------------------------------------
   Estado BLOQUEADO: NUNCA opaco -- borde rojo vivo y estático,
   generando expectativa mientras se espera el sorteo (sin
   animación continua por ficha; el pulso vive solo en la leyenda).
   --------------------------------------------------------- */
.numbers-arc.phase-locked .number-chip {
    border-color: var(--ruby-bright);
    border-width: 2.5px;
    background: rgba(217, 72, 98, 0.1);
    color: var(--cream);
    cursor: not-allowed;
}
.numbers-arc.phase-locked .number-chip:disabled {
    opacity: 1; /* anula el opacado genérico a propósito */
}

/* ---------------------------------------------------------
   Estado RESULTADO: dorado calmo, sin pulso de invitación a jugar
   --------------------------------------------------------- */
.numbers-arc.phase-settled .number-chip {
    border-color: rgba(201, 162, 39, 0.5);
    color: var(--gold-200);
    cursor: not-allowed;
}
.numbers-arc.phase-settled .number-chip:disabled { opacity: 1; }

/* ---------------------------------------------------------
   Leyenda grande del estado de venta
   --------------------------------------------------------- */
.phase-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.phase-legend .pl-icon { font-size: 1.2rem; }

.phase-legend.state-open {
    background: linear-gradient(135deg, rgba(224, 189, 74, 0.18), rgba(201, 162, 39, 0.08));
    border: 1px solid rgba(224, 189, 74, 0.4);
    color: var(--gold-200);
}

.phase-legend.state-locked {
    background: linear-gradient(135deg, rgba(217, 72, 98, 0.22), rgba(168, 50, 74, 0.1));
    border: 1px solid rgba(217, 72, 98, 0.5);
    color: #ffd6de;
}
.phase-legend.state-locked .pl-icon.pl-spin {
    display: inline-block;
    animation: pl-spin 1.4s linear infinite;
}
@keyframes pl-spin { to { transform: rotate(360deg); } }

.phase-legend.state-settled {
    background: linear-gradient(135deg, rgba(62, 207, 142, 0.2), rgba(26, 118, 82, 0.08));
    border: 1px solid rgba(62, 207, 142, 0.5);
    color: var(--emerald-bright);
}

.phase-legend.state-cancelled {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.18), rgba(168, 50, 74, 0.1));
    border: 1px solid rgba(201, 162, 39, 0.4);
    color: var(--gold-200);
}

@media (max-width: 500px) {
    .phase-legend { font-size: 0.92rem; padding: 0.6rem 0.8rem; }
}

/* Número que el jugador YA compró en esta ronda (puede seguir comprando más) */
.number-chip.owned {
    background: linear-gradient(160deg, rgba(62, 207, 142, 0.4), rgba(26, 118, 82, 0.22)) !important;
    border-color: var(--emerald-bright) !important;
    color: #fff !important;
    animation: none !important;
}
.number-chip.owned::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid var(--emerald-bright);
    pointer-events: none;
}
.number-chip .owned-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    z-index: 1;
    background: var(--emerald-bright);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.22rem 0.5rem;
    border-radius: 12px;
    display: none;
    white-space: nowrap;
}
.number-chip.owned .owned-badge { display: block; }

.number-chip .chip-count {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: var(--ruby);
    color: var(--cream);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    display: none;
}
.number-chip.show-count .chip-count { display: block; }
.number-chip.is-winner {
    border-color: var(--emerald-bright) !important;
    background: linear-gradient(160deg, rgba(62, 207, 142, 0.35), rgba(26, 118, 82, 0.15)) !important;
    animation: is-winner-pulse 1.4s ease-in-out infinite !important;
}
@keyframes is-winner-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}

.purchase-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--line-strong);
}
.purchase-summary { color: var(--gold-200); font-size: 0.9rem; }

.result-banner {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(62, 207, 142, 0.08);
    border: 1px solid rgba(62, 207, 142, 0.3);
}
.result-banner-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--emerald-bright);
    line-height: 1;
}
.result-banner-text { color: var(--gold-200); font-size: 0.9rem; margin-top: 0.5rem; }

/* ---------------------------------------------------------
   Chat flotante: botón (FAB) + panel
   --------------------------------------------------------- */
.chat-fab {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 220;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--gold-400), var(--gold-500));
    border: none;
    color: var(--ink);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--ruby-bright);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--felt-900);
}

.chat-float-panel {
    position: fixed;
    right: 1.1rem;
    bottom: 4.6rem;
    z-index: 220;
    width: min(340px, calc(100vw - 1.6rem));
    height: min(480px, calc(100vh - 6.5rem));
    background: var(--felt-800);
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 0.7rem 0.9rem;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.chat-header > span:first-child { flex: 1; }

.chat-close-btn {
    background: var(--panel);
    border: none;
    color: var(--cream);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-online {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--emerald-bright);
    letter-spacing: 0;
}
.online-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--emerald-bright);
    animation: online-pulse 2s infinite;
}
@keyframes online-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message { display: flex; font-size: 0.83rem; line-height: 1.4; }
.chat-message.own { justify-content: flex-end; }
.chat-message.system { color: var(--gold-200); opacity: 0.7; font-style: italic; }

.chat-bubble {
    max-width: 82%;
    padding: 0.4rem 0.65rem;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    background: var(--panel);
    word-break: break-word;
}
.chat-message.own .chat-bubble {
    background: #2563eb;
    color: #fff;
    border-radius: 12px;
    border-bottom-right-radius: 4px;
}
.chat-message .chat-user { color: var(--gold-400); font-weight: 700; margin-right: 0.4rem; }
.chat-guest-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink);
    background: var(--gold-400);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-top: 1px solid var(--line);
}
.chat-form input {
    flex: 1;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--cream);
    font-size: 0.85rem;
}
.chat-form input:focus { outline: none; border-color: var(--gold-500); }

/* ---------------------------------------------------------
   Botón "Ver" conectados + modal de usuarios en línea
   --------------------------------------------------------- */
.online-view-btn {
    background: rgba(62, 207, 142, 0.15);
    border: 1px solid rgba(62, 207, 142, 0.4);
    color: var(--emerald-bright);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    margin-left: 0.3rem;
}
.online-view-btn:hover { background: rgba(62, 207, 142, 0.28); }

.online-users-modal {
    position: fixed;
    inset: 0;
    background: var(--felt-900);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 260;
    padding: 1rem;
}
.oum-box {
    width: 100%;
    max-width: 380px;
    max-height: 75vh;
    background: var(--felt-800);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.oum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--line);
}
.oum-header h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0;
    letter-spacing: 0.03em;
}
.oum-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.oum-empty { color: var(--gold-200); opacity: 0.6; text-align: center; padding: 1.5rem 0; }
.oum-user-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}
.oum-user-row .online-dot { flex-shrink: 0; }
.oum-user-row.oum-me { border-color: rgba(201, 162, 39, 0.5); background: rgba(201, 162, 39, 0.1); }
.oum-user-row .oum-me-tag { margin-left: auto; font-size: 0.7rem; color: var(--gold-400); font-family: var(--font-mono); }

/* ---------------------------------------------------------
   Historial en vivo de ganadores
   --------------------------------------------------------- */
.recent-winners-panel {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
.rw-header {
    padding: 0.7rem 1rem;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: var(--gold-400);
    border-bottom: 1px solid var(--line);
    background: rgba(201, 162, 39, 0.06);
}
.rw-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.rw-empty { color: var(--gold-200); opacity: 0.6; text-align: center; padding: 1.2rem 0; margin: 0; font-size: 0.85rem; }

.rw-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    animation: rw-row-in 0.4s ease;
}
.rw-row:last-child { border-bottom: none; }
.rw-medal { font-size: 1rem; flex-shrink: 0; }
.rw-user { color: var(--gold-400); font-weight: 700; }
.rw-detail { color: var(--gold-200); opacity: 0.7; font-size: 0.78rem; }
.rw-amount {
    margin-left: auto;
    font-family: var(--font-mono);
    color: var(--emerald-bright);
    font-weight: 700;
    white-space: nowrap;
}
@keyframes rw-row-in {
    from { opacity: 0; transform: translateY(-8px); background: rgba(62, 207, 142, 0.15); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Modal de historial de movimientos
   --------------------------------------------------------- */
.history-modal {
    position: fixed;
    inset: 0;
    background: var(--felt-900);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.history-box {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: var(--felt-800);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
}
.history-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 0.03em;
}

.wallet-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem 0;
}
.wallet-balance-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold-400);
}

.wallet-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--line);
}
.wallet-actions .btn { flex: 1; }

.history-summary {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
}
.hs-item { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.hs-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-200); opacity: 0.6; }
.hs-value { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; }
.hs-positive { color: var(--emerald-bright); }
.hs-negative { color: var(--ruby-bright); }

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-empty { color: var(--gold-200); opacity: 0.6; text-align: center; padding: 2rem 0; }

.history-load-more-wrap {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: center;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.hi-left { display: flex; flex-direction: column; gap: 0.15rem; }
.hi-label { font-size: 0.88rem; font-weight: 600; }
.hi-meta { font-size: 0.72rem; color: var(--gold-200); opacity: 0.6; }

.hi-amount { font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.hi-amount.positive { color: var(--emerald-bright); }
.hi-amount.negative { color: var(--ruby-bright); }

.hi-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; flex-shrink: 0;
}
.hi-icon.purchase { background: rgba(217, 72, 98, 0.15); }
.hi-icon.payout, .hi-icon.jackpot_payout { background: rgba(62, 207, 142, 0.15); }
.hi-icon.refund { background: rgba(224, 189, 74, 0.15); }
.hi-icon.adjustment { background: rgba(201, 162, 39, 0.15); }

/* ---------------------------------------------------------
   Modal de confirmación de compra por número (con animación)
   --------------------------------------------------------- */
.purchase-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.pcm-backdrop {
    position: absolute;
    inset: 0;
    background: var(--felt-900);
    animation: pcm-backdrop-in 0.25s ease;
}
@keyframes pcm-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.pcm-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 340px;
    background: radial-gradient(ellipse at top, var(--felt-700) 0%, var(--felt-900) 100%);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    animation: pcm-box-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pcm-box-in {
    0%   { transform: scale(0.6) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.pcm-number {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--ink);
    background: radial-gradient(circle at 35% 30%, var(--gold-200), var(--gold-500) 75%);
    margin-bottom: 0.3rem;
    animation: pcm-number-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}
@keyframes pcm-number-pop {
    0%   { transform: scale(0.3) rotate(-20deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.pcm-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cream);
}
.pcm-price {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--gold-400);
    letter-spacing: 0.02em;
}
.pcm-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.6rem;
}
.pcm-actions .btn { flex: 1; }

@media (max-width: 500px) {
    .pcm-number { width: 76px; height: 76px; font-size: 2.4rem; }
    .pcm-text { font-size: 1rem; }
    .pcm-price { font-size: 1.35rem; }
}

/* ---------------------------------------------------------
   Overlay de pausa/mantenimiento -- tono calmado y profesional,
   no urgente. Bloquea toda la mesa hasta que el admin lo quite.
   --------------------------------------------------------- */
.maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--felt-700) 0%, var(--felt-900) 75%);
    padding: 1.5rem;
}
.mo-content {
    text-align: center;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.mo-icon {
    font-size: 3.6rem;
    animation: mo-icon-pulse 2.4s ease-in-out infinite;
    opacity: 0.9;
}
@keyframes mo-icon-pulse {
    0%, 100% { transform: scale(1); opacity: 0.75; }
    50%      { transform: scale(1.08); opacity: 1; }
}
.mo-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    letter-spacing: 0.03em;
    color: var(--gold-300, var(--gold-400));
}
.mo-message {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--gold-200);
    opacity: 0.85;
    margin: 0;
}

/* ---------------------------------------------------------
   Overlay de "NUEVA RONDA" -- toma toda la pantalla por unos
   segundos, estilo casino en vivo, antes de revelar la mesa.
   --------------------------------------------------------- */
.new-round-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #4d431c 0%, var(--felt-900) 68%);
    animation: nro-fade-in 0.35s ease, nro-fade-out 0.5s ease 2.7s forwards;
}

.nro-burst {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(224, 189, 74, 0.45) 0%, transparent 62%);
    transform: scale(0);
    animation: nro-burst-pulse 1.1s ease-out forwards;
}
@keyframes nro-burst-pulse {
    0%   { transform: scale(0); opacity: 1; }
    100% { transform: scale(2.6); opacity: 0; }
}

.nro-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.nro-spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold-400);
    animation: nro-spark-fly 1.15s ease-out forwards;
}
@keyframes nro-spark-fly {
    0%   { transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--dist)) scale(0.2); opacity: 0; }
}

.nro-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    text-align: center;
    padding: 0 1.5rem;
}

.nro-wheel {
    font-size: 5rem;
    animation: nro-wheel-spin 1.4s cubic-bezier(0.2, 0.8, 0.3, 1);
    filter: drop-shadow(0 0 24px rgba(224, 189, 74, 0.6));
}
@keyframes nro-wheel-spin {
    0%   { transform: rotate(0deg) scale(0.3); opacity: 0; }
    35%  { transform: rotate(400deg) scale(1.25); opacity: 1; }
    70%  { transform: rotate(680deg) scale(1); }
    100% { transform: rotate(720deg) scale(1); }
}

.nro-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 9vw, 4rem);
    letter-spacing: 0.06em;
    background: linear-gradient(180deg, var(--gold-200), var(--gold-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: nro-title-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s backwards;
}
@keyframes nro-title-pop {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.nro-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold-200);
    letter-spacing: 0.02em;
    animation: nro-subtitle-in 0.4s ease 0.55s backwards;
}
@keyframes nro-subtitle-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes nro-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nro-fade-out { from { opacity: 1; } to { opacity: 0; } }

.number-chip.purchase-flash { animation: purchase-flash 1.4s ease !important; }
@keyframes purchase-flash {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ---------------------------------------------------------
   Banner de confirmación de compra -- grande, claro y de larga
   duración, pensado para jugadores poco familiarizados con la
   tecnología (no un aviso pequeño que pase desapercibido).
   --------------------------------------------------------- */
.purchase-success-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 260;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: max-content;
    min-width: min(90vw, 340px);
    max-width: min(94vw, 560px);
    background: linear-gradient(135deg, rgba(62, 207, 142, 0.98), rgba(26, 118, 82, 0.98));
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    animation: psb-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), psb-out 0.4s ease 4.6s forwards;
}
.psb-check {
    font-size: 1.9rem;
    flex-shrink: 0;
    animation: psb-check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.psb-text {
    font-size: 1.02rem;
    line-height: 1.4;
    font-weight: 500;
}
.psb-text strong { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.02em; }
.psb-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.psb-close:hover { background: rgba(255, 255, 255, 0.3); }

@keyframes psb-in {
    from { opacity: 0; transform: translate(-50%, 24px) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes psb-out {
    from { opacity: 1; transform: translate(-50%, 0) scale(1); }
    to   { opacity: 0; transform: translate(-50%, 24px) scale(0.95); }
}
@keyframes psb-check-pop {
    0%   { transform: scale(0.3) rotate(-15deg); opacity: 0; }
    60%  { transform: scale(1.2) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}

@media (max-width: 860px) {
    .nro-wheel { font-size: 3.6rem; }
    .purchase-success-banner { bottom: 1rem; padding: 0.85rem 1.1rem; }
    .psb-text { font-size: 0.92rem; }
}

/* ---------------------------------------------------------
   Feed de notificaciones push de compras
   --------------------------------------------------------- */
.purchase-feed {
    position: absolute;
    top: 46px;
    left: 10px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    max-width: calc(100% - 20px);
    pointer-events: none;
}

.purchase-feed-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    width: fit-content;
    max-width: 100%;
    background: var(--felt-900);
    border-radius: 6px;
    animation: pf-in 0.3s ease, pf-out 0.4s ease 3.6s forwards;
}

.purchase-feed-item .pf-icon { font-size: 1rem; flex-shrink: 0; }
.purchase-feed-item .pf-user { color: var(--gold-400); font-weight: 700; }
.purchase-feed-item .pf-text { opacity: 0.85; }

@keyframes pf-in {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pf-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-24px); }
}


/* ---------------------------------------------------------
   Franja llamativa: racha, jackpot y pozo de la ronda
   --------------------------------------------------------- */
.round-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.hl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.9rem 0.6rem;
    border-radius: 14px;
    text-align: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
}

.hl-icon { font-size: 1.3rem; line-height: 1; }
.hl-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}
.hl-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.02em;
}

.hl-streak {
    background: linear-gradient(160deg, rgba(217, 72, 98, 0.18), rgba(168, 50, 74, 0.08));
    border-color: rgba(217, 72, 98, 0.35);
}
.hl-streak .hl-value { color: var(--ruby-bright); }

.hl-jackpot {
    background: linear-gradient(160deg, rgba(224, 189, 74, 0.22), rgba(201, 162, 39, 0.08));
    border-color: rgba(201, 162, 39, 0.45);
}
.hl-jackpot .hl-value { color: var(--gold-400); }

.hl-pool {
    background: linear-gradient(160deg, rgba(62, 207, 142, 0.18), rgba(26, 76, 61, 0.1));
    border-color: rgba(62, 207, 142, 0.35);
}
.hl-pool .hl-value { color: var(--emerald-bright); }

.jackpot-condition-note {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-400);
    margin-bottom: 0.3rem;
}

.bet-cost-note {
    text-align: center;
    font-size: 1.15rem;
    color: var(--gold-200);
    opacity: 0.9;
}
.bet-cost-note strong { color: var(--gold-400); font-family: var(--font-mono); font-size: 1.25rem; }
.bet-cost-sep { opacity: 0.4; margin: 0 0.15rem; }

@media (max-width: 500px) {
    .hl-value { font-size: 1.2rem; }
    .hl-icon { font-size: 1.1rem; }
}

/* ---------------------------------------------------------
   Transmisión en vivo
   --------------------------------------------------------- */
.live-stream-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: #05100c;
}

.live-stream-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: radial-gradient(ellipse at center, var(--felt-700) 0%, var(--felt-900) 100%);
    color: var(--gold-200);
}

.lsp-icon {
    font-size: 2.4rem;
    opacity: 0.55;
    animation: lsp-pulse 2.4s infinite;
}
@keyframes lsp-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.75; }
}

.live-stream-placeholder p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.65;
    letter-spacing: 0.02em;
}

.live-stream-frame {
    position: absolute;
    inset: 0;
}
.yt-player-mount,
.yt-player-mount iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Bloquea el toque directo sobre el iframe de YouTube (título, doble clic,
   controles nativos) -- toda la interacción pasa por nuestros botones,
   que están por encima de este escudo transparente. */
.yt-click-shield {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
}

.live-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}

.live-ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.live-ctrl-btn:hover {
    background: rgba(201, 162, 39, 0.25);
    border-color: var(--gold-500);
    transform: translateY(-1px);
}

.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: var(--ruby);
    color: var(--cream);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
}
.live-badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #fff;
    animation: online-pulse 1.4s infinite;
}

.live-reconnecting {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--felt-900);
    color: var(--gold-200);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}
.lr-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    border-top-color: var(--gold-400);
    animation: lr-spin 0.8s linear infinite;
}
@keyframes lr-spin { to { transform: rotate(360deg); } }

/* Overlay grande: "Pulsa para reproducir" (cuando está pausado/sin iniciar) */
.live-play-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    background: var(--felt-900);
    border: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    color: var(--cream);
    font-family: inherit;
    transition: background 0.2s ease;
}
.live-play-overlay:hover {
    background: var(--ink);
}
.lpo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    border: 2px solid var(--gold-400);
    font-size: 1.6rem;
    color: #fff;
    padding-left: 3px; /* centra visualmente el triángulo del ícono */
    transition: transform 0.2s ease;
}
.live-play-overlay:hover .lpo-circle {
    transform: scale(1.08);
    background: #403b25;
}
.lpo-text {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    color: var(--gold-200);
}

/* Pastilla discreta: "Pulsa para escuchar" (cuando está en silencio) */
.live-mute-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--felt-900);
    border: 2px solid var(--gold-500);
    color: var(--gold-200);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.85rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
    width: max-content;
    max-width: 90vw;
    transition: background 0.15s ease, transform 0.15s ease;
}
.live-mute-badge i { font-size: 1.2rem; flex-shrink: 0; }
.live-mute-badge:hover {
    background: #403b25;
    transform: translate(-50%, -50%) scale(1.05);
}

/* ---------------------------------------------------------
   Revelado animado de conteos al cerrar ventas
   --------------------------------------------------------- */
@keyframes reveal-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.28); }
    100% { transform: scale(1); }
}
.number-chip.reveal-pop,
.numbers-arc.phase-locked .number-chip.reveal-pop {
    animation: reveal-pop 0.6s ease !important;
}
.number-chip .chip-count {
    transition: opacity 0.2s ease;
}

/* ---------------------------------------------------------
   Overlay especial de JACKPOT ganado
   --------------------------------------------------------- */
.jackpot-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #554821 0%, var(--felt-900) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    padding: 1.5rem;
    overflow: hidden;
    animation: fade-in 0.3s ease;
}

.jp-coins {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.jp-coin {
    position: absolute;
    top: -40px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--gold-200), var(--gold-500) 75%);
    animation: jp-fall linear forwards;
}
@keyframes jp-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0.9; }
}

.jp-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.jp-badge {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    color: var(--gold-400);
}

.jp-amount {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
    background: linear-gradient(180deg, var(--gold-200), var(--gold-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: wo-number-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jp-personal {
    font-family: var(--font-display);
    font-size: 1.6rem;
    padding: 0.5rem 1.4rem;
    border-radius: 12px;
    background: rgba(62, 207, 142, 0.15);
    border: 1px solid var(--emerald-bright);
    color: var(--emerald-bright);
    animation: wo-personal-in 0.4s ease 0.3s backwards;
}

.jp-note {
    margin: 0;
    font-size: 0.78rem;
    color: var(--gold-200);
    opacity: 0.65;
    letter-spacing: 0.01em;
}

.jp-winners-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}
.jp-winners-list .wo-winner-row {
    background: rgba(201, 162, 39, 0.08);
    border-color: rgba(201, 162, 39, 0.3);
}

/* ---------------------------------------------------------
   Overlay de resultado ganador (pantalla completa)
   --------------------------------------------------------- */
.winner-overlay {
    position: fixed;
    inset: 0;
    background: var(--felt-900);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1.5rem;
    animation: fade-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.wo-content {
    width: 100%;
    max-width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.wo-number {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 5rem;
    color: var(--ink);
    background: radial-gradient(circle at 35% 30%, var(--gold-200), var(--gold-500) 70%);
    animation: wo-number-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wo-number-pop {
    0%   { transform: scale(0.2) rotate(-25deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}

.wo-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.03em;
    color: var(--gold-200);
}

.wo-personal {
    font-family: var(--font-display);
    font-size: 1.9rem;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
    animation: wo-personal-in 0.4s ease 0.3s backwards;
}
@keyframes wo-personal-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wo-personal-win { background: rgba(62, 207, 142, 0.15); border: 1px solid var(--emerald-bright); color: var(--emerald-bright); }
.wo-personal-lose { background: var(--panel-soft); border: 1px solid var(--line-strong); color: var(--gold-200); font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }

.wo-winners-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
}
.wo-winner-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    opacity: 0;
    animation: wo-row-in 0.35s ease forwards;
}
@keyframes wo-row-in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.wo-winner-name { font-weight: 600; }
.wo-winner-amount { font-family: var(--font-mono); color: var(--emerald-bright); font-weight: 700; }
.wo-empty { color: var(--gold-200); opacity: 0.7; font-size: 0.9rem; }

/* ---------------------------------------------------------
   Toast de notificaciones
   --------------------------------------------------------- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--felt-900);
    border: 1px solid var(--gold-500);
    color: var(--cream);
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    z-index: 100;
}
.toast.error { border-color: var(--ruby-bright); }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 860px) {
    .table-main { grid-template-columns: 1fr; padding: 0.6rem; gap: 0.6rem; }
    .table-felt { padding: 0.8rem; border-radius: 12px; }
    .numbers-arc { grid-template-columns: repeat(5, 1fr); gap: 0.45rem; }
    .number-chip { font-size: 1.3rem; }
    .player-name { max-width: 34vw; }
    .table-header { padding: 0.55rem 0.75rem; }
    .round-status-bar { gap: 0.35rem; padding-bottom: 0.35rem; }
    .round-id { font-size: 0.72rem; }
    .round-id .round-id-number { font-size: 1.25rem; margin-left: 0.15rem; }
    .round-id .round-participants { font-size: 0.62rem; margin-left: 0.2rem; }
    .round-phase { font-size: 0.62rem; letter-spacing: 0.06em; }
    .round-timer { font-size: 1.6rem; min-width: 2.4ch; }
    .round-highlights { gap: 0.4rem; }
    .hl-card { padding: 0.6rem 0.4rem; }
    .chat-fab { width: 48px; height: 48px; font-size: 1.3rem; right: 0.8rem; bottom: 0.8rem; }
    .chat-float-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: min(48vh, 400px);
        border-radius: 14px 14px 0 0;
    }
}
