/* Basketballboard.at — zentrales Stylesheet */

:root{
  --bb-blue:#06183A;
  --bb-blue-2:#0a2557;
  --bb-red:#e11d2e;
  --bg:#f3f6fb;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#64748b;
  --line:#e6edf7;
  --shadow: 0 10px 30px rgba(6,24,58,.10);
  --radius: 16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  max-width:100%;
  overflow-x:hidden;
}
a{color:inherit; text-decoration:none}
img{max-width:100%}
h1,h2,h3{line-height:1.2; margin:0 0 8px}
.wrap{max-width:1180px; margin:0 auto; padding:0 18px}

/* ---------- TOPBAR ---------- */
.topbar{
  position:sticky; top:0; z-index:100;
  background:linear-gradient(180deg,var(--bb-blue),#05142f);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.topbar-inner{max-width:1180px; margin:0 auto; padding:12px 18px; display:flex; align-items:center; gap:18px}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px; font-size:17px; white-space:nowrap}
.brand-dot{width:9px;height:9px;border-radius:99px;background:var(--bb-red); box-shadow:0 0 0 3px rgba(225,29,46,.18)}

.mainnav{display:flex; gap:2px; flex:1; flex-wrap:wrap}
.mainnav a{
  padding:10px 12px; border-radius:10px; font-size:13.5px; font-weight:700;
  color:rgba(255,255,255,.82); white-space:nowrap;
}
.mainnav a:hover, .mainnav a.active{color:#fff; background:rgba(255,255,255,.08)}
.mainnav a.live{color:#fff; background:var(--bb-red); box-shadow:0 0 0 2px rgba(225,29,46,.25)}
.mainnav a.live:hover{filter:brightness(1.08)}

.navtoggle{display:none; background:none; border:1px solid rgba(255,255,255,.2); color:#fff; border-radius:10px; padding:8px 10px; font-size:18px; cursor:pointer}

@media (max-width: 980px){
  .mainnav{
    display:none; position:fixed; top:56px; left:0; right:0; bottom:0;
    background:linear-gradient(180deg,var(--bb-blue),#05142f);
    flex-direction:column; padding:10px 14px; overflow-y:auto; z-index:99;
  }
  .mainnav.open{display:flex}
  .mainnav a{padding:14px 12px; font-size:15px; border-bottom:1px solid rgba(255,255,255,.06)}
  .navtoggle{display:inline-flex; align-items:center; justify-content:center; margin-left:auto}
}

/* ---------- HERO / SECTIONS ---------- */
.section{padding:28px 0}
.section-head{display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap}
.section-head h2{font-size:20px}
.section-head .more{font-size:13px; font-weight:800; color:var(--bb-blue-2)}
.eyebrow{font-size:12px; font-weight:800; letter-spacing:.6px; text-transform:uppercase; color:var(--bb-red); margin-bottom:6px}

.hero{
  background:linear-gradient(160deg,var(--bb-blue) 0%,#0d2a63 55%,var(--bb-blue-2) 100%);
  color:#fff; padding:44px 0 34px;
}
.hero h1{font-size:clamp(26px,4vw,40px); font-weight:900; margin-bottom:10px}
.hero p{color:rgba(255,255,255,.82); font-size:15.5px; max-width:640px}
.hero-links{display:flex; flex-wrap:wrap; gap:10px; margin-top:18px}
.chip{
  display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px;
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16); font-size:13px; font-weight:700; color:#fff;
}
.chip:hover{background:rgba(255,255,255,.16)}

/* ---------- CARDS ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow)}
.pad{padding:18px}

/* ---------- LEAGUE GRID (Startseite) ---------- */
.league-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:14px}
@media (max-width:860px){.league-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){.league-grid{grid-template-columns:1fr}}
.league-card{
  display:block; padding:18px; border-radius:14px; background:#fff; border:1px solid var(--line); box-shadow:var(--shadow);
  transition:transform .15s ease;
}
.league-card:hover{transform:translateY(-2px)}
.league-card .tag{display:inline-block; font-size:11px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; color:#fff; background:var(--bb-blue-2); padding:3px 9px; border-radius:999px; margin-bottom:10px}
.league-card .tag.soon{background:#94a3b8}
.league-card h3{font-size:16.5px}
.league-card p{color:var(--muted); font-size:13px; margin:6px 0 0}

/* ---------- TABS ---------- */
.tabs{display:flex; gap:8px; border-bottom:1px solid var(--line); margin-bottom:0}
.tab-btn{
  padding:12px 16px; font-weight:800; font-size:13.5px; color:var(--muted); cursor:pointer;
  border-bottom:3px solid transparent; background:none; border-top:none; border-left:none; border-right:none;
}
.tab-btn.active{color:var(--bb-blue); border-bottom-color:var(--bb-red)}
.tab-panel{display:none}
.tab-panel.active{display:block}

/* ---------- COMPETITION PILLS ---------- */
.pills{display:flex; flex-wrap:wrap; gap:8px; padding:16px 18px 0}
.pill{padding:7px 13px; border-radius:999px; border:1px solid var(--line); font-size:12.5px; font-weight:700; color:var(--muted); background:#f8fafc}
.pill.active{background:var(--bb-blue); color:#fff; border-color:var(--bb-blue)}

/* ---------- STANDINGS TABLE ---------- */
table{width:100%; border-collapse:separate; border-spacing:0}
.standings thead th{
  background:linear-gradient(180deg,var(--bb-blue),#05142f); color:#fff; font-size:11px;
  text-transform:uppercase; letter-spacing:.5px; padding:11px 10px; text-align:center;
}
.standings thead th:nth-child(2){text-align:left}
.standings tbody td{padding:11px 10px; border-bottom:1px solid var(--line); font-size:13.5px; text-align:center}
.standings tbody td:nth-child(2){text-align:left; font-weight:800}
.standings tbody tr:hover{background:#f8fbff}
.standings .rank{font-weight:900; color:var(--muted)}
.standings .teamcell{display:flex; align-items:center; gap:9px}
.standings .teamcell img{width:26px; height:26px; object-fit:contain}
.standings .diff-pos{color:#0a8a4a; font-weight:800}
.standings .diff-neg{color:#c81e3a; font-weight:800}

/* Mobile: FESTE Spaltenbreiten (Summe = 100%) statt die Tabelle breiter als den
   Viewport zu machen. Eine frühere Version nutzte min-width:520px + horizontales
   Scrollen — auf iOS Safari kann eine breitere Mindestbreite den umgebenden
   overflow-x:auto-Container durchbrechen und die GANZE Seite horizontal wischbar
   machen (nicht nur die Tabelle). table-layout:fixed mit Prozent-Breiten kann die
   100% niemals überschreiten, dadurch bleibt die Seite garantiert fix, der
   Teamname bricht sauber um und Diff/Punkte werden nie abgeschnitten. */
@media (max-width:700px){
  .standings{table-layout:fixed}
  .standings th, .standings td{padding-left:4px; padding-right:4px; font-size:11.5px}
  .standings th:nth-child(1), .standings td:nth-child(1){width:8%}
  .standings th:nth-child(2), .standings td:nth-child(2){width:36%; white-space:normal}
  .standings th:nth-child(3), .standings td:nth-child(3){width:11%}
  .standings th:nth-child(4), .standings td:nth-child(4){width:11%}
  .standings th:nth-child(5), .standings td:nth-child(5){width:11%}
  .standings th:nth-child(6), .standings td:nth-child(6){width:12%}
  .standings th:nth-child(7), .standings td:nth-child(7){width:11%}
  .standings .teamcell{gap:5px}
  .standings .teamcell img{width:18px; height:18px; flex:0 0 auto}
}

/* ---------- SCHEDULE TABLE (Spielplan) ---------- */
.tablecard{overflow:hidden}
@media (max-width:860px){ .tablecard{overflow-x:auto; -webkit-overflow-scrolling:touch} }
.sched thead th{background:linear-gradient(180deg,var(--bb-blue),#05142f); color:#fff; font-size:11px; text-transform:uppercase; letter-spacing:.5px; padding:11px 10px; text-align:left}
.sched thead th:last-child{text-align:right}
.sched tbody td{padding:12px 10px; border-bottom:1px solid var(--line); font-size:13.5px; vertical-align:middle}
.sched tbody tr:nth-child(even){background:#f3f5f9}
.sched tbody tr:hover{background:#f8fbff}
.badge{display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px; font-size:11.5px; font-weight:800; border:1px solid var(--line); background:#f8fafc}
.badge.live{background:var(--bb-red); color:#fff; border-color:var(--bb-red); animation:pulse 1.6s infinite}
@keyframes pulse{0%{opacity:1}50%{opacity:.55}100%{opacity:1}}
.match{display:flex; align-items:center; gap:10px; min-width:260px}
.team{display:flex; align-items:center; gap:8px; min-width:0}
.team img{width:28px; height:28px; object-fit:contain; flex:0 0 auto}
.team a:hover{text-decoration:underline}
.tname{max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700}
.vs{color:var(--muted); font-weight:800; font-size:12px}
.score{font-weight:900; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums}
.score .s-sep{margin:0 3px; font-weight:700; color:var(--muted)}
.status-label{color:var(--muted); font-size:11.5px; font-weight:800; text-transform:uppercase}

@media (max-width:860px){
  thead{display:none}
  .sched, .sched tbody{display:block}
  .sched tbody tr{display:grid; grid-template-columns:1fr 90px; gap:6px 10px; padding:12px; border-bottom:1px solid var(--line)}
  .sched tbody td{padding:0; border-bottom:none; min-width:0}
  /* Team A und Team B nicht mehr nebeneinander in einer Zeile (führte zu
     abgeschnittenen Namen wie "Kapfe..." vs "Oberwa..."), sondern jeweils auf
     eigener Zeile mit vollem Namen. Ergebnis steht daneben, vertikal zentriert
     zum Team-Stapel. */
  .match{min-width:0; display:flex; flex-direction:column; align-items:stretch; gap:6px}
  .match .vs{display:none}
  .tname{max-width:none; overflow:visible; text-overflow:clip; white-space:normal}
  /* Ergebnis nicht mehr als eine Zeile "94 : 80", sondern Heim-/Auswärtswert
     je auf eigener Zeile, ausgerichtet zur jeweiligen Team-Zeile links daneben. */
  .score{align-self:stretch; display:flex; flex-direction:column; align-items:center; justify-content:space-between; text-align:center; font-size:16px; padding:1px 0}
  .score .s-sep{display:none}
  .score .s-home, .score .s-away{line-height:1.3}
}

/* ---------- TEAM GRID ---------- */
.team-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px}
@media (max-width:900px){.team-grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:640px){.team-grid{grid-template-columns:repeat(2,1fr)}}
.team-card{display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:20px 14px; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow)}
.team-card img{width:64px; height:64px; object-fit:contain}
.team-card .name{font-weight:800; font-size:13.5px}
.team-card .city{color:var(--muted); font-size:11.5px}

/* ---------- PLAYER GRID ---------- */
.player-grid{display:grid; grid-template-columns:repeat(5,1fr); gap:12px}
@media (max-width:900px){.player-grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:560px){.player-grid{grid-template-columns:repeat(2,1fr)}}
.player-card{background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:var(--shadow); display:flex; flex-direction:column}
.player-card .photo{aspect-ratio:3/4; background:#eef2f9 linear-gradient(160deg,#eef2f9,#e2e8f5); display:flex; align-items:center; justify-content:center; overflow:hidden}
.player-card .photo img{width:100%; height:100%; object-fit:cover}
/* Team-Logo-Fallback (kein Spielerfoto vorhanden): nicht zuschneiden wie ein Foto,
   sondern klein und vollständig sichtbar zentrieren. */
.player-card .photo img[style*="grayscale"]{width:56% !important; height:56% !important; object-fit:contain !important; margin:auto !important}
.player-card .info{padding:10px 12px}
.player-card .pname{font-weight:800; font-size:13px; line-height:1.25}
.player-card .pmeta{color:var(--muted); font-size:11px; margin-top:3px}
.player-card .num{position:absolute; margin:8px; font-weight:900; font-size:13px; color:#fff; background:rgba(6,24,58,.75); padding:2px 8px; border-radius:8px}

/* ---------- PLAYER DETAIL ---------- */
.player-hero{display:grid; grid-template-columns:220px 1fr; gap:24px}
@media (max-width:700px){.player-hero{grid-template-columns:1fr}}
.player-hero .photo{width:100%; aspect-ratio:3/4; background:#eef2f9; border-radius:16px; overflow:hidden; box-shadow:var(--shadow); display:flex; align-items:center; justify-content:center}
.player-hero .photo img{width:100%; height:100%; object-fit:cover}
.player-hero .photo img[style*="grayscale"]{width:55% !important; height:55% !important; object-fit:contain !important; margin:auto !important}
.stat-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:10px; margin-top:16px}
.stat-box{background:#f8fafc; border:1px solid var(--line); border-radius:12px; padding:12px}
.stat-box .label{font-size:11px; color:var(--muted); text-transform:uppercase; font-weight:800; letter-spacing:.4px}
.stat-box .value{font-size:17px; font-weight:900; margin-top:3px}

@media (max-width:640px){
  /* Team-Kopfzeile: die 4 Stat-Boxen (Spiele/Siege/Niederlagen/Korbdifferenz) hatten inline
     grid-template-columns:repeat(4,auto) -> auf schmalen Screens breiter als der Viewport,
     wodurch "Korbdifferenz" rechts abgeschnitten wurde. Auf Mobile 2 Spalten erzwingen. */
  .stat-grid{grid-template-columns:repeat(2,1fr) !important; width:100%}
}

/* ---------- LIVE PAGE ---------- */
.live-item{display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; border-bottom:1px solid var(--line)}
.live-item:last-child{border-bottom:none}
.live-league{font-size:11.5px; color:var(--muted); font-weight:800; text-transform:uppercase; margin-bottom:10px; padding:12px 16px 0}

/* ---------- BUTTONS ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; height:42px; padding:0 16px; border-radius:12px; font-size:13px; font-weight:800; letter-spacing:.3px; border:1px solid rgba(6,24,58,.12); box-shadow:0 6px 16px rgba(6,24,58,.10); cursor:pointer}
.btn-primary{background:linear-gradient(180deg,var(--bb-blue-2),var(--bb-blue)); color:#fff; border-color:rgba(255,255,255,.12)}
.btn-outline{background:#fff; color:var(--bb-blue); border-color:var(--line)}
.btn:hover{filter:brightness(1.05)}

/* ---------- FOOTER ---------- */
.site-footer{margin-top:50px; background:var(--bb-blue); color:rgba(255,255,255,.75); padding:36px 0 22px}
.site-footer .cols{display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:24px}
@media (max-width:760px){.site-footer .cols{grid-template-columns:1fr 1fr}}
.site-footer h4{color:#fff; font-size:13px; text-transform:uppercase; letter-spacing:.5px; margin-bottom:12px}
.site-footer a{display:block; padding:4px 0; font-size:13.5px; color:rgba(255,255,255,.72)}
.site-footer a:hover{color:#fff}
.site-footer .bottom{margin-top:26px; padding-top:18px; border-top:1px solid rgba(255,255,255,.12); font-size:12px; color:rgba(255,255,255,.55); display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px}

/* ---------- MISC ---------- */
.empty-state{padding:34px 18px; text-align:center; color:var(--muted)}
.empty-state .ico{font-size:34px; margin-bottom:10px}
.breadcrumbs{font-size:12.5px; color:var(--muted); margin-bottom:14px}
.breadcrumbs a:hover{text-decoration:underline}
.season-select{height:38px; border-radius:10px; border:1px solid var(--line); padding:0 10px; font-size:13px; background:#fff}
.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0)}

/* --- update28: brand-logo size fix --- */
.brand-logo{height:50px; width:auto; max-width:none; display:block}
@media (max-width:640px){ .brand-logo{height:41px} }

/* --- update29: live-meta layout --- */
.live-meta{display:flex; align-items:center; gap:10px; flex:0 0 auto}
.live-teams{font-weight:700}
