/* ==========================================================================
   Football Huddle – Web-App, Bereich SPIELE (#/heute, #/spielplan, #/spiel/<id>)
   Ergänzt huddle.css (Tokens, Karten, Anzeigetafel, Spielzeilen). Präfix gm- = „games“.
   Gelb (--line) nur für Schlüsselmomente, Line to Gain und die Auswahl im Diagramm;
   Rot (--live) nur für „läuft gerade“.
   ========================================================================== */

.view.gm-settled { animation: none; }

/* Kopf ------------------------------------------------------------------- */
.gm-head { margin-bottom: 0; }
.gm-head__title { overflow-wrap: anywhere; }
.gm-game .gm-head__title { font-size: var(--fs-2xl); }
.gm-head__actions { gap: var(--space-2); margin-top: var(--space-1); }

/* Aktualisierungszeile */
.gm-fresh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-xs); color: var(--muted); }
.gm-fresh > span { display: inline-flex; align-items: center; gap: 6px; }
.gm-fresh.is-failed { color: #FFC2BD; }
.gm-fresh .btn { min-height: 32px; }

/* Listen von Spielzeilen */
.gm-list .game-row { padding-block: var(--space-3); }
.gm-list > li { position: relative; }
.gm-list .game-row:hover { background: rgba(255, 255, 255, .03); }
.gm-list .game-row:has(.card__link:focus-visible) { box-shadow: inset 0 0 0 2px var(--sky); border-radius: var(--radius); }
.gm-day { margin: var(--space-2) 0 0; font-size: var(--fs-sm); font-weight: 800; font-stretch: 110%; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }

/* Heute ------------------------------------------------------------------ */
.gm-hero { gap: var(--space-4); }
.gm-hero .scoreboard__name { font-size: var(--fs-lg); }
@media (max-width: 420px) { .gm-hero .scoreboard__name { font-size: clamp(.75rem, 19cqi, var(--fs-md)); } }
.gm-hero__cta { align-self: center; }
.gm-hero .field-strip { max-width: 680px; margin-inline: auto; display: block; }

.gm-picker { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.gm-picker__btn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--radius); border: 1px solid transparent; background: rgba(255, 255, 255, .04); color: var(--mist); font: inherit; font-size: var(--fs-xs); font-weight: 800; font-stretch: 80%; cursor: pointer; transition: background-color .2s, border-color .2s, transform .2s var(--ease); }
.gm-picker__btn:hover { background: rgba(255, 255, 255, .1); border-color: var(--glass-border); transform: translateY(-1px); }
.gm-picker__btn:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus); }

.gm-live-grid { --grid-gap: var(--space-3); }
.gm-live-card { overflow: hidden; }
.gm-live-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--away-1), var(--home-1)); opacity: .9; }
.gm-live-field { padding: 0 var(--space-4) var(--space-4); }
.gm-live-field .field-strip { border-radius: var(--radius-sm); }

.gm-bye-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.gm-byes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gm-byes__item { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-border); color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 650; }
.gm-byes__item:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.gm-byes__item:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus); }

/* Spielplan -------------------------------------------------------------- */
.gm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.gm-switch { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 650; color: var(--mist); cursor: pointer; }
.gm-switch .switch { flex: none; }
.gm-switch--card { display: flex; }
.gm-switch--card > span { display: inline-flex; align-items: center; gap: 6px; }
.gm-phases { align-self: flex-start; }
.gm-weeknav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.gm-weekchips { padding-block: 4px; }
.gm-weekchips .chip { min-width: 44px; justify-content: center; font-family: var(--font-score); font-stretch: 75%; font-weight: 900; font-size: 1rem; }
.gm-chip--now:not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--sky) 60%, transparent); color: var(--mist); }
.gm-weekhead { align-items: flex-end; }
.gm-filters .chip[disabled] { opacity: .45; cursor: not-allowed; }
.gm-chip__n { font-family: var(--font-score); font-stretch: 70%; font-weight: 900; opacity: .7; }

.gm-teambar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.gm-teamselect { flex: 1 1 240px; max-width: 420px; }

