/* LOSERSLEAGUE V15.35 — universal mobile sync / geometry guard.
   Loaded last. Same content is used by public and admin control pages. */
:root{--ll34-safe-x:clamp(8px,3vw,16px);--ll34-touch:44px}
html,body{width:100%;max-width:100%;overflow-x:hidden}
*,*::before,*::after{box-sizing:border-box}
img,video,svg,canvas,iframe{max-width:100%}
.wrap,.competition-panel,.v15-shell,.v15-main,.v15-dashboard,.v15-unified-page,.v15-unified-main,.v15-unified-content,.v15-tournament-content{min-width:0;max-width:100%}
.table-scroll,.table-wrap,.wc-table-wrap{overscroll-behavior-inline:contain}

@media(max-width:1000px){
  .v15-main,.v15-unified-main{width:100%!important;min-width:0!important;max-width:100%!important}
  .v15-dashboard,.v15-right-rail,.v15-results-panel,.v15-feature-panel,.v15-leaders-panel{min-width:0!important;max-width:100%!important}
  .competition-nav,.v15-local-nav,.v15-unified-local-nav,.og26-local-nav{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .competition-nav::-webkit-scrollbar,.v15-local-nav::-webkit-scrollbar,.v15-unified-local-nav::-webkit-scrollbar,.og26-local-nav::-webkit-scrollbar{display:none}
}

@media(max-width:700px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
  button,a,input,select,textarea{touch-action:manipulation}
  button{min-height:var(--ll34-touch)}
  input,select,textarea{max-width:100%!important;font-size:16px!important}

  /* One content width on every phone. No desktop panel is allowed to widen the page. */
  .v15-main,.v15-unified-main,.v15-tournament-main{width:100%!important;max-width:100%!important;min-width:0!important;padding-left:var(--ll34-safe-x)!important;padding-right:var(--ll34-safe-x)!important}
  .v15-dashboard,.v15-right-rail,.v15-panel,.v15-hero-card,.v15-editorial-hero,.headline,.history-global-card,.history-backup-card,.ll-rules-page,.ll-rules-card,.ll-rules-strength,.ll-rules-example{width:100%!important;max-width:100%!important;min-width:0!important}

  /* Tournament navigation is identical on iPhone, Galaxy and generic Android widths. */
  .v15-menu,.competition-nav-inner,.v15-local-nav,.og26-local-nav-inner{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:none!important;max-width:100%!important}
  .v15-menu::-webkit-scrollbar,.competition-nav-inner::-webkit-scrollbar,.v15-local-nav::-webkit-scrollbar,.og26-local-nav-inner::-webkit-scrollbar{display:none}
  .v15-menu button,.competition-nav button,.v15-local-nav button,.v15-unified-local-nav button,.og26-local-nav button{flex:0 0 auto!important;white-space:nowrap!important}

  /* Home: keep ELO/header, then a true single-column feed. */
  .v15-topline{width:100%!important;max-width:100%!important;min-width:0!important}
  .v15-elo-display{max-width:100%!important;min-width:0!important}
  .v15-dashboard{grid-template-columns:minmax(0,1fr)!important}
  .v15-right-rail{width:100%!important}
  .v15-hero-card,.v15-editorial-hero{overflow:hidden!important}
  .v15-hero-slide,.v15-hero-media,.v15-hero-content{max-width:100%!important;min-width:0!important}
  .v15-hero-title{font-size:clamp(30px,9.4vw,45px)!important;overflow-wrap:anywhere}
  .v15-hero-subtitle{max-width:96%!important}
  .v15-hero-slide-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
  .v15-hero-slide-actions button{min-height:42px!important;max-width:100%!important}

  /* Shared tables: only the table itself may scroll horizontally, never the page. */
  .table-scroll,.table-wrap,.wc-table-wrap,#tableBox,#wcThirdsBox,#wcBracketBox,#og26CalendarBox,#og26SeedBox,#og26GroupsBox,#og26StatsMatches{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
  table{max-width:none!important}

  /* World Cup full bracket stays readable without creating document-level horizontal scroll. */
  #comp-wc26 .wc-bracket-wrap,#comp-wc26 .wc-ko-bracket-scroll{width:100%!important;max-width:100%!important;overflow-x:auto!important;overscroll-behavior-inline:contain}

  /* Premier League / UCL cards and match controls. */
  #comp-pl .headline{grid-template-columns:minmax(0,1fr)!important}

  /* Olympics, including the bot-driven statistics added in V15.31/32. */
  #comp-og26,.og26-shell,.og26-view,.og26-stage,.og26-stats-hero,.og26-stats-match,.og26-stat-card{min-width:0!important;max-width:100%!important}
  #comp-og26 .og26-stats-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #comp-og26 .og26-stats-leaders{grid-template-columns:minmax(0,1fr)!important}
  .og26-stats-match-main{grid-template-columns:minmax(0,1fr) minmax(64px,78px) minmax(0,1fr)!important}
  .og26-stats-team{min-width:0!important}
  .og26-stats-team b{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .og26-stats-match footer{flex-wrap:wrap!important}
  .og26-stats-sheet{max-width:calc(100vw - 16px)!important}
  .og26-protocol-head{grid-template-columns:minmax(0,1fr) 70px minmax(0,1fr)!important}

  /* Rules/history/modal surfaces. */
  .ll-rules-grid{grid-template-columns:minmax(0,1fr)!important}
  .matchcard-sheet,.team-history-sheet,.og26-stats-sheet{max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important}

  /* Long names should truncate locally, not widen the viewport. */
  .team-name,.team-cell,.club-name,.wc-team,.og26-team,.ucl-team,.ll-inline-team,.ll-epl-team{min-width:0!important;max-width:100%!important}
}

@media(max-width:390px){
  :root{--ll34-safe-x:8px}
  .v15-hero-title{font-size:31px!important}
  #comp-og26 .og26-stats-summary{gap:7px!important}
  .og26-stats-match-main{grid-template-columns:minmax(0,1fr) 62px minmax(0,1fr)!important;gap:4px!important}
}

@media(min-width:640px) and (max-width:915px) and (max-height:500px) and (orientation:landscape){
  .v15-main,.v15-unified-main{padding-left:12px!important;padding-right:12px!important}
  .v15-sidebar{height:auto!important;max-height:none!important}
  .v15-dashboard{grid-template-columns:minmax(0,1fr)!important}
  .v15-hero-card,.v15-editorial-hero{min-height:320px!important}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
