/* style.css */
/* Estilos Cyber-Neon Premium para CYBER-POKER */

:root {
    --bg-dark: #05060f;
    --bg-panel: rgba(14, 16, 35, 0.75);
    --neon-purple: #a100ff;
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff007f;
    --neon-green: #39ff14;
    --neon-red: #ff3333;
    --text-white: #ffffff;
    --text-gray: #8c92ac;
    --felt-color: radial-gradient(circle, #0f1236 0%, #040510 100%);
    --font-primary: 'Outfit', sans-serif;
    --font-hud: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

input, textarea, select {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* ==========================================
   NEON GLOWS TRASEROS DE AMBIENTE
   ========================================== */
.neon-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}
.glow-purple {
    background-color: var(--neon-purple);
    top: -200px;
    left: -200px;
}
.glow-cyan {
    background-color: var(--neon-cyan);
    bottom: -200px;
    right: -200px;
}

/* ==========================================
   ELEMENTOS DE BOTONES Y FORMULARIOS
   ========================================== */
.btn {
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-purple) 0%, #7000b3 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-accent {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, #00a4b3 100%);
    color: #000;
    font-weight: 800;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-glow:hover {
    transform: translateY(-2px);
}
.btn-primary.btn-glow:hover {
    box-shadow: 0 0 20px rgba(161, 0, 255, 0.6);
}
.btn-accent.btn-glow:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

input[type="text"], input[type="password"], input[type="number"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 1px;
    font-weight: 600;
}

.error-msg {
    color: var(--neon-red);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 500;
    text-align: center;
}

/* ==========================================
   VISTAS GENERALES (PANTALLAS SPA)
   ========================================== */
.screen-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10;
}

.screen-view.active {
    display: flex;
    flex-direction: column;
}

/* ==========================================
   VISTA 1: LOGIN / AUTH
   ========================================== */
#view-login {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #0f1025 0%, #03040a 100%);
}