.gm-season > li { position: relative; }
.gm-season__phase { padding: var(--space-3) var(--space-4) var(--space-1); background: rgba(0, 0, 0, .14); }
.gm-season__row, .gm-season__bye {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 6.5rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-height: 56px;
}
.gm-season__row:has(.gm-season__ics) { grid-template-columns: 2.6rem minmax(0, 6.5rem) minmax(0, 1fr) auto auto; }
.gm-season__row:hover { background: rgba(255, 255, 255, .03); }
.gm-season__row:has(.card__link:focus-visible) { box-shadow: inset 0 0 0 2px var(--sky); }
.gm-season__bye { grid-template-columns: 2.6rem 1fr; color: var(--muted); font-size: var(--fs-sm); font-style: italic; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, .025) 8px 16px); }
.gm-season__wk { font-family: var(--font-score); font-stretch: 70%; font-weight: 900; font-size: 1.1rem; color: var(--slate); }
.gm-season__when { display: flex; flex-direction: column; font-size: var(--fs-sm); font-weight: 650; line-height: 1.25; }
.gm-season__opp { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-weight: 700; }
.gm-season__ha { width: 1.6em; flex: none; text-align: center; }
.gm-season__intl { padding: 1px 6px; font-size: .65rem; }
.gm-season__res { display: flex; align-items: center; gap: 6px; justify-content: flex-end; position: relative; z-index: 1; }
.gm-season__res .pill { padding: 2px 7px; }
.gm-season__ics { position: relative; z-index: 1; }
@media (max-width: 520px) {
  .gm-season__row, .gm-season__row:has(.gm-season__ics) { grid-template-columns: 2.2rem minmax(0, 1fr) auto; grid-template-areas: "wk opp res" "wk when ics"; row-gap: 2px; }
  .gm-season__wk { grid-area: wk; align-self: start; padding-top: 4px; }
  .gm-season__opp { grid-area: opp; }
  .gm-season__res { grid-area: res; }
  .gm-season__when { grid-area: when; flex-direction: row; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
  .gm-season__ics { grid-area: ics; justify-self: end; }
}

/* Spielzentrale ---------------------------------------------------------- */
.gm-scorecard { padding-bottom: var(--space-4); }
.gm-ls { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid rgba(255, 255, 255, .1); }
.gm-ls .linescore { max-width: 560px; margin-inline: auto; }
.gm-ls td { color: var(--muted); font-family: var(--font-score); font-stretch: 70%; font-weight: 700; font-size: 1.05rem; }
.gm-ls td:last-child { color: #fff; }
.gm-ls__team { display: inline-flex; align-items: center; gap: 8px; font-weight: 850; font-stretch: 80%; }

.gm-event-card { padding-block: var(--space-4); }
.gm-event { display: flex; gap: var(--space-3); align-items: flex-start; }
.gm-event__icon { flex: none; color: var(--line); display: grid; place-items: center; width: 44px; min-height: 44px; }
.gm-event__title { font-size: var(--fs-xl); font-weight: 900; font-stretch: 108%; line-height: 1.15; }

.gm-sections { align-self: flex-start; position: sticky; top: calc(var(--space-2) + env(safe-area-inset-top)); z-index: 5; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); background: color-mix(in srgb, var(--night) 70%, transparent); }
.gm-sections > button { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 899px) { .gm-sections { top: calc(56px + env(safe-area-inset-top)); } }

/* Live-Situation */
.gm-live__status { font-family: var(--font-score); font-stretch: 75%; font-weight: 900; font-size: 1.15rem; margin-right: auto; }
.gm-poss { color: var(--line); display: inline-flex; align-items: center; gap: 6px; }
.gm-dd { font-size: var(--fs-2xl); }
.gm-legend { gap: var(--space-4); }
.gm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gm-legend i { display: inline-block; width: 4px; height: 13px; border-radius: 1px; }
.gm-legend__los { background: var(--scrimmage); }
.gm-legend__ltg { background: var(--line); }
.gm-legend__drive { width: 16px !important; height: 6px !important; border-radius: 3px !important; background: rgba(189, 221, 252, .55); }
.gm-to { display: inline-flex; align-items: center; gap: 4px; }
.gm-to__abbr { font-size: var(--fs-xs); font-weight: 850; font-stretch: 75%; color: var(--muted); margin-right: 2px; }
.gm-to__pip { width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .15); }
.gm-to__pip.is-on { background: var(--mist); }

.gm-prob__bar { height: 12px; gap: 3px; background: none; }
.gm-prob__bar > span { border-radius: 999px; }
.gm-links { margin-inline: calc(var(--card-pad) * -1); }
.gm-links .list__item { padding-inline: var(--card-pad); }
.gm-links .tile__icon { width: 28px; height: 28px; border-radius: 8px; }

