:root {
  --bg: #07140c;
  --bg-2: #0c1f14;
  --bg-3: #122a1b;
  --card: #0f2418;
  --line: #1e4a32;
  --green: #1db954;
  --green-2: #0f8a3c;
  --yellow: #f5c518;
  --white: #f4f7f2;
  --muted: #9bb5a4;
  --red: #e23d3d;
  --lib: #1a6b3c;
  --pre: #1e4e8c;
  --sul: #8a6a12;
  --zel: #6b1f1f;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Barlow", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #163822 0%, transparent 50%),
    radial-gradient(900px 500px at -10% 20%, #1a3d22 0%, transparent 45%),
    var(--bg);
  color: var(--white);
  line-height: 1.45;
}

img {
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 20px 48px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(7, 20, 12, 0.2), rgba(7, 20, 12, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 42px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 197, 24, 0.12);
  border: 1px solid rgba(245, 197, 24, 0.35);
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 12px;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
}

.logo-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1db954, #0b5c2b);
  box-shadow: 0 10px 24px rgba(29, 185, 84, 0.35);
  font-weight: 900;
  font-size: 22px;
  margin: 22px 0 12px;
}

h1 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(56px, 12vw, 108px);
  letter-spacing: 0.04em;
  line-height: 0.9;
}

.subtitle {
  font-size: clamp(18px, 3vw, 28px);
  color: var(--yellow);
  font-weight: 700;
  margin-top: 8px;
}

.tagline {
  max-width: 640px;
  color: var(--muted);
  margin: 14px 0 28px;
  font-size: 16px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.stat-pill {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 140px;
}

.stat-pill b {
  display: block;
  font-size: 22px;
  color: var(--yellow);
}

.stat-pill span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.crests {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 10px;
  margin: 8px 0 32px;
}

.crests img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, #2be067, #129a45);
  color: #06210f;
  font-size: 18px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 24px rgba(18, 154, 69, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}

.btn-yellow {
  background: var(--yellow);
  color: #1a1400;
}

.btn-danger {
  background: #4a1b1b;
  color: #ffd6d6;
  border: 1px solid #7a2c2c;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 20, 12, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: 0.06em;
}

.brand small {
  display: block;
  font-family: "Barlow", sans-serif;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.progress-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 10px;
}

.bar {
  height: 10px;
  background: #163221;
  border-radius: 99px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 8px 0 16px;
}

.tabs button {
  flex: 0 0 auto;
  background: var(--bg-3);
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}

.tabs button.active {
  background: var(--green);
  color: #06210f;
  border-color: var(--green);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.round-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 12px;
}

.round-title h2 {
  font-size: 22px;
}

.round-title span {
  color: var(--muted);
  font-size: 13px;
}

.match {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.match:last-child {
  border-bottom: 0;
}

.sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team.away {
  flex-direction: row-reverse;
  text-align: right;
}

.team img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.team b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.vs {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.match-date {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.choices button {
  background: #163221;
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.choices button.selected.home {
  background: var(--green);
  color: #06210f;
  border-color: var(--green);
}

.choices button.selected.draw {
  background: var(--yellow);
  color: #1a1400;
  border-color: var(--yellow);
}

.choices button.selected.away {
  background: #2d6cdf;
  color: #fff;
  border-color: #2d6cdf;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--card);
}

th,
td {
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}

th {
  background: #12301e;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td.club {
  text-align: left;
  font-weight: 700;
}

.club-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.club-cell img {
  width: 24px;
  height: 24px;
}

tr.zone-lib td:first-child,
tr.zone-pre td:first-child,
tr.zone-sul td:first-child,
tr.zone-zel td:first-child {
  box-shadow: inset 4px 0 0 currentColor;
}

tr.zone-lib { color: inherit; }
tr.zone-lib td:first-child { color: #3ee07a; }
tr.zone-pre td:first-child { color: #7eb6ff; }
tr.zone-sul td:first-child { color: var(--yellow); }
tr.zone-zel td:first-child { color: #ff8a8a; }

.tie-flag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: var(--yellow);
  border: 1px solid rgba(245, 197, 24, 0.4);
  border-radius: 999px;
  padding: 1px 6px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.note {
  margin-top: 12px;
  background: rgba(245, 197, 24, 0.08);
  border: 1px solid rgba(245, 197, 24, 0.25);
  color: #f3e3a4;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}

.footer-actions {
  position: sticky;
  bottom: 0;
  background: rgba(7, 20, 12, 0.94);
  border-top: 1px solid var(--line);
  padding: 10px 16px 16px;
}

.footer-actions .btn-row {
  max-width: 1180px;
  margin: 0 auto;
}

.footer-actions .btn {
  flex: 1 1 140px;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.modal-card h3 {
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--muted);
  margin-bottom: 14px;
}

#shareCanvas {
  width: 100%;
  border-radius: 12px;
  background: #07140c;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(20px);
  background: #163221;
  border: 1px solid var(--green);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.source {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .crests {
    grid-template-columns: repeat(5, 1fr);
  }

  .choices button {
    font-size: 10px;
    padding: 11px 4px;
  }

  .team b {
    font-size: 13px;
  }
}
