/* Replacing entire CSS with original comprehensive styling - UPDATED */
/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  /* Prefer the self-hosted font (GSC-Roboto), then Roboto/system fallbacks */
  font-family: 'GSC-Roboto', Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #f8f9fa;
  min-width: 280px;
  color: #222;
}

/* ===== FORZAR ANCHO COMPLETO - ANULAR ELEMENTOR/TEMAS ===== */
/* Anular cualquier padding/margin de contenedores Elementor padre */
.elementor-widget-container .golf-leaderboard-container,
.elementor-element .golf-leaderboard-container,
.elementor-column .golf-leaderboard-container,
.elementor-widget-shortcode .golf-leaderboard-container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Anular padding de widget shortcode de Elementor */
.elementor-widget-shortcode {
  padding: 0 !important;
  margin: 0 !important;
}

.elementor-widget-shortcode .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Anular padding de columnas Elementor */
.elementor-column-wrap,
.elementor-column > .elementor-widget-wrap {
  padding: 0 !important;
}

/* Forzar contenedor a ocupar todo el ancho disponible */
.golf-leaderboard-container,
.golf-leaderboard-container * {
  box-sizing: border-box !important;
}
main {
  margin: 0;
  padding: 0;
  min-width: 280px;
}

/* ===== CUSTOM SELECT (MOBILE) ===== */
.custom-select-box {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  position: relative;
  box-sizing: border-box;
  font-size: 1em;
  cursor: pointer;
}
.custom-select-selected {
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-weight: 500;
  border-bottom: 1px solid #e1e1e1;
}
.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 8px rgba(36, 59, 85, 0.08);
  z-index: 10;
  max-height: 180px;
  overflow-y: auto;
}
.custom-select-option {
  padding: 12px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid #e1e1e1;
  color: #222;
  background: #fff;
  cursor: pointer;
  border: 1px solid #e1e1e1;
}
.custom-select-option:last-child {
  border-bottom: none;
}
.custom-select-option:hover {
  background: #f0f4f8;
}

/* ===== ROUND SELECTOR ===== */
.round-selector-container {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 18px 24px 0 24px;
  background: #f8f9fa;
}
.round-label {
  font-weight: 600;
  color: #222;
  font-size: 1.08em;
}
.round-select {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  font-size: 1em;
  background: #fff;
  color: #222;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.round-select:focus {
  border-color: #27ae60;
}

