:root{
  --primary:#023171; /* azul Super Liga BetPlay */
  --primary-700:#034599;
  --bg:#ffffff;
  --muted:#f5f5f5;
  --text:#121212;
  --accent:#FFD700;  /* opcional para resaltes */
  --radius:16px;
  --shadow:0 10px 30px rgba(0,0,0,.2);
}

/* Botón principal */
.dimayor-btn-eventos{
  appearance:none;
  background:var(--primary);
  color:#fff;
  border:none;
  padding:12px 22px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  transition:transform .05s ease, background .3s ease, box-shadow .3s ease;
  box-shadow:0 6px 20px rgba(2,49,113,.25);
}
.dimayor-btn-eventos:hover{ background:var(--primary-700); }
.dimayor-btn-eventos:active{ transform:translateY(1px); }

/* Modal */
.dimayor-modal{
  position:fixed; inset:0; z-index:9999;
  display:none;
}
.dimayor-modal[aria-hidden="false"]{ display:block; }
.dimayor-modal__overlay{
  position:absolute; inset:0; background:rgba(0,0,0,.6);
  opacity:0; animation:fadeIn .2s forwards;
}
.dimayor-modal__content{
  position:relative; margin:4% auto 0; width:min(920px,92vw);
  background:var(--bg); border-radius:var(--radius); box-shadow:var(--shadow);
  display:flex; flex-direction:column; max-height:88vh; overflow:hidden;
  transform:translateY(12px); animation:slideUp .25s ease forwards;
}
@keyframes fadeIn{to{opacity:1}}
@keyframes slideUp{to{transform:translateY(0)}}

.dimayor-modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; background:linear-gradient(0deg, #012654, var(--primary));
  color:#fff;
}
.dimayor-modal__header h3{ margin:0; font-size:18px; }
.dimayor-modal__close{
  background:transparent; border:none; color:#fff; font-size:26px; cursor:pointer;
}

/* Tabs */
.dimayor-tabs{
  display:flex; gap:6px; padding:10px; background:var(--muted);
  border-bottom:1px solid #eaeaea;
}
.dimayor-tab{
  flex:1; background:#fff; border:1px solid #e5e7eb; border-radius:12px;
  padding:10px 12px; font-weight:700; cursor:pointer;
  transition:box-shadow .2s, border-color .2s, color .2s, background .2s;
}
.dimayor-tab.is-active{
  border-color:var(--primary); color:var(--primary);
  box-shadow:0 4px 16px rgba(2,49,113,.15);
}

/* Panels */
.dimayor-tabs__panels{
  overflow:auto; padding:10px 12px 16px; height:100%;
}
.dimayor-tabpanel{ display:none; }
.dimayor-tabpanel.is-active{ display:block; }

