:root {
  --bg: #050505;
  --bg2: #0b0b0b;
  --panel: rgba(255,255,255,0.045);
  --panel2: rgba(255,255,255,0.025);
  --text: #ffffff;
  --muted: #d6d6d6;
  --muted-2: #a9a9a9;

  --ffo-red: #d71920;
  --ffo-red-dark: #8f1015;
  --ffo-red-soft: rgba(215,25,32,0.18);

  --blue: #2f80ed;
  --blue-soft: rgba(47,128,237,0.16);
  --blue-line: rgba(47,128,237,0.62);

  --line: rgba(255,255,255,0.13);
  --line-strong: rgba(215,25,32,0.42);

  --green: #35d07f;
  --shadow: 0 18px 50px rgba(0,0,0,0.44);
  --radius: 18px;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(215,25,32,0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(255,255,255,0.07), transparent 30%),
    linear-gradient(180deg, #111111 0%, #060606 56%, #000000 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--ffo-red);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

button:hover {
  filter: brightness(1.08);
}

button.danger {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255,255,255,0.35);
}

.feed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.speed-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.speed-btn {
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1;
  background: transparent;
  color: #ffffff;
  border-color: rgba(255,255,255,0.24);
}

.speed-btn.active {
  background: var(--ffo-red);
  color: #ffffff;
  border-color: var(--ffo-red);
}

.match-page {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 14px 80px;
  overflow-x: hidden;
}

.hero,
.panel {
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  overflow: hidden;
}

.hero {
  background:
    radial-gradient(circle at top left, rgba(215,25,32,0.22), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.025));
  border-color: var(--line-strong);
}

.eyebrow {
  color: #ffffff;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.team {
  min-width: 0;
  text-align: center;
}

.team h1 {
  margin: 12px 0 6px;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.team p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.club-logo {
  width: 122px;
  height: 122px;
  object-fit: contain;
  display: none;
  margin: 0 auto;
  padding: 10px;
  background: rgba(255,255,255,0.96);
  border: 2px solid rgba(215,25,32,0.55);
  border-radius: 22px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.46);
}

.scorebox {
  min-height: 122px;
  border-radius: 20px;
  background: rgba(0,0,0,0.62);
  border: 1px solid rgba(215,25,32,0.55);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
}

.scorebox div {
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
}

.scorebox span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-top: 8px;
  letter-spacing: 0.10em;
}

.scorebox.spoiler div {
  filter: blur(8px);
}

.match-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--muted);
  margin-top: 18px;
}

.match-meta span {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.045);
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.match-help {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}

.match-help code {
  color: #ffffff;
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  padding: 3px 6px;
}

.hidden {
  display: none;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel h3 {
  margin: 0 0 12px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lineups {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.lineups ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.lineups li {
  min-width: 0;
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.lineups li span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lineups .pos {
  color: #ffffff;
  font-weight: 900;
  flex: 0 0 auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sticky-feed-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5,5,5,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 10px;
  margin: -6px -6px 14px;
}

.sticky-feed-head h2 {
  margin: 0;
}

.progress-wrap {
  height: 10px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 18px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ffo-red);
}

.timeline {
  display: grid;
  gap: 10px;
}

.event {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 13px;
  background: rgba(0,0,0,0.38);
}

.event.goal {
  border-color: rgba(53,208,127,0.55);
  background: rgba(53,208,127,0.10);
}

.event.yellow-card {
  border-color: rgba(230,190,40,0.65);
  background: rgba(230,190,40,0.12);
}

.event.red-card {
  border-color: rgba(215,25,32,0.65);
  background: rgba(215,25,32,0.14);
}

.event.sub,
.event.tactic {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

.event.marker {
  border-color: rgba(215,25,32,0.55);
  background: rgba(215,25,32,0.14);
}

.event-minute {
  color: #ffffff;
  font-weight: 900;
  margin-bottom: 6px;
}

.event-text {
  color: rgba(255,255,255,0.88);
  white-space: pre-wrap;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.vidi-printer {
  min-height: 420px;
  max-height: 620px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.78), rgba(0,0,0,0.52));
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius);
  padding: 16px;
  font-family: "Courier New", Courier, monospace;
  box-shadow: inset 0 0 28px rgba(0,0,0,0.45);
}

.printer-line {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 9px 0;
  color: rgba(255,255,255,0.9);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.printer-line:first-child {
  color: #ffffff;
  font-weight: 900;
}

.printer-line.goal {
  color: #bfffd8;
}

.printer-line.yellow-card {
  color: #ffe48a;
}

.printer-line.red-card {
  color: #ff9a9a;
}

.printer-line.sub,
.printer-line.tactic {
  color: #9fc8ff;
}

.printer-line.marker {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.final-score {
  font-size: clamp(18px, 3vw, 32px);
  font-weight: 900;
  text-align: center;
  border: 1px solid rgba(215,25,32,0.52);
  background: rgba(0,0,0,0.62);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.info-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(0,0,0,0.34);
}

.info-card p {
  margin: 8px 0;
  color: rgba(255,255,255,0.84);
  overflow-wrap: anywhere;
}

.stats-bars {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
}

.stat-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-num {
  font-weight: 900;
  text-align: center;
  color: #ffffff;
}

.stat-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--homeWidth) var(--awayWidth);
}

.stat-home {
  background: var(--ffo-red);
}

.stat-away {
  background: rgba(255,255,255,0.42);
}

.player-stats {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.player-stats table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
}

.player-stats th,
.player-stats td {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

.player-stats th {
  color: #ffffff;
  background: rgba(215,25,32,0.24);
}

pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-x: auto;
  background: rgba(0,0,0,0.54);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 16px;
  line-height: 1.45;
  color: rgba(255,255,255,0.88);
}

@media (max-width: 760px) {
  .match-page {
    padding: 14px 10px 56px;
  }

  .hero,
  .panel {
    padding: 16px;
    border-radius: 14px;
  }

  .teams {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .team-home {
    order: 1;
  }

  .scorebox {
    order: 2;
  }

  .team-away {
    order: 3;
  }

  .club-logo {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    padding: 8px;
  }

  .team h1 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .feed-controls {
    width: 100%;
    justify-content: stretch;
  }

  .speed-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .speed-btn {
    width: 100%;
  }

  .lineups,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .sticky-feed-head {
    position: sticky;
    top: 0;
  }

  .actions button,
  .feed-controls > button {
    width: 100%;
  }

  .stat-row {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .vidi-printer {
    min-height: 360px;
    max-height: 520px;
    padding: 13px;
  }
}