:root {
  --club-green: #1f4d38;
  --club-green-mid: #163d2d;
  --club-green-deep: #0f3326;
  --club-green-dark: #0a1e15;
  --club-gold: #cfb178;
  --club-gold-bright: #e3d2a6;
  --club-gold-dim: rgba(207, 177, 120, 0.45);
  --club-gold-line: rgba(207, 177, 120, 0.28);
  --ink: #eeebe3;
  --ink-soft: #c7c2b4;
  --muted: #a7a396;
  --bg: #0a1e15;
  --bg-elev: rgba(13, 42, 31, 0.78);
  --bg-elev-solid: #0d2a1f;
  --line: rgba(238, 235, 227, 0.09);
  --line-strong: rgba(207, 177, 120, 0.24);
  --red: #ff6b5b;
  --yellow: #f0c14d;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --nav-h: 58px;
  --tabbar-h: 60px;
  --tap-min: 44px;
  --safe-top: max(12px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  --safe-left: max(16px, env(safe-area-inset-left, 0px));
  --safe-right: max(16px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #0d2a1f 0%, #0a1e15 40%, #060f0b 100%);
}
body::after {
  display: none;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--safe-right) max(36px, var(--safe-bottom)) var(--safe-left);
}
@media (max-width: 900px) {
  .shell { padding-bottom: calc(96px + var(--safe-bottom)); }
}

/* ——— Header ——— */
.ios-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(var(--nav-h) + var(--safe-top));
  padding: var(--safe-top) var(--safe-right) 12px var(--safe-left);
  background: rgba(10, 30, 21, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.brand:hover { opacity: 0.92; transform: translateY(-1px); }
.brand img {
  width: 36px;
  height: 46px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-text { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 2.6vw, 1.3rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(46vw, 280px);
}
.brand-text span {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--club-gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
}
@media (max-width: 380px) {
  .brand-text span { display: none; }
  .brand-text strong { max-width: 42vw; }
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(238, 235, 227, 0.025);
  color: var(--club-gold);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s, transform 0.15s;
}
.icon-btn:hover { background: rgba(212, 180, 90, 0.1); border-color: var(--club-gold-line); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn:focus-visible { outline: 2px solid var(--club-gold); outline-offset: 2px; }
.icon-btn svg { width: 18px; height: 18px; }

.tabs-desk {
  display: none;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
@media (min-width: 901px) { .tabs-desk { display: flex; align-items: center; } }
.tabs-desk .tab-trigger {
  position: relative;
  min-height: 36px;
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: 700 12px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tabs-desk .tab-trigger:hover { color: var(--ink-soft); }
.tabs-desk .tab-trigger.active {
  color: var(--club-gold-bright);
  background: rgba(207, 177, 120, 0.1);
  box-shadow: inset 0 0 0 1px rgba(207, 177, 120, 0.2);
}

.ios-tabbar {
  display: none;
  position: fixed;
  left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 300;
  padding: 8px;
  background: rgba(5, 22, 14, 0.92);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
@media (max-width: 900px) {
  .ios-tabbar { display: flex; justify-content: space-around; gap: 4px; }
}
.ios-tabbar .tab-trigger {
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-height: var(--tabbar-h);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 16px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.ios-tabbar .tab-trigger.active {
  color: var(--club-gold);
  background: rgba(18, 138, 74, 0.22);
}
.ios-tabbar .tab-trigger:active { transform: scale(0.96); }
.tb-icon { width: 22px; height: 22px; opacity: 0.65; }
.ios-tabbar .tab-trigger.active .tb-icon { opacity: 1; color: var(--club-gold); }

.page { display: none; }
.page.active {
  display: block;
  animation: pageIn 0.5s var(--ease);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ——— Czysty hero wyniku — bez zdjęć i ozdobnych ramek wokół herbów ——— */
.match-hero {
  position: relative;
  margin: 0 0 28px;
  min-height: clamp(300px, 38vw, 410px);
  overflow: hidden;
  isolation: isolate;
  animation: heroIn 0.7s var(--ease);
  background: #0d2a1f;
  border-bottom: 1px solid var(--line);
}
@keyframes heroIn {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}
.match-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px var(--safe-right);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: inherit;
}

.match-hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  min-width: 0;
  animation: rise 0.65s var(--ease) 0.1s both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.match-hero-brand img {
  width: clamp(52px, 12vw, 72px);
  height: clamp(52px, 12vw, 72px);
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid var(--club-gold-line);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(18, 138, 74, 0.15);
  flex-shrink: 0;
}
.match-hero-copy {
  min-width: 0;
  flex: 1;
}
.match-hero-kicker {
  font-size: clamp(0.58rem, 1.8vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--club-gold);
  margin-bottom: 4px;
}
.match-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 5.5vw, 3.2rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  color: #fff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.sb-stage {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 24px) clamp(12px, 2vw, 22px) clamp(14px, 2vw, 20px);
  background: rgba(10, 30, 21, 0.7);
  border: 1px solid rgba(207, 177, 120, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(6, 15, 11, 0.25);
  animation: rise 0.7s var(--ease) 0.18s both;
}

/* Balanced 3-column scoreboard: team | score | team */
.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(10px, 2vw, 20px) clamp(8px, 1.5vw, 16px);
  width: 100%;
}
.team-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0;
  width: 100%;
  text-align: center;
}
.team-side.home { justify-self: stretch; }
.team-side.away { justify-self: stretch; }
.team-name {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 2.2vw, 1.45rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink-soft);
  text-align: center;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.crest {
  width: clamp(76px, 10vw, 112px);
  height: clamp(76px, 10vw, 112px);
  border-radius: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  transition: border-color 0.2s, transform 0.2s;
}
.crest:not(.empty):hover {
  transform: translateY(-2px);
}
.crest.empty { opacity: 0.25; }
.crest img { width: 100%; height: 100%; object-fit: contain; }

.score-wrap {
  display: grid;
  grid-template-columns: minmax(1.1ch, auto) auto minmax(1.1ch, auto);
  align-items: center;
  justify-items: center;
  column-gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.score-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 20px rgba(18, 138, 74, 0.45);
  font-variant-numeric: tabular-nums;
}
.score-sep {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--club-gold);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1;
  opacity: 0.9;
  align-self: center;
  transform: translateY(-0.04em);
}

.scoreboard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1;
  text-align: center;
}
.badge.live {
  background: rgba(255, 90, 90, 0.12);
  color: #ff8a7e;
  border-color: rgba(255, 107, 91, 0.4);
}
.badge.live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a5a;
  animation: liveDot 1.5s infinite;
}
@keyframes liveDot {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(255, 90, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0); }
}
.badge.upcoming {
  color: var(--club-gold);
  border-color: var(--club-gold-line);
  background: rgba(212, 180, 90, 0.08);
}
.badge.finished {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.match-clock {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--club-gold);
  font-size: 13px;
  min-height: 36px;
  padding: 0 4px;
}
.match-clock[hidden] { display: none !important; }
.match-clock-phase {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  line-height: 1;
}
.match-clock-minute {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.minute-track {
  width: 100%;
  max-width: 520px;
  margin: 16px auto 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: visible;
}
.minute-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--club-green-deep), var(--club-gold));
  width: 0%;
  transition: width 0.5s var(--ease);
  box-shadow: 0 0 12px rgba(212, 180, 90, 0.35);
}
.minute-markers { position: absolute; inset: 0; pointer-events: none; }
.minute-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--club-gold);
  border: 2px solid #04140c;
}
.minute-marker.goal { background: #fff; box-shadow: 0 0 10px rgba(212, 180, 90, 0.8); }
.minute-marker.card-y { background: var(--yellow); }
.minute-marker.card-r { background: var(--red); }
.minute-marker.sub { background: #7dd3a0; }

.commentary-bar {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(18, 138, 74, 0.12);
  border: 1px solid rgba(18, 138, 74, 0.25);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  animation: fadeSoft 0.35s var(--ease);
}
.commentary-bar.visible { display: flex; }
.commentary-bar .tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--club-gold);
  line-height: 1;
}
.commentary-text {
  min-width: 0;
  line-height: 1.4;
}
@keyframes fadeSoft {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sticky compact score */
.sticky-score {
  position: sticky;
  top: calc(var(--nav-h) + var(--safe-top) - 4px);
  z-index: 180;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  margin: 0;
  padding: 0 var(--safe-right) 0 var(--safe-left);
  background: rgba(3, 18, 9, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: transform 0.3s var(--ease), opacity 0.3s, max-height 0.3s, padding 0.3s, border-color 0.3s;
}
.sticky-score.visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  max-height: 56px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom-color: var(--line-strong);
}
.sticky-score .ss-teams {
  grid-column: 1;
  justify-self: end;
  font-size: clamp(0.78rem, 2.4vw, 0.95rem);
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: right;
  line-height: 1.1;
}
.sticky-score .ss-score {
  grid-column: 2;
  justify-self: center;
  color: var(--club-gold);
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.sticky-score .ss-min {
  grid-column: 3;
  justify-self: start;
  font-size: clamp(0.78rem, 2.4vw, 0.95rem);
  color: var(--muted);
  line-height: 1;
  min-width: 2.5ch;
}

/* Goal flash */
.goal-flash {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%) scale(0.94);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  padding: 20px clamp(18px, 4vw, 36px);
  border-radius: var(--radius-lg);
  background: rgba(4, 22, 14, 0.94);
  border: 1px solid var(--club-gold);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 180, 90, 0.2);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  letter-spacing: 0.12em;
  text-align: center;
  width: min(320px, calc(100vw - 32px));
  text-transform: uppercase;
  line-height: 1.1;
}
.goal-flash.show { animation: flashIn 0.7s var(--ease) forwards; }
.goal-flash .sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--club-gold);
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@keyframes flashIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(12px); }
  18% { opacity: 1; transform: translateX(-50%) scale(1.03); }
  75% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.98) translateY(-10px); }
}

