/* Final user-requested fixes: responsive, teams, podium, calendars. */
html,body{max-width:100%;overflow-x:hidden}

/* White native calendar glyphs on dark controls. */
input[type="date"]{color-scheme:dark!important;color:#fff!important}
#battleHistoryDateV131035::-webkit-calendar-picker-indicator,
#authBirthV131038::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator{filter:invert(1) brightness(2)!important;opacity:1!important;cursor:pointer}

/* 2v2 team identity during the live battle. */
#playerSlots .slot.pbTeamAFix{border-color:#3284ff!important;box-shadow:0 0 0 1px rgba(50,132,255,.18)}
#playerSlots .slot.pbTeamBFix{border-color:#ff4e63!important;box-shadow:0 0 0 1px rgba(255,78,99,.16)}
#playerSlots .slot.pbTeamAFix .slotTop{background:linear-gradient(90deg,rgba(34,112,255,.24),rgba(17,24,38,.96))!important;border-bottom-color:rgba(61,139,255,.55)!important}
#playerSlots .slot.pbTeamBFix .slotTop{background:linear-gradient(90deg,rgba(234,56,77,.24),rgba(17,24,38,.96))!important;border-bottom-color:rgba(255,77,97,.55)!important}
#playerSlots .slot.pbTeamAFix .slotWho small:after{content:" · EQUIPO AZUL";color:#78b3ff;font-weight:1000}
#playerSlots .slot.pbTeamBFix .slotWho small:after{content:" · EQUIPO ROJO";color:#ff8493;font-weight:1000}

/* VS presentation: FFA is everyone-vs-everyone, never visually 3v2. */
.pb46VsModeFix{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:5;color:#ffd75a;font-size:11px;font-weight:1000;letter-spacing:.12em;white-space:nowrap}
.pb46Fighter.teamA{border-color:#347fe8!important;background:linear-gradient(180deg,rgba(28,87,177,.28),#151d2d)!important}
.pb46Fighter.teamB{border-color:#e94c61!important;background:linear-gradient(180deg,rgba(183,46,65,.28),#151d2d)!important}
.pb46VsStage.ffaModeFix{grid-template-columns:1fr!important;min-height:340px!important;padding-top:52px!important}
.pb46VsStage.ffaModeFix #pb46Right{display:none!important}
.pb46VsStage.ffaModeFix .pb46VsCenter{order:-1;margin:0 auto 8px}
.pb46VsStage.ffaModeFix #pb46Left{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));width:min(930px,100%);margin:0 auto;gap:12px;align-items:start}
.pb46Fighter.ffa{width:100%;max-width:170px;justify-self:center;opacity:0;transform:scale(.78) translateY(28px)}
.pb46Fighter.ffa.go{animation:pbFfaEnterFix .36s cubic-bezier(.2,.9,.2,1) forwards}
@keyframes pbFfaEnterFix{to{opacity:1;transform:none}}

/* A classic 2 / 1 / 3 podium. */
.leaderboardPodiumV131029{grid-template-columns:1fr 1.08fr 1fr!important;align-items:end!important;gap:10px!important}
.leaderboardPodiumV131029>.lbPodiumCardV131029:nth-child(1){min-height:158px!important;order:1}
.leaderboardPodiumV131029>.lbPodiumCardV131029:nth-child(2){min-height:188px!important;order:2;transform:translateY(-10px)}
.leaderboardPodiumV131029>.lbPodiumCardV131029:nth-child(3){min-height:142px!important;order:3}

/* ---------- Mobile responsiveness ---------- */
@media(max-width:760px){
  .page{padding-left:10px!important;padding-right:10px!important}
  .sectionhead{gap:10px!important;flex-wrap:wrap!important}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .stat{min-width:0!important;padding:12px!important}
  .stat strong{font-size:19px!important;overflow-wrap:anywhere}

  /* Inventory toolbar: no clipped selects/buttons. */
  #page-inventory .inventoryToolbar{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;width:100%!important;min-width:0!important;padding:8px!important}
  #page-inventory #invSearch{grid-column:1/-1!important;min-width:0!important;width:100%!important}
  #page-inventory .inventoryToolbar select{width:100%!important;min-width:0!important}
  #page-inventory #invGradeFilterV115{grid-column:1/-1!important}
  #inventorySellBarV1396{width:100%!important;min-width:0!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important}
  #inventorySellBarV1396 .sellBtnsV1396{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:6px!important}
  #inventorySellBarV1396 .sellBtnsV1396 .btn{min-width:0!important;width:100%!important;white-space:normal!important;padding:8px 6px!important}
  #inventorySellSummaryV1396{overflow-wrap:anywhere}
  .inventoryActionsV10{display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
  #inventory{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  #inventory .inv,#inventory .invPackV10{min-width:0!important}
  #inventory .inv b,#inventory .invPackV10 b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Upgrade: wheel and cards fit viewport. */
  .upgradeLayoutV10{grid-template-columns:1fr!important;width:100%!important;min-width:0!important;gap:10px!important}
  .upgradeOfferV10,.upgradeWheelPanelV10,.upgradeTargetV10{min-width:0!important;width:100%!important;box-sizing:border-box!important;padding:12px!important}
  .upgradeOfferGridV10{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
  .upgradeWheelV10{width:min(270px,calc(100vw - 70px))!important;height:auto!important;aspect-ratio:1/1!important}
  .upgradeWheelV10 .needleV10{height:43%!important;top:7%!important;transform-origin:50% 100%!important}
  .upgradeTargetCardV10 img{max-width:100%!important;height:auto!important;max-height:360px!important;object-fit:contain!important}
  .upgradeFilterBarV113{grid-template-columns:1fr 1fr!important}
  .upgradeFilterBarV113 #upgradeInvSearchV10{grid-column:1/-1!important}

  /* Battle lobby controls: clean two-column grid. */
  #pbLobbyStable46{grid-template-columns:1fr!important;padding:0!important;gap:10px!important}
  #pbLobbyStable46 .pb46Set{grid-template-columns:76px minmax(0,1fr)!important;padding:10px!important}
  #pbLobbyStable46 .pb46SetLogo{width:76px!important;height:76px!important}
  #pbLobbyStable46 .pb46Facts{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  #pbLobbyStable46 .pb46Fact{min-width:0!important;padding:9px!important}
  #pbLobbyStable46 .pb46Fact:nth-child(5){grid-column:1/-1!important}
  #pbLobbyStable46 .pb46Actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:7px!important}
  #pbLobbyStable46 .pb46Actions button{width:100%!important;min-width:0!important;padding:0 7px!important;font-size:12px!important;white-space:normal!important}
  #pbLobbyStable46 .pb46Actions .leave{grid-column:1/-1!important}
  #pbLobbyStable46 .pb46Actions .primary{min-height:44px!important}
  .arenahead{flex-wrap:wrap!important;gap:8px!important}
  .arenaTools{width:100%!important;display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;gap:6px!important}
  #battleSpeedButtonsV118{max-width:100%!important;overflow:hidden!important}
  #battleSpeedButtonsV118 button{min-width:36px!important;padding:7px 6px!important}

  /* VS mobile remains a real versus; 2v2 does not stack 4 people vertically. */
  .pb46VsStage:not(.ffaModeFix){grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr)!important;gap:5px!important;min-height:270px!important;width:calc(100vw - 18px)!important;padding:42px 8px 12px!important;border-radius:18px!important}
  .pb46VsStage:not(.ffaModeFix) .pb46VsCenter{order:0!important}
  .pb46VsStage:not(.ffaModeFix) .pb46Team{display:flex!important;flex-direction:column!important;gap:7px!important;align-items:stretch!important}
  .pb46VsStage:not(.ffaModeFix) .pb46Fighter{width:100%!important;max-width:none!important;padding:8px 5px!important;border-radius:12px!important}
  .pb46VsStage:not(.ffaModeFix) .pb46Avatar{width:54px!important;height:54px!important;font-size:25px!important;margin-bottom:5px!important;border-radius:12px!important}
  .pb46VsStage:not(.ffaModeFix) .pb46Fighter b{font-size:12px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .pb46VsStage:not(.ffaModeFix) .pb46Fighter small{font-size:8px!important}
  .pb46VsStage:not(.ffaModeFix) .pb46VsLogo{width:64px!important;height:64px!important}
  .pb46VsStage:not(.ffaModeFix) .pb46Open{font-size:24px!important}
  .pb46VsModeFix{top:13px!important;font-size:9px!important}
  .pb46VsStage.ffaModeFix{width:calc(100vw - 18px)!important;min-height:0!important;padding:45px 10px 14px!important}
  .pb46VsStage.ffaModeFix #pb46Left{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .pb46VsStage.ffaModeFix .pb46Fighter{width:100%!important;max-width:150px!important;padding:8px!important}
  .pb46VsStage.ffaModeFix .pb46Fighter:last-child:nth-child(odd){grid-column:1/-1;justify-self:center}
  .pb46VsStage.ffaModeFix .pb46Avatar{width:58px!important;height:58px!important;font-size:26px!important;margin-bottom:5px!important}
  .pb46VsStage.ffaModeFix .pb46Fighter b{font-size:12px!important}
  .pb46VsStage.ffaModeFix .pb46VsCenter{position:absolute!important;top:44px!important;left:50%!important;transform:translateX(-50%)!important;z-index:3}
  .pb46VsStage.ffaModeFix .pb46VsLogo{width:70px!important;height:70px!important;opacity:.95}
  .pb46VsStage.ffaModeFix #pb46Left{padding-top:73px!important}

  /* Leaderboard: podium stays 2-1-3 in one row, rows show account value without horizontal drag. */
  .leaderboardShellV131029{padding:8px!important;width:100%!important;min-width:0!important}
  .leaderboardPodiumV131029{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;align-items:end!important}
  .leaderboardPodiumV131029>.lbPodiumCardV131029{min-width:0!important;padding:9px 4px!important;transform:none!important}
  .leaderboardPodiumV131029>.lbPodiumCardV131029:nth-child(1){min-height:132px!important}
  .leaderboardPodiumV131029>.lbPodiumCardV131029:nth-child(2){min-height:158px!important;transform:translateY(-7px)!important}
  .leaderboardPodiumV131029>.lbPodiumCardV131029:nth-child(3){min-height:116px!important}
  .lbPodiumAvatarV131029{width:42px!important;height:42px!important;font-size:20px!important}
  .lbPodiumCardV131029 b{font-size:11px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
  .lbPodiumCardV131029 small{font-size:8px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
  .lbPodiumValueV131029{font-size:14px!important;white-space:nowrap!important}
  .leaderboardTableWrapV131029{overflow:visible!important;width:100%!important}
  .leaderboardTableV131029{min-width:0!important;width:100%!important;display:block!important}
  .leaderboardTableV131029 thead{display:none!important}
  .leaderboardTableV131029 tbody{display:block!important;width:100%!important}
  .leaderboardTableV131029 tbody tr{display:grid!important;grid-template-columns:30px minmax(0,1fr) auto!important;align-items:center!important;width:100%!important;padding:8px 6px!important;border-bottom:1px solid #252e40!important;gap:5px!important}
  .leaderboardTableV131029 td{display:block!important;padding:0!important;border:0!important;min-width:0!important}
  .leaderboardTableV131029 .lbDetailV131029{display:none!important}
  .leaderboardTableV131029 .lbMetricV131029{justify-self:end!important;text-align:right!important;font-size:12px!important;max-width:105px!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .leaderboardTableV131029 .lbTrainerV131029{min-width:0!important;gap:7px!important}
  .leaderboardTableV131029 .lbTrainerV131029 span{min-width:0!important}
  .leaderboardTableV131029 .lbTrainerV131029 b,.leaderboardTableV131029 .lbTrainerV131029 small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
  .leaderboardTableV131029 .lbTrainerV131029 small{font-size:8px!important}
}

@media(max-width:430px){
  #inventory{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .upgradeOfferGridV10{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #inventorySellBarV1396 .sellBtnsV1396{grid-template-columns:1fr!important}
  .leaderboardPodiumV131029{gap:3px!important}
  .lbPodiumAvatarV131029{width:36px!important;height:36px!important}
  .lbPodiumValueV131029{font-size:12px!important}
}
.lbPodiumStepFix{margin:12px -13px -13px;padding:8px 0 6px;border-top:1px solid rgba(255,255,255,.09);font-size:20px;font-weight:1000;line-height:1;color:#fff;background:linear-gradient(180deg,#b82c2c,#7d1717);text-shadow:0 2px 4px rgba(0,0,0,.35)}
.lbPodiumStepFix.rank1{padding-top:14px;padding-bottom:10px;background:linear-gradient(180deg,#d33c34,#a51d1d);font-size:25px}
.lbPodiumStepFix.rank2{background:linear-gradient(180deg,#bd332e,#8a1d1d)}
.lbPodiumStepFix.rank3{padding-top:6px;background:linear-gradient(180deg,#a82b29,#751817)}
@media(max-width:760px){.lbPodiumStepFix{margin:8px -4px -9px;padding:6px 0 5px;font-size:16px}.lbPodiumStepFix.rank1{padding-top:10px;padding-bottom:7px;font-size:20px}}
