:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --surface: #162038;
  --surface-2: #1c2945;
  --ink: #e8eefc;
  --muted: #9aabcb;
  --line: rgba(232, 238, 252, 0.1);
  --accent: #3dd6c6;
  --accent-2: #2bb3a5;
  --accent-soft: rgba(61, 214, 198, 0.14);
  --warn: #f0b429;
  --danger: #ff7b72;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 10% -10%, rgba(61, 214, 198, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(88, 120, 255, 0.16), transparent 50%),
    linear-gradient(180deg, #0d1528 0%, var(--bg) 40%, #08101c 100%);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

#app { min-height: 100dvh; }

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 16px 56px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  font-family: var(--display);
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}
.brand span { color: var(--accent); }
.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.portal-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.portal-link:hover { color: var(--ink); border-color: rgba(61, 214, 198, 0.35); }

.search-panel {
  background: linear-gradient(160deg, rgba(22, 32, 56, 0.95), rgba(17, 26, 46, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input[type="text"],
input[type="date"],
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(61, 214, 198, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06221f;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost.active {
  border-color: rgba(61, 214, 198, 0.55);
  background: var(--accent-soft);
  color: var(--accent);
}

.suggestions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}
.suggestion:hover { border-color: rgba(61, 214, 198, 0.4); }
.suggestion img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.suggestion strong { display: block; }
.suggestion span { color: var(--muted); font-size: 0.84rem; }

.team-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.team-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.team-pill img { width: 28px; height: 28px; object-fit: contain; }
.team-pill strong { font-family: var(--display); letter-spacing: -0.02em; }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.seg {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}
.seg .btn-ghost { flex: 1; }

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.match-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
}
.match-card .when {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.match-card .when strong {
  color: var(--accent);
  font-size: 1rem;
}
.match-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.match-meta {
  display: grid;
  gap: 6px;
  margin-top: auto;
  font-size: 0.88rem;
}
.match-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.match-meta span { color: var(--muted); }
.match-meta strong { text-align: right; font-weight: 600; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}

.status {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
}
.status.error { color: var(--danger); }
.foot {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.foot a { color: var(--accent); }

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .search-row { grid-template-columns: 1fr; }
}
