.mastmain {
  /* Default padding — enough for top-pane (50px) + navbar (~80px) */
  padding-top: max(15vh, 130px);
}

@font-face {
  font-family: 'Formula1Black';
  src: local('Formula1Black'),
       url("../fonts/Formula1-Black.f817b827ea06.ttf") format("truetype");
}

@font-face {
  font-family: 'Formula1Wide';
  src: local('Formula1Wide'),
       url("../fonts/Formula1-Wide.5d49e39d7227.ttf") format("truetype");
}

@font-face {
  font-family: 'Formula1Bold';
  src: local('Formula1Bold'),
       url("../fonts/Formula1-Bold.0819be9f7b49.ttf") format("truetype");
}

@font-face {
  font-family: 'Formula1Regular';
  src: local('Formula1Regular'),
       url("../fonts/Formula1-Regular.ea4e4ee44601.ttf") format("truetype");
}


/* Define styles for top pane */
.top-pane {
  background-color: white;
  height: 50px;
  display: flex;
  align-items: center;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
}

/* Define styles for top right buttons container */
.top-right-buttons {
  height:100%;
  display: flex;
  align-items: center; /* Vertically center the buttons */
  margin-left: auto; /* Pushes the buttons to the right */
}

/* Define styles for buttons in top pane */
.top-right-buttons .btn {
  padding: 3px;
  border-radius: 5px;
  cursor: pointer;
  height: 80%; 
  width: 130px;
  text-decoration: none; /* Remove underline */
}

/* Define styles for sign in button */
.sign-in-btn {
  color: white;
  background-color: black;
  margin-right: 5px;
}

.signed-in-btn {
  color: #E10600;
  background-color: lightgrey;
  border-style: "solid";
  border-color: #E10600;
  margin-right: 5px;
  padding: 2%;
}

