/* =========================================================
   TRAYECTORIA PAGE — verde premium + mejor uso del alto
   ========================================================= */

/* Wrapper general */
.tray-page{
  padding: 8px 12px 10px 12px;
  background: transparent;
  height: calc(110vh);
  overflow: hidden;
  box-sizing: border-box;
}

/* =========================================================
   Contenedor grande principal
   ========================================================= */

.tray-main-card{
  margin-top: 0;
  border-radius: 18px;
  border: 1px solid rgba(55,242,166,0.18);
  background:
    radial-gradient(1200px 220px at 18% 0%, rgba(55,242,166,0.12), transparent 58%),
    radial-gradient(800px 180px at 85% 100%, rgba(55,242,166,0.06), transparent 62%),
    linear-gradient(180deg, rgba(55,242,166,0.05) 0%, rgba(255,255,255,0.01) 100%),
    #0d1318;
  box-shadow:
    0 18px 45px rgba(0,0,0,0.58),
    0 0 0 1px rgba(55,242,166,0.05) inset,
    0 0 24px rgba(55,242,166,0.06);
  backdrop-filter: blur(10px);
  overflow: hidden;
  padding: 10px;
  position: relative;
  z-index: 1;
  height: 100%;
  box-sizing: border-box;
}

/* =========================================================
   Layout principal
   ========================================================= */

