/* ==========================================================================
   QUINELA MUNDIALISTA 2026 - ESTILOS PREMIUM SPORTS VIP (EA SPORTS FC STYLE)
   ========================================================================== */

/* 1. VARIABLES DE DISEÑO FUTURISTAS Y DEPORTIVAS */
:root {
    --bg-primary: #06080c;        /* Negro carbón deportivo */
    --bg-secondary: #0b0f19;      /* Azul marino oscuro de estadio */
    --bg-card: rgba(11, 15, 25, 0.6); /* Cristal esmerilado translúcido */
    --bg-card-hover: rgba(22, 28, 45, 0.75);
    
    --border-color: rgba(212, 175, 55, 0.2); /* Oro translúcido */
    --border-color-active: rgba(255, 215, 0, 0.85);
    
    --gold-light: #fff5cc;
    --gold-primary: #e5b83b;      /* Oro Championship */
    --gold-secondary: #fcd86a;
    --gold-dark: #96701c;
    --gold-gradient: linear-gradient(135deg, #fff5cc 0%, #e5b83b 50%, #96701c 100%);
    --gold-text-gradient: linear-gradient(120deg, #fcd86a, #fff5cc, #e5b83b);
    
    --emerald-gradient: linear-gradient(135deg, #00f0ff 0%, #00ffaa 100%); /* Neon Cyan/Emerald */
    --cyber-glow: 0 0 25px rgba(229, 184, 59, 0.2);
    
    --text-main: #f2f5fa;         /* Blanco deportivo */
    --text-muted: #7f8fa4;        /* Azul grisáceo atenuado */
    --text-dark: #06080c;
    
    --danger: #ff3b30;
    --danger-hover: #ff453a;
    --success: #00ffaa;
    --success-hover: #34c759;
    --info: #00f0ff;
    
    --font-sans: 'Space Grotesk', sans-serif;
    --font-header: 'Bebas Neue', sans-serif;
    --font-serif: 'DM Serif Display', serif;
    --font-mono: 'Courier Prime', monospace;
    
    --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 2. RESET Y ESTRUCTURA DE FONDO (STADIUM NIGHT AMBIENCE) */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
    
    /* Degradado de malla animado que simula la iluminación de un estadio */
    background-image: 
        radial-gradient(circle at 50% -20%, rgba(0, 240, 255, 0.14) 0%, rgba(6, 8, 12, 0) 65%),
        radial-gradient(circle at 10% 75%, rgba(229, 184, 59, 0.06) 0%, rgba(6, 8, 12, 0) 50%),
        radial-gradient(circle at 90% 75%, rgba(0, 255, 170, 0.06) 0%, rgba(6, 8, 12, 0) 50%),
        linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    animation: stadium-lights-pulse 15s ease-in-out infinite alternate;
}

@keyframes stadium-lights-pulse {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
    50% { background-position: 0% 4%, 2% 0%, -2% 2%, 0% 0%, 0% 0%; }
    100% { background-position: 0% 0%, -2% -2%, 2% -2%, 0% 0%, 0% 0%; }
}

/* Scrollbar premium */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(6, 8, 12, 0.95);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-primary), var(--info));
    border-radius: 5px;
    border: 2px solid rgba(6, 8, 12, 0.95);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-secondary);
}

/* CANVAS DE CONFETI */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.app-container {
    width: 100%;
    max-width: 1650px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 3. CABECERA VIP (STADIUM SCREEN) */
.main-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 30%;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    box-shadow: 0 0 15px var(--gold-primary);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 8px;
}

.golden-trophy-icon {
    font-size: 3.8rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(229, 184, 59, 0.5));
    animation: trophy-bounce 3.5s ease-in-out infinite alternate;
}

@keyframes trophy-bounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.03) rotate(3deg); }
}

.main-header h1 {
    font-family: var(--font-header);
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-main);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
}

.main-header h1 span {
    font-family: var(--font-header);
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-header .subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--gold-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    background: rgba(229, 184, 59, 0.08);
    display: inline-block;
    padding: 6px 24px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    margin-top: 12px;
    box-shadow: 0 0 15px rgba(229, 184, 59, 0.05);
}

