:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1b1f23;
  --muted: #5b6570;
  --accent: #e50914;
  --border: rgba(27, 31, 35, 0.12);
  --success: #11845b;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: 100vh;
}

.panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

.panel--search {
  padding: 32px 28px;
  border-right: 1px solid var(--border);
  gap: 24px;
}

.panel__header h1 {
  margin: 0 0 12px;
  font-size: 1.7rem;
}

.panel__header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.12);
}

.search-results {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(4px);
}

.search-result {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(27, 31, 35, 0.06);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result strong {
  display: block;
  font-weight: 600;
}

.search-result span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-result:hover,
.search-result:focus {
  background: rgba(229, 9, 20, 0.08);
}

.options {
  display: grid;
  gap: 16px;
}

.option select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.option.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option.toggle input {
  width: 18px;
  height: 18px;
}

.panel__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.panel__footer button {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
}

.panel__footer button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.panel--detail {
  padding: 32px;
  overflow-y: auto;
}

.empty-state {
  margin: auto;
  text-align: center;
  max-width: 420px;
  color: var(--muted);
}

.empty-state h2 {
  margin-bottom: 12px;
  color: var(--text);
}

.team-view.hidden {
  display: none;
}

.team-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.team-info__league {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.team-info__name {
  margin: 4px 0;
  font-size: 2rem;
}

.team-info__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.team-actions .btn {
  padding: 12px 18px;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(229, 9, 20, 0.24);
}

.team-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.badge {
  padding: 6px 12px;
  background: rgba(229, 9, 20, 0.1);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.link-button {
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.match-list {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.match {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(130%);
  display: grid;
  gap: 12px;
}

.match__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.95rem;
}

.match__date {
  font-weight: 600;
}

.match__round {
  color: var(--muted);
  font-size: 0.85rem;
}

.match__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.05rem;
}

.match__teams span:last-child {
  text-align: right;
}

.match__score {
  font-size: 0.95rem;
  color: var(--muted);
}

.match__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.btn--ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel--search {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .panel--detail {
    padding: 24px;
  }

  .team-info__name {
    font-size: 1.6rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b0f;
    --panel: #111720;
    --text: #f0f4ff;
    --muted: #8b94a3;
    --border: rgba(255, 255, 255, 0.08);
  }

  .search-results,
  .match {
    background: rgba(17, 23, 32, 0.8);
  }

  .badge {
    background: rgba(229, 9, 20, 0.16);
  }

  .btn--ghost {
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text);
  }

  .btn--ghost:hover {
    border-color: var(--accent);
    color: #fff;
  }
}