/* Layout */
.match-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 901px) {
  .match-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
    align-items: stretch;
    gap: 28px;
  }
  .panel-stream,
  .side-stack,
  .side-stack > .panel { height: 100%; }
  .side-stack { display: flex; flex-direction: column; gap: 24px; }
  .side-stack > .panel { flex: 1; }
}

.panel {
  background: linear-gradient(180deg, rgba(12, 36, 22, 0.78), rgba(8, 28, 18, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.panel:hover {
  border-color: rgba(212, 180, 90, 0.22);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}
.panel-stream { overflow: visible; }
.panel-stream:hover { border-color: var(--line); box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18); }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 14px 16px 12px;
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.1;
  min-width: 0;
}
.panel-head .team-switch {
  flex: 1 1 180px;
  max-width: 280px;
  margin-left: auto;
}
.panel-body { padding: 16px; }

/* Video */
.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: -1px;
}
.panel-stream .panel-head {
  border-bottom: none;
  padding-bottom: 10px;
}
.video-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-overlay {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(4, 22, 14, 0.82);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  letter-spacing: 0.04em;
}
.video-overlay .ov-score {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--club-gold);
}
.video-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 12px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.video-wrap:hover .video-controls,
.video-wrap:focus-within .video-controls,
.video-wrap.show-controls .video-controls { opacity: 1; }
@media (max-width: 900px) { .video-controls { opacity: 1; } }
.vbtn {
  min-height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(4, 22, 14, 0.65);
  color: #fff;
  font: 700 11px var(--font-ui);
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.vbtn:hover { background: rgba(18, 138, 74, 0.5); border-color: var(--club-gold-line); }
.vbtn:active { transform: scale(0.97); }
.vbtn select {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  outline: none;
}
.no-stream {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  background:
    radial-gradient(ellipse at center, rgba(18, 138, 74, 0.18), transparent 55%),
    #070b08;
}
.no-stream svg { width: 44px; height: 44px; opacity: 0.45; color: var(--club-gold); }
.no-stream span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 16px;
}