.auth-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    width: 90%;
    max-width: 420px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(161, 0, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-logo {
    font-family: var(--font-hud);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.cyber-txt {
    color: var(--text-white);
}

.poker-txt {
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

.auth-subtitle {
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 2px;
    margin-bottom: 30px;
    font-weight: 600;
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.auth-form button {
    margin-top: 10px;
}

.auth-footer {
    margin-top: 30px;
    font-size: 0.75rem;
    color: var(--text-gray);
    text-align: center;
}

/* ==========================================
   VISTA 2: LOBBY
   ========================================== */
.lobby-header {
    background: rgba(5, 6, 15, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.lobby-brand {
    font-family: var(--font-hud);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 600;
    color: white;
}

.user-chips {
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-family: var(--font-hud);
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.lobby-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 10;
}

.lobby-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.lobby-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.lobby-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: white;
    letter-spacing: 1px;
}

.lobby-card p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.config-group label {
    font-size: 0.75rem;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-toggle {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-gray);
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-toggle.active {
    background: var(--neon-purple);
    color: white;
    box-shadow: 0 0 15px rgba(161, 0, 255, 0.4);
}

.room-code-input {
    text-align: center;
    font-size: 1.8rem !important;
    font-family: var(--font-hud);
    letter-spacing: 8px;
    font-weight: 700;
    color: var(--neon-cyan) !important;
    border-color: rgba(0, 240, 255, 0.3) !important;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.15);
    margin: 20px 0;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span {
    padding: 0 10px;
}

.active-rooms-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.rooms-list-container {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(15px);
}

.rooms-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.rooms-table th, .rooms-table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rooms-table th {
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 1px;
    font-weight: 600;
}

.rooms-table td {
    font-size: 0.95rem;
}

.rooms-table tr:last-child td {
    border-bottom: none;
}

.room-badge {
    background: rgba(161, 0, 255, 0.15);
    color: #cb66ff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-family: var(--font-hud);
}

.no-rooms {
    text-align: center;
    color: var(--text-gray);
    padding: 30px !important;
    font-style: italic;
}

/* ==========================================
   VISTA 3: MANDO MÓVIL (JUGADOR)
   ========================================== */
#view-mobile.active {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.mobile-hud {
    background: rgba(14, 16, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.hud-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-gray);
    font-family: var(--font-hud);
}

.hud-room-label strong {
    color: var(--neon-cyan);
}

.hud-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-name {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hud-chips {
    color: var(--neon-cyan);
    font-family: var(--font-hud);
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Alerta de Turno Pulsante */
.turn-banner-alert {
    background: linear-gradient(90deg, transparent 0%, rgba(57, 255, 20, 0.25) 50%, transparent 100%);
    color: var(--neon-green);
    border-top: 1px solid rgba(57, 255, 20, 0.4);
    border-bottom: 1px solid rgba(57, 255, 20, 0.4);
    text-align: center;
    padding: 8px;
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 1.1rem;
    margin: 15px 0;
    display: none;
    animation: pulseTurnBanner 1.5s infinite;
}

@keyframes pulseTurnBanner {
    0% { opacity: 0.7; }
    50% { opacity: 1; text-shadow: 0 0 15px var(--neon-green); }
    100% { opacity: 0.7; }
}

/* Contenedor de Cartas Privadas */
.player-hand-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

.cards-instruction {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.cards-wrapper {
    display: flex;
    gap: 15px;
    perspective: 1000px; /* Para efecto 3D de peeking */
}

/* MÓVIL: Estructura de la Carta Privada */
.poker-card-mobile {
    width: 120px;
    height: 175px;
    cursor: pointer;
    position: relative;
    border-radius: 12px;
}

.card-mobile-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 12px;
}

.poker-card-mobile.peeking .card-mobile-inner {
    transform: rotateY(-180deg);
}

.card-mobile-back, .card-mobile-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.card-mobile-back {
    background: #0d0f22;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 15px rgba(161, 0, 255, 0.3), inset 0 0 15px rgba(161, 0, 255, 0.2);
}

/* Patrón de fondo geométrico tecnológico */
.neon-back-pattern {
    width: 85%;
    height: 85%;
    border: 1px solid rgba(161, 0, 255, 0.3);
    border-radius: 6px;
    background-image: 
        radial-gradient(var(--neon-purple) 1px, transparent 1px), 
        radial-gradient(var(--neon-cyan) 1px, transparent 1px);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
    opacity: 0.6;
}

.card-mobile-front {
    background: #fbfbff;
    color: #111115;
    transform: rotateY(180deg);
    border: 1px solid #ffffff;
    font-weight: 800;
}

.card-mobile-val {
    font-size: 3rem;
    line-height: 1;
    font-family: var(--font-hud);
}

.card-mobile-suit {
    font-size: 2.5rem;
    margin-top: 5px;
}

/* Colores de cartas */
.card-red {
    color: #ff2255 !important;
}

.card-black {
    color: #111115 !important;
}

/* Temporizador de Turno */
.turn-timer-container {
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.turn-timer-bar {
    height: 100%;
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    transition: width 1s linear, background-color 0.5s;
    width: 100%;
}

.turn-timer-txt {
    display: none; /* Oculto, usado en lógica si es necesario */
}

/* CONTROLES DE APUESTAS Y ACCIONES */
.mobile-actions-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Panel Deslizador de Subidas (Raise Box) */
.raise-slider-container {
    background: rgba(14, 16, 35, 0.95);
    border: 1px solid var(--neon-purple);
    box-shadow: 0 0 20px rgba(161, 0, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    display: none; /* Se activa con Javascript al pulsar SUBER */
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: var(--font-hud);
}

.neon-purple-txt {
    color: #df9cff;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(161, 0, 255, 0.5);
}

.slider-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-adjust {
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.1);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: var(--neon-purple);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-purple);
}

.quick-raise-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-quick {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    border-radius: 6px;
    padding: 8px 0;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-hud);
}

.btn-quick:active {
    background: var(--neon-purple);
}

/* Rejilla de Botones de Acción */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    border-radius: 8px;
    height: 65px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.2s;
    line-height: 1.3;
}

.btn-action:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.btn-fold {
    border-color: rgba(255, 51, 51, 0.2);
}
.btn-fold:active {
    background: var(--neon-red);
    box-shadow: 0 0 15px var(--neon-red);
}

.btn-check {
    border-color: rgba(57, 255, 20, 0.2);
}
.btn-check:active {
    background: var(--neon-green);
    color: black;
    box-shadow: 0 0 15px var(--neon-green);
}

.btn-call {
    border-color: rgba(0, 240, 255, 0.2);
    font-weight: 800;
}
.btn-call:active {
    background: var(--neon-cyan);
    color: black;
    box-shadow: 0 0 15px var(--neon-cyan);
}

.btn-raise {
    border-color: rgba(161, 0, 255, 0.2);
}
.btn-raise.active {
    background: rgba(161, 0, 255, 0.2);
    border-color: var(--neon-purple);
}

.btn-raise-confirm {
    grid-column: span 2; /* Ocupa doble espacio */
    background: linear-gradient(135deg, var(--neon-purple) 0%, #ff00c8 100%);
    border: none;
    font-weight: 800;
}

.active-glow {
    animation: neonPulsePurple 1.5s infinite alternate;
}

@keyframes neonPulsePurple {
    from { box-shadow: 0 0 5px var(--neon-purple); }
    to { box-shadow: 0 0 20px var(--neon-purple); }
}

/* ==========================================
   VISTA 4: PANTALLA GIGANTE (MESA TV)
   ========================================== */
#view-table.active {
    display: flex;
    flex-direction: column;
    background-color: #030408;
    overflow: hidden;
    padding: 20px 40px;
    justify-content: space-between;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
    z-index: 10;
}

.table-info {
    display: flex;
    gap: 15px;
}

.room-code-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: var(--font-hud);
}

.room-code-badge strong {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.game-mode-badge {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--neon-cyan);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.table-title {
    font-family: var(--font-hud);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 4px;
}

.tv-tournament-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-hud);
}

#tv-blind-level {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--neon-purple);
    text-shadow: 0 0 10px rgba(161, 0, 255, 0.3);
}

#tv-blind-time {
    font-size: 0.95rem;
    color: var(--text-gray);
}

/* ESCENA DE LA MESA DE POKER */
.poker-table-scene {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 10px;
}

/* Borde exterior e interior de la mesa de Poker (Cyber-Neon) */
.poker-table-border {
    width: 90%;
    height: 100%;
    min-height: 480px;
    background: #0c0a15;
    border-radius: 200px;
    padding: 22px; /* Grosor de la madera exterior */
    box-shadow: 
        0 25px 60px rgba(0,0,0,0.8),
        0 0 40px rgba(161, 0, 255, 0.3),
        inset 0 0 30px rgba(0,0,0,0.9);
    position: relative;
    border: 4px solid #1a172c;
}

/* Tapete ovalado interior */
.poker-table-felt {
    width: 100%;
    height: 100%;
    background: var(--felt-color);
    border-radius: 180px;
    position: relative;
    overflow: visible; /* Permitir que los avatares sobresalgan ligeramente */
    border: 5px solid #00f0ff;
    box-shadow: 
        0 0 30px rgba(0, 240, 255, 0.5), 
        inset 0 0 60px rgba(0,0,0,0.9);
}

/* Efecto de líneas HUD sobre el tapete */
.table-center-neon {
    position: absolute;
    width: 60%;
    height: 50%;
    top: 25%;
    left: 20%;
    border: 2px dashed rgba(0, 240, 255, 0.12);
    border-radius: 120px;
    pointer-events: none;
}

/* BOTE CENTRAL Y MESA DE CARTAS */
.table-center-board {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

.pot-display-box {
    background: rgba(5, 6, 15, 0.85);
    border: 1px solid rgba(161, 0, 255, 0.4);
    box-shadow: 0 0 15px rgba(161, 0, 255, 0.2);
    border-radius: 10px;
    padding: 8px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pot-label {
    font-size: 0.65rem;
    color: var(--text-gray);
    letter-spacing: 1px;
    font-weight: 600;
}

.pot-amount {
    font-family: var(--font-hud);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Espacio de Fichas Visuales del Bote */
.pot-chips-graphic {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

/* Cartas de la mesa en TV */
.community-cards-container {
    display: flex;
    gap: 10px;
}

.card-tv {
    width: 125px;
    height: 180px;
    position: relative;
    perspective: 500px;
    border-radius: 8px;
}

.card-tv-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px;
}

.card-tv.revealed .card-tv-inner {
    transform: rotateY(180deg);
}

.card-tv-back, .card-tv-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

.card-tv-back {
    background: #080a18;
    border: 1px solid var(--neon-cyan);
    box-shadow: inset 0 0 10px rgba(0,240,255,0.3);
}

.card-tv-front {
    background: white;
    color: black;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 3.2rem;
    border: 1px solid #ddd;
    font-family: var(--font-hud);
}

.card-tv.empty .card-tv-back {
    background: rgba(255,255,255,0.01) !important;
    border: 1px dashed rgba(255,255,255,0.08) !important;
    box-shadow: none !important;
}

.card-tv.empty .card-tv-front {
    display: none;
}

/* ==========================================
   AVATARES DE LOS JUGADORES EN LA MESA (ASIENTOS)
   ========================================== */
.player-seats-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9; /* Renderiza los asientos por encima de la capa de emparejamiento (z-index 8) */
}

.player-seat {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Coordenadas en círculo de los 8 asientos alrededor de la mesa */
.seat-0 { top: -5px; left: 50%; transform: translateX(-50%); } /* Norte */
.seat-1 { top: 5%; right: 100px; } /* Noreste */
.seat-2 { top: 50%; right: -5px; transform: translateY(-50%); } /* Este */
.seat-3 { bottom: 5%; right: 100px; } /* Sureste */
.seat-4 { bottom: -5px; left: 50%; transform: translateX(-50%); } /* Sur */
.seat-5 { bottom: 5%; left: 100px; } /* Suroeste */
.seat-6 { top: 50%; left: -5px; transform: translateY(-50%); } /* Oeste */
.seat-7 { top: 5%; left: 100px; } /* Noroeste */

.seat-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0b0c16;
    border: 3px solid var(--text-gray);
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    transition: all 0.3s;
}

/* Si es asiento ocupado */
.player-seat.occupied .seat-avatar {
    border-color: var(--neon-purple);
    background-color: #120e2e;
    /* Imagen del avatar por defecto */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23a100ff"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>');
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Turno Activo */
.player-seat.active-turn .seat-avatar {
    border-color: var(--neon-green);
    box-shadow: 0 0 20px var(--neon-green);
    transform: scale(1.1);
}

/* Retirado (Folded) */
.player-seat.folded-hand {
    opacity: 0.4;
}

/* Información del Jugador */
.seat-info {
    background: rgba(5,6,15,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 3px 8px;
    margin-top: 8px;
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

.seat-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.seat-chips {
    font-size: 0.8rem;
    font-family: var(--font-hud);
    font-weight: 700;
    color: var(--neon-cyan);
}

/* Cartas repartidas visuales del jugador (Para Showdown o Boca abajo) */
.seat-cards {
    position: absolute;
    top: -25px;
    display: flex;
    gap: 4px;
}

.card-tiny {
    width: 42px;
    height: 62px;
    border-radius: 4px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.4);
}

.card-tiny.back {
    background: #0f1025;
    border: 1px solid var(--neon-purple);
}

.card-tiny.front {
    background: white;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-hud);
}

/* Gráficos de fichas de apuestas */
.seat-bet {
    position: absolute;
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-hud);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    display: none;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Colocar la etiqueta de apuestas en la dirección correcta para que apunte al tapete */
.seat-0 .seat-bet { bottom: -45px; display: block; }
.seat-1 .seat-bet { left: -50px; bottom: 0; display: block; }
.seat-2 .seat-bet { left: -50px; display: block; }
.seat-3 .seat-bet { left: -50px; top: 0; display: block; }
.seat-4 .seat-bet { top: -45px; display: block; }
.seat-5 .seat-bet { right: -50px; top: 0; display: block; }
.seat-6 .seat-bet { right: -50px; display: block; }
.seat-7 .seat-bet { right: -50px; bottom: 0; display: block; }

/* Marcadores de Rol (Dealer, Ciega Chica, Ciega Grande) */
.role-badge {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    color: black;
    box-shadow: 0 3px 5px rgba(0,0,0,0.4);
    font-family: var(--font-hud);
}

.role-dealer {
    background: #ffffff;
    border: 1px solid #aaa;
    right: -10px;
    top: 10px;
}

.role-sb {
    background: var(--neon-purple);
    border: 1px solid #bf4aff;
    color: white;
    right: -10px;
    bottom: 10px;
}

.role-bb {
    background: var(--neon-cyan);
    border: 1px solid #4adeff;
    right: -10px;
    bottom: 10px;
}

/* ==========================================
   PANTALLA GIGANTE: CAPA DE EMPAREJAMIENTO
   ========================================== */
.pairing-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(5, 6, 15, 0.78); /* Más translúcido para dejar ver el fieltro y los asientos ocupados */
    border-radius: 175px;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 8; /* Por debajo de player-seats-wrapper (z-index 9) */
    backdrop-filter: blur(8px);
}

/* Estilo deshabilitado premium de neón inactivo */
.btn-disabled, .btn:disabled {
    background: rgba(25, 27, 49, 0.65) !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    color: var(--text-gray) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
    text-shadow: none !important;
    opacity: 0.6 !important;
}

/* Estado del Roster de Emparejamiento en TV */
.pairing-players-status {
    margin-top: 22px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.status-title {
    font-size: 0.8rem;
    color: var(--text-gray);
    letter-spacing: 2px;
    font-weight: 700;
    font-family: var(--font-hud);
    text-transform: uppercase;
}

.pairing-players-list {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 90%;
    margin-top: 4px;
}

/* Cápsula de jugador conectado */
.player-badge-pill {
    background: rgba(161, 0, 255, 0.15);
    border: 1px solid rgba(161, 0, 255, 0.4);
    box-shadow: 0 0 10px rgba(161, 0, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary);
    animation: pillScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Punto pulsante LED verde */
.player-badge-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
    display: inline-block;
    animation: ledPulse 1.2s infinite;
}

@keyframes ledPulse {
    0% { opacity: 0.6; box-shadow: 0 0 4px var(--neon-green); }
    50% { opacity: 1; box-shadow: 0 0 10px var(--neon-green); }
    100% { opacity: 0.6; box-shadow: 0 0 4px var(--neon-green); }
}

@keyframes pillScaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pairing-overlay.active {
    display: flex;
}

.pairing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
}

.pairing-content h2 {
    font-family: var(--font-hud);
    font-size: 2.2rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.pairing-content p {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.pairing-qr-box {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 0 30px rgba(255,255,255,0.1);
}

.pairing-code-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 40px;
}

.pairing-code-display span {
    font-size: 0.75rem;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.pairing-code-display h1 {
    font-family: var(--font-hud);
    font-size: 3.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    letter-spacing: 4px;
}

/* ==========================================
   ANUNCIO DRAMÁTICO DEL GANADOR (SHOWDOWN OVERLAY)
   ========================================== */
.showdown-announce-overlay {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background: rgba(3, 4, 8, 0.88);
    backdrop-filter: blur(25px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.showdown-announce-overlay.active {
    display: flex;
    animation: fadeInOverlay 0.5s;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.showdown-content {
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.showdown-glow-border {
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 40px rgba(161, 0, 255, 0.4);
    background: rgba(14, 16, 35, 0.95);
    border-radius: 20px;
    padding: 40px;
    transform: scale(0.9);
    animation: scaleUpContent 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUpContent {
    to { transform: scale(1); }
}

.showdown-glow-border h2 {
    font-family: var(--font-hud);
    font-size: 1.4rem;
    letter-spacing: 2px;
}

.showdown-glow-border h1 {
    font-family: var(--font-primary);
    font-size: 3.2rem;
    font-weight: 800;
    margin: 15px 0 5px 0;
    text-transform: uppercase;
}

.showdown-glow-border h3 {
    font-size: 1.5rem;
    color: white;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.winning-chips-announce {
    font-family: var(--font-hud);
    font-size: 2.2rem;
    color: var(--neon-green) !important;
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

.winning-combo-cards {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.card-showdown {
    width: 50px;
    height: 75px;
    background: white;
    color: black;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    font-family: var(--font-hud);
    border: 1px solid #ddd;
}

/* ==========================================
   AJUSTES RESPONSIVOS DE PANTALLA GIGANTE
   ========================================== */
@media screen and (max-height: 600px) {
    .poker-table-border {
        min-height: 380px;
    }
    .card-tv {
        width: 50px;
        height: 72px;
    }
    .card-tv-front {
        font-size: 1.2rem;
    }
    .seat-avatar {
        width: 45px;
        height: 45px;
    }
    .player-seat {
        width: 100px;
        height: 100px;
    }
}