/* Siegwahrscheinlichkeit */
.gm-wp { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.gm-wp__plot { position: relative; }
.gm-wp__svg { display: block; width: 100%; height: clamp(160px, 28vw, 230px); touch-action: pan-y; cursor: crosshair; overflow: visible; }
.gm-wp__grid { stroke: rgba(255, 255, 255, .1); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gm-wp__mid { stroke: rgba(255, 255, 255, .35); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.gm-wp__q { stroke: rgba(255, 255, 255, .12); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gm-wp__ql, .gm-wp__yl { position: absolute; font: 850 11px/1 var(--font); font-stretch: 75%; color: var(--muted); pointer-events: none; }
.gm-wp__ql { bottom: 2px; padding-left: 4px; color: var(--slate); }
.gm-wp__yl { left: 0; width: calc(var(--wp-l) - 6px); text-align: right; }
.gm-wp__yl--top { top: var(--wp-t); }
.gm-wp__yl--mid { top: calc((100% - var(--wp-b) + var(--wp-t)) / 2); transform: translateY(-50%); }
.gm-wp__yl--bottom { top: calc(100% - var(--wp-b)); transform: translateY(-100%); }
.gm-wp__line { fill: none; stroke: var(--mist); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gm-wp__marker line { stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.gm-wp__marker circle { fill: var(--line); stroke: var(--night); stroke-width: 2; vector-effect: non-scaling-stroke; }
.gm-wp__slider { display: block; }
.gm-wp__range { width: 100%; accent-color: var(--sky); height: 28px; margin: 0; cursor: pointer; }
.gm-wp__range:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus); border-radius: 6px; }
.gm-wp__readout { margin: 0; color: var(--muted); min-height: 2.6em; }
.gm-wp__sel { color: var(--line); font-variant-numeric: tabular-nums; }

/* Schlüsselmomente & Punkte */
.gm-keys, .gm-scoring, .gm-plays, .gm-cmp, .gm-inj { list-style: none; margin: 0; padding: 0; }
.gm-keys > li + li { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid rgba(255, 255, 255, .07); }
.gm-key { padding-left: var(--space-3); border-left: 4px solid var(--line); border-radius: 2px; }
.gm-key__head { gap: var(--space-2); margin-bottom: var(--space-2); }
.gm-key__swing { color: var(--line); font-size: 1.4rem; }
.gm-key__head .gm-clock { margin-left: auto; }
.gm-clock { font-size: var(--fs-xs); font-weight: 800; font-stretch: 80%; letter-spacing: .06em; color: var(--slate); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gm-scoring__item { display: flex; gap: var(--space-3); align-items: flex-start; padding-block: var(--space-3); }
.gm-scoring__item + .gm-scoring__item { border-top: 1px solid rgba(255, 255, 255, .07); }
.gm-scoring__score { font-size: 1.6rem; color: var(--mist); }
.gm-leaders { margin-inline: calc(var(--card-pad) * -1); }
.gm-leaders .list__item { padding-inline: var(--card-pad); }
.gm-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gm-info { margin: 0; display: grid; gap: var(--space-2); }
.gm-info > div { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.gm-info dt { color: var(--muted); font-size: var(--fs-sm); }
.gm-info dd { margin: 0; font-weight: 650; text-align: right; font-size: var(--fs-sm); }
.gm-inj > li { display: flex; align-items: center; gap: var(--space-3); padding-block: 6px; font-size: var(--fs-sm); }
.gm-pill--warn { background: rgba(255, 159, 10, .16); color: #FFD199; border-color: transparent; }

/* Spielverlauf */
.gm-drive { --card-pad: 0; overflow: hidden; }
.gm-drive.is-current { border-color: color-mix(in srgb, var(--live) 50%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--drive-c) 18%, transparent), transparent 60%), var(--glass-bg); }
.gm-drive__sum {
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
}
.gm-drive__sum::-webkit-details-marker { display: none; }
.gm-drive__sum:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: inset 0 0 0 2px var(--sky); border-radius: var(--radius); }
.gm-drive__text { display: flex; flex-direction: column; min-width: 0; }
.gm-drive__result { font-weight: 850; font-size: var(--fs-md); }
.gm-drive.is-score .gm-drive__result { color: var(--mist); }
.gm-drive__when { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--slate); }
.gm-drive__chev { transition: transform .25s var(--ease); }
.gm-drive[open] .gm-drive__chev { transform: rotate(180deg); }
.gm-drive__body { padding: 0 var(--space-4) var(--space-4); border-top: 1px solid rgba(255, 255, 255, .07); padding-top: var(--space-3); }
.gm-drive__body .field-strip { border-radius: var(--radius-sm); max-width: 640px; }
.gm-drivebar { grid-column: 1 / -1; position: relative; display: block; height: 10px; border-radius: 999px; overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255, 255, 255, .16) calc(10% - 1px) 10%), color-mix(in srgb, var(--turf) 55%, transparent); }
.gm-drivebar__fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--drive-c) 70%, transparent), var(--drive-c)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); min-width: 8px; }
.gm-plays > li + li { border-top: 1px solid rgba(255, 255, 255, .06); }
.gm-plays > li { padding-block: var(--space-3); }