/* 4. TABS NAVEGACIÓN ESTILO SEGMENTED SLIDER */
.dashboard-tabs {
    display: inline-flex;
    justify-content: center;
    background: rgba(6, 8, 12, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 6px;
    margin: 0 auto 36px auto;
    align-self: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 14px 36px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--gold-gradient);
    color: var(--text-dark);
    box-shadow: 0 4px 20px rgba(229, 184, 59, 0.4);
    font-weight: 800;
}

/* Control de visibilidad de las pestañas */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 5. DISEÑO DE PANELES DE CRISTAL (GLASS PANELS) */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.section-card:hover {
    border-color: rgba(229, 184, 59, 0.4);
    background: var(--bg-card-hover);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(229, 184, 59, 0.08);
}

.flex-grow-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 350px);
    min-height: 480px;
    margin-bottom: 0;
}

.section-title {
    font-family: var(--font-header);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title i {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* FORMULARIOS DEPORTIVOS */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    background: rgba(6, 8, 12, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.input-group input:focus {
    outline: none;
    border-color: var(--gold-secondary);
    box-shadow: 0 0 15px rgba(229, 184, 59, 0.25);
    background: rgba(6, 8, 12, 0.85);
}

/* BOTONES DE ALTA CALIDAD */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-bounce);
    user-select: none;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--text-dark);
    box-shadow: 0 4px 20px rgba(229, 184, 59, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(229, 184, 59, 0.55);
    filter: brightness(1.1);
}

.btn-success {
    background: var(--emerald-gradient);
    color: var(--text-dark);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.25);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.45);
}

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

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold-primary);
}

.btn-secondary.danger:hover:not(:disabled) {
    background: rgba(255, 59, 48, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-large {
    padding: 18px 32px;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

/* LISTA DE PARTICIPANTES */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
}

.list-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
}

.action-icons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    color: var(--gold-secondary);
    border-color: var(--gold-primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.icon-btn.danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(255, 59, 48, 0.1);
}

/* TABLERO DE ESTADÍSTICAS RÁPIDAS (SIDEBAR) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(6, 8, 12, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 12px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-box.highlight {
    border-color: rgba(229, 184, 59, 0.25);
    background: rgba(229, 184, 59, 0.02);
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-secondary);
    text-shadow: 0 0 10px rgba(229, 184, 59, 0.1);
}

.stat-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ALERTAS CON DISEÑO DEPORTIVO */
.warning-alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
}

.warning-alert.info {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: #a5f3fc;
}

.warning-alert.success {
    background: rgba(0, 255, 170, 0.08);
    border: 1px solid rgba(0, 255, 170, 0.2);
    color: #a7f3d0;
}

/* PARTICIPANTES LIST SCROLL */
.participants-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.participants-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.participant-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    animation: slide-in-fade 0.3s ease-out;
}

.participant-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.p-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.p-name-txt {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.p-tickets-badge {
    font-size: 0.72rem;
    color: var(--gold-primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-delete-participant {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: var(--transition-smooth);
}

.btn-delete-participant:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* ==========================================================================
   6. CONTROLES Y REJILLA (SORTEO TAB)
   ========================================================================== */
.main-layout {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 32px;
}

.grid-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* BARRA DE CONTROLES VIP */
.controls-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.draw-controls {
    display: flex;
    gap: 16px;
}

.draw-settings {
    display: flex;
    align-items: center;
    gap: 28px;
}

.control-setting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-setting label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-setting select {
    background: rgba(6, 8, 12, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 10px 18px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.control-setting select:focus {
    outline: none;
    border-color: var(--gold-secondary);
}

.icon-btn-large {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-bounce);
}

.icon-btn-large:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold-primary);
    color: var(--gold-secondary);
    transform: scale(1.1);
}

/* BANNER DE ESTADO CON LEDS */
.draw-status-banner {
    background: rgba(6, 8, 12, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-pulse {
    width: 12px;
    height: 12px;
    background-color: var(--text-muted);
    border-radius: 50%;
    display: inline-block;
}

.status-pulse.active {
    background-color: var(--success);
    animation: status-pulse-glow 1.5s infinite;
}

.status-pulse.running {
    background-color: var(--info);
    animation: status-pulse-glow-blue 1.2s infinite;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gold-gradient);
    box-shadow: 0 0 15px rgba(229, 184, 59, 0.6);
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* REJILLA DE SOBRES */
.envelopes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 18px;
    overflow-y: auto;
    max-height: calc(100vh - 270px);
    padding: 10px 4px;
}

/* ==========================================================================
   7. EA SPORTS FC / FIFA CARD PACK STYLE
   ========================================================================== */
.envelope-card-wrapper {
    perspective: 1000px;
    aspect-ratio: 4/5;
    cursor: pointer;
    position: relative;
}

/* Efecto de brillo de haz de luz en hover */
.envelope-card-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0) 25%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 75%);
    background-size: 250% 250%;
    background-position: -120% -120%;
    transition: background-position 0.7s ease-out;
    pointer-events: none;
    z-index: 5;
    border-radius: var(--radius-sm);
}