.circular-photo {
  width: 20%;
  height: 90%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-link img {
  max-width: 25%; /* Adjust size as needed */
  max-height: 85%; /* Adjust size as needed */
  margin-right: 5px; /* Space between image and text */
}

/* Define styles for register button */
.register-btn {
  color: white;
  background-color: #E10600;
  text-align: center; 
  margin-right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-login {
  width: 20%;
  margin-right: 8px;
}

.statistics-nav-dropdown {
  position: relative;
}

.statistics-nav-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 150px;
  background: #ffffff;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 1500;
  padding: 0.3rem 0;
}

.statistics-nav-dropdown:hover .statistics-nav-menu {
  display: block;
}

.statistics-nav-option {
  display: block;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  color: #1d2634;
  font-family: Formula1Bold;
  font-size: 0.75rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.statistics-nav-option:hover {
  background: #f3f4f7;
  color: #E10600;
}

.statistics-nav-option.active {
  color: #E10600;
}

@media (max-width: 991px) {
  .statistics-nav-menu {
    position: static;
    display: block;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 0 0.3rem 0.8rem;
  }

  .statistics-nav-option {
    color: #ffffff;
    opacity: 0.9;
    padding: 0.25rem 0;
    font-size: 0.7rem;
  }

  .statistics-nav-option:hover,
  .statistics-nav-option.active {
    color: #ffffff;
    opacity: 1;
    background: transparent;
  }
}



/* **************************************************
************* HOME PAGE GP & TIMER ***************
************************************************** */
.container-home {
  width:  var(--screen-desk);
  /* height: 25vh; */
  padding: 1%;
  margin-bottom: 10px;
  margin-top: 2%;
}

.subcontainer-home{
  width: 100%;
  border-radius: 15px;
  background-color: lightgrey;
  display: flex;
}

.left-home {
  width: 25%;
  padding: 1%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-gp-home-left {
  width: 100%;
  height: auto;
  border-radius: 15px;
}

.center-home {
  width: 55%;
  display: flex;  
  padding: 1%;
  align-items: center;
  text-transform: uppercase;
}

.title-home {
  align-items: center;
  display: flex;  
  font-family: "Formula1Bold";
  font-size: 1.5em;
  line-height: 1.5em;
  letter-spacing: 0;
}

.subtitle-home {
  font-family: "Formula1Regular";
  margin-top: 10px;
  font-size: 1.1rem;
}

.image-gp-home-flag {
  width: 3.6rem;
  margin-right: 20px;
}

.image-gp-home {
  width: 100%;
  height: auto;
  display: block;
}

.right-home {
  width: 20%;  
  padding: 0.5%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.timer-container-home {
  width: 90%;
  height: 75%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.timer-title {
  position: relative;
  padding: 0.3rem;
  z-index: 2;
  width: auto;
  background: hsl(240, 5%, 28%);
  border-radius: .2rem;
  text-align: center;
  color: hsl(0, 0%, 100%);
  font-size: 1vw;
  letter-spacing: .005rem;
  margin-bottom: 0.4rem;
}

.timer-title span{
  font-size: 0.7em;
}

.timer-main {
  position: relative;
  top: -1.3rem; /* Adjust vertical overlap */
  width: 100%;
  height:100%;
  padding: 1rem 0.6rem 0.6rem;
  background: hsl(240, 18%, 10%);
  border-radius: .8rem;
  color: hsl(0, 0%, 100%);
  display: flex;
  justify-content: center;
  z-index: 1;
  font-weight: 800;
  font-size: 3vw; /* Make the font size responsive to viewport width */
}

.timer-main ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: "Formula1Regular";
}

.timer-main li {
  display: flex;
  align-items: center;
  flex-direction: column; /* Stack items vertically */
  margin: 0 0.5rem; /* Adjust margin as needed */
  justify-content: center; /* Center the content horizontally */
}

.timer-main li span {
  display: flex;
  align-items: center; /* Center items vertically */
}

.timer-main li span:first-child {
  font-size: 0.6em; /* Adjust font size as needed */
}

.timer-main li span:last-child {
  font-size: 0.3em; /* Adjust font size as needed */
  text-transform: uppercase;
  margin-top: 0.2rem; /* Adjust spacing between number and unit */
}


.button-home {
  height: 80%;
  background-color: red;
  text-align: center;
  border: none;
  cursor: pointer;
  margin-bottom: 5px;
  color: white;
  font-size: 1em;
  font-family: "Formula1Bold";
  display: flex;
  align-items: center;
}


.main-team{
  border-radius: 1%;
  margin-bottom: 10px;
  width:  var(--screen-desk);
  min-height: 110vh;
  height: auto;
  background-color: lightgrey;
  padding:1%;
  margin: 0.5%;
  display: flex; 
  flex-direction: column;
  align-items: center;
}

.fantasy-team{
  width: 100%;
  margin-top: 0;
  height: auto;
  display: flex; 
  justify-content: center;
  align-items: flex-start;
  gap: 0.8rem;
}

.team-selections{
  width: 55%;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.top-selection{
  display: flex;
  flex-direction: column;
  margin-left: 0;
  margin-bottom: 0.9rem;
  padding: 0 1.5%;
  gap: 0.6rem;
}

.top-selection-budget{
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  position: relative;
}

.budget-block{
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 190px;
  flex: 0 0 190px;
  gap: 0.25rem;
}

.top-selection-actions{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.budget-selection{
  font-size: 1.3rem;
  line-height: 1.6rem;
  letter-spacing: .002rem;
  display: block;
  font-family: "Formula1Bold";
  min-width: 0;
  margin-bottom: 0;
}

.budget-selection span{
  display: block;
}

.budgetBar{
  width: 14rem;
  height: .6rem;
  position: relative;
  overflow: hidden;
  background-color: gray;
  margin-top: 0.35rem;
  width: 190px;
  border-radius: 100px;
  align-self: flex-start;
}

.budgetBar progress{
  opacity: 0;
}

.budgetBar span{
  position: absolute;
  left: 0;
  height: 100%;
  top: 0;
  background-color: hsl(114, 100%, 38%);
  transition: width .1s linear;
  border-radius: 100px;
}

.btn:disabled{
  pointer-events: none;
  opacity: .4;
}

.button-reset-team{
  color: white;
  background-color: black;
  margin-right: 0;
  border-radius: 5px;
}

.button-save-team{
    color: white;
    background-color: #E10600;
    text-align: center; 
    margin-right: 0;
    border-radius: 5px;
}

.button-save-deactivated{
  color: lightgray;
  background-color: darkgray;
  text-align: center; 
  margin-right: 0;
  border-radius: 5px;
}

.chip-buttons-wrap{
  margin-top: 0.2rem;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.65rem;
  width: auto;
  flex-wrap: nowrap;
}

.chip-hidden-input{
  display: none;
}

.chip-action-btn{
  border: 2px solid #2f2f2f;
  border-radius: 5px;
  background-color: #d8d8d8;
  color: #141414;
  font-family: "Formula1Bold";
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  min-height: 0;
  height: auto;
  width: auto;
  justify-content: center;
  white-space: nowrap;
  transition: transform .1s linear, background-color .15s linear, border-color .15s linear;
}

.chip-action-btn img{
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* (chip img rule moved above) */

.chip-action-btn:hover:not(:disabled){
  transform: translateY(-1px);
}

.chip-action-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

.chip-action-drs{
  border-color: #8d1598;
  background-color: #d68ce0;
  color: #4a0d50;
}

.chip-action-drs.active{
  border-color: #8d1598;
  background-color: #8d1598;
  color: #ffffff;
}

.drs-chip-row{
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  margin: 0;
}

.chip-status{
  font-family: "Formula1Bold";
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid transparent;
  min-width: 64px;
  min-height: 28px;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
}

.chip-status.active{
  color: #0e5d26;
  background-color: #c7f4d4;
  border-color: #53b96e;
  display: inline-flex;
}

.chip-action-pit{
  border-color: #1d7c32;
  background-color: #a5e4b0;
  color: #0d3f18;
}

.top-selection .incoming-block-info{
  position: absolute;
  left: 0;
  top: calc(100% + 0.6rem);
  margin: 0;
  white-space: nowrap;
}

.confirm-action-modal-content{
  width: 460px;
  max-width: 94vw;
  text-align: left;
  border-radius: 10px;
}

.confirm-action-modal-content h3{
  margin: 0 0 .65rem;
  font-family: "Formula1Bold";
  text-transform: uppercase;
  font-size: 1rem;
}

.confirm-action-modal-content p{
  margin: 0 0 .9rem;
  font-family: "Formula1Regular";
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: pre-line;
}

.confirm-action-buttons{
  display: flex;
  justify-content: center;
  gap: .55rem;
}

.confirm-action-buttons .button-save-team,
.confirm-action-buttons .button-reset-team{
  margin-right: 0;
  min-width: 112px;
}

.block-chip-modal-content{
  width: 420px;
  max-width: 92vw;
  text-align: left;
}

.block-chip-modal-content h3{
  margin: 0 0 .55rem;
}

.chip-disclaimer{
  font-family: "Formula1Regular";
  font-size: 0.8rem;
  margin-bottom: .75rem;
}

.chip-current-info{
  font-size: 0.78rem;
  margin-bottom: .75rem;
}

.block-chip-form{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.block-chip-form .myteam-sort-select{
  width: 100%;
}

.block-submit-btn{
  margin-right: 0;
  margin-top: .2rem;
}

.chip-warning{
  margin-top: .45rem;
  color: #8a5a00;
  display: block;
}


.selection-div{
  height: 100%;
  display:flex; 
  flex-direction: column; 
  align-items: center;
  margin-left:5vh; 
  margin-right:5vh;
  justify-content: center;
}

.selected-div{
  display:flex; 
  flex-direction: column; 
  align-items: center;
  background-color: white;
  border-radius: 5px;
  margin-left:5%; 
  margin-right:5%;
  position: relative;
}

#selection1{
  border: 3px solid red
}

#selection1.drs-boost-active{
  border: 3px solid #8d1598;
}

#selection1::after{
  position: absolute;
  margin: 2px;
  top: 1%; /* Adjust the value as needed to position the button correctly */
  left: 1%; /* Adjust the value as needed to position the button correctly */
  font-weight: 700;
  content:"2x";
  text-transform: uppercase;
  color: white;
  background-color: black;
  font-family: "Formula1Bold";
  font-size: 0.6rem;
  box-shadow: none;
  padding: 3%;
  border-radius: 100px; /* Optional: Add border-radius for rounded corners */
  cursor: pointer; /* Change cursor to pointer to indicate it's clickable */
  z-index: 2; /* Ensure it overlays the other components */
}

#selection1.drs-boost-active::after{
  content: "3x";
  background-color: #8d1598;
}

.driver-selected-photo{
  width: 100%;
  height: 12ch;
  display:flex;
  justify-content: center;
}

.driver-selected-photo.team-photo-stack {
  height: 16ch;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
}

.driver-selected-photo.team-photo-stack .team-car {
  width: auto;
  height: auto;
  max-width: 95%;
  padding-bottom: 5px;
}

.driver-selected-data{
  width: 100%;
  height: 40%;
  font-family: "Formula1Bold";
  text-transform: uppercase;
  font-size: 0.5rem;
  padding: 2%;
}

.driver-selected-price{
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2%;
}

.gray-line-driver{
  border: none;
  height: 1px;
  background-color: hsl(240, 5%, 28%);
  margin-top: 0;
  margin-bottom: 0;
}

.remove-selected{
  position: absolute;
  margin: 2px;
  top: 1%; /* Adjust the value as needed to position the button correctly */
  right: 1%; /* Adjust the value as needed to position the button correctly */
  font-weight: 700;
  box-shadow: none;
  border-radius: 10px; /* Optional: Add border-radius for rounded corners */
  cursor: pointer; /* Change cursor to pointer to indicate it's clickable */
  z-index: 1; /* Ensure it overlays the other components */
}

.remove-driver{
  font-size: 0.9rem;
  display: flex;
  width: 0.8rem;
  height: 0.8rem;
  justify-content: center;
  align-items: center;
  color: hsl(0, 0%, 100%) !important;
  font-weight: 900;
}

.driver-selected-li{
  padding: 1%; 
  display: flex; 
  justify-content: center; 
  margin-top: 3ch; 
  list-style-type: none;
}

.driver-selected-li li{
  width: 33%;
}

.team-selected-li{
  padding: 1%; 
  display: flex; 
  justify-content: center; 
  margin-top: 1%; 
  list-style-type: none;
}

.team-selected-li li{
  width: 80%;
}

.add-selection{
  color: white;
  background-color: #E10600;
  text-align: center; 
  border-radius: 3px;
  border: none;
  padding: 0;
  width: 4vh;
  height: 4vh;
}

.selection-text {
  margin-top: 3vh;
  margin-bottom: 3vh;
  font-weight: 800;
  font-size: 0.8rem;
  text-decoration: underline;
  text-decoration-color: red;
}

.gray-line {
  border: none;
  height: 1px;
  background-color: hsl(240, 5%, 28%);;
  margin-top: 0; /* Reset default margin */
  margin-bottom: 10px; /* Adjust margin as needed */
}

.team-options{
  flex-basis: 46rem;
  flex-shrink: 0;
  position: static;
  background-color: white;
  border-radius: 10px;
}



.selectable-list{  
  width: 45%;
  height: 100%;
  margin-top: 0.25rem;
  padding: 0, 1.5%, 0, 1.5%;
}

.myteam-sort-bar{
  width: 95%;
  margin: 0 2% 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  font-family: "Formula1Bold";
  font-size: 0.72rem;
  text-transform: uppercase;
}

.myteam-sort-select{
  border: none;
  border-radius: 8px;
  background-color: gray;
  color: white;
  padding: 0.32rem 0.5rem;
  font-family: "Formula1Bold";
  font-size: 0.72rem;
  text-transform: uppercase;
}

.myteam-sort-select:focus{
  outline: 2px solid #E10600;
  outline-offset: 1px;
}

.team-driver-selectable{  
  height: 5.2rem;
  width:95%;
  padding: var(--gutter10) var(--gutter16) var(--gutter16);
  margin: 2%;
  background-color: white;
  font-size: 1.2rem;
  color: black;
  align-items: center;
}

.team-driver-selectable ul{
  width: 100%;
  display:flex;
}

.team-driver-selectable ul li{
  flex-grow: 1;
  flex-basis: 100%;
  margin: 2%;
  text-align: center;
}

.team-driver-selectable ul li:first-child{
  border-right:2px solid ;
  height: 100%;
  background-color: hsl(240, 5%, 28%);
  background-color: var(--primary-hot-red);
}

.team-driver-selectable a{
  color:grey;
  text-decoration: none;
  font-family: "Formula1Bold";
  padding-bottom: var(--gutter16);
  position: relative;
  display: block;

}

.team-driver-selectable a.active {
  color:black;
  font-weight: bold;
}

.team-driver-selectable a.active::after {
  content: "";
  position: absolute;
  justify-self: center;
  left: 0;
  right: 0;
  margin: 1%;
  height: 0.2rem;
  width: 80%;
  background-color: hsl(2, 100%, 44%);
  border-radius: 100px;
  transition: max-width .1s linear;
}

.dotted-selector{
  width:94%;
  display: flex;
  margin: 3%;
  justify-content: center;
}

.dotted-selector span{
  margin: 2%;
  display: block;
  width: .6rem;
  height: .6rem;
  background-color: lightgray;
  border-radius: 10px;
}

img {
  overflow-clip-margin: content-box;
  overflow: clip;
}

.tabla{ 
  overflow: auto;
  display: block;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-20) var(--grey-70);
  height: 35rem;
  padding-right: 1%;
}

.tabla-pilotos{
  align-items: center;
  
}

.fila-piloto{
  display:flex;
  height: 8.5rem;
  width: 100%;  
  padding: 1%;
  background-color: white;
  margin-top: 0.5%;
  margin-bottom: 0.5%;
}

.fila-equipo{
  display:flex;
  height: 8.5rem;
  width: 100%;  
  padding: 1%;
  background-color: white;
  margin-top: 0.5%;
  margin-bottom: 0.5%;
}

ul {
  list-style-type: none;
  padding-left: 0.5rem;
}

.foto-piloto{
  height: 100%;
  width: 25%;
  border-radius: 10px;
  display: flex;
  vertical-align: middle;
  position: relative; 
  overflow: hidden;
}

.team-photo-stack {
  justify-content: flex-end;
  align-items: flex-end;
}

.team-car {
  width: auto;
  height: 70%;
  max-width: none;
  object-fit: contain;
  display: block;
  padding-bottom: 4px;
}

.piloto-kogo-number{
  position: absolute;
}

.driver-team-number{
  display: flex;
  align-self: flex-start;
  position: absolute;
  right: 1rem;
  bottom: 0.5rem;
}

.driver-number{
  width: 2.8rem;
  height: auto;
} 

.team-logo-ring{
  position: absolute;
  right: 1rem;
  top: 0.8rem;
  width: 3rem;
  height: 3rem;
  box-sizing: border-box;
  padding: 0.28rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  z-index: 3;
}

.team-logo{
  width: 100%;
  height: 100%;
  object-fit: contain;
} 

.foto-piloto-inside{
  align-self: flex-end;
  padding: 2%;
  margin-left: 2%;
}

.foto-piloto-number{
  align-items: flex-end;
  margin-top: 30%;
}

.data-piloto{
  height: 100%;
  width: 65%;
  display: flex;
  vertical-align: middle;
  margin-right: 2%;
}

.piloto-equipo{
  margin-right: 4%;
  margin-left: 2%;
  width: 75%;
  vertical-align: middle;
  align-content: center;
}

.driver-name{
  text-align: left;
  text-transform: uppercase;
  font-family: "Formula1Bold";
  font-size: 1.5rem;
  line-height: 2rem;
  letter-spacing: .02rem;
  margin-top: 2%;
  margin-bottom: 2%;
}

.driver-team{
  text-align: left;
  font-family: "Formula1Regular";
  font-size: 1rem;
  line-height: 1.5rem;
  letter-spacing: .02rem;
}

.driver-stats{
  width: 100%;
  height:auto;
  display: flex;
  justify-content: space-around;
}

.driver-stats ul{
  padding-left: 0.2rem;
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.driver-stats li{
  margin-left: 2%;
  margin-right: 2%;
  width: 30%;
  background-color: lightgray;
  border-radius: 4px;
  font-family: "Formula1Bold";
  font-size: 0.95rem;
  padding: 1%;
  display: flex;
  justify-content: center;
}

.driver-price{
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Formula1Bold";
  margin: auto;
  font-size: 1.25rem;
  line-height: 1.4rem;
  letter-spacing: .03rem;
}

.price-up{
  color: hsl(206, 100%, 39%); 
  font-size: 0.8rem;
  line-height:0.9rem
}

.price-down{
  color: hsl(4, 77%, 48%); 
  font-size: 0.8rem;
  line-height:0.9rem
}

.selectable-piloto{
  height: 100%;
  width: 10%;
  display:flex;  
  justify-content: center
}

.add-piloto{
  align-self: center;
  display: grid;
  color: white;
  background-color: black;
  border-radius: 5px;
  width: 30px;
  height: 30px;
  align-content: center;
  justify-content: center;
}

.add-equipo{
  align-self: center;
  display: grid;
  color: white;
  background-color: black;
  border-radius: 5px;
  width: 30px;
  height: 30px;
  align-content: center;
  justify-content: center;
}

.no-selectable-piloto{
  height: 100%;
  width: 10%;
  display:flex;  
  justify-content: center
}

.remove-driver-table{
  align-self: center;
  display: grid;
  color: black;
  background-color: white;
  border-radius: 5px;
  width: 30px;
  height: 30px;
  align-content: center;
  justify-content: center;
  font-weight: 700;
}

.remove-team-table{
  align-self: center;
  display: grid;
  color: black;
  background-color: white;
  border-radius: 5px;
  width: 30px;
  height: 30px;
  align-content: center;
  justify-content: center;
  font-weight: 700;
}



.general-selections{
  margin: 0.8% 0.5% 1% 0.5%;
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex; 
  justify-content: space-around;
  align-items: flex-start;
  position: relative;
  z-index: 10;
}

.selection-cards-wrap{
  margin-top: 1rem;
  padding: 1.2% 2% 1.8%;
}

.section {
  width:15%;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 0.5%;
  font-family: "Formula1Bold";
  font-size: 0.6rem;
}

.section-name{
  font-size: 0.8rem;
  padding: 3%;
  margin-bottom: 2%;
  margin-left: 3%;
}

.pole-position > *{
  border-left: 3px solid gray;
  border-bottom: 3px solid gray;
  border-radius: 5px;
}

.pole-position > div > button{
  border: 3px solid gray;
}

.first-place > *{
  border-left: 3px solid gold;
  border-bottom: 3px solid gold;
  border-radius: 5px;
}

.first-place > div > button{
  border: 3px solid gold;
}

.second-place > *{
  border-left: 3px solid silver;
  border-bottom: 3px solid silver;
  border-radius: 5px;
}

.second-place > div > button{
  border: 3px solid silver;
}

.third-place > *{
  border-left: 3px solid hsla(30, 61%, 50%, 1);
  border-bottom: 3px solid hsla(30, 61%, 50%, 1);
  border-radius: 5px;
}

.third-place > div > button{
  border: 3px solid hsla(30, 61%, 50%, 1);
}

.fastest-lap > *{
  border-left: 3px solid hsl(300, 100%, 50%);
  border-bottom: 3px solid hsl(300, 100%, 50%);
  border-radius: 5px;
}

.fastest-lap > div > button{
  border: 3px solid hsl(300, 100%, 50%);
}

.best-team > *{
  border-left: 3px solid hsla(90, 100%, 32%, 1);
  border-bottom: 3px solid hsla(90, 100%, 32%, 1);
  border-radius: 5px;
}

.best-team > div > button{
  border: 3px solid hsla(90, 100%, 32%, 1);
}

.dropdown {
  border: 0;
  width: 100%;
  position: relative;
  display: inline-block;
  padding: 3%;
}

.dropbtn {
  width: 100%;
  border-radius: 10px;
  background-color: gray;
  color: white;
  padding: 16px;
  border: none;
  cursor: pointer;
}

.dropbtn:hover, .dropbtn:focus {
  background-color: white;
  color: gray;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1000;
}

.dropdown-content a {
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content span {
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.show {
  display: block;
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  width: 300px;
  font-family: "Formula1Bold";
  position: relative;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 12px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.blocked-asset-row{
  filter: grayscale(100%);
  opacity: 0.65;
}

.blocked-asset-pill{
  align-self: center;
  background: #f3f4f6;
  border: 1px solid #9ca3af;
  color: #374151;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  margin-right: 0.35rem;
  white-space: nowrap;
}

.incoming-block-info{
  margin-top: 0.6rem;
}

/* Make DRS Boost and Pit Stop buttons same width */
.chip-action-fixedwidth {
    min-width: 130px;
    max-width: 130px;
    justify-content: center;
    text-align: center;
}

/* Align Save/Reset buttons to right on desktop */
.team-save-reset-btns {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .team-save-reset-btns {
        justify-content: center;
    }
}

/* ==========================================================
   RESPONSIVE OVERRIDES – Team page (mobile / small screens)
   Desktop layout is kept exactly as-is; these rules only
   activate below the given breakpoints.
   ========================================================== */

/* ── Global guard: prevent horizontal overflow ────────── */
.container-home,
.main-team {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ── ≤ 1100px  – first compression tier ──────────────── */
@media (max-width: 1100px) {

  /* GP header: let the 3 columns wrap */
  .subcontainer-home {
    flex-wrap: wrap;
  }

  .left-home {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
  }

  .image-gp-home-left {
    object-fit: cover;
    height: 220px;
  }

  .center-home {
    width: 65%;
  }

  .right-home {
    width: 35%;
  }

  /* General selections: 3 per row */
  .general-selections {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .section {
    width: 30%;
    min-width: 130px;
  }

  /* Fantasy team two-panel → stack */
  .fantasy-team {
    flex-direction: column;
  }

  .team-selections {
    width: 100%;
  }

  .selectable-list {
    width: 100%;
  }

  /* Top selection bar: allow wrapping */
  .top-selection-actions {
    flex-wrap: wrap;
  }
}

/* ── ≤ 768px  – typical phone landscape ──────────────── */
@media (max-width: 768px) {

  .mastmain {
    padding-top: max(12vh, 110px);
  }

  /* GP header: hide left track image, full-width center & right */
  .left-home {
    display: none;
  }

  .center-home {
    width: 100% !important;
  }

  .center-home section:first-child {
    width: 100% !important;
    font-size: 3.5vw !important;   /* override inline 2vw */
  }

  .center-home section:last-child {
    width: 35% !important;
  }

  .right-home {
    width: 100%;
  }

  .timer-title {
    font-size: 2.8vw;
  }

  .timer-main {
    font-size: 5.5vw;
  }

  /* General selections: 2 per row */
  .section {
    width: 45%;
  }

  /* Driver selected cards: 2 per row */
  .driver-selected-li {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .driver-selected-li li {
    width: 45%;
  }

  /* Smaller driver photos in table */
  .fila-piloto,
  .fila-equipo {
    height: auto;
    min-height: 5.5rem;
    flex-wrap: nowrap;
  }

  .foto-piloto {
    width: 28%;
    min-width: 80px;
  }

  .data-piloto {
    width: 62%;
  }

  .driver-name {
    font-size: 1.05rem;
    line-height: 1.3rem;
  }

  .driver-team {
    font-size: 0.8rem;
    line-height: 1rem;
  }

  .driver-price {
    font-size: 0.95rem;
    line-height: 1.1rem;
  }

  .driver-stats li {
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  /* Chip buttons on 768px */
  .chip-action-btn {
    font-size: 0.7rem;
    padding: 0.22rem 0.4rem;
  }

  .chip-action-btn img {
    width: 15px;
    height: 15px;
  }

  /* Keep X button above team logo on mobile */
  .remove-selected {
    z-index: 5;
  }

  /* Team card logo: center on mobile so it doesn't overlap X */
  .team-photo-stack .team-logo-ring {
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2.2rem;
    height: 2.2rem;
    padding: 0.2rem;
  }

  /* Driver table: logo & number scale down */
  .team-logo-ring {
    width: 2.2rem;
    height: 2.2rem;
    right: 0.5rem;
    top: 0.4rem;
    padding: 0.2rem;
  }

  .driver-team-number {
    right: 0.5rem;
    bottom: 0.3rem;
  }

  .driver-number {
    width: 2rem;
  }

  /* Budget bar */
  .budget-block {
    min-width: 150px;
    flex: 0 0 auto;
  }

  .budgetBar {
    width: 150px;
  }

  /* Buttons */
  .button-reset-team,
  .button-save-team,
  .button-save-deactivated {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  /* Team selected cards: side by side instead of 80% */
  .team-selected-li {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .team-selected-li li {
    width: 45%;
  }

  /* Footer font */
  .mastmain > div:last-child a:last-child {
    font-size: 2vw !important;
  }
}

/* ── ≤ 576px  – phone portrait ───────────────────────── */
@media (max-width: 576px) {

  .mastmain {
    padding-top: max(8vh, 90px);
  }

  /* GP title sizing */
  .title-home {
    font-size: 1.1em;
    line-height: 1.3em;
  }

  .subtitle-home {
    font-size: 0.8rem;
  }

  .image-gp-home-flag {
    width: 2.2rem;
    margin-right: 10px;
  }

  .center-home section:first-child {
    font-size: 5vw !important;
  }

  .center-home section:last-child {
    width: 30% !important;
  }

  /* Timer */
  .timer-title {
    font-size: 3.5vw;
  }

  .timer-main {
    font-size: 7vw;
  }

  /* General selections: 1 per row */
  .section {
    width: 100%;
  }

  .dropdown {
    padding: 2%;
  }

  .dropbtn {
    padding: 10px;
    font-size: 0.85rem;
  }

  /* Chip buttons on 576px */
  .chip-action-btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.35rem;
  }

  .chip-action-btn img {
    width: 13px;
    height: 13px;
  }

  /* Driver cards: 1 per row */
  .driver-selected-li {
    flex-direction: column;
    align-items: center;
    margin-top: 1.5ch;
  }

  .driver-selected-li li {
    width: 85%;
  }

  .team-selected-li li {
    width: 85%;
  }

  /* Selection div margin fix */
  .selection-div {
    margin-left: 2vh;
    margin-right: 2vh;
  }

  /* Driver/team table rows */
  .foto-piloto {
    width: 30%;
    min-width: 65px;
  }

  .foto-piloto-inside img {
    height: 80px;
  }

  .data-piloto {
    width: 55%;
  }

  .selectable-piloto,
  .no-selectable-piloto {
    width: 14%;
  }

  .driver-name {
    font-size: 0.85rem;
    line-height: 1.1rem;
  }

  .driver-team {
    font-size: 0.65rem;
  }

  .driver-price {
    font-size: 0.8rem;
    line-height: 1rem;
  }

  .driver-stats li {
    font-size: 0.6rem;
    width: auto;
    margin: 1%;
  }

  /* Table scroll height */
  .tabla {
    height: 28rem;
  }

  /* Tabs */
  .team-driver-selectable {
    height: auto;
    padding: 8px;
    font-size: 0.9rem;
  }

  /* Budget */
  .budget-selection {
    font-size: 1rem;
    line-height: 1.2rem;
  }

  /* Chips */
  .chip-action-btn {
    min-width: 80px;
    min-height: 30px;
    font-size: 0.62rem;
    gap: 0.25rem;
    padding: 0.2rem 0.35rem;
  }

  .chip-action-btn img {
    width: 18%;
  }

  /* Driver table: logo & number smaller */
  .team-logo-ring {
    width: 1.8rem;
    height: 1.8rem;
    right: 0.35rem;
    top: 0.3rem;
    padding: 0.15rem;
  }

  /* Team card logo: stay centered */
  .team-photo-stack .team-logo-ring {
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1.8rem;
    height: 1.8rem;
    padding: 0.15rem;
  }

  .driver-team-number {
    right: 0.35rem;
    bottom: 0.2rem;
  }

  .driver-number {
    width: 1.6rem;
  }

  /* Navbar top pane */
  .top-pane {
    height: 40px;
  }

  .top-right-buttons .btn {
    width: auto;
    min-width: 60px;
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  /* Footer */
  .mastmain > div:last-child a:last-child {
    font-size: 4vh !important;
  }
}

/* ── ≤ 400px  – very small phones ────────────────────── */
@media (max-width: 400px) {

  .center-home {
    flex-direction: column;
  }

  .center-home section:last-child {
    width: 50% !important;
    justify-content: flex-start !important;
    margin-top: 0.5rem;
  }

  .timer-container-home {
    width: 100%;
  }

  .top-selection-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chip-action-btn {
    font-size: 0.6rem;
    padding: 0.18rem 0.3rem;
  }

  .chip-action-btn img {
    width: 12px;
    height: 12px;
  }

  .drs-chip-row {
    flex-direction: column;
    align-items: stretch;
  }

  /* Driver table: logo & number tiniest */
  .team-logo-ring {
    width: 1.5rem;
    height: 1.5rem;
    right: 0.25rem;
    top: 0.25rem;
    padding: 0.12rem;
  }

  /* Team card logo: stay centered */
  .team-photo-stack .team-logo-ring {
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    padding: 0.12rem;
  }

  .driver-team-number {
    right: 0.25rem;
    bottom: 0.15rem;
  }

  .driver-number {
    width: 1.3rem;
  }

  /* Budget block full width */
  .budget-block {
    min-width: 100%;
  }

  .budgetBar {
    width: 100%;
  }
}

