:root {
  --bg: #0b1f3a;
  --panel: #13294b;
  --panel-2: #1c3a66;
  --text: #eaf1fb;
  --muted: #9bb0cf;
  --accent: #36d399;
  --up: #36d399;
  --down: #f87272;
  --line: #25406b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 88px;
}

header.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 14px;
  margin: -16px -16px 8px;
  background: linear-gradient(135deg, #13294b 0%, #0b1f3a 60%);
  border-bottom: 1px solid var(--line);
}
header.top img { width: 34px; height: 34px; }
header.top h1 { font-size: 18px; margin: 0; }
header.top .spacer { flex: 1; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--accent);
  color: #06231a;
  font-weight: 700;
}
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button.small { padding: 7px 11px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }

input, textarea {
  font: inherit;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  margin: 6px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 14px 0;
  font-weight: 600;
}
.tabbar button.active { color: var(--accent); }

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.match:last-child { border-bottom: none; }
.match .team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match .team.away { justify-content: flex-end; }

.team-badge { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match .team.away .team-badge { flex-direction: row-reverse; }
.crest-wrap { flex: 0 0 auto; display: inline-flex; }
.crest { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }
.crest-emoji { font-size: 22px; line-height: 1; }
.crest-fallback {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--muted);
}
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .score-in { width: 46px; text-align: center; }
.tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: none; }
.lb-rank {
  font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
}
.lb-rank.gold { background: #f5c84233; color: #f5c842; }
.lb-rank.silver { background: #cdd6e433; color: #cdd6e4; }
.lb-rank.bronze { background: #cd7f3233; color: #e0995a; }
.lb-pts { font-weight: 700; }
.move { font-size: 13px; font-weight: 700; min-width: 34px; text-align: right; }
.move.up { color: var(--up); }
.move.down { color: var(--down); }
.move.same { color: var(--muted); }

.pill {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: #06231a;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; }

.hidden { display: none !important; }
.center { text-align: center; }
a { color: var(--accent); }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
