/* KonyaFutbol Responsive Layout Fix — 2026-11-02
   Non-destructive visual overrides for existing PHP markup.
   Load AFTER assets/app.css, news-assets/news.css and inline <style> blocks.
*/
:root{--kf-radius:14px}
html{max-width:100%}
body{min-width:0;max-width:100%;overflow-wrap:break-word}
img,video,canvas,svg{max-width:100%}
iframe{max-width:100%}
.wrap,.panel,.content-grid,.content-grid>*,.admin-layout,.admin-layout>*,
.main-col,.side-col,.match-center,.match-detail,.match-card,.news-grid,
.home-news-feature,.home-news-slider-wrap,.home-news-grid,.weekly-xi-carousel,
.weekly-xi-track,.lineup-editor-grid,.lineup-editor-card,.admin-content,
.team-profile-page,.match-officials-panel,.event-feed-panel{min-width:0;max-width:100%}
.wrap{width:100%;box-sizing:border-box}
.panel,.match-card,.home-news-card,.admin-content{overflow-wrap:anywhere}
.panel h1,.panel h2,.panel h3,.page-head h2,.profile-head h2{overflow-wrap:anywhere}
/* Horizontal navigation must scroll inside itself, not push the whole document. */
.top{box-sizing:border-box;width:100%;max-width:100%;min-width:0}
.toplinks{min-width:0;max-width:100%;scrollbar-width:thin}
.toplinks a{flex-shrink:0}
.brand{min-width:0}
.brand>span:last-child{min-width:0}
.brand b,.brand small{overflow-wrap:anywhere}
.account{min-width:0;max-width:100%}
/* Match listings and fixtures: team names wrap, scores remain legible. */
.match-card,.match-body,.match-team,.match-team b,.match-detail,.detail-score,
.fixture,.fixture b,.fixture>*,.match-footer,.match-meta{min-width:0}
.match-body{grid-template-columns:minmax(0,1fr) minmax(60px,auto) minmax(0,1fr)}
.match-team b,.fixture b,.match-footer,.match-meta{overflow-wrap:anywhere;word-break:normal}
.match-team{min-width:0}
.match-result{flex-shrink:0}
.detail-score{grid-template-columns:minmax(0,1fr) minmax(90px,auto) minmax(0,1fr)}
/* Wide data tables are intentionally scrollable; do not cut off columns. */
.table-wrap{display:block;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border-radius:10px}
.table-wrap table{width:100%;max-width:none}
/* News cards, hero image and sliders. */
.hero{min-width:0}
.hero h1{overflow-wrap:anywhere}
.hero>div:first-child{min-width:0}
.home-news-slider-wrap,.home-news-grid.home-news-slider,.weekly-xi-carousel{min-width:0;max-width:100%}
.home-news-grid.home-news-slider,.weekly-xi-track{overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
.home-news-slider .home-news-card,.home-news-card{min-width:0}
.home-news-card b,.home-news-card p,.home-news-card small,
.home-news-slider .home-news-card b,.headline-news a{overflow-wrap:anywhere}
.home-news-card img,.home-news-slider .home-news-card img,.news-card img{display:block;max-width:100%;object-fit:cover}
.news-slide-btn,.xi-arrow{flex-shrink:0}
/* Admin inputs, player cards, and profile pages. */
input:not([type=checkbox]):not([type=radio]),select,textarea{max-width:100%;box-sizing:border-box}
.form-grid,.form-grid>*,.form-grid label,.match-edit-form,
.match-edit-form>*,.match-edit-form label,.coach-assign-form,
.coach-assign-form>*,.inline-upload,.inline-upload>*,
.lineup-roster-row,.lineup-player-name,.lineup-saved-columns,
.lineup-saved-columns>*{min-width:0}
input[type=file]{max-width:100%;min-width:0}
.lineup-player-name,.lineup-saved-player,.lineup-team-heading b,
.team-tile,.team-tile small{overflow-wrap:anywhere}
.ys-match-preferences{max-width:100%}
.ys-match-preferences .btn{white-space:normal;text-align:center}
.youtube-frame,.video-frame{width:100%;max-width:100%;aspect-ratio:16/9}
/* Tablet portrait */
@media(max-width:900px){
  .top{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 10px;padding:10px 14px}
  .top .brand{grid-column:1;grid-row:1;min-width:0}
  .top .account{grid-column:2;grid-row:1;max-width:100%;margin:0;flex-wrap:wrap;justify-content:flex-end}
  .top .toplinks{grid-column:1/-1;grid-row:2;order:initial;display:flex;width:100%;max-width:100%;min-width:0;overflow-x:auto;flex-wrap:nowrap;gap:7px;padding:8px 0 2px}
  .top .toplinks a{flex:0 0 auto;white-space:nowrap}
  .wrap{padding-inline:16px}
  .content-grid{grid-template-columns:minmax(0,1fr)}
  .admin-layout{grid-template-columns:minmax(0,1fr)}
  .side-col{min-width:0}
  .home-news-slider .home-news-card{flex-basis:min(88%,510px)}
}
/* Phones */
@media(max-width:700px){
  .wrap{padding:16px 12px 32px}
  .top{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 10px;padding:10px 12px}
  .top .brand{grid-column:1;grid-row:1;max-width:100%;gap:8px}
  .top .brand-mark{flex:0 0 38px;width:38px;height:38px}
  .top .brand b{font-size:14px;line-height:1.2}
  .top .brand small{font-size:9px}
  .top .account{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;margin:0}
  .top .account .btn{padding:8px 9px;font-size:10px}
  .top .user-name{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .top .toplinks{grid-column:1/-1;grid-row:2;order:initial;width:100%;max-width:100%;display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;padding:7px 0 2px;scrollbar-width:thin}
  .top .toplinks a{flex:0 0 auto;padding:8px 10px;font-size:11px;white-space:nowrap}
  .hero{padding:24px 20px;min-height:0;border-radius:16px}
  .hero h1{font-size:clamp(26px,7vw,36px);letter-spacing:-.7px}
  .hero-actions{display:flex;flex-wrap:wrap;gap:8px}
  .hero-actions .btn{max-width:100%;white-space:normal;text-align:center}
  .panel{padding:14px;max-width:100%}
  .page-head{flex-wrap:wrap}
  .page-head h2{font-size:clamp(21px,6vw,26px)}
  .league-filter,.league-filter label,.fixture-filters,.fixture-filters label{min-width:0;width:100%}
  .league-filter select,.fixture-filters input,.fixture-filters select{min-width:0;width:100%;max-width:100%}
  .fixture-filters{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .fixture-filters label:first-of-type{grid-column:auto}
  .fixture-filters .btn{width:100%}
  .match-body{grid-template-columns:minmax(0,1fr) minmax(56px,auto) minmax(0,1fr);gap:5px}
  .match-team{gap:4px}
  .match-team b{font-size:11px;line-height:1.3}
  .match-team .team-logo{flex-shrink:0}
  .match-result strong{font-size:clamp(18px,5vw,23px)}
  .detail-score{grid-template-columns:minmax(0,1fr) minmax(72px,auto) minmax(0,1fr);gap:5px}
  .detail-score>a{min-width:0;overflow-wrap:anywhere}
  .table-wrap table{min-width:520px}
  .home-news-grid{grid-template-columns:minmax(0,1fr)}
  .home-news-slider-wrap{gap:5px}
  .home-news-grid.home-news-slider{min-width:0;flex:1;padding-inline:0;gap:10px}
  .home-news-slider .home-news-card{flex:0 0 96%;max-width:none}
  .home-news-slider .home-news-card img{height:190px}
  .news-slide-btn{width:28px;flex-basis:28px;height:38px;font-size:22px}
  .headline-news{display:flex;flex-wrap:wrap;gap:10px;padding:10px 12px}
  .headline-news a{min-width:0;flex:1 1 140px;font-size:13px}
  .headline-news img{flex:0 0 70px;max-width:70px;height:52px;object-fit:cover}
  .weekly-stars-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .weekly-stars-grid>*,.star-card{min-width:0}
  .star-card b,.star-card span,.star-card small{overflow-wrap:anywhere}
  .admin-nav{display:flex;flex-wrap:nowrap;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
  .admin-nav a{flex-shrink:0}
  .form-grid{grid-template-columns:minmax(0,1fr)}
  .form-grid .wide{grid-column:auto}
  .inline-upload{max-width:100%;flex-wrap:wrap}
  .inline-upload input[type=file]{width:100%;max-width:100%}
  .coach-assign-form{align-items:stretch}
  .coach-assign-form label{width:100%;max-width:100%}
  .lineup-editor-grid,.lineup-grid,.admin-lineup-grid{grid-template-columns:minmax(0,1fr)}
  .lineup-saved-columns{grid-template-columns:repeat(2,minmax(0,1fr))}
  .player-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ys-match-preferences{flex-wrap:wrap}
}
@media(max-width:375px){
  .top .brand b{font-size:12px}
  .top .brand small{font-size:8px}
  .top .account .btn{font-size:9px;padding:7px}
  .panel{padding:11px}
  .match-team b{font-size:10px}
  .team-logo{width:25px;height:25px}
  .match-body{grid-template-columns:minmax(0,1fr) 52px minmax(0,1fr)}
  .home-news-slider .home-news-card{flex-basis:100%}
  .lineup-saved-columns{grid-template-columns:minmax(0,1fr)}
  .weekly-stars-grid{grid-template-columns:minmax(0,1fr)}
  .official-list,.weekly-star-admin-grid{grid-template-columns:minmax(0,1fr)}
}