/* Listados base (placeholder) */
.dimayor-list{
  display:grid; gap:10px;
}
.dimayor-card{
  border:1px solid #ececec; border-radius:12px; padding:12px;
  background:#fff; box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.dimayor-card__title{ font-weight:700; margin-bottom:6px; color:var(--primary); }

/* Badges de evento (ejemplo) */
.badge{ display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; border:1px solid #e5e7eb }
.badge--gol{ background:#e8f7ec; }
.badge--amarilla{ background:#fff7e6; }
.badge--roja{ background:#ffecec; }
.badge--cambio{ background:#e8f1ff; }

/* Responsive: en móvil hacemos modal "fullscreen" */
@media (max-width:768px){
  .dimayor-modal__content{
    width:100vw; height:100vh; margin:0; border-radius:0;
    max-height:100vh;
  }
  .dimayor-tabs{ position:sticky; top:0; z-index:1; }
}

/* ====== PLAYER PROFILE PREMIUM STYLES (Glassmorphism) ====== */
.player-profile-container {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.player-profile-modal {
    width: min(480px, 95vw);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    overflow: hidden;
    color: #1a1a1a;
    position: relative;
    animation: dimSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dimSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.player-profile-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(0,0,0,0.2);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s;
}

.player-profile-modal .modal-close:hover {
    background: rgba(0,0,0,0.4);
}

.player-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, #011a3d 100%);
    padding: 45px 30px 30px;
    color: white;
    position: relative;
}

.player-main-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.player-photo-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.25);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.player-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-photo-placeholder {
    font-size: 55px;
    color: rgba(255, 255, 255, 0.4);
}

.player-profile-name {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.player-meta {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    font-size: 13px;
    flex-wrap: wrap;
}

.meta-item {
    background: rgba(255, 255, 255, 0.12);
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-card-body {
    padding: 30px;
}

.section-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.player-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background: #ffffff;
    padding: 18px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #e2e8f0;
}

.stat-item.highlight {
    background: linear-gradient(135deg, #fff 0%, #fffbf2 100%);
    border: 1px solid #ffedb5;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-footer {
    margin-top: 30px;
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
}

.dimayor-player-clickable {
    cursor: pointer !important;
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dimayor-player-clickable:hover {
    background: rgba(2, 49, 113, 0.08) !important;
}

.player-profile-loading {
    padding: 80px 40px;
    text-align: center;
}

.dimayor-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #f1f5f9;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: dimSpin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 0 auto 20px;
}

@keyframes dimSpin {
    to { transform: rotate(360deg); }
}

.no-stats {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-style: italic;
}

/* === STANDINGS TABLE GLOBAL STYLES === */
.dimayor-table {
    width: 100% !important;
    max-width: 100% !important; /* Ahora ocupa todo el ancho disponible */
    margin: 20px auto !important; /* Centrado */
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 14px !important;
    background: #fff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .05) !important;
    border: 1px solid #eef2f7 !important;
    table-layout: auto !important;
}

.dimayor-group-title {
    font-size: 14px !important;
    margin: 25px 0 12px !important;
    color: #023171 !important;
    text-transform: uppercase !important;
    border-left: 4px solid #023171 !important;
    padding-left: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
}

.dimayor-table thead th {
    background: linear-gradient(180deg, #023171 0%, #011a3d 100%) !important;
    color: #ffffff !important;
    padding: 14px 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    border: none !important;
}

.dimayor-table td {
    padding: 12px 8px !important;
    border-bottom: 1px solid #f1f4f8 !important;
    vertical-align: middle !important;
    color: #334155 !important;
    text-align: center !important;
}

.dimayor-table tr:last-child td {
    border-bottom: none !important;
}

.dimayor-table tr:hover td {
    background-color: #f8fafc !important;
}

/* Alineaciones y anchos específicos */
.dimayor-table .col-pos { width: 42px !important; text-align: center !important; font-weight: 800; color: #1e293b; }
.dimayor-table .col-team { text-align: left !important; font-weight: 700; color: #0f172a; min-width: 200px; padding-left: 15px !important; }
.dimayor-table .col-pts { width: 70px !important; text-align: center !important; font-weight: 800; color: #023171; background: rgba(2, 49, 113, 0.03); }
.dimayor-table .col-stat { width: 60px !important; text-align: center !important; color: #64748b; font-size: 13px; }
.dimayor-table .col-dg { width: 50px !important; text-align: center !important; font-weight: 600; color: #475569; }

/* Especial para la tabla de descenso */
.dimayor-table-relegation .col-stat { width: auto !important; min-width: 60px; }

/* Estilos de Logo */
.dimayor-table .team-box {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    justify-content: flex-start !important;
}

.dimayor-table img.team-logo, 
.dimayor-table img.team-logo-small,
.dimayor-table td img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    vertical-align: middle !important;
    margin-right: 0 !important; /* El margen lo maneja el gap del team-box */
    object-fit: contain !important;
    display: inline-block !important;
    padding: 0 !important;
    background: transparent !important;
    flex-shrink: 0;
}

.dimayor-table .team-name-small {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    max-width: 300px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    text-align: left !important;
}

#dimayor-scorers-container .team-name-small {
    max-width: none !important;
    font-size: 15px !important;
    color: #1a1a1a;
}

#dimayor-scorers-container .team-box {
    gap: 12px !important;
}

#dimayor-scorers-container td:nth-child(3) .team-name-small,
#dimayor-scorers-container td:nth-child(3) {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.scorer-avatar { 
    width: 38px !important; 
    height: 38px !important; 
    border-radius: 50% !important; 
    object-fit: cover !important; 
    background: #f1f5f9 !important; 
    border: 2px solid #fff !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1) !important;
    flex-shrink: 0;
}

/* Podio Premium con Badges Circulares */
#dimayor-scorers-container .col-pos span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}

#dimayor-scorers-container tr:nth-child(1) .col-pos span { 
    background: linear-gradient(180deg, #FFD700 0%, #FDB931 100%) !important; 
    color: #5C4000 !important; 
    box-shadow: 0 2px 4px rgba(253, 185, 49, 0.3);
}
#dimayor-scorers-container tr:nth-child(2) .col-pos span { 
    background: linear-gradient(180deg, #E2E2E2 0%, #C0C0C0 100%) !important; 
    color: #333 !important; 
}
#dimayor-scorers-container tr:nth-child(3) .col-pos span { 
    background: linear-gradient(180deg, #E2A76F 0%, #CD7F32 100%) !important; 
    color: #fff !important; 
}

#dimayor-scorers-container tr:hover td {
    background-color: rgba(2, 49, 113, 0.05) !important;
    transition: background 0.2s ease;
}

.scorer-team-logo { 
    width: 18px !important; 
    height: 18px !important; 
    object-fit: contain !important; 
    vertical-align: middle !important; 
    margin-right: 6px !important;
    flex-shrink: 0;
}

.dimayor-btn-view-more { 
    display: block !important; 
    width: 100% !important; 
    max-width: 100% !important; /* Ajustado al nuevo ancho */
    margin: 0 auto 20px;
    text-align: center !important; 
    background: #f8fafc !important; 
    border: 1px solid #e2e8f0 !important; 
    border-top: none !important; 
    padding: 16px !important; 
    font-weight: 800 !important; 
    cursor: pointer !important; 
    color: #023171 !important; 
    border-radius: 0 0 12px 12px !important; 
    transition: all 0.2s ease !important;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.dimayor-btn-view-more:hover { 
    background: #f1f5f9 !important;
    color: #011f4b !important;
}

/* Wrapper para scroll en móvil */
.dmr-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 12px;
}

@media (max-width: 1024px) {
    .dimayor-table .col-pts { width: 45px !important; }
    .dimayor-table .col-stat { width: 40px !important; }
    .dimayor-table .col-dg { width: 40px !important; }
    .dimayor-table .col-team { min-width: 160px !important; }
    .dimayor-table td, .dimayor-table th {
        padding: 12px 4px !important;
    }
}

@media (max-width: 768px) {
    .dimayor-table {
        font-size: 12px !important;
        margin: 10px 0 !important;
        table-layout: auto !important;
    }
    
    .dimayor-table .col-team {
        min-width: 140px !important;
        padding-left: 10px !important;
    }

    .dimayor-table .team-name-small {
        max-width: 120px !important;
        font-size: 11px !important;
    }

    .dimayor-group-title {
        font-size: 12px !important;
        margin: 15px 0 8px !important;
    }
}

.dmr-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 12px;
}

.hidden-scorer-row {
    display: none;
}