/* Botón con gradiente Obsidian Glow */
.view-results-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 1.08em;
  font-weight: bold;
  background: linear-gradient(90deg, #243b55 0%, #141e30 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(36, 59, 85, 0.15);
  transition: transform 0.1s, box-shadow 0.2s;
  letter-spacing: 1px;
}
.view-results-btn:hover,
.view-results-btn:focus {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(36, 59, 85, 0.18);
  background: linear-gradient(90deg, #141e30 0%, #243b55 100%);
}

/* ===== ANULAR TODOS LOS PADDINGS/MARGINS DE ELEMENTOR Y TEMAS ===== */
/* Máxima prioridad - Forzar ancho completo sin espacios */
div[class*="elementor"] .golf-leaderboard-container,
section[class*="elementor"] .golf-leaderboard-container,
.elementor .golf-leaderboard-container {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Anular padding del widget container de Elementor */
.elementor-widget-container > .golf-leaderboard-container {
  margin: 0 !important;
  padding: 0 !important;
}

/* Si el shortcode está dentro de un div wrapper */
.elementor-shortcode > .golf-leaderboard-container,
div > .golf-leaderboard-container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* ===== LEADERBOARD CONTAINER =====  user */
.golf-leaderboard-container,
.leaderboard-container {
    flex-direction: column;
    justify-content: flex-start;
    background-color: #f8f9fa;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    overflow-y: auto;
    display: flex;
    max-width: 100% !important;
    max-height: 100vh;
    /* Make this a container for container queries so layout adapts to the column width */
    container-type: inline-size;
    container-name: leaderboard;
    overflow-x: hidden;
    box-sizing: border-box !important;
    /* Compensar padding de columna Elementor padre si existe */
    position: relative;
    left: 0;
    right: 0;
}

/* Variante para compensar padding común de Elementor (10px, 15px, 20px) */
.elementor-column-gap-default > .elementor-widget-wrap > .elementor-element .golf-leaderboard-container,
.elementor-column-gap-narrow > .elementor-widget-wrap > .elementor-element .golf-leaderboard-container {
  margin-left: -10px !important;
  margin-right: -10px !important;
  width: calc(100% + 20px) !important;
  max-width: calc(100% + 20px) !important;
}

.elementor-column-gap-extended > .elementor-widget-wrap > .elementor-element .golf-leaderboard-container,
.elementor-column-gap-wide > .elementor-widget-wrap > .elementor-element .golf-leaderboard-container {
  margin-left: -20px !important;
  margin-right: -20px !important;
  width: calc(100% + 40px) !important;
  max-width: calc(100% + 40px) !important;
}

.elementor-column-gap-wider > .elementor-widget-wrap > .elementor-element .golf-leaderboard-container {
  margin-left: -30px !important;
  margin-right: -30px !important;
  width: calc(100% + 60px) !important;
  max-width: calc(100% + 60px) !important;
}
.golf-leaderboard-list,
.leaderboard-list {
  width: 100% !important;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  background-color: #f8f9fa;
  /* Removed left padding so the list is flush inside its white container */
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  /* Fallback: allow capping height via CSS var if JS is unavailable */
  max-height: var(--leaderboard-max-height, none);
  overflow-x: hidden; /* avoid horizontal scrollbar inside Elementor columns */
  box-sizing: border-box !important;

  /* Safeguard: force zero left offset for cases where parent elementor columns add spacing */
  margin-left: 0 !important;
  padding-left: 0 !important;

  /* Center the leaderboard content area and limit width so desktop and monitor show the same centered layout */
  max-width: 920px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Extra high-specificity rules to override theme/elementor spacing if still present */
.elementor .golf-leaderboard-container > .golf-leaderboard-list,
.elementor .golf-leaderboard-container > .leaderboard-list,
.golf-leaderboard-container .golf-leaderboard-list,
.golf-leaderboard-container .leaderboard-list {
  padding-left: 0 !important;
  margin-left: 0 !important;
}
.golf-leaderboard-card,
.leaderboard-card {
  background-color: white;
  padding: 6px 4px;
  width: 100% !important;
  margin: 0 !important;
  display: flex;
  gap: 6px;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
  position: relative;
  min-height: 60px;
  flex-shrink: 0;
  min-width: 0; /* allow children to shrink within narrow columns */
  overflow: hidden; /* prevent inner overflow causing horizontal scroll */
  box-sizing: border-box !important;
}
.golf-leaderboard-card:first-child,
.leaderboard-card:first-child {
  border-top: 1px solid #e0e0e0 !important;
}
.golf-leaderboard-card:last-child,
.leaderboard-card:last-child {
  border-bottom: 1px solid #e0e0e0 !important;
}
.golf-leaderboard-card:hover,
.leaderboard-card:hover {
  background-color: #f8f9fa !important;
}
.golf-leaderboard-card .card-content {
  /* Grid layout: POS | Avatar | Name | Score/Thru */
  display: grid;
  grid-template-columns: 56px 40px 1fr 110px; /* POS | Avatar | Name | Score/Thru (110px) */
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 0;
  padding: 12px 8px;
  box-shadow: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
}

/* Container max-width tweak for option 2 (aesthetic centered layout) */
.golf-leaderboard-list, .leaderboard-list { max-width: 960px; }

/* Responsive avatar sizes: large screens 48px, medium 44px, small 40px */
@media (min-width: 1200px) {
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials { width: 48px; height: 48px; }
  .golf-leaderboard-card .card-content { grid-template-columns: 56px 48px 1fr 110px; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials { width: 44px; height: 44px; }
  .golf-leaderboard-card .card-content { grid-template-columns: 56px 44px 1fr 110px; }
}
@media (max-width: 991px) {
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials { width: 40px; height: 40px; }
  .golf-leaderboard-card .card-content { grid-template-columns: 56px 40px 1fr 110px; }
}
.leaderboard-img,
.name {
  text-align: left;
}
.name {
  flex: 1;
}
.golf-leaderboard-card .position-box {
  font-weight: bold;
  font-size: 1.02em;
  text-align: center;
  margin: 0;
  min-width: 56px;
  color: #666;
}
.golf-leaderboard-card .leaderboard-img,
.golf-leaderboard-card .avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 8px;
}

/* Grid cell alignment: center POS and avatar vertically/horizontally */
.golf-leaderboard-card .position-box { display:flex; align-items:center; justify-content:center; }
.golf-leaderboard-card .leaderboard-img, .golf-leaderboard-card .avatar-initials { align-self:center; justify-self:center; }

/* Name left aligned vertically centered */
.golf-leaderboard-card .name { align-self:center; justify-self:start; padding-left: 8px; }

/* Score/Thru right aligned and vertically centered */
.golf-leaderboard-card .score, .golf-leaderboard-card .thru { align-self:center; justify-self:end; }

/* Score group: stack score, accumulated and thru vertically; mobile grid will position it */
.score-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }

@media (max-width: 600px) {
  .card-content { display: grid; grid-template-columns: 48px 48px 1fr 64px; align-items: center; gap: 8px; }
  .position-box { grid-column: 1; }
  .leaderboard-img { grid-column: 2; }
  .name { grid-column: 3; text-align: left; }
  .score-group { grid-column: 4; align-items: center; }
  .score-group .thru { order: 2; font-size: 12px; }
  .score-group .score { order: 1; font-size: 16px; }
}
.golf-leaderboard-card .name {
  font-weight: 600;
  font-size: 1em;
  margin-bottom: 0;
  text-transform: uppercase;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 120px;
  max-width: calc(100% - 160px);
  display: block;
}
.golf-leaderboard-card .score,
.golf-leaderboard-card .score.negative,
.golf-leaderboard-card .score.positive,
.golf-leaderboard-card .score.even {
  font-weight: bold;
  font-size: 16px;
  text-align: right;
  min-width: 60px;
  color: #e74c3c;
  display: block;
}
.score.positive {
  color: #27ae60;
}
.score.even {
  color: #333;
}
.golf-leaderboard-card .thru,
.golf-leaderboard-card .thru-text {
  color: #888;
  font-size: 12px;
  text-align: right;
  min-width: 60px;
  display: block;
}

/* Force same grid layout even on very narrow screens to match visual style in the second image */
/* Keep mobile-like typography for smaller screens but layout already enforced above */
@media (max-width: 480px) {
  .golf-leaderboard-container .golf-leaderboard-card .card-content { grid-template-columns: 48px 40px 1fr 100px !important; gap: 8px !important; }
  .golf-leaderboard-container .golf-leaderboard-card .name { font-size: 0.95em !important; }
  .golf-leaderboard-container .golf-leaderboard-card .score { font-size: 14px !important; }
  .golf-leaderboard-container .golf-leaderboard-card .thru { font-size: 12px !important; }
}

.total-to-par {
  color: #6c757d; /* muted gray */
  font-size: clamp(0.8em, 1.2vw, 0.95em);
  line-height: 1;
}

/* Persistent last-update label inside the leaderboard container */
.golf-last-update {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 8px);
  opacity: 0;
  display: inline-block;
  color: #ffffff;
  font-weight: 600;
  font-size: clamp(0.75em, 1.0vw, 0.9em);
  text-align: center;
  padding: 4px 8px;
  line-height: 1;
  background: #1b2a40; /* solid navy */
  border-radius: 6px; /* small rounded rect */
  box-shadow: 0 2px 6px rgba(11, 24, 40, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 96px;
  max-width: 48%;
  z-index: 9999;
  transition: transform 280ms ease, opacity 280ms ease;
  pointer-events: none; /* non-interactive */
}

.golf-last-update.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

/* Accent when live */
.golf-last-update[data-status="live"] {
  border-color: rgba(43, 180, 75, 0.28);
}

/* Slightly dim when stale */
.golf-last-update[data-status="stale"] {
  opacity: 0.92;
}

/* When the pill is visible, add top padding to the container so the pill doesn't cover content */
.golf-leaderboard-container.has-last-update {
  padding-top: 32px !important; /* reduced space to keep layout tight */
}

/* Responsive adjustments: reduce size on narrow screens */
@media (max-width: 600px) {
  .golf-last-update {
    left: 8px;
    transform: translate(0, 8px);
    max-width: calc(100% - 16px);
    font-size: 0.78em;
    padding: 4px 8px;
  }
  .golf-leaderboard-container.has-last-update {
    padding-top: 28px !important;
  }
}

/* Slightly smaller on very small screens */
@media (max-width: 360px) {
  .golf-last-update {
    font-size: 0.92em;
  }
}

/* ===== RESPONSIVE ===== */
/* Reorganización de Media Queries para un enfoque Mobile-First */

@media (max-width: 600px) {
  /* **Cambio importante:** Se ajusta el padding del contenedor padre
        para controlar el espacio en los bordes. */
  .round-selector-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 8px 0 8px; /* Controla el padding desde aquí */
  }

  /* **Cambio importante:** El select y custom-select-box simplemente
        se ajustan al 100% de su contenedor. */
  .custom-select-box {
    width: 100%;
    margin: 0;
  }
  .round-select {
    width: 100%;
    margin: 0;
    padding: 12px 8px;
    box-sizing: border-box;
  }

  .view-results-btn {
    width: 80vw;
    max-width: 320px;
    padding: 12px;
    font-size: 1em;
    margin: auto;
    display: block;
    text-align: center;
    align-items: center;
  }
}

@media (max-width: 450px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    display: grid !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    grid-template-areas: 
      "pos img name score"
      ". . . thru" !important;
    grid-template-columns: 10% 20% 45% 25% !important;
    grid-template-rows: 1fr 1fr !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
    justify-items: center !important;
    align-items: center !important;
    padding: 10px 6px !important;
    margin: 0 !important;
    min-height: 70px !important;
  }
  .position-box {
    grid-area: pos !important;
    order: unset !important;
    margin: 0 !important;
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    grid-row: span 2 !important;
  }
  .leaderboard-img,
  .avatar-initials {
    grid-area: img !important;
    order: unset !important;
    width: 56px;
    height: 56px;
    margin: 0 !important;
    display: block !important;
    justify-self: center !important;
    align-self: center !important;
    grid-row: span 2 !important;
  }
  .name {
    grid-area: name !important;
    order: unset !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 0.95em;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    grid-row: span 2 !important;
  }
  .score,
  .score.negative,
  .score.positive,
  .score.even {
    grid-area: score !important;
    order: unset !important;
    justify-self: center !important;
    align-self: end !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 0.95em;
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-bottom: 2px !important;
  }
  .thru,
  .thru-text {
    grid-area: thru !important;
    order: unset !important;
    justify-self: center !important;
    align-self: start !important;
    text-align: center !important;
    white-space: nowrap;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 0.80em;
    color: #888;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 2px !important;
  }
}
@media (min-width: 451px) and (max-width: 600px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 6px 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box {
    flex-basis: 5% !important;
    text-align: center !important;
    margin-right: 1% !important;
    font-size: clamp(0.85em, 2vw, 1em) !important;
    order: 1 !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials {
    flex-basis: clamp(35px, 6vw, 45px) !important;
    flex-shrink: 0 !important;
    width: clamp(35px, 6vw, 45px) !important;
    height: clamp(35px, 6vw, 45px) !important;
    margin-right: 1.5% !important;
    order: 2 !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name {
    flex-grow: 0 !important;
    flex-basis: 30% !important;
    text-align: left !important;
    margin-right: auto !important;
    font-size: clamp(0.85em, 2vw, 1em) !important;
    min-width: 80px !important;
    order: 3 !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even {
    flex-basis: 8% !important;
    text-align: center !important;
    margin-right: 1% !important;
    font-size: clamp(0.85em, 2vw, 1em) !important;
    order: 4 !important;
    display: inline-block !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text {
    flex-basis: 12% !important;
    text-align: right !important;
    margin-right: 2% !important;
    font-size: clamp(0.75em, 1.8vw, 0.9em) !important;
    order: 5 !important;
    display: inline-block !important;
    min-width: auto !important;
  }
}

@media (min-width: 601px) and (max-width: 768px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 7px 10px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box {
    flex-basis: 5% !important;
    text-align: center !important;
    margin-right: 1% !important;
    font-size: clamp(0.9em, 2.2vw, 1.05em) !important;
    order: 1 !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials {
    flex-basis: clamp(40px, 7vw, 50px) !important;
    flex-shrink: 0 !important;
    width: clamp(40px, 7vw, 50px) !important;
    height: clamp(40px, 7vw, 50px) !important;
    margin-right: 1.8% !important;
    order: 2 !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name {
    flex-grow: 0 !important;
    flex-basis: 32% !important;
    text-align: left !important;
    margin-right: auto !important;
    font-size: clamp(0.9em, 2.2vw, 1.05em) !important;
    min-width: 90px !important;
    order: 3 !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even {
    flex-basis: 9% !important;
    text-align: center !important;
    margin-right: 1.5% !important;
    font-size: clamp(0.9em, 2.2vw, 1.05em) !important;
    order: 4 !important;
    display: inline-block !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text {
    flex-basis: 13% !important;
    text-align: right !important;
    margin-right: 2.5% !important;
    font-size: clamp(0.8em, 2vw, 0.95em) !important;
    order: 5 !important;
    display: inline-block !important;
    min-width: auto !important;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 8px 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box {
    flex-basis: 5% !important;
    text-align: center !important;
    margin-right: 1% !important;
    font-size: clamp(1em, 2.5vw, 1.08em) !important;
    order: 1 !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials {
    flex-basis: clamp(45px, 8vw, 55px) !important;
    flex-shrink: 0 !important;
    width: clamp(45px, 8vw, 55px) !important;
    height: clamp(45px, 8vw, 55px) !important;
    margin-right: 2% !important;
    order: 2 !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name {
    flex-grow: 0 !important;
    flex-basis: 35% !important;
    text-align: left !important;
    margin-right: auto !important;
    font-size: clamp(1em, 2.5vw, 1.08em) !important;
    min-width: 100px !important;
    order: 3 !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even {
    flex-basis: 10% !important;
    text-align: center !important;
    margin-right: 2% !important;
    font-size: clamp(1em, 2.5vw, 1.08em) !important;
    order: 4 !important;
    display: inline-block !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text {
    flex-basis: 15% !important;
    text-align: right !important;
    margin-right: 3% !important;
    font-size: clamp(0.85em, 2.2vw, 1em) !important;
    order: 5 !important;
    display: inline-block !important;
    min-width: auto !important;
  }
}
@media (min-width: 901px) and (max-width: 1200px) {
  /* Para laptops pequeños/medianos - usar layout apilado con imágenes pequeñas */
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    display: grid !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    grid-template-areas: 
      "pos img name score"
      ". . . thru" !important;
    grid-template-columns: 8% 12% 60% 20% !important;
    grid-template-rows: 1fr 1fr !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
    justify-items: center !important;
    align-items: center !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    min-height: 65px !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box {
    grid-area: pos !important;
    order: unset !important;
    margin: 0 !important;
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    grid-row: span 2 !important;
    font-size: clamp(1em, 2.5vw, 1.1em) !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials {
    grid-area: img !important;
    order: unset !important;
    width: clamp(40px, 5vw, 50px) !important;
    height: clamp(40px, 5vw, 50px) !important;
    margin: 0 !important;
    display: block !important;
    justify-self: center !important;
    align-self: center !important;
    grid-row: span 2 !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name {
    grid-area: name !important;
    order: unset !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(1em, 2.5vw, 1.1em) !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    grid-row: span 2 !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even {
    grid-area: score !important;
    order: unset !important;
    justify-self: center !important;
    align-self: end !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: clamp(1em, 2.5vw, 1.1em) !important;
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-bottom: 2px !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text {
    grid-area: thru !important;
    order: unset !important;
    justify-self: center !important;
    align-self: start !important;
    text-align: center !important;
    white-space: nowrap;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: clamp(0.8em, 2.2vw, 0.95em) !important;
    color: #888;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 2px !important;
  }
}

@media (min-width: 1201px) {
  /* Para pantallas grandes - layout horizontal tradicional */
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 8px 12px !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box {
    /* Removed fixed flex-basis to allow left alignment like design mockup */
    /* flex-basis removed so the position column won't create extra left gap */
    text-align: center !important;
    margin-right: 0.6% !important;
    font-size: 1em !important;
    order: 1 !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials {
    flex-basis: 45px !important;
    flex-shrink: 0 !important;
    width: 45px !important;
    height: 45px !important;
    margin-right: 2% !important;
    order: 2 !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name {
    flex-grow: 0 !important;
    flex-basis: 35% !important;
    text-align: left !important;
    margin-right: auto !important;
    min-width: 120px !important;
    font-size: 1em !important;
    order: 3 !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even {
    flex-basis: 10% !important;
    text-align: center !important;
    margin-right: 2% !important;
    font-size: 1em !important;
    order: 4 !important;
    display: inline-block !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text {
    flex-basis: 15% !important;
    text-align: right !important;
    margin-right: 3% !important;
    font-size: 1em !important;
    order: 5 !important;
    display: inline-block !important;
    min-width: auto !important;
  }
}

/* ===== LOADER ===== */
.golf-loader,
#loader {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin-top: -32px;
  margin-left: -32px;
  border: 6px solid #ccc;
  border-top-color: #2c3e50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1000;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== SNACKBAR ===== */
.golf-snackbar {
  visibility: hidden;
  min-width: 280px;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 12px 16px;
  border-radius: 6px;
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.5s ease, bottom 0.5s ease;
  font-size: 14px;
}
.golf-snackbar.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

/* Ensure the container is positioned relative for absolute snackbar */
.golf-leaderboard-container {
  position: relative;
}

/* ===== CONTAINER-QUERY ADAPTATION (Elementor columns) ===== */
/* The parent container now has container-type: inline-size; container-name: leaderboard; */

/* Medium columns: usar layout apilado para mejor responsividad */
@container leaderboard (min-width: 481px) and (max-width: 800px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    display: grid !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    grid-template-areas: 
      "pos img name score"
      ". . . thru" !important;
    grid-template-columns: 8% 18% 52% 22% !important;
    grid-template-rows: 1fr 1fr !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
    justify-items: center !important;
    align-items: center !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    min-height: 65px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box { 
    grid-area: pos !important;
    grid-row: span 2 !important;
    text-align: center !important;
    font-size: clamp(0.9em, 4cqw, 1.05em) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials { 
    grid-area: img !important;
    grid-row: span 2 !important;
    width: clamp(40px, 12cqw, 64px) !important; 
    height: clamp(40px, 12cqw, 64px) !important; 
    justify-self: center !important;
    align-self: center !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name { 
    grid-area: name !important;
    grid-row: span 2 !important;
    text-align: center !important;
    font-size: clamp(0.85em, 4cqw, 1.02em) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even { 
    grid-area: score !important;
    justify-self: center !important;
    align-self: end !important;
    text-align: center !important;
    font-size: clamp(0.85em, 4cqw, 1.02em) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text { 
    grid-area: thru !important;
    justify-self: center !important;
    align-self: start !important;
    text-align: center !important;
    font-size: clamp(0.75em, 3.5cqw, 0.9em) !important;
    color: #888 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding-top: 2px !important;
    min-width: auto !important;
  }
}

/* Wide columns: usar layout apilado hasta llegar a pantallas muy amplias */
@container leaderboard (min-width: 801px) and (max-width: 1200px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content {
    display: grid !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    grid-template-areas: 
      "pos img name score"
      ". . . thru" !important;
    grid-template-columns: 7% 15% 56% 22% !important;
    grid-template-rows: 1fr 1fr !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
    justify-items: center !important;
    align-items: center !important;
    padding: clamp(8px, 2.5cqw, 16px) clamp(12px, 4cqw, 28px) !important;
    margin: 0 !important;
    min-height: 70px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box { 
    grid-area: pos !important;
    grid-row: span 2 !important;
    text-align: center !important;
    font-size: clamp(1em, 5cqw, 1.15em) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials { 
    grid-area: img !important;
    grid-row: span 2 !important;
    width: clamp(56px, 8cqw, 80px) !important; 
    height: clamp(56px, 8cqw, 80px) !important; 
    justify-self: center !important;
    align-self: center !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name { 
    grid-area: name !important;
    grid-row: span 2 !important;
    text-align: center !important;
    font-size: clamp(1em, 5cqw, 1.15em) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even { 
    grid-area: score !important;
    justify-self: center !important;
    align-self: end !important;
    text-align: center !important;
    font-size: clamp(1em, 5cqw, 1.15em) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text { 
    grid-area: thru !important;
    justify-self: center !important;
    align-self: start !important;
    text-align: center !important;
    font-size: clamp(0.85em, 4.5cqw, 1em) !important;
    color: #888 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding-top: 2px !important;
    min-width: auto !important;
  }
}

/* Solo para pantallas realmente amplias usar layout horizontal */
@container leaderboard (min-width: 1201px) {
  .golf-leaderboard-card .card-content,
  .leaderboard-card .card-content { 
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: clamp(10px, 3cqw, 20px) clamp(15px, 5cqw, 35px) !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
  }
  .golf-leaderboard-card .position-box,
  .leaderboard-card .position-box { 
    flex-basis: 5% !important;
    text-align: center !important;
    margin-right: 1% !important;
    font-size: clamp(1.1em, 6cqw, 1.3em) !important;
    order: 1 !important;
  }
  .golf-leaderboard-card .leaderboard-img,
  .golf-leaderboard-card .avatar-initials,
  .leaderboard-card .leaderboard-img,
  .leaderboard-card .avatar-initials { 
    flex-basis: clamp(70px, 10cqw, 90px) !important;
    flex-shrink: 0 !important;
    width: clamp(70px, 10cqw, 90px) !important; 
    height: clamp(70px, 10cqw, 90px) !important; 
    margin-right: 2% !important;
    order: 2 !important;
  }
  .golf-leaderboard-card .name,
  .leaderboard-card .name { 
    flex-grow: 0 !important;
    flex-basis: 35% !important;
    text-align: left !important;
    margin-right: auto !important;
    font-size: clamp(1.1em, 6cqw, 1.3em) !important;
    order: 3 !important;
    min-width: clamp(140px, 35cqw, 280px) !important;
  }
  .golf-leaderboard-card .score,
  .golf-leaderboard-card .score.negative,
  .golf-leaderboard-card .score.positive,
  .golf-leaderboard-card .score.even,
  .leaderboard-card .score,
  .leaderboard-card .score.negative,
  .leaderboard-card .score.positive,
  .leaderboard-card .score.even { 
    flex-basis: 10% !important;
    text-align: center !important;
    margin-right: 2% !important;
    font-size: clamp(1.1em, 6cqw, 1.3em) !important;
    order: 4 !important;
    display: inline-block !important;
  }
  .golf-leaderboard-card .thru,
  .golf-leaderboard-card .thru-text,
  .leaderboard-card .thru,
  .leaderboard-card .thru-text { 
    flex-basis: 15% !important;
    text-align: right !important;
    margin-right: 3% !important;
    font-size: clamp(1.1em, 6cqw, 1.3em) !important;
    order: 5 !important;
    display: inline-block !important;
    min-width: auto !important;
  }
}

/* Low-specificity final overrides — intentionally placed at end to avoid !important and reduce selector specificity
   These keep the mobile-style layout (POS | AVATAR | NAME | SCORE/THRU) while allowing theme updates to more easily override if needed. */
.golf-leaderboard-card .card-content {
  display: grid;
  grid-template-columns: 56px 48px 1fr 110px;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
}
.golf-leaderboard-card .position-box { display:flex; align-items:center; justify-content:center; min-width:56px; }
.golf-leaderboard-card .leaderboard-img, .golf-leaderboard-card .avatar-initials { width:48px; height:48px; border-radius:50%; object-fit:cover; margin:0 8px; }
.golf-leaderboard-card .name { align-self:center; justify-self:start; padding-left:8px; font-weight:600; text-transform:uppercase; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.golf-leaderboard-card .score { text-align:right; font-weight:700; color:#e74c3c; }
.golf-leaderboard-card .thru { text-align:right; color:#888; font-size:0.92em; }

@media (max-width:1199px) and (min-width:992px) {
  .golf-leaderboard-card .card-content { grid-template-columns: 56px 44px 1fr 110px; }
  .golf-leaderboard-card .leaderboard-img { width:44px; height:44px; }
}
@media (max-width:991px) {
  .golf-leaderboard-card .card-content { grid-template-columns: 56px 40px 1fr 110px; }
  .golf-leaderboard-card .leaderboard-img { width:40px; height:40px; }
}

