/* SG Westpfalz – Spielberichte & Twitch-Live
   Farben an die bestehende Seite angelehnt (Grün #0f7c43). */

:root {
  --sgw-green: #0f7c43;
  --sgw-green-dark: #0b5a31;
  --sgw-green-soft: rgba(15, 124, 67, 0.09);
  --sgw-ink: #1d2b24;
  --sgw-muted: #66736d;
  --sgw-line: #e3eae6;
  --sgw-red: #b23a3a;
  --sgw-radius: 14px;
}

/* ---------- Layout ---------- */
.sgw-wrap { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem 3rem; color: var(--sgw-ink); }
.sgw-head { margin-bottom: 1.5rem; }
.sgw-head h1, .sgw-bericht h1 { margin: 0.2rem 0 0.6rem; line-height: 1.15; }
.sgw-kicker { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sgw-green); }
.sgw-kicker a { color: inherit; text-decoration: none; }
.sgw-kicker a:hover { text-decoration: underline; }
.sgw-intro { color: var(--sgw-muted); max-width: 70ch; }

/* ---------- Filter ---------- */
.sgw-filter { display: grid; gap: 0.9rem; margin: 1.25rem 0 1.75rem; padding: 1.1rem 1.2rem; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: linear-gradient(135deg, var(--sgw-green-soft), #fff 70%); }
.sgw-filter__group { display: grid; grid-template-columns: 7.5rem 1fr; align-items: start; gap: 0.6rem; }
.sgw-filter__label { padding-top: 0.45rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sgw-muted); }
.sgw-chips, .sgw-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.sgw-chip { display: inline-block; padding: 0.4rem 0.8rem; border: 1px solid rgba(15, 124, 67, 0.3); border-radius: 999px; background: #fff; color: var(--sgw-green-dark); font-size: 0.9rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.sgw-chip:hover { border-color: var(--sgw-green); text-decoration: none; }
.sgw-chip.is-active { background: var(--sgw-green); border-color: var(--sgw-green); color: #fff; }
.sgw-chip--verein { border-style: dashed; }
.sgw-count { margin: 0; font-size: 0.85rem; color: var(--sgw-muted); }

/* ---------- Karten ---------- */
.sgw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.sgw-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.05); transition: transform .15s, box-shadow .15s; }
.sgw-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09); }
.sgw-card.is-hidden { display: none; }
.sgw-card__media { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--sgw-green-dark); overflow: hidden; }
.sgw-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sgw-card__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.92); font-size: 1.4rem; font-weight: 800; letter-spacing: 0.04em; background: radial-gradient(circle at 75% 20%, rgba(255,255,255,.18) 0 18%, transparent 19%), linear-gradient(135deg, var(--sgw-green), var(--sgw-green-dark)); }
.sgw-card__result { position: absolute; right: 0.7rem; bottom: 0.7rem; padding: 0.3rem 0.65rem; border-radius: 8px; background: rgba(0, 0, 0, 0.72); color: #fff; font-weight: 800; font-size: 1.05rem; }
.sgw-card__result.is-win { background: var(--sgw-green); }
.sgw-card__result.is-loss { background: var(--sgw-red); }
.sgw-card__body { display: flex; flex-direction: column; gap: 0.45rem; padding: 1rem 1.1rem 1.15rem; flex: 1; }
.sgw-card__meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin: 0; font-size: 0.8rem; color: var(--sgw-muted); }
.sgw-card__title { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.sgw-card__title a { color: var(--sgw-ink); text-decoration: none; }
.sgw-card__title a:hover { color: var(--sgw-green); }
.sgw-card__match { margin: 0; font-weight: 600; font-size: 0.92rem; color: var(--sgw-green-dark); }
.sgw-card__summary { margin: 0; font-size: 0.92rem; color: #45524c; flex: 1; }
.sgw-tag { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 999px; background: var(--sgw-green-soft); color: var(--sgw-green-dark); font-size: 0.78rem; font-weight: 700; text-decoration: none; }
a.sgw-tag:hover { background: var(--sgw-green); color: #fff; text-decoration: none; }
.sgw-tag--verein { background: #f1f1ec; color: #555; }
.sgw-empty { padding: 2rem; text-align: center; color: var(--sgw-muted); border: 1px dashed var(--sgw-line); border-radius: var(--sgw-radius); }

/* ---------- Einzelbericht ---------- */
.sgw-bericht { max-width: 860px; }
.sgw-bericht__meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0 0 0.7rem; color: var(--sgw-muted); font-size: 0.92rem; }
.sgw-scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin: 1.4rem 0; padding: 1.2rem 1.4rem; border-radius: var(--sgw-radius); background: linear-gradient(135deg, var(--sgw-ink), #2c4a3a); color: #fff; }
.sgw-scoreboard.is-win { background: linear-gradient(135deg, var(--sgw-green-dark), var(--sgw-green)); }
.sgw-scoreboard.is-loss { background: linear-gradient(135deg, #4a2323, var(--sgw-red)); }
.sgw-scoreboard__team { font-weight: 700; font-size: 1.05rem; }
.sgw-scoreboard__team:last-child { text-align: right; }
.sgw-scoreboard__score { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sgw-scoreboard__score strong { font-size: 2.3rem; line-height: 1; letter-spacing: 0.04em; }
.sgw-scoreboard__score small { margin-top: 0.35rem; opacity: 0.85; font-size: 0.8rem; }
.sgw-scoreboard__badge { margin-top: 0.5rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 0.75rem; font-weight: 600; }
.sgw-bericht__hero { margin: 0 0 1.5rem; }
.sgw-bericht__hero img { width: 100%; height: auto; border-radius: var(--sgw-radius); display: block; }
.sgw-bericht__content { font-size: 1.04rem; line-height: 1.7; }
.sgw-bericht__content img { max-width: 100%; height: auto; border-radius: 10px; margin: 0.6rem 0; }
.sgw-bericht__h2 { margin-top: 2.2rem; font-size: 1.25rem; }
.sgw-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; }
.sgw-gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; display: block; }
.sgw-related ul { list-style: none; margin: 0; padding: 0; }
.sgw-related li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--sgw-line); }
.sgw-related li span { color: var(--sgw-muted); font-size: 0.85rem; white-space: nowrap; }
.sgw-back { margin-top: 2rem; }

/* ---------- Twitch-Live (Startseite) ---------- */
.sgw-twitch { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s ease, opacity .4s ease, margin .4s ease; margin: 0; }
.sgw-twitch.is-live { max-height: 1400px; opacity: 1; margin: 0 0 2rem; }
.sgw-twitch__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; font-weight: 700; }
.sgw-twitch__head a { color: var(--sgw-green); }
.sgw-live-dot { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: 6px; background: #e91916; color: #fff; font-size: 0.8rem; letter-spacing: 0.06em; }
.sgw-live-dot::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #fff; animation: sgw-pulse 1.4s infinite; }
@keyframes sgw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.sgw-twitch__player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--sgw-radius); overflow: hidden; background: #000; }
.sgw-twitch__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 640px) {
  .sgw-filter__group { grid-template-columns: 1fr; gap: 0.35rem; }
  .sgw-filter__label { padding-top: 0; }
  .sgw-scoreboard { grid-template-columns: 1fr; text-align: center; }
  .sgw-scoreboard__team:last-child { text-align: center; }
}

/* ---------- Mannschaftsseiten: nächste Spiele & Tabelle ---------- */
.sgw-teamdata { margin: 1.5rem 0 2rem; color: var(--sgw-ink); }
.sgw-teamdata.is-loading { color: var(--sgw-muted); font-style: italic; }
.sgw-td__block { margin-bottom: 2rem; }
.sgw-td__title { margin: 0 0 0.8rem; font-size: 1.3rem; }
.sgw-td__league { margin: -0.5rem 0 0.8rem; color: var(--sgw-muted); font-size: 0.9rem; }
.sgw-td__games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.sgw-td__game { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem 1.1rem; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.05); }
.sgw-td__when { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--sgw-line); }
.sgw-td__when strong { font-size: 1rem; }
.sgw-td__when span { color: var(--sgw-muted); font-size: 0.9rem; white-space: nowrap; }
.sgw-td__what { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.sgw-td__badge { padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sgw-td__badge.is-home { background: var(--sgw-green); color: #fff; }
.sgw-td__badge.is-away { background: #eef1ef; color: #4b5852; }
.sgw-td__opp { font-size: 1.02rem; line-height: 1.3; }
.sgw-td__place { color: var(--sgw-muted); font-size: 0.85rem; }
.sgw-td__empty { color: var(--sgw-muted); }
.sgw-td__tablewrap { overflow-x: auto; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; }
.sgw-td__table { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.92rem; }
.sgw-td__table th, .sgw-td__table td { padding: 0.6rem 0.7rem; text-align: center; border-bottom: 1px solid var(--sgw-line); white-space: nowrap; }
.sgw-td__table th { background: #f6faf8; color: var(--sgw-muted); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
.sgw-td__table .is-name { text-align: left; white-space: normal; min-width: 10rem; }
.sgw-td__table .is-points { font-weight: 800; }
.sgw-td__table tbody tr:last-child td { border-bottom: 0; }
.sgw-td__table tr.is-own td { background: var(--sgw-green-soft); font-weight: 700; }
.sgw-td__table tr.is-own td:first-child { box-shadow: inset 4px 0 0 var(--sgw-green); }
.sgw-td__meta { margin: -1rem 0 0; color: var(--sgw-muted); font-size: 0.78rem; }
@media (max-width: 640px) {
  .sgw-td__table .is-optional { display: none; }
  .sgw-td__table th, .sgw-td__table td { padding: 0.5rem 0.45rem; }
}
/* Schmale Spalten (z. B. halbbreiter Gantry-Baustein): nach Containerbreite statt Bildschirmbreite */
.sgw-teamdata { container-type: inline-size; }
@container (max-width: 560px) {
  .sgw-td__table .is-optional { display: none; }
  .sgw-td__table th, .sgw-td__table td { padding: 0.5rem 0.4rem; }
  .sgw-td__table .is-name { min-width: 8rem; }
  .sgw-td__games { grid-template-columns: 1fr; }
}

/* ---------- Startseite: kommende Spiele aller Mannschaften ---------- */
.sgw-club { margin: 0.5rem 0 2rem; color: var(--sgw-ink); }
.sgw-club__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.9rem; }
.sgw-club__tabs { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.3rem; border-radius: 12px; background: #eef3f0; }
.sgw-club__tab { display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; padding: 0.45rem 0.9rem; border: 0; border-radius: 9px; background: transparent; color: var(--sgw-green-dark); font: inherit; cursor: pointer; transition: background .15s, color .15s; }
.sgw-club__tab small { font-size: 0.7rem; opacity: 0.75; }
.sgw-club__tablabel { font-weight: 700; font-size: 0.92rem; }
.sgw-club__tab:hover { background: rgba(255, 255, 255, 0.7); }
.sgw-club__tab.is-active { background: var(--sgw-green); color: #fff; box-shadow: 0 4px 12px rgba(15, 124, 67, 0.25); }
.sgw-club__nav { display: flex; gap: 0.4rem; }
.sgw-club__arrow { width: 2.3rem; height: 2.3rem; border: 1px solid var(--sgw-line); border-radius: 50%; background: #fff; color: var(--sgw-green-dark); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sgw-club__arrow:disabled { opacity: 0.35; cursor: default; }
.sgw-club__note { margin: 0 0 0.7rem; color: var(--sgw-muted); font-size: 0.88rem; }
.sgw-club__strip { display: flex; gap: 0.9rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 0.2rem 2px 0.9rem; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.sgw-club__strip:focus { outline: none; }
.sgw-club__card { flex: 0 0 260px; scroll-snap-align: start; display: flex; overflow: hidden; border: 1px solid var(--sgw-line); border-radius: var(--sgw-radius); background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05); }
.sgw-club__date { flex: 0 0 4.6rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; padding: 0.8rem 0.4rem; background: var(--sgw-green); color: #fff; text-align: center; }
.sgw-club__card.is-away .sgw-club__date { background: #3d4a44; }
.sgw-club__wd { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.sgw-club__dm { font-size: 1.15rem; line-height: 1.1; }
.sgw-club__time { font-size: 0.75rem; opacity: 0.9; }
.sgw-club__body { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 0.85rem; min-width: 0; }
.sgw-club__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }
.sgw-club__team { font-size: 1.15rem; font-weight: 800; line-height: 1.2; color: var(--sgw-green-dark); }
.sgw-club__ha { padding: 0.08rem 0.45rem; border-radius: 999px; background: var(--sgw-green-soft); color: var(--sgw-green-dark); font-size: 0.68rem; font-weight: 700; }
.sgw-club__card.is-away .sgw-club__ha { background: #eef1ef; color: #4b5852; }
.sgw-club__opp { font-size: 0.85rem; font-weight: 500; line-height: 1.3; color: #45524c; }
.sgw-club__place, .sgw-club__league { color: var(--sgw-muted); font-size: 0.78rem; line-height: 1.3; }
.sgw-club__empty { margin: 0; padding: 1.5rem; color: var(--sgw-muted); }
.sgw-club__meta { margin: 0; color: var(--sgw-muted); font-size: 0.75rem; }
@media (max-width: 640px) {
  .sgw-club__nav { display: none; }
  .sgw-club__card { flex-basis: 82%; }
}

/* Hallen als Google-Maps-Link */
a.sgw-club__place, a.sgw-td__place { color: var(--sgw-muted); text-decoration: none; }
a.sgw-club__place::before, a.sgw-td__place::before { content: "📍 "; }
a.sgw-club__place:hover, a.sgw-td__place:hover { color: var(--sgw-green); text-decoration: underline; }