.gm-play { display: flex; flex-direction: column; gap: 4px; }
.gm-play__head { display: flex; align-items: baseline; gap: var(--space-2); }
.gm-play__icon { flex: none; width: 18px; color: var(--slate); align-self: center; display: inline-flex; }
.gm-play.is-flag .gm-play__icon, .gm-play.is-score .gm-play__icon { color: var(--line); }
.gm-play.is-turnover .gm-play__icon { color: var(--loss); }
.gm-play__title { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 800; }
.gm-play.is-score .gm-play__title { color: var(--mist); }
.gm-play__sit, .gm-play__text, .gm-play__score, .gm-play__insights { margin: 0 0 0 26px; }
.gm-play__sit { font-size: var(--fs-xs); font-weight: 850; font-stretch: 80%; color: var(--sky); }
.gm-play__text { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.gm-play__score { margin-top: 2px; }
.gm-play__insights { margin-top: var(--space-2); }

.gm-insight { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--sky) 10%, transparent); border: 1px solid color-mix(in srgb, var(--sky) 20%, transparent); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--sky) 70%, transparent); color: inherit; text-decoration: none; }
a.gm-insight:hover { background: color-mix(in srgb, var(--sky) 16%, transparent); color: inherit; }
a.gm-insight:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus); }
.gm-insight__icon { color: var(--sky); flex: none; padding-top: 1px; }
.gm-insight__title { display: block; font-size: var(--fs-xs); font-weight: 800; color: #fff; }
.gm-insight__body { display: block; font-size: var(--fs-xs); color: var(--muted); }
.gm-insight__chev { color: var(--sky); flex: none; align-self: center; }

.gm-playfilter { margin-bottom: calc(var(--space-2) * -1); }

/* Box Score */
.gm-box-card { --card-pad: var(--space-3); }
@media (min-width: 700px) { .gm-box-card { --card-pad: var(--space-4); } }
.gm-box .table { font-size: var(--fs-sm); }
.gm-box thead th { background: var(--storm); }
.gm-box abbr { text-decoration: none; cursor: help; }
.gm-box .gm-box__name { position: sticky; left: 0; z-index: 2; background: color-mix(in srgb, var(--storm) 92%, transparent); text-align: left; min-width: 9.5rem; max-width: 12rem; }
.gm-box thead .gm-box__name { z-index: 3; }
.gm-box tbody th { font-weight: 650; }
.gm-box tbody th a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; max-width: 100%; }
.gm-box tbody th a span:last-child { overflow: hidden; text-overflow: ellipsis; }
.gm-box tbody th a:hover span:last-child { text-decoration: underline; }
.gm-box td { color: var(--mist); }
.gm-box__total th, .gm-box__total td { font-weight: 850; color: #fff; border-top: 1px solid rgba(255, 255, 255, .14); }

/* Teamvergleich */
.gm-cmp__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); font-stretch: 85%; }
.gm-cmp__row { padding-block: var(--space-2); }
.gm-cmp__row + .gm-cmp__row { border-top: 1px solid rgba(255, 255, 255, .05); }
.gm-cmp__vals { display: grid; grid-template-columns: minmax(3.5rem, auto) minmax(0, 1fr) minmax(3.5rem, auto); gap: var(--space-2); align-items: center; }
.gm-cmp__vals .score { font-size: 1.35rem; }
.gm-cmp__vals .score:last-child { text-align: right; }
.gm-cmp__label { text-align: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.gm-cmp__bar { display: flex; gap: 3px; height: 7px; margin-top: 6px; }
.gm-cmp__bar > span { display: block; flex-basis: 0; min-width: 2px; border-radius: 999px; opacity: .9; }

/* Bewegung */
@media (prefers-reduced-motion: reduce) {
  .gm-drive__chev, .gm-picker__btn { transition: none; }
  .gm-picker__btn:hover { transform: none; }
}
@media (max-width: 380px) {
  .gm-sections > button { padding-inline: 10px; font-size: var(--fs-xs); }
  .gm-sections > button .icon { display: none; }
}
@media print {
  .gm-sections, .gm-fresh, .gm-head__actions, .gm-wp__slider { display: none !important; }
}

/* Team-Auswahl im Box Score */
.gm-boxteams { align-self: flex-start; }
.gm-boxteams > button { display: inline-flex; align-items: center; gap: 6px; }
.gm-boxteams .team-badge { width: 20px; height: 20px; }

/* Schmale Bildschirme */
.gm-teamhead { flex-wrap: wrap; }
.gm-teamhead > .grow { flex: 1 1 180px; }
@media (max-width: 480px) {
  .gm-sections { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--radius); align-self: stretch; }
  .gm-sections > button { justify-content: center; }
  .gm-phases > button { padding-inline: 10px; font-size: var(--fs-xs); }
  .gm-wp__yl { font-size: 10px; }
}