.pip-dock {
  position: fixed;
  right: 12px;
  bottom: calc(100px + var(--safe-bottom));
  width: min(42vw, 220px);
  z-index: 250;
  display: none;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--club-gold-line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.pip-dock.active { display: block; animation: pipIn 0.3s var(--ease); }
@keyframes pipIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.pip-dock video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }

/* Pitch */
.pitch-frame {
  display: flex;
  justify-content: center;
  width: 100%;
}
.pitch {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 68 / 105;
  height: auto;
  max-height: none;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 30%, rgba(0, 0, 0, 0.18)),
    repeating-linear-gradient(
      90deg,
      #176338 0,
      #176338 12.5%,
      #1a6e3e 12.5%,
      #1a6e3e 25%
    );
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}
@media (min-width: 1100px) {
  .side-stack .pitch { width: min(100%, 280px); }
}
@media (max-width: 700px) {
  .pitch { width: min(100%, 320px); }
}
#sklad-both .pitch { width: min(100%, 260px); }
.pitch-markings {
  position: absolute;
  inset: 4.5% 6%;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  border-radius: 2px;
  pointer-events: none;
}
.pitch-halfway {
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1.5px solid rgba(255, 255, 255, 0.42);
}
.pitch-circle {
  position: absolute;
  left: 50%; top: 50%;
  width: 28%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
}
.pitch-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 56%;
  height: 15.5%;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
}
.pitch-box.top { top: 0; border-top: none; }
.pitch-box.bottom { bottom: 0; border-bottom: none; }
.pitch-penalty {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 5.5%;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
}
.pitch-penalty.top { top: 0; border-top: none; }
.pitch-penalty.bottom { bottom: 0; border-bottom: none; }
.pitch-spot.center {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.pitch-label {
  position: absolute;
  left: 8px; top: 6px;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.pitch-slots { position: absolute; inset: 0; }
.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 44px;
  min-height: 44px;
  padding: 2px 1px;
  border: none;
  background: transparent;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
}
.pitch-slot.inert { pointer-events: none; }
.pitch-slot.empty {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
  font-weight: 700;
  justify-content: center;
}
.pitch-slot.filled .ps-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  font-family: var(--font-ui);
  background: linear-gradient(160deg, #0f4d2b, #0b3d22);
  border: 1.5px solid var(--club-gold);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, background 0.2s;
}
.pitch-slot.filled:hover .ps-num {
  background: linear-gradient(160deg, #146338, #0f4d2b);
  transform: scale(1.06);
}
.pitch-slot.filled .ps-name {
  max-width: 56px;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.ps-badges { display: flex; gap: 2px; min-height: 7px; }
.ps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8px;
  height: 8px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 800;
}
.ps-badge.goal { background: #fff; color: #045c30; padding: 0 2px; min-width: 10px; height: 10px; border-radius: 4px; }
.ps-badge.yellow { width: 6px; background: var(--yellow); }
.ps-badge.red { width: 6px; background: var(--red); }
.ps-badge.cap {
  background: var(--club-gold);
  color: #042010;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  font-size: 7px;
}
.pitch-slot.highlight .ps-num {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.pitch-slot.subbed-out { opacity: 0.35; filter: grayscale(0.7); }
.pitch-slot.subbed-out .ps-name { text-decoration: line-through; }
.pitch-slot.sent-off .ps-num { border-color: var(--red); }
.pitch-slot.sub-anim .ps-num { animation: subPop 0.45s var(--ease); }
@keyframes subPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.team-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.team-switch button {
  flex: 1;
  min-height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 700 11px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.team-switch button:hover { color: var(--ink-soft); }
.team-switch button.active {
  background: rgba(18, 138, 74, 0.28);
  color: var(--club-gold);
  box-shadow: inset 0 0 0 1px var(--club-gold-line);
}

.bench-label {
  margin: 16px 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.bench-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bench-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.bench-chip:hover { border-color: var(--club-gold-line); background: rgba(212, 180, 90, 0.06); }
.bench-chip .bn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 138, 74, 0.35);
  color: var(--club-gold);
  font-weight: 800;
  font-size: 11px;
  border: 1px solid var(--line);
}
.bench-chip .bname { font-weight: 600; }
.bench-chip .bst {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 2px;
}
.bench-chip.status-substituted_out { opacity: 0.55; }
.bench-chip.status-sent_off { border-color: rgba(255, 107, 91, 0.4); }

.onpitch-list { display: flex; flex-direction: column; gap: 0; }
#sklad-single > .panel:last-child,
#sklad-both {
  margin-bottom: 28px;
}
.onpitch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.15s, padding-left 0.2s;
}
.onpitch-row:last-child { border-bottom: none; }
.onpitch-row:hover {
  background: rgba(18, 138, 74, 0.08);
  padding-left: 8px;
}
.onpitch-row .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 138, 74, 0.28);
  color: var(--club-gold);
  font-weight: 800;
  font-size: 11px;
  border: 1px solid var(--line);
}
.onpitch-row .pos {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Timeline */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 14px;
}
@media (max-width: 520px) {
  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filter-row .chip { width: 100%; justify-content: center; }
}
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: 700 11px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-align: center;
}
.chip:hover { color: var(--ink-soft); border-color: var(--club-gold-line); }
.chip.active {
  background: rgba(18, 138, 74, 0.28);
  color: var(--club-gold);
  border-color: var(--club-gold-line);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 480px;
  overflow: auto;
}
.tl-item {
  display: grid;
  grid-template-columns: 44px 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s;
}
.tl-item:last-child { border-bottom: none; }
.tl-item:hover,
.tl-item.active {
  background: rgba(18, 138, 74, 0.1);
  transform: translateX(2px);
}
.tl-min {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--club-gold);
  text-align: right;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.tl-icon {
  color: var(--club-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.4em;
  padding-top: 2px;
}
.tl-body { min-width: 0; }
.tl-title {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tl-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.tl-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  font-style: italic;
  border-left: 2px solid var(--club-gold-line);
  padding-left: 10px;
}
.tl-sub-pair { display: flex; flex-direction: column; gap: 3px; font-size: 12px; margin-top: 4px; }
.tl-sub-pair .out { color: #ff8a7a; }
.tl-sub-pair .in { color: #7ddea0; }
.empty-hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 28px 8px;
}

/* Season results */
.season-list { display: flex; flex-direction: column; gap: 10px; }
.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.result-row:hover {
  border-color: var(--club-gold-line);
  background: rgba(18, 138, 74, 0.1);
  transform: translateY(-1px);
}
.result-row .t {
  font-weight: 700;
  font-size: clamp(0.78rem, 2.2vw, 0.92rem);
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}
.result-row .t.home { text-align: right; }
.result-row .t.away { text-align: left; }
.result-row .sc {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.result-meta {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.result-row.win .sc {
  border-color: rgba(125, 222, 160, 0.4);
  color: #b8f0cc;
  background: rgba(125, 222, 160, 0.08);
}
.result-row.loss .sc {
  border-color: rgba(255, 107, 91, 0.35);
  background: rgba(255, 107, 91, 0.06);
}
.result-row.draw .sc {
  border-color: var(--club-gold-dim);
  color: var(--club-gold-bright);
}

.section-intro {
  margin: 18px 0 16px;
  color: var(--muted);
  font-size: clamp(0.84rem, 2.4vw, 0.92rem);
  max-width: 40em;
  line-height: 1.55;
  text-wrap: pretty;
}
.section-intro strong {
  color: var(--club-gold);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeSoft 0.25s var(--ease);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(420px, 100%);
  background: var(--bg-elev-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
}
.modal h3 {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
  font-size: clamp(1.2rem, 4vw, 1.4rem);
  text-align: center;
  line-height: 1.15;
}
.modal canvas {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #041008;
  border: 1px solid var(--line);
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: none;
  font: 700 12px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--club-gold);
  color: var(--club-green-dark);
  border: 1px solid var(--club-gold);
  box-shadow: 0 8px 22px rgba(207, 177, 120, 0.16);
}
.btn-primary:hover {
  background: var(--club-gold-bright);
  border-color: var(--club-gold-bright);
  box-shadow: 0 10px 26px rgba(207, 177, 120, 0.24);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--club-gold-bright);
  outline-offset: 2px;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--club-gold-line); }

.countdown {
  text-align: center;
  padding: clamp(18px, 3vw, 26px) 16px;
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: rise 0.55s var(--ease);
}
.countdown .cd-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown .cd-parts {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  margin-top: 12px;
}
.countdown .cd-part {
  min-width: clamp(64px, 12vw, 100px);
  padding: 10px 12px;
  border-left: 1px solid var(--line-strong);
}
.countdown .cd-part:first-child:not([hidden]) { border-left: 0; }
.countdown #countdown-days-part[hidden] + .cd-part { border-left: 0; }
.countdown .cd-part[hidden] { display: none; }
.countdown .cd-part strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--club-gold-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown .cd-part span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) { .compare-grid { grid-template-columns: 1fr; } }

/* Narrow phones: stack scoreboard cleanly */
@media (max-width: 520px) {
  .match-hero {
    min-height: auto;
  }
  .match-hero-inner {
    padding-top: 20px;
    padding-bottom: 22px;
  }
  .teams {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
  }
  .team-side {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
  .team-name {
    text-align: center;
    -webkit-line-clamp: 2;
    font-size: 0.78rem;
  }
  .crest { width: 68px; height: 68px; }
  .score-wrap {
    width: auto;
    padding: 8px;
    grid-template-columns: minmax(1ch, auto) auto minmax(1ch, auto);
  }
  .score-num { font-size: clamp(2.2rem, 12vw, 3.2rem); }
  .countdown .cd-parts { gap: 0; }
  .countdown .cd-part { min-width: 0; flex: 1; padding-inline: 6px; }
  .panel-head .team-switch {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
  .result-row {
    padding: 12px;
    gap: 6px 8px;
  }
  .modal-actions {
    flex-direction: column;
  }
  .modal-actions .btn { width: 100%; }
}

@media (min-width: 521px) and (max-width: 700px) {
  .match-hero { min-height: auto; }
  .team-name { font-size: clamp(0.9rem, 2.4vw, 1.2rem); }
}

/* Focus for a11y */
.tab-trigger:focus-visible,
.chip:focus-visible,
.team-switch button:focus-visible,
.vbtn:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--club-gold);
  outline-offset: 2px;
}
