
/* =========================================================
   PRIME LEAGUE — CORREZIONE LAYOUT MOBILE GLOBALE
   ========================================================= */

html{
  width:100%;
  min-width:0;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body{
  width:100%;
  min-width:0;
  margin:0;
  overflow-x:hidden;
}

#app,
.shell,
main.container{
  min-width:0;
  max-width:100%;
}

img,
svg,
video{
  max-width:100%;
}

/* Impedisce a elementi larghi di aumentare la larghezza del documento */
.table-wrap,
.premium-table-wrap,
.score-scroll,
.sidebar,
.lineup-table-wrap{
  max-width:100%;
}

/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width:650px){

  .shell{
    width:100%;
    max-width:100%;
    overflow:hidden;
  }

  .topbar{
    width:100%;
    max-width:100%;
    box-sizing:border-box;
    padding:10px 14px !important;
  }

  .brand{
    min-width:0;
    max-width:75%;
  }

  .brand-crest{
    width:40px !important;
    height:40px !important;
    flex:0 0 40px;
  }

  .brand > span{
    min-width:0;
    font-size:.78rem;
    white-space:nowrap;
  }

  .brand small{
    display:none !important;
  }

  main.container{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    padding:14px 10px 86px !important;
    box-sizing:border-box;
  }

  /* Hero Classifica a piena larghezza */
  .standings-hero{
    width:auto !important;
    max-width:none !important;
    margin:0 -10px 26px !important;
    padding:34px 16px 24px !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:22px !important;
    box-sizing:border-box;
  }

  .standings-hero h1{
    font-size:2.3rem !important;
    line-height:1 !important;
    margin:8px 0 12px !important;
  }

  .standings-hero p{
    max-width:100%;
    font-size:.84rem !important;
    line-height:1.5;
  }

  .season-selector-card{
    width:100% !important;
    max-width:100% !important;
    justify-self:stretch !important;
    padding:15px !important;
    box-sizing:border-box;
  }

  .season-selector-card select{
    width:100%;
    min-width:0;
  }

  .standings-content{
    width:100% !important;
    max-width:100% !important;
    min-width:0;
  }

  .standings-title-row{
    width:100%;
    max-width:100%;
    gap:12px !important;
    margin-bottom:15px !important;
  }

  .standings-title-row h2{
    font-size:1.55rem !important;
    line-height:1.1;
  }

  .qualification-legend{
    width:100%;
    font-size:.61rem !important;
    gap:10px !important;
  }

  .standings-desktop{
    display:none !important;
  }

  .standings-mobile{
    display:grid !important;
    width:100% !important;
    max-width:100% !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:9px !important;
  }

  .standing-mobile-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0;
    box-sizing:border-box;
    padding:12px !important;
    border-radius:16px !important;
  }

  .standing-mobile-head{
    width:100%;
    min-width:0;
    display:grid !important;
    grid-template-columns:28px 36px minmax(0,1fr) 46px !important;
    gap:7px !important;
  }

  .standing-mobile-head .logo{
    width:36px !important;
    height:36px !important;
    min-width:36px;
  }

  .standing-mobile-name{
    min-width:0;
  }

  .standing-mobile-name strong{
    font-size:.78rem;
  }

  .qualification-badge{
    max-width:100%;
    font-size:.46rem !important;
    padding:3px 5px !important;
  }

  .mobile-points{
    min-width:44px !important;
    width:44px;
    height:44px !important;
    border-radius:12px !important;
  }

  .mobile-points b{
    font-size:1.05rem !important;
  }

  .standing-mobile-stats{
    width:100%;
    min-width:0;
    grid-template-columns:repeat(7,minmax(0,1fr)) !important;
    gap:1px !important;
    margin-top:10px !important;
    padding-top:10px !important;
  }

  .standing-mobile-stats b{
    font-size:.69rem !important;
  }

  .standing-mobile-stats small{
    font-size:.43rem !important;
  }

  /* Strisce e footer sempre a piena larghezza */
  .brand-marquee,
  .footer,
  .mega-footer{
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box;
  }

  .mega-footer{
    padding-left:16px !important;
    padding-right:16px !important;
  }

  .footer-grid{
    width:100%;
    max-width:100%;
    grid-template-columns:1fr !important;
  }

  /* Menu inferiore completo e stabile */
  .mobile-nav{
    width:100%;
    max-width:100%;
    box-sizing:border-box;
  }
}


