/* LOSERSLEAGUE V15.21 — final responsive safety layer.
   Intentionally loaded last. It does not replace desktop logic; it only
   constrains geometry and touch behaviour on tablets/phones. */
:root{--ll21-safe:clamp(10px,3vw,18px);--ll21-touch:44px}
html,body{max-width:100%;overflow-x:hidden}
img,video,svg,canvas{max-width:100%}
button,a,input,select,textarea{touch-action:manipulation}

@media(max-width:1000px){
  .v15-main,.v15-unified-main{min-width:0!important;width:100%!important;padding-left:14px!important;padding-right:14px!important}
  .v15-unified-content,.v15-tournament-content{min-width:0!important;width:100%!important;max-width:100%!important}
  .v15-topline,.v15-unified-topline{min-width:0!important;max-width:100%!important}
  .v15-unified-local-nav,.v15-local-nav,.og26-local-nav{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .v15-unified-local-nav::-webkit-scrollbar,.v15-local-nav::-webkit-scrollbar,.og26-local-nav::-webkit-scrollbar{display:none}
  .og26-local-nav-inner{min-width:max-content!important;display:flex!important;flex-wrap:nowrap!important}
  #comp-pl .headline{grid-template-columns:minmax(0,1fr) minmax(220px,28%)!important}
}

@media(max-width:700px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:54px}
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
  *{box-sizing:border-box}
  input,select,textarea{font-size:16px!important;max-width:100%!important}
  button{min-height:var(--ll21-touch)}

  /* Shared V15 shell: desktop sidebar becomes the same horizontal tournament rail everywhere. */
  .v15-shell,.v15-unified-page{width:100%!important;max-width:100%!important;min-width:0!important}
  .v15-sidebar{position:relative!important;inset:auto!important;width:100%!important;min-width:0!important;height:auto!important;max-height:none!important;padding:8px 10px!important;border-right:0!important;border-bottom:1px solid #222b34!important;display:block!important;overflow:hidden!important}
  .v15-sidebar-brand,.v15-sidebar-foot{display:none!important}
  .v15-menu{display:flex!important;flex-direction:row!important;gap:5px!important;width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:none!important;padding:0!important}
  .v15-menu::-webkit-scrollbar{display:none}
  .v15-menu-sep{display:none!important}
  .v15-menu button{flex:0 0 auto!important;width:auto!important;min-width:max-content!important;height:44px!important;min-height:44px!important;padding:0 12px!important;margin:0!important;border-radius:6px!important;font-size:9px!important;white-space:nowrap!important}
  .v15-menu button span{margin-right:5px!important}
  .v15-main,.v15-unified-main{width:100%!important;min-width:0!important;max-width:100%!important;padding:0 var(--ll21-safe) calc(28px + env(safe-area-inset-bottom))!important}

  /* Header: no second row, no auth button falling into content. */
  .v15-topline,.v15-tournament-topline,.v15-unified-topline{width:100%!important;max-width:100%!important;min-height:68px!important;height:auto!important;padding:10px 0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;gap:4px 10px!important;align-items:center!important}
  .v15-season,.v15-unified-season{display:none!important}
  .v15-score,.v15-elo,.v15-versus,.v15-unified-score{min-width:0!important}
  .v15-unified-status,.v15-status{grid-column:2!important;grid-row:1 / span 2!important;justify-self:end!important;align-self:center!important;max-width:140px!important;height:36px!important;font-size:7px!important;padding:0 10px!important}

  /* Legacy PL/UCL navigation retained functionally, rendered as a swipe rail. */
  .competition-nav,#plSubnav,#uclSubnav,.v15-unified-local-nav,.v15-local-nav,.og26-local-nav{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:none!important}
  .competition-nav::-webkit-scrollbar,#plSubnav::-webkit-scrollbar,#uclSubnav::-webkit-scrollbar{display:none}
  .competition-nav-inner,.og26-local-nav-inner{display:flex!important;flex-wrap:nowrap!important;gap:5px!important;min-width:max-content!important;padding-left:6px!important;padding-right:6px!important}
  .competition-nav button,.v15-unified-local-nav button,.v15-local-nav button,.og26-local-nav button{flex:0 0 auto!important;min-height:44px!important;white-space:nowrap!important}

  /* Hero/editorial surfaces. */
  .v15-hero-card,.v15-editorial-hero{min-height:390px!important;height:auto!important;max-width:100%!important;overflow:hidden!important}
  .v15-hero-card video,.v15-editorial-hero video{width:100%!important;height:100%!important;object-fit:cover!important}
  .v15-hero-copy,.v15-hero-content{max-width:92%!important;padding-left:16px!important;padding-right:12px!important}
  .v15-hero-copy h1,.v15-hero-content h1{font-size:clamp(34px,10vw,48px)!important;line-height:.94!important}
  .v15-hero-copy p,.v15-hero-content p{font-size:12px!important;line-height:1.4!important;max-width:95%!important}
  .v15-hero-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
  .v15-hero-actions button,.v15-hero-actions a{min-height:44px!important;padding:0 13px!important;font-size:9px!important}

  /* Olympic command-center hero: retain the ice arena, text stays legible, generated panel may crop on narrow phones. */
  #comp-og26 .v15-og-titlebar{min-height:390px!important;padding:24px 18px!important;background-position:60% center!important;border-radius:10px!important}
  #comp-og26 .v15-og-titlebar:before{background:linear-gradient(90deg,rgba(4,11,18,.86) 0%,rgba(4,11,18,.66) 46%,rgba(4,11,18,.12) 82%,rgba(4,11,18,.08) 100%)!important}
  #comp-og26 .v15-og-titlebar>*{position:relative;z-index:2;max-width:92%!important}
  #comp-og26 .v15-og-titlebar h1{font-size:clamp(34px,10vw,48px)!important;line-height:.95!important;letter-spacing:-1.5px!important}
  #comp-og26 .v15-og-titlebar p{font-size:12px!important;line-height:1.45!important;max-width:92%!important}
  #comp-og26 .v15-og-statline{display:flex!important;flex-wrap:wrap!important;gap:7px 12px!important;font-size:8px!important}
  .v15-og-facts{display:flex!important;overflow-x:auto!important;flex-wrap:nowrap!important;gap:6px!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch}
  .v15-og-facts::-webkit-scrollbar{display:none}
  .v15-og-facts span{flex:0 0 auto!important;white-space:nowrap!important}

  /* Formerly desktop-only two-column title cards collapse predictably. */
  #comp-pl .headline{display:grid!important;grid-template-columns:1fr!important;gap:13px!important;padding:18px!important}
  #comp-pl .hero h1{font-size:clamp(34px,10vw,46px)!important;line-height:.96!important}

  /* All card systems become one-column unless they deliberately manage their own horizontal strip. */
  .og26-groups,.v15-dashboard,.v15-wc-overview,.recap-insights{grid-template-columns:1fr!important;min-width:0!important}
  .card,.comp-card,.wc-group-card,.og26-group-card,.ucl-panel,.history-global-card,.history-backup-card{min-width:0!important;max-width:100%!important;overflow:hidden!important}

  /* Tables scroll inside their card, never the whole page. */
  .table-wrap,.table-scroll,.wc-table-wrap,#tableBox,#og26CalendarBox,#og26SeedBox,#og26GroupsBox{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-inline:contain}
  table{max-width:none}
  .table,.stats-table,.wc-table,.og26-table,.ucl-table{font-size:10px!important}
  .table th,.table td,.stats-table th,.stats-table td,.wc-table th,.wc-table td,.og26-table th,.og26-table td,.ucl-table th,.ucl-table td{padding-left:7px!important;padding-right:7px!important}

  /* Match inputs and protocol controls remain usable with fingers. */
  .score-input,.og26-score-input{min-width:42px!important;min-height:42px!important}
  .match-row button,.mw-control button,.mw-control select{min-height:44px!important}

  /* Long names/logos never push the page width. */
  .team-cell,.team-name,.club-name,.og26-team,.wc-team,.ucl-team{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis}

  .foot{padding-left:var(--ll21-safe)!important;padding-right:var(--ll21-safe)!important}
}

@media(max-width:390px){
  :root{--ll21-safe:8px}
  .v15-main,.v15-unified-main{padding-left:8px!important;padding-right:8px!important}
  .v15-menu button{padding-left:10px!important;padding-right:10px!important;font-size:8px!important}
  .v15-hero-card,.v15-editorial-hero{min-height:370px!important}
  #comp-og26 .v15-og-titlebar{min-height:370px!important;padding:20px 14px!important;background-position:57% center!important}
  #comp-og26 .v15-og-titlebar h1{font-size:34px!important}
  .v15-unified-status,.v15-status{max-width:112px!important;font-size:6.5px!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}
}
