/* FrontRow feed lab. One timing sheet, two feeds: Sportmonks on the left in teal, API-Football
   on the right in orange, and a centre gutter that shows who reported each moment first. */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #12161b;
  --muted: #5b6672;
  --line: #dde2e7;
  --soft: #eef1f4;
  --sm: #0f766e;
  --sm-soft: #e3f3f1;
  --af: #b4480f;
  --af-soft: #fbeee6;
  --fd: #4b5563;
  --live: #d92d20;
  --goal: #15803d;
  --yellow: #eab308;
  --red: #dc2626;
  --focus: #2563eb;
  --radius: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* Frame */

.topbar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--ink); color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; }
.brand-sub { font-weight: 400; color: #b8c1cb; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 4px;
  background: linear-gradient(90deg, var(--sm) 0 50%, var(--af) 50% 100%);
}
.topbar-note { margin: 0; color: #b8c1cb; font-size: 13px; }

.page { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px; }

.footer {
  max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 32px;
  color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer p { margin: 0; max-width: 70ch; }

/* Sections */

.section { margin-top: 32px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.section-title { font-size: 20px; line-height: 1.3; margin: 0 0 12px; }
.section-title-small { font-size: 15px; color: var(--muted); }
.count { margin-right: auto; background: var(--live); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.empty { margin: 0; padding: 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; }
.split .section { margin-top: 32px; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* Shared bits */

.team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crest { width: 24px; height: 24px; object-fit: contain; flex: none; }
.crest-empty { display: inline-block; border-radius: 50%; background: var(--soft); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--soft); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill-live { background: #fdecea; color: var(--live); }
.pill-quiet { font-weight: 500; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.tag {
  display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--soft); color: var(--muted);
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.tag[title] { cursor: help; }
.tag-warn { background: #fef3c7; color: #8a5a00; }

.tally { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.tally-part { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.tally-part.sm .swatch { background: var(--sm); }
.tally-part.af .swatch { background: var(--af); }

/* Home: live cards */

.live-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.live-card {
  display: grid; gap: 12px; padding: 16px; text-decoration: none; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.live-card:hover { border-color: #b9c2cb; }
.live-card-top { display: flex; align-items: center; gap: 10px; }
.live-card-status { color: var(--muted); font-size: 13px; }
.live-card-teams { display: grid; gap: 6px; }
.live-card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 600; }
.live-score { font-size: 22px; font-weight: 700; min-width: 1.2em; text-align: right; }
.live-card-foot { border-top: 1px solid var(--soft); padding-top: 10px; }

/* Home: fixture lists */

.day { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 6px; }
.day:first-of-type { margin-top: 0; }
.fixture-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fixture-list li + li { border-top: 1px solid var(--soft); }
.fixture { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; }
.fixture:hover { background: #f8fafb; }
.fixture-time { color: var(--muted); font-size: 13px; }
.fixture-teams { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.fixture .crest { width: 20px; height: 20px; }
.vs { color: var(--muted); font-size: 13px; }
.final-score { font-weight: 700; padding: 0 4px; }
.fixture-recorded { grid-template-columns: 76px minmax(0, 1fr); }
.fixture-tally { grid-column: 2; }

.capture-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 13px; color: var(--muted); }
.capture-item { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.capture-name { color: var(--ink); font-weight: 600; }

/* Match: scoreboard */

.back { margin: 0 0 12px; font-size: 14px; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--ink); text-decoration: underline; }

.scoreboard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.scoreboard-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.team-large { font-size: clamp(18px, 3vw, 26px); font-weight: 700; gap: 12px; }
.team-large .crest { width: 40px; height: 40px; }
.team-away { justify-self: end; flex-direction: row-reverse; text-align: right; }
.scoreboard-score { font-size: clamp(32px, 6vw, 48px); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.scoreboard-score .dash { padding: 0 .15em; color: var(--muted); font-weight: 600; }
.scoreboard-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.providers { list-style: none; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--soft); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.provider { display: grid; gap: 2px; padding-left: 10px; border-left: 3px solid var(--fd); font-size: 13px; }
.provider-sm { border-color: var(--sm); }
.provider-af { border-color: var(--af); }
.provider-name { font-weight: 600; }
.provider-state { color: var(--muted); }
@media (max-width: 640px) {
  .providers { grid-template-columns: minmax(0, 1fr); }
  .scoreboard-teams { grid-template-columns: minmax(0, 1fr) auto; }
  .scoreboard-teams .team-away { grid-column: 1; grid-row: 2; justify-self: start; flex-direction: row; text-align: left; }
  .scoreboard-score { grid-column: 2; grid-row: 1 / span 2; }
}

/* Match: verdict */

.verdict { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.verdict-card { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-top: 4px solid var(--fd); }
.verdict-sm { border-top-color: var(--sm); }
.verdict-af { border-top-color: var(--af); }
.verdict-same { border-top-color: var(--line); }
.verdict-number { font-size: 34px; font-weight: 800; line-height: 1.1; }
.verdict-label { font-weight: 600; }
.verdict-detail { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .verdict { grid-template-columns: minmax(0, 1fr); } }

/* Match: key moments */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.moments { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.moments th, .moments td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--soft); vertical-align: top; }
.moments tbody tr:last-child > * { border-bottom: 0; }
.moments thead th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; }
.moments thead .col-sm { box-shadow: inset 0 -3px 0 var(--sm); }
.moments thead .col-af { box-shadow: inset 0 -3px 0 var(--af); }
.moments thead .col-fd { box-shadow: inset 0 -3px 0 var(--fd); }
.moments tbody th { font-weight: 600; }
.moments td time { margin-right: 6px; }
.first-mark { display: inline-block; padding: 0 6px; border-radius: 4px; background: #dcfce7; color: #166534; font-size: 12px; font-weight: 600; }
.delay { color: var(--muted); font-size: 13px; }

/* Match: the timing sheet */

.order-toggle {
  font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.order-toggle:hover { border-color: #b9c2cb; }

.feeds { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feeds-head, .row { display: grid; grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr); }
.feeds-head {
  position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0; font-size: 13px; font-weight: 700;
}
.feeds-head > span { padding: 10px 14px; }
.feeds-head-sm { color: var(--sm); box-shadow: inset 0 -3px 0 var(--sm); }
.feeds-head-af { color: var(--af); box-shadow: inset 0 -3px 0 var(--af); text-align: left; }
.feeds-head-lead { text-align: center; color: var(--muted); font-weight: 500; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows.newest-first { flex-direction: column-reverse; }
.row { border-top: 1px solid var(--soft); }
.rows > .row:first-child { border-top: 0; }
.rows.newest-first > .row:first-child { border-top: 1px solid var(--soft); }
.rows.newest-first > .row:last-child { border-top: 0; }
.row.fresh { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: #fff8db; } to { background: transparent; } }

.cell { padding: 10px 14px; min-width: 0; }
.cell-label { display: none; }
.absent { color: #c0c7cf; }

.item { display: grid; gap: 2px; }
.item-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.when { font-weight: 600; color: var(--ink); }
.item-body { overflow-wrap: anywhere; }
.item-body .glyph { margin-right: 7px; vertical-align: -1px; }
.item-body .tag { margin-left: 6px; vertical-align: 1px; }
.item-team { color: var(--muted); font-size: 13px; }
.item-team::before { content: "· "; }
.item-detail { margin: 0; color: var(--muted); font-size: 12px; }
.score-text { font-size: 16px; }
.kind-phase .item-main { font-weight: 700; }
.kind-removed .item-main { text-decoration: line-through; color: var(--muted); }
.is-initial { opacity: .7; }

.glyph {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 14px; height: 14px; font-size: 10px; font-weight: 700; line-height: 1; color: var(--muted);
}
.glyph-goal { width: 12px; min-width: 12px; height: 12px; border-radius: 50%; background: var(--goal); }
.glyph-score { width: 12px; min-width: 12px; height: 12px; border-radius: 3px; background: var(--ink); }
.glyph-yellow { width: 10px; min-width: 10px; height: 13px; border-radius: 2px; background: var(--yellow); }
.glyph-red { width: 10px; min-width: 10px; height: 13px; border-radius: 2px; background: var(--red); }
.glyph-var { padding: 0 3px; border: 1px solid currentColor; border-radius: 3px; height: 15px; font-size: 9px; }
.glyph-sub { font-size: 14px; }
.glyph-phase { font-size: 14px; color: var(--ink); }
.glyph-odds-suspended, .glyph-odds-open { padding: 0 4px; border-radius: 3px; height: 16px; font-size: 10px; background: var(--af-soft); color: var(--af); }
.glyph-odds-suspended { background: var(--af); color: #fff; }
.glyph-missed-penalty { width: 12px; min-width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--goal); }
.glyph-other, .glyph-shootout { width: 8px; min-width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

.gutter { display: flex; align-items: center; justify-content: center; padding: 10px 4px; border-left: 1px solid var(--soft); border-right: 1px solid var(--soft); background: #fbfcfd; }
.lead { position: relative; display: block; width: 100%; height: 22px; font-size: 12px; font-weight: 700; }
.lead::before { content: ""; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1px; background: var(--line); }
.lead-bar { position: absolute; top: 6px; bottom: 6px; width: calc(var(--w) * 0.5); }
.lead-sm .lead-bar { right: 50%; background: var(--sm); border-radius: 3px 0 0 3px; }
.lead-af .lead-bar { left: 50%; background: var(--af); border-radius: 0 3px 3px 0; }
.lead-label { position: absolute; top: 0; line-height: 22px; white-space: nowrap; }
.lead-sm .lead-label { left: calc(50% + 6px); color: var(--sm); }
.lead-af .lead-label { right: calc(50% + 6px); color: var(--af); }
.lead-same { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.lead-same::before { display: none; }
.lead-same .lead-label { position: static; font-weight: 500; }

@media (max-width: 760px) {
  .feeds-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); padding: 4px 0; }
  .gutter { border: 0; background: none; padding: 0 14px; justify-content: flex-start; }
  .gutter:empty { display: none; }
  .lead { max-width: 220px; }
  .cell { padding: 8px 14px; }
  .cell-label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 2px; }
  .cell-sm .cell-label { color: var(--sm); }
  .cell-af .cell-label { color: var(--af); }
  .cell:has(> .absent) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot, .row.fresh { animation: none; }
}