/* =========================================================
   SCHEDA GIOCATORE — SOLO SMARTPHONE
   La foto occupa una zona separata sotto il selettore stagione.
   Nessuna modifica alla versione desktop.
   ========================================================= */

@media (max-width:650px){

  .player-profile-hero{
    position:relative !important;
    display:block !important;
    width:100% !important;
    min-height:0 !important;
    padding:24px 20px 0 !important;
    border-radius:24px !important;
    overflow:hidden !important;
    box-sizing:border-box;
  }

  .player-profile-copy{
    position:relative !important;
    z-index:5 !important;
    width:100%;
  }

  .player-profile-kicker{
    max-width:100%;
    margin-bottom:34px !important;
  }

  .player-profile-kicker .logo{
    width:48px !important;
    height:48px !important;
    flex:0 0 48px;
  }

  .player-profile-kicker span{
    min-width:0;
    font-size:.68rem !important;
    line-height:1.35;
  }

  .player-profile-copy h1{
    max-width:100%;
    margin:14px 0 22px !important;
    font-size:clamp(3rem,15vw,4.5rem) !important;
    line-height:.82 !important;
    letter-spacing:-.065em !important;
    word-break:normal;
  }

  .player-profile-meta{
    position:relative;
    z-index:5;
    gap:8px !important;
  }

  .player-profile-meta span,
  .player-profile-meta a{
    padding:9px 12px !important;
    font-size:.72rem !important;
  }

  /*
   * Il selettore resta nel normale flusso della pagina.
   * Il margine inferiore crea lo spazio riservato alla foto.
   */
  .player-season-switch{
    position:relative !important;
    inset:auto !important;
    z-index:6 !important;
    width:100% !important;
    max-width:none !important;
    margin:30px 0 0 !important;
    padding:17px !important;
    box-sizing:border-box;
    background:rgba(3,17,43,.78) !important;
    backdrop-filter:blur(18px);
  }

  .player-season-switch select{
    width:100% !important;
    min-width:0;
  }

  .player-season-switch small{
    max-width:230px;
    line-height:1.45;
  }

  /*
   * Zona fotografica separata.
   * Non può più sovrapporsi al selettore stagione.
   */
  .player-profile-image{
    position:relative !important;
    inset:auto !important;
    z-index:3 !important;
    width:calc(100% + 40px) !important;
    height:390px !important;
    margin:18px -20px 0 !important;
    display:flex !important;
    align-items:flex-end !important;
    justify-content:flex-end !important;
    overflow:hidden;
    opacity:1 !important;
    pointer-events:none;
  }

  .player-profile-image img{
    width:auto !important;
    max-width:88% !important;
    height:100% !important;
    max-height:100% !important;
    margin-right:-2% !important;
    object-fit:contain !important;
    object-position:right bottom !important;
    filter:drop-shadow(0 18px 20px rgba(0,0,0,.32));
  }

  .player-profile-fallback{
    width:72% !important;
    height:330px !important;
    margin-left:auto;
    border-radius:140px 140px 0 0 !important;
  }

  .player-watermark{
    z-index:1 !important;
    right:-8% !important;
    top:45% !important;
    font-size:13rem !important;
  }
}

/* Telefoni molto stretti */
@media (max-width:390px){

  .player-profile-hero{
    padding-inline:16px !important;
  }

  .player-profile-copy h1{
    font-size:3.05rem !important;
  }

  .player-profile-image{
    width:calc(100% + 32px) !important;
    height:350px !important;
    margin-inline:-16px !important;
  }

  .player-profile-image img{
    max-width:94% !important;
  }

  .player-profile-meta a{
    width:100%;
    text-align:center;
  }
}
