/* =======================
   ÚLTIMOS VISTOS · GENERAL
   ======================= */
.his-last-wrap{
  padding-top: 6px;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.his-last-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  width: 100%;
  min-width: 0;
}

.his-last-title{
  font-weight: 900;
  letter-spacing: .2px;
  opacity: .9;
  min-width: 0;
}

.his-last-right{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

/* la fila de partidos/jugadores debe estirar ambas columnas */
.his-last-wrap .row{
  align-items: stretch;
  overflow: visible;
}

.his-last-wrap .col-md-6,
.his-last-wrap .col-12{
  display: flex;
  min-width: 0;
  overflow: visible;
}

.his-last-panel{
  border-radius: 16px;
  background: rgba(10,12,16,0.62);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 14px 34px rgba(0,0,0,0.25);
  padding: 10px 10px 10px 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.his-last-subtitle{
  font-weight: 900;
  font-size: 12px;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .35px;
  margin-bottom: 10px;
}

.his-last-slot{
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding-bottom: 4px;
}

/* grid común */
.his-last-cards{
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 10px;
  align-content: start;
  align-items: start;
  justify-items: stretch;
  box-sizing: border-box;
  padding-top: 12px;
  overflow: visible;
}

/* =======================
   PARTIDOS
   ======================= */
.his-last-cards--partidos{
  width: 100%;
  min-width: 0;
  overflow: visible;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  scrollbar-gutter: auto;
  align-content: start;
  box-sizing: border-box;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1400px){
  .his-last-cards--partidos{
    grid-template-columns: 1fr !important;
    max-height: 474px;
    overflow-y: auto;
    overflow-x: visible;
    padding-right: 6px;
    scrollbar-gutter: stable;
  }
}

/* =======================
   JUGADORES
   ======================= */
.his-last-cards--jugadores{
  width: 100%;
  min-width: 0;
  overflow: visible;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 7px;
  row-gap: 10px;
  padding-left: 0;
  padding-right: 8px;
  padding-bottom: 0;
  box-sizing: border-box;
}

.his-last-cards--jugadores > *{
  min-width: 0;
  overflow: visible;
}

@media (max-width: 768px){
  .his-last-cards--jugadores{
    grid-template-columns: 1fr;
    column-gap: 0;
    padding-left: 0;
    padding-right: 4px;
  }
}

.hdg-empty{
  border-radius: 14px;
  padding: 14px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
  font-size: 12px;
  opacity: .72;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* =======================
   SHELL EXTERIOR JUGADOR
   ======================= */
.his-jg2-card-shell{
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: visible;
  display: block;
  box-sizing: border-box;
  padding-left: 12px;
  padding-right: 4px;
  padding-bottom: 8px;
}

@media (max-width: 768px){
  .his-jg2-card-shell{
    padding-left: 10px;
    padding-right: 3px;
    padding-bottom: 7px;
  }
}

@media (max-width: 640px){
  .his-jg2-card-shell{
    padding-left: 7px;
    padding-right: 2px;
    padding-bottom: 6px;
  }
}

/* =======================
   TARJETA JUGADOR
   ======================= */
.his-jg2-card{
  --his-jg2-avatar: 54px;
  --his-jg2-radius: 16px;

  position: relative;
  overflow: visible;
  border-radius: var(--his-jg2-radius);
  padding: 22px 14px 16px 12px;
  min-height: 98px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.04), transparent 35%),
    linear-gradient(180deg, rgba(21,26,28,.98) 0%, rgba(15,19,22,.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 16px rgba(0,0,0,.24);

  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.his-jg2-card:hover{
  transform: translateY(-1px);
}

.his-jg2-card.status-follow{
  border-color: rgba(41,217,163,.52);
  box-shadow:
    0 8px 18px rgba(0,0,0,.22),
    0 0 0 1px rgba(41,217,163,.10) inset,
    0 0 14px rgba(41,217,163,.12);
  background:
    linear-gradient(180deg, rgba(8,29,24,.82), rgba(9,20,18,.92)),
    linear-gradient(90deg, rgba(6,190,132,.16), rgba(6,190,132,.08));
}

.his-jg2-card.status-maybe{
  border-color: rgba(255,193,87,.50);
  box-shadow:
    0 8px 18px rgba(0,0,0,.22),
    0 0 0 1px rgba(255,193,87,.10) inset,
    0 0 14px rgba(255,193,87,.10);
  background:
    linear-gradient(180deg, rgba(34,23,8,.82), rgba(24,18,10,.92)),
    linear-gradient(90deg, rgba(255,165,0,.15), rgba(255,165,0,.07));
}

.his-jg2-card.status-no{
  border-color: rgba(255,92,92,.48);
  box-shadow:
    0 8px 18px rgba(0,0,0,.22),
    0 0 0 1px rgba(255,92,92,.08) inset,
    0 0 14px rgba(255,92,92,.10);
  background:
    linear-gradient(180deg, rgba(36,14,16,.84), rgba(24,12,14,.92)),
    linear-gradient(90deg, rgba(255,92,92,.14), rgba(255,92,92,.06));
}

/* watermark */
.his-jg2-wm{
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.his-jg2-wm-img{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  transform: translate(-50%, -50%) translateX(16px);
  opacity: .14;
  filter: grayscale(.82) contrast(1.04) brightness(1.02) drop-shadow(0 0 8px rgba(0,0,0,.28));
  user-select: none;
}

/* badges superiores */
.his-jg2-top-badges{
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-34%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: calc(100% - 24px);
  overflow: visible;
  pointer-events: none;
}

.his-jg2-top-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 180px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow:
    0 2px 8px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.05);
  pointer-events: auto;
  color: #f5fff9;
}

.his-jg2-card.status-follow .his-jg2-top-badge{
  border: 1px solid rgba(83,255,173,.34);
  background: rgba(2,87,64,.96);
}

.his-jg2-card.status-maybe .his-jg2-top-badge{
  border: 1px solid rgba(255,193,87,.34);
  background: rgba(104,61,10,.96);
}

.his-jg2-card.status-no .his-jg2-top-badge{
  border: 1px solid rgba(255,120,120,.34);
  background: rgba(120,34,34,.96);
}

.his-jg2-card:not(.status-follow):not(.status-maybe):not(.status-no) .his-jg2-top-badge{
  border: 1px solid rgba(83,255,173,.28);
  background: rgba(2,87,64,.94);
}

/* bloque principal */
.his-jg2-main{
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.his-jg2-avatar-wrap{
  position: relative;
  width: var(--his-jg2-avatar);
  height: var(--his-jg2-avatar);
  flex: 0 0 auto;
  overflow: visible;
}

.his-jg2-avatar-img,
.his-jg2-avatar-fallback{
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: block;
}

.his-jg2-avatar-img{
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 10px rgba(0,0,0,.24);
  background: #0b1214;
}

.his-jg2-avatar-fallback{
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #effff6;
  background: linear-gradient(135deg,#013d2f 0%,#04664b 100%);
  border: 1.5px solid rgba(255,255,255,.25);
  box-shadow: 0 4px 10px rgba(0,0,0,.22);
}

/* badges avatar */
.his-jg2-avatar-badge{
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.his-jg2-avatar-badge--dorsal{
  top: -8px;
  left: -16px;
}

.his-jg2-avatar-badge--age{
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  min-width: 28px;
  height: 16px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(120,255,190,.95), rgba(28,180,95,.96));
  border: 2px solid rgba(195,255,220,.95);
  box-shadow:
    0 2px 8px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.his-jg2-avatar-age-text{
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: #04160c;
  white-space: nowrap;
}

.his-jg2-dorsal{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: #effff6;
  background: #025740;
  border: 2px solid #06be84;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.his-jg2-maintext{
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.his-jg2-name{
  font-weight: 900;
  font-size: 15px;
  line-height: 1.12;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.his-jg2-team{
  font-weight: 800;
  font-size: 12px;
  opacity: .78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* NUEVO: badges laterales derechos como overlays */
.his-jg2-side-badges-right{
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: visible;
  pointer-events: auto;
  margin-left: 0;
  padding-left: 0;
}

.his-jg2-side-badge{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #06BE84;
  background: #023e2f;
  box-shadow:
    0 2px 6px rgba(0,0,0,.35),
    0 0 10px rgba(6,190,132,.10);
  overflow: visible;
  display: block;
}

.his-jg2-card.status-maybe .his-jg2-side-badge{
  border-color: rgba(255,193,87,.85);
  background: #5a3b10;
  box-shadow:
    0 2px 6px rgba(0,0,0,.35),
    0 0 10px rgba(255,193,87,.10);
}

.his-jg2-card.status-no .his-jg2-side-badge{
  border-color: rgba(255,120,120,.85);
  background: #5f2020;
  box-shadow:
    0 2px 6px rgba(0,0,0,.35),
    0 0 10px rgba(255,120,120,.10);
}

/* badges inferiores */
.his-jg2-bottom-badges{
  position: absolute;
  right: 10px;
  bottom: 0;
  transform: translateY(26%);
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: calc(100% - 20px);
  overflow: visible;
}

.his-jg2-badge{
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: rgba(14,20,22,.96);
  border: 2px solid rgba(255,255,255,.22);
  box-shadow:
    0 2px 8px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
}

.his-jg2-badge--flag{
  background: radial-gradient(circle at 30% 30%, rgba(120,255,190,.95), rgba(28,180,95,.96));
  border: 2px solid rgba(195,255,220,.95);
}

.his-jg2-badge--double{
  width: auto;
  min-width: 24px;
  padding: 0 6px;
  gap: 4px;
}

.his-jg2-badge-img{
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

.his-jg2-badge-img--flag{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  filter: none;
}

.his-jg2-badge-text{
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  color: #f5fff9;
}

.his-jg2-badge-dot{
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.30);
}

.his-jg2-badge-dot.follow{ background: #06be84; }
.his-jg2-badge-dot.maybe{ background: #e5c558; }
.his-jg2-badge-dot.no{ background: #ef5b5b; }

@media (max-width: 640px){
  .his-jg2-card{
    --his-jg2-avatar: 46px;
    padding: 20px 12px 15px 10px;
    min-height: 92px;
  }

  .his-jg2-name{
    font-size: 13px;
  }

  .his-jg2-team{
    font-size: 11px;
  }

  .his-jg2-top-badge{
    font-size: 10px;
    min-height: 21px;
    padding: 0 7px;
    max-width: 140px;
  }

  .his-jg2-side-badges-right{
    right: -17px;
    gap: 3px;
  }

  .his-jg2-side-badge{
    width: 26px;
    height: 26px;
  }

  .his-jg2-bottom-badges{
    gap: 5px;
    right: 8px;
    transform: translateY(22%);
  }

  .his-jg2-badge{
    width: 22px;
    height: 22px;
    min-width: 22px;
  }

  .his-jg2-badge-img{
    width: 12px;
    height: 12px;
  }

  .his-jg2-badge-img--flag{
    width: 14px;
    height: 14px;
  }

  .his-jg2-badge-text{
    font-size: 9px;
  }

  .his-jg2-avatar-badge--age{
    bottom: -4px;
    height: 15px;
    padding: 0 6px;
  }

  .his-jg2-avatar-age-text{
    font-size: 8px;
  }

  .his-jg2-wm-img{
    width: 82px;
    height: 82px;
    transform: translate(-50%, -50%) translateX(12px);
  }
}