.tray-shell{
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

/* Panel base */
.tray-panel{
  border-radius: 16px;
  border: 1px solid rgba(55,242,166,0.14);
  background:
    radial-gradient(900px 140px at 20% 0%, rgba(55,242,166,0.08), transparent 60%),
    linear-gradient(180deg, rgba(55,242,166,0.025) 0%, rgba(255,255,255,0.008) 100%),
    rgba(10,12,16,0.92);
  box-shadow:
    0 14px 34px rgba(0,0,0,0.42),
    0 0 0 1px rgba(255,255,255,0.03) inset;
  backdrop-filter: blur(10px);
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.tray-panel-left{
  flex: 0 0 250px;
  max-width: 250px;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.tray-panel-right{
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* =========================================================
   Headers internos de panel
   ========================================================= */

.tray-panel-header{
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid rgba(55,242,166,0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.tray-panel-header-title{
  margin: 0;
  color: rgba(255,255,255,0.94);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .2px;
}

.tray-panel-header-sub{
  color: rgba(255,255,255,0.60);
  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   Federaciones
   ========================================================= */

.tray-fed-list{
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.tray-fed-button{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.92);
  padding: 9px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.tray-fed-button:hover{
  transform: translateY(-1px);
  border-color: rgba(55,242,166,0.22);
  background: rgba(55,242,166,0.05);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}

.tray-fed-button.is-active{
  background:
    linear-gradient(180deg, rgba(55,242,166,0.14) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(55,242,166,0.42);
  box-shadow:
    0 12px 28px rgba(0,0,0,.28),
    0 0 0 1px rgba(55,242,166,.08) inset,
    0 0 18px rgba(55,242,166,.08);
}

.tray-fed-flag{
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  flex: 0 0 auto;
}

.tray-fed-label{
  min-width: 0;
  flex: 1 1 auto;
  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-fed-badge{
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.14);
  opacity: .9;
}

/* =========================================================
   Header panel derecho
   ========================================================= */

.tray-right-header{
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid rgba(55,242,166,0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
}

.tray-right-topline{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  overflow: visible;
}

.tray-right-title{
  min-width: 0;
  flex: 1 1 auto;
}

.tray-right-fed-head{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tray-right-fed-flag{
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
  display: block;
}

.tray-right-fed-name{
  color: rgba(255,255,255,.96);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Buscador inline
   ========================================================= */

.tray-search-wrap{
  position: relative;
  min-width: 0;
  z-index: 60;
}

.tray-search-wrap--inline{
  flex: 0 0 clamp(250px, 29vw, 380px);
  width: clamp(250px, 29vw, 380px);
  max-width: 100%;
}

.tray-search-input{
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: #fff;
  padding: 0 12px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.tray-search-input::placeholder{
  color: rgba(255,255,255,.45);
}

.tray-search-input:focus{
  border-color: rgba(55,242,166,.42);
  box-shadow: 0 0 0 3px rgba(55,242,166,.12);
}

.tray-search-suggestions{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 9999;
  pointer-events: none;
}

.tray-search-suggestions .tray-search-list,
.tray-search-suggestions .tray-search-empty{
  pointer-events: auto;
}

.tray-search-list{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(13,17,23,.98);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
}

.tray-search-empty{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(13,17,23,.98);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  font-size: 12px;
  opacity: .9;
}

/* =========================================================
   Chips de edad
   ========================================================= */

.tray-age-strip{
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0;
}

.tray-age-chip{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: rgba(255,255,255,0.93);
  white-space: nowrap;
  font-weight: 800;
  font-size: 12px;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.tray-age-chip:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
}

.tray-age-chip.is-active{
  background:
    linear-gradient(90deg, rgba(55,242,166,0.16) 0%, rgba(255,255,255,0.03) 100%);
  border-color: rgba(55,242,166,0.42);
  box-shadow: 0 0 0 1px rgba(55,242,166,.08) inset;
}

.tray-age-icon{
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
  flex: 0 0 auto;
}

/* =========================================================
   Bloque edad/progreso
   ========================================================= */

.tray-achievements-wrap{
  padding: 8px 12px 0 12px;
  flex: 0 0 auto;
}

.tray-achievements-card--age{
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(340px 120px at 8% 0%, var(--tray-age-accent, rgba(34,211,238,.35)), transparent 70%),
    radial-gradient(220px 90px at 90% 100%, rgba(255,255,255,0.04), transparent 70%),
    rgba(255,255,255,0.03);
  border-radius: 14px;
  box-shadow:
    0 12px 28px rgba(0,0,0,0.28),
    0 0 0 1px rgba(255,255,255,0.02) inset;
  color: white;
  padding: 10px 12px;
}

.tray-achievements-card--age::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.02), transparent 35%, transparent 65%, rgba(255,255,255,0.015));
}

.tray-achievements-agehead{
  position: relative;
  z-index: 1;
}

.tray-achievements-ageleft{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tray-achievements-ageicon{
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  padding: 2px;
}

.tray-achievements-agetexts{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tray-achievements-age-title{
  color: rgba(255,255,255,0.96);
  font-weight: 950;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-achievements-text{
  opacity: .86;
  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   Explorer
   ========================================================= */

.tray-explorer-wrap{
  padding: 8px 12px 12px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.tray-empty-box{
  padding: 14px;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   Visual de liga
   ========================================================= */

.tray-league-titlebox{
  width: 100%;
  min-width: 0;
}

.tray-league-card-header{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: white;
}

.tray-league-card-icon{
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tray-league-card-title{
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-league-card-badge{
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.14);
  opacity: .9;
}

.tray-league-card-body{
  padding: 10px 12px 12px 12px;
}

.tray-league-card-body--tight{
  padding-top: 8px;
  padding-bottom: 10px;
}

.tray-league-card-body--inner{
  padding-top: 10px;
}

/* =========================================================
   Header de grupo
   ========================================================= */

.tray-group-titlebox{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-right: 6px;
}

.tray-group-header-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  width:100%;
  min-width: 0;
}

.tray-group-header-title{
  font-weight:900;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.tray-group-header-count{
  opacity:.75;
  font-weight:800;
  white-space:nowrap;
  flex:0 0 auto;
}

.tray-group-progress-wrap{
  width: 100%;
}

/* =========================================================
   Grid de equipos
   ========================================================= */

.tray-team-grid{
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  height: auto;
  min-height: 0;
  overflow: visible;
}

@media (min-width: 700px){
  .tray-team-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px){
  .tray-team-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   Team chip
   ========================================================= */

.tray-team-row{
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0;
  min-width: 0;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.tray-team-row:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,0.05);
}

.tray-team-row.is-seen{
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.20);
}

.tray-team-row.is-seen:hover{
  border-color: rgba(34,197,94,0.32);
  background: rgba(34,197,94,0.16);
}

.tray-team-state{
  width: 18px;
  text-align: center;
  flex: 0 0 auto;
  line-height: 1.2;
  margin-top: 1px;
}

.tray-team-shield{
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(0,0,0,.15);
  flex: 0 0 auto;
  margin-top: 1px;
}

.tray-team-meta{
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tray-team-name{
  display: block;
  min-width: 0;
  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   Accordions Bootstrap
   ========================================================= */

.tray-explorer-wrap .accordion{
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: rgba(255,255,255,0.08);
  --bs-accordion-color: rgba(255,255,255,0.88);
  --bs-accordion-btn-color: rgba(255,255,255,0.88);
  --bs-accordion-btn-bg: rgba(255,255,255,0.02);
  --bs-accordion-active-bg: rgba(255,255,255,0.04);
  --bs-accordion-active-color: rgba(255,255,255,0.95);
}

/* =========================================================
   Accordion externo
   ========================================================= */

.tray-leagues-accordion .accordion-item{
  border-radius: 14px !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
  background:
    radial-gradient(320px 100px at 15% 0%, rgba(255,255,255,0.03), transparent 65%),
    rgba(255,255,255,0.015);
  box-shadow:
    0 12px 28px rgba(0,0,0,.22),
    0 0 0 1px rgba(255,255,255,0.02) inset;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.tray-leagues-accordion .accordion-item:hover{
  border-color: rgba(255,255,255,0.14);
  box-shadow:
    0 16px 34px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,0.03) inset;
}

.tray-leagues-accordion .accordion-button{
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  align-items: stretch;
}

.tray-leagues-accordion .accordion-button:not(.collapsed){
  background: transparent !important;
  box-shadow: none !important;
}

.tray-leagues-accordion .accordion-button::after{
  margin-right: 12px;
  margin-left: 8px;
  align-self: center;
  flex: 0 0 auto;
  filter: brightness(1.2);
}

.tray-leagues-accordion .accordion-body{
  background: transparent !important;
  padding: 0 0 10px 0 !important;
  overflow: visible !important;
}

.tray-leagues-accordion .accordion-item:hover .tray-league-card-header{
  background: rgba(255,255,255,0.07);
}

/* =========================================================
   Accordion interno
   ========================================================= */

.tray-groups-accordion .accordion-item{
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
  background: rgba(255,255,255,0.015);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  overflow: visible !important;
}

.tray-groups-accordion .accordion-item:hover{
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.025);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}

.tray-groups-accordion .accordion-button{
  padding: 10px 12px !important;
  align-items: flex-start;
  box-shadow: none !important;
  font-weight: 800;
  font-size: 12px;
  transition: background .15s ease;
}

.tray-groups-accordion .accordion-button:hover{
  background: rgba(255,255,255,0.04);
}

.tray-groups-accordion .accordion-button:not(.collapsed){
  padding: 10px 12px !important;
  box-shadow: none !important;
}

.tray-groups-accordion .accordion-button::after{
  margin-left: 10px;
  margin-right: 2px;
  align-self: center;
  flex: 0 0 auto;
}

.tray-groups-accordion .accordion-collapse{
  overflow: visible !important;
}

.tray-groups-accordion .accordion-body{
  overflow: visible !important;
  background: rgba(255,255,255,0.015);
  padding: 10px !important;
}

/* =========================================================
   Barras de progreso
   ========================================================= */

.tray-progress.progress{
  background-color: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
}

.tray-progress.progress .progress-bar{
  border-radius: 999px;
}

.tray-progress--edad.progress{
  height: 14px;
}

.tray-progress--liga.progress{
  height: 10px;
}

.tray-progress--grupo.progress{
  height: 6px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px){
  .tray-shell{
    flex-wrap: wrap;
    height: auto;
  }

  .tray-main-card{
    height: auto;
  }

  .tray-page{
    height: auto;
    overflow: visible;
  }

  .tray-panel-left{
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
  }

  .tray-panel-right{
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .tray-fed-list{
    max-height: 280px;
    min-height: 0;
    height: auto;
  }

  .tray-explorer-wrap{
    min-height: 0;
  }
}

@media (max-width: 980px){
  .tray-right-topline{
    flex-direction: column;
    align-items: stretch;
  }

  .tray-search-wrap--inline{
    flex: 0 0 auto;
    width: 100%;
  }
}

.tray-group-lazy-body{
  min-height: 2px;
}