.envelope-card-wrapper:hover::after {
    background-position: 220% 220%;
}

.envelope-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.envelope-card-wrapper:hover:not(.is-opened) .envelope-card-inner {
    transform: translateY(-8px) rotateY(15deg);
}

.envelope-card-wrapper.is-opened .envelope-card-inner {
    transform: rotateY(180deg);
    cursor: default;
}

.envelope-card-wrapper.is-opened:hover .envelope-card-inner {
    transform: translateY(-8px) rotateY(195deg);
}

.envelope-card-front,
.envelope-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

/* CROMO CERRADO: PAQUETE DE LEYENDAS (GOLD PACK) */
.envelope-card-front {
    background: linear-gradient(135deg, #0f1522 0%, #06090e 55%, #000000 100%);
    border: 1.5px solid var(--border-color);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.envelope-card-front::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--gold-primary), var(--gold-primary) 3px, transparent 3px, transparent 6px);
}

.envelope-card-front::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--gold-primary), var(--gold-primary) 3px, transparent 3px, transparent 6px);
}

.envelope-flap-mockup {
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.envelope-number {
    font-family: var(--font-header);
    font-size: 3.4rem;
    font-weight: 700;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.95));
    margin-top: 16px;
    z-index: 2;
}

.envelope-footer-decor {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gold-primary);
    z-index: 2;
    border-top: 1px dashed rgba(229, 184, 59, 0.25);
    padding-top: 8px;
}

/* CROMO ABIERTO: CARTA FUT RATINGS (GOLD EDITION) */
.envelope-card-back {
    background: linear-gradient(135deg, #0b101d 0%, #05070c 100%);
    border: 2.5px solid var(--gold-primary);
    transform: rotateY(180deg);
    padding: 10px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* Borde poligonal estilizado */
    clip-path: polygon(0 0, 100% 0, 100% 88%, 88% 100%, 0 100%);
}

.card-flag-container {
    width: 76px;
    height: 50px;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-top: 8px;
    overflow: hidden;
}

.card-flag-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-country-name {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 900;
    text-align: center;
    color: #ffffff;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.card-winner-box {
    background: rgba(6, 8, 12, 0.85);
    width: 100%;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: auto;
    border: 1px solid var(--border-color);
}

.card-winner-lbl {
    font-family: var(--font-sans);
    font-size: 0.55rem;
    color: var(--gold-primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-winner-name {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffffff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-winner-name.unassigned {
    color: var(--text-muted);
    font-style: italic;
    font-weight: normal;
}

/* ==========================================================================
   8. APERTURA CINEMÁTICA CON DESTELLO DE LUZ (PACK OPENING)
   ========================================================================== */
.reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 5, 8, 0.97);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

.reveal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Destello de cámara sincronizado en la apertura (exactamente a los 1.5s del giro) */
.reveal-overlay::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

.reveal-overlay.active::after {
    animation: pack-opening-flash 2s ease-out forwards;
}

@keyframes pack-opening-flash {
    0% { opacity: 0; }
    55% { opacity: 0; }
    60% { opacity: 1; filter: blur(5px); } /* Detonador del flash */
    70% { opacity: 0.9; }
    100% { opacity: 0; }
}

/* Foco radial gigante */
.reveal-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 900px;
    height: 900px;
    margin-top: -450px;
    margin-left: -450px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, rgba(229, 184, 59, 0.05) 40%, rgba(4, 5, 8, 0) 70%);
    animation: spotlight-sweep-animated 8s linear infinite;
    pointer-events: none;
}

@keyframes spotlight-sweep-animated {
    0% { transform: rotate(0deg) translate(-50px, -50px); }
    50% { transform: rotate(180deg) translate(50px, 50px); }
    100% { transform: rotate(360deg) translate(-50px, -50px); }
}

.reveal-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    z-index: 10;
}

.reveal-ticket-info {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold-secondary);
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(229, 184, 59, 0.7);
}

.reveal-card-container {
    perspective: 1500px;
    width: 290px;
    aspect-ratio: 4/5;
    margin: 10px 0;
}

.reveal-envelope-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 80px rgba(0,0,0,0.9), 0 0 60px rgba(229, 184, 59, 0.35);
}

.reveal-envelope-card.is-flipping {
    transform: rotateY(180deg) scale(1.18);
}

.reveal-envelope-card .envelope-front,
.reveal-envelope-card .envelope-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    border: 3px solid var(--gold-primary);
}

.reveal-envelope-card .envelope-front {
    background: linear-gradient(135deg, #10192b 0%, #05080f 50%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope-seal {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe699 5%, #e5b83b 55%, #805c10 100%);
    border: 2px solid var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: var(--text-dark);
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), inset 0 2px 5px rgba(255,255,255,0.5);
    animation: seal-pulse-glow 2s infinite alternate;
}

@keyframes seal-pulse-glow {
    0% { transform: scale(1); box-shadow: 0 12px 25px rgba(0,0,0,0.6), 0 0 15px rgba(229,184,59,0.4); }
    100% { transform: scale(1.06); box-shadow: 0 18px 30px rgba(0,0,0,0.6), 0 0 35px rgba(229,184,59,0.7); }
}

.reveal-envelope-card .envelope-back {
    background: linear-gradient(135deg, #0b101c 0%, #030509 100%);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 90% 100%, 0 100%);
}

.reveal-country-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.reveal-flag-container {
    width: 165px;
    height: 110px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.65);
    border: 2px solid rgba(255,255,255,0.2);
}

.reveal-flag-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reveal-country-name {
    font-family: var(--font-sans);
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.reveal-confed-tag {
    background: var(--emerald-gradient);
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 900;
    padding: 6px 20px;
    border-radius: 30px;
}

/* GANADOR MOSTRADO EN PEDESTAL DE CRISTAL */
.reveal-winner-section {
    background: rgba(6, 8, 12, 0.85);
    border: 1.5px solid var(--gold-primary);
    border-radius: var(--radius-md);
    padding: 22px 48px;
    width: 100%;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s;
}

.reveal-overlay.active .reveal-winner-section {
    opacity: 1;
    transform: translateY(0);
}

.winner-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold-secondary);
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.winner-name {
    font-size: 2.4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255,255,255,0.25);
}

.shake-element {
    animation: pack-shake-tension 0.6s infinite alternate;
}

