@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@500;700&family=IBM+Plex+Mono:wght@400;500;600&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
  --paper: #ece7d8;
  --card: #fbfaf3;
  --ink: #26314a;
  --ink-soft: #5a6480;
  --line: #c9c2ac;
  --red: #a8342a;
  --green: #3f6b4a;
  --amber: #a4772b;
  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    rgba(38, 49, 74, 0.07) 28px
  );
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

h1, h2, h3, .display {
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.4em 0;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.mono { font-family: 'IBM Plex Mono', monospace; }

/* --- Layout --- */

.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 18px 24px;
  border-bottom: 4px solid var(--red);
}
.site-header .brand {
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 0.01em;
}
.site-header .brand span { color: var(--red); }
.site-header nav a {
  color: var(--paper);
  opacity: 0.85;
  margin-left: 18px;
  font-size: 0.92rem;
}
.site-header nav a:hover { opacity: 1; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 80px 24px;
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

/* --- Cards --- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
}

.match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.teams {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.05rem;
  font-weight: 600;
}

.meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* --- Status badges --- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.badge.upcoming { color: var(--ink-soft); }
.badge.completed { color: var(--green); }
.badge.live, .badge.ongoing {
  color: var(--red);
  animation: pulse 1.8s ease-in-out infinite;
}
.badge.live .dot, .badge.ongoing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  display: inline-block;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .badge.live { animation: none; }
}

/* --- Match detail --- */

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  margin-bottom: 14px;
}
.video-frame iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

.overlay-frame {
  width: 100%;
  height: 90px;
  border: 1px solid var(--line);
  background: var(--card);
}

.result-line {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  color: var(--green);
  border-left: 3px solid var(--green);
  padding-left: 12px;
  margin: 16px 0;
}

.commentary-feed {
  list-style: none;
  margin: 0; padding: 0;
}
.commentary-feed li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.94rem;
}
.commentary-feed li:last-child { border-bottom: none; }
.commentary-feed .ts {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-right: 8px;
}

/* --- Forms (admin) --- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input[type=text], .field input[type=password], .field input[type=datetime-local],
.field select, .field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
}
.field textarea { min-height: 70px; resize: vertical; }

button, .btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--red); text-decoration: none; }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.admin-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.empty-state {
  padding: 30px 0;
  color: var(--ink-soft);
  font-style: italic;
}

.flash {
  background: #eef3ea;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  border-radius: var(--radius);
}