@keyframes pack-shake-tension {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    20% { transform: translate(-2px, -3px) rotate(-1deg); }
    40% { transform: translate(-4px, 0px) rotate(1.5deg); }
    60% { transform: translate(2px, 3px) rotate(-1.5deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    100% { transform: translate(3px, -2px) rotate(0deg); }
}

/* ==========================================================================
   9. MODAL DE RESULTADOS DE CRISTAL
   ========================================================================== */
.results-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 5, 8, 0.9);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.results-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.results-modal {
    background: rgba(11, 15, 25, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 1000px;
    max-height: 85vh;
    box-shadow: 0 40px 90px rgba(0,0,0,0.85), 0 0 50px rgba(0, 240, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scale-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.results-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.success-icon {
    font-size: 2.2rem;
    color: var(--success);
    filter: drop-shadow(0 0 10px var(--success));
}

.results-header h2 {
    font-size: 1.7rem;
    font-weight: 800;
    background: var(--gold-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-btn {
    position: absolute;
    right: 24px;
    top: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 0.5;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: white;
}

/* FILTRADOS DEL MODAL */
.results-actions {
    padding: 18px 32px;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.export-buttons {
    display: flex;
    gap: 12px;
}

/* TABLA DE RESULTADOS */
.results-table-container {
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px 32px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
}

.results-table th,
.results-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.results-table th {
    background-color: transparent;
    color: var(--gold-primary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table tbody tr {
    transition: var(--transition-smooth);
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.results-table td .flag-small {
    width: 34px;
    height: 23px;
    border-radius: 3px;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-right: 14px;
    border: 1px solid rgba(255,255,255,0.1);
}

.results-table td .country-span {
    vertical-align: middle;
    font-weight: 700;
}

.results-table td .winner-span {
    font-weight: 800;
    color: var(--success);
}

.results-table td .winner-span.unassigned {
    color: var(--text-muted);
    font-style: italic;
    font-weight: normal;
}

.results-table td .badge-confed {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
}

.results-footer {
    padding: 20px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   10. PESTAÑA DE CLASIFICACIÓN (E-SPORTS SCORES STYLE)
   ========================================================================== */
.leaderboard-layout {
    display: grid;
    grid-template-columns: 1fr 370px;
    gap: 32px;
    align-items: start;
}

.leaderboard-table-card {
    padding: 24px;
    margin-bottom: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header .section-title {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.search-filter-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(6, 8, 12, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    min-width: 280px;
    transition: var(--transition-smooth);
}

.search-filter-box:focus-within {
    border-color: var(--gold-secondary);
    box-shadow: 0 0 15px rgba(229, 184, 59, 0.25);
    background: rgba(6, 8, 12, 0.75);
}

.search-filter-box i {
    color: var(--gold-primary);
    font-size: 1rem;
}

.search-filter-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    width: 100%;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.leaderboard-table th {
    padding: 12px 18px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-table td {
    padding: 16px 20px;
    font-size: 0.98rem;
    vertical-align: middle;
    background: rgba(11, 15, 25, 0.5);
    border-top: 1.5px solid var(--border-color);
    border-bottom: 1.5px solid var(--border-color);
    transition: var(--transition-smooth);
}

.leaderboard-table td:first-child {
    border-left: 1.5px solid var(--border-color);
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.leaderboard-table td:last-child {
    border-right: 1.5px solid var(--border-color);
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

/* Fila del LÍDER actual con glow especial */
.leaderboard-table tbody tr:first-child td {
    border-color: rgba(229, 184, 59, 0.5);
    background: rgba(229, 184, 59, 0.05);
}

.leaderboard-table tbody tr:hover td {
    background: rgba(22, 28, 45, 0.6);
    border-color: var(--gold-secondary);
}

/* Tipografía de puntuaciones */
.leaderboard-table td:nth-child(4),
.leaderboard-table td:nth-child(5),
.leaderboard-table td:nth-child(6),
.leaderboard-table td:nth-child(7) {
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: center;
}

.leaderboard-teams-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6,8,12,0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.team-badge-inline img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

/* MEDALLERO DE PODIO EN 3D HOLOGRÁFICO */
.row-pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    border: 1.5px solid rgba(255,255,255,0.08);
}

tr:nth-child(1) td:first-child .row-pos-badge {
    background: radial-gradient(circle at 30% 30%, #fff0b3 0%, #e5b83b 55%, #96701c 100%);
    color: var(--bg-primary);
    border-color: #fff5cc;
    box-shadow: 0 0 15px rgba(229,184,59,0.6);
}

tr:nth-child(2) td:first-child .row-pos-badge {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #a6a6a6 55%, #666666 100%);
    color: var(--bg-primary);
    border-color: #e6e6e6;
    box-shadow: 0 0 12px rgba(255,255,255,0.35);
}

tr:nth-child(3) td:first-child .row-pos-badge {
    background: radial-gradient(circle at 30% 30%, #fcd4b4 0%, #cd7f32 55%, #804c10 100%);
    color: var(--bg-primary);
    border-color: #f7c9b0;
    box-shadow: 0 0 12px rgba(205,127,50,0.45);
}

.leaderboard-table .debt-amount {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-secondary);
}

.leaderboard-table .debt-amount.zero {
    color: var(--success);
    text-shadow: 0 0 12px rgba(0,255,170,0.45);
}

/* TABLERO DE ESTADÍSTICAS TOTALES LATERAL (STADIUM SCOREBOARD) */
.leaderboard-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stat-val-large {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--success);
    text-shadow: 0 0 15px rgba(0,255,170,0.6);
    background: rgba(6, 8, 12, 0.7);
    border: 2.5px solid var(--border-color);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.85);
}

.summary-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 20px 0;
}

.summary-substats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.substat-box {
    background: rgba(6, 8, 12, 0.5);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.substat-val {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
}

.substat-lbl {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* TABLA DE REGLAS DE COSTOS */
.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 18px 0;
}

.rules-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.rule-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rule-badge.warning { background: rgba(229, 184, 59, 0.15); border: 1px solid var(--gold-primary); color: var(--gold-secondary); }
.rule-badge.danger { background: rgba(255, 59, 48, 0.15); border: 1px solid var(--danger); color: var(--danger); }
.rule-badge.info { background: rgba(0, 240, 255, 0.15); border: 1px solid var(--info); color: var(--info); }
.rule-badge.success { background: rgba(0, 255, 170, 0.15); border: 1px solid var(--success); color: var(--success); }

.rules-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    margin-top: 14px;
}

/* ==========================================================================
   11. PESTAÑA: MARCADORES DE EQUIPOS (FUT SELECTIONS DETAILED)
   ========================================================================== */
.matches-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

.matches-title-area h2 {
    font-size: 1.85rem;
    font-weight: 800;
    background: var(--gold-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.matches-title-area .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.matches-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Grid de marcadores */
.teams-records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 28px;
}

.team-record-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-premium);
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 90% 100%, 0 100%);
}

.team-record-card:hover {
    border-color: var(--gold-secondary);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75), 0 0 35px rgba(229, 184, 59, 0.12);
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.team-card-flag-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.team-card-flag-box img {
    width: 62px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255,255,255,0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.team-card-name {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.team-card-confed {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--gold-secondary);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 800;
}

.team-card-owner {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 22px;
    background: rgba(6, 8, 12, 0.7);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.team-card-owner strong {
    color: #ffffff;
    font-weight: 800;
}

/* Controles +/- */
.team-counters-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.counter-control-box {
    background: rgba(6, 8, 12, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.counter-label {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.counter-value-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.counter-val {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    width: 24px;
    text-align: center;
}

.counter-control-box.win .counter-val { color: var(--success); }
.counter-control-box.draw .counter-val { color: var(--info); }
.counter-control-box.loss .counter-val { color: var(--danger); }

.counter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-main);
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 800;
    transition: var(--transition-bounce);
}

.counter-btn:hover:not(:disabled) {
    background: var(--gold-gradient);
    color: var(--text-dark);
    border-color: var(--gold-secondary);
}

.counter-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.team-card-subtotal {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.team-card-subtotal strong {
    font-family: var(--font-mono);
    color: var(--gold-secondary);
    font-weight: 700;
    font-size: 1.15rem;
}

/* ==========================================================================
   12. MODAL DE DETALLE DEL PARTICIPANTE VIP
   ========================================================================== */
.participant-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 5, 8, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.participant-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.participant-modal {
    background: rgba(11, 15, 25, 0.92);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 35px 80px rgba(0,0,0,0.85);
    border-radius: var(--radius-md);
    width: 92%;
    max-width: 620px;
    overflow: hidden;
    position: relative;
    animation: scale-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-user-icon {
    font-size: 2.6rem;
    color: var(--gold-primary);
}

.modal-subtitle {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
    max-height: 55vh;
    overflow-y: auto;
}

/* Mini Tablero de Puntuaciones */
.modal-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.modal-stat-card {
    background: rgba(6, 8, 12, 0.6);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-stat-val {
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 700;
}

.modal-stat-lbl {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.modal-section-title {
    font-family: var(--font-header);
    font-size: 1.45rem;
    color: var(--gold-secondary);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    letter-spacing: 0.5px;
}

.modal-section-title i {
    color: var(--gold-primary);
}

.modal-teams-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 8, 12, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
}

.modal-team-info-side {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-team-info-side img {
    width: 46px;
    height: 31px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255,255,255,0.12);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.modal-team-name-side {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 800;
}

.modal-team-stats-side {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-team-counters-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

.modal-team-subtotal-display {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-secondary);
    min-width: 80px;
    text-align: right;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-debt-total {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.15rem;
}

.modal-debt-total strong {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--success);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0,255,170,0.35);
}

/* ==========================================================================
   13. ANIMACIONES Y MEDIA QUERIES
   ========================================================================== */
@keyframes status-pulse-glow {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 170, 0.6); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(0, 255, 170, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 170, 0); }
}

@keyframes status-pulse-glow-blue {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.6); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(0, 240, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.animate-scale-up {
    animation: scale-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes scale-up {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-fade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* DISEÑO RESPONSIVO (MEDIA QUERIES) */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .flex-grow-card {
        height: 380px;
    }
    .envelopes-grid {
        max-height: 550px;
    }
    .leaderboard-layout {
        grid-template-columns: 1fr;
    }
    .leaderboard-stats-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .draw-settings {
        justify-content: space-between;
    }
    .app-container {
        padding: 16px;
    }
    .main-header h1 {
        font-size: 2.8rem;
    }
    .golden-trophy-icon {
        font-size: 2.8rem;
    }
    .envelopes-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 12px;
    }
    .envelope-number {
        font-size: 2.2rem;
        margin-top: 8px;
    }
    .card-flag-container {
        width: 50px;
        height: 33px;
        margin-top: 4px;
    }
    .card-country-name {
        font-size: 0.72rem;
        margin-top: 4px;
    }
    .card-winner-box {
        padding: 4px 2px;
    }
    .card-winner-name {
        font-size: 0.68rem;
    }
    .envelope-card-front {
        padding: 8px;
    }
    .envelope-card-back {
        padding: 6px;
    }
    .leaderboard-stats-panel {
        grid-template-columns: 1fr;
    }
    .dashboard-tabs {
        width: 100%;
        flex-wrap: wrap;
        border-radius: var(--radius-md);
        padding: 8px;
    }
    .tab-btn {
        flex: 1 1 45%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .results-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .export-buttons {
        justify-content: space-between;
    }
}

/* ==========================================================================
   14. ESTILOS DE LA FASE DE ELIMINATORIAS (TOURNAMENT BRACKET)
   ========================================================================== */
.bracket-wrapper {
    overflow-x: auto;
    width: 100%;
    padding: 20px 5px;
    mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
}

.bracket-butterfly {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 15px;
    min-width: 1350px;
    margin: 0 auto;
}

.bracket-side {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.bracket-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    flex-shrink: 0;
    gap: 10px;
    background: radial-gradient(circle, rgba(229, 184, 59, 0.04) 0%, transparent 70%);
    border-radius: var(--radius-md);
    padding: 10px 5px;
}

/* Área de trofeo central */
.championship-cup-area {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
}

.gold-cup-icon {
    font-size: 3rem;
    color: var(--gold-secondary);
    filter: drop-shadow(0 0 10px rgba(229, 184, 59, 0.45));
    animation: floatGoldCup 4s ease-in-out infinite;
}

@keyframes floatGoldCup {
    0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 10px rgba(229, 184, 59, 0.45)); }
    50% { transform: translateY(-6px) scale(1.05); filter: drop-shadow(0 0 18px rgba(229, 184, 59, 0.65)); }
}

.bracket-column {
    display: flex;
    flex-direction: column;
    width: 145px;
    flex-shrink: 0;
}

.bracket-column.center-column {
    width: 165px;
}

.bracket-column-title {
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-secondary);
    text-align: center;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 5px;
    text-shadow: 0 0 5px rgba(254, 216, 106, 0.15);
}

.gold-title {
    color: #ffffff;
    border-bottom-color: var(--gold-secondary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
    font-size: 1.1rem;
}

.bracket-matches-list {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 520px; /* Reducido a 520px para compactar el árbol y eliminar el espacio vacío */
}

.center-list {
    height: 340px;
    justify-content: center;
    gap: 25px;
}

/* TARJETA DE PARTIDO BRACKET COMPACTA */
.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-bounce);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.bracket-match:hover {
    border-color: rgba(229, 184, 59, 0.3);
    background: var(--bg-card-hover);
    transform: scale(1.025);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(229, 184, 59, 0.05);
}

/* Efecto de avance sutil en hover según el lado */
.left-side .bracket-match:hover {
    transform: translateX(3px) scale(1.015);
}

.right-side .bracket-match:hover {
    transform: translateX(-3px) scale(1.015);
}

.bracket-match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 2px;
}

.bracket-info-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.bracket-info-btn:hover {
    color: var(--gold-secondary);
    transform: scale(1.15);
}

.bracket-match-teams {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* FILA DE EQUIPO DENTRO DE LA TARJETA COMPACTA */
.bracket-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 8, 12, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.01);
    border-radius: 2px;
    padding: 4px 6px;
    transition: var(--transition-smooth);
    user-select: none;
    height: 24px; /* Fila de una sola línea */
}

.bracket-team.clickable {
    cursor: pointer;
}

.bracket-team.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Ganador seleccionado */
.bracket-team.winner {
    background: linear-gradient(135deg, rgba(229, 184, 59, 0.08) 0%, rgba(5, 10, 7, 0.55) 100%);
    border-color: var(--gold-secondary);
    box-shadow: 0 0 8px rgba(229, 184, 59, 0.1);
}

.bracket-team.winner .bracket-team-name {
    color: #ffffff;
    font-weight: 800;
}

.bracket-team.winner::after {
    content: '\f058'; /* FontAwesome check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--success);
    font-size: 0.75rem;
    filter: drop-shadow(0 0 3px var(--success));
    margin-left: 4px;
}

.bracket-team.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bracket-team-identity {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-grow: 1;
}

.bracket-flag {
    width: 22px;
    height: 14px;
    object-fit: cover;
    border-radius: 1px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bracket-flag-placeholder {
    width: 22px;
    height: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.5rem;
}

.bracket-team-name {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ESTILOS DEL MODAL DE DETALLES DE PARTIDOS */
.bracket-modal-teams-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
}

.bracket-modal-team-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
}

.bracket-modal-vs {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--gold-secondary);
    text-shadow: 0 0 15px rgba(229, 184, 59, 0.3);
    flex-shrink: 0;
}

.badge-owner-modal {
    background: linear-gradient(135deg, rgba(229, 184, 59, 0.2) 0%, rgba(229, 184, 59, 0.05) 100%);
    border: 1px solid var(--gold-secondary);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ESTILOS DE IMPRESIÓN */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .app-container, .stars-overlay, .sidebar-panel, .controls-bar, .draw-status-banner, .envelopes-grid, .results-actions, .results-footer, .close-btn, #confetti-canvas {
        display: none !important;
    }
    .results-modal-overlay {
        position: relative;
        background: transparent;
        opacity: 1 !important;
        pointer-events: auto !important;
        display: block !important;
    }
    .results-modal {
        box-shadow: none;
        border: none;
        background: transparent;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        display: block;
    }
    .results-header h2 {
        color: #000000 !important;
        -webkit-text-fill-color: initial !important;
        background: none !important;
    }
    .results-table th {
        background-color: #f2f2f2 !important;
        color: #000000 !important;
        border-bottom: 2px solid #000000;
    }
    .results-table td {
        border-bottom: 1px solid #cccccc;
        color: #000000 !important;
    }
    .results-table td .winner-span {
        color: #000000 !important;
    }
}
