:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #1a1d24;
  --text: #e8e8ea;
  --muted: #9a9ea8;
  --accent: #f2b705;
  --border: #2a2e38;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
  font-size: 1.4rem;
}

.layout {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  align-items: flex-start;
}

.filters {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--panel);
  padding: 1rem;
  border-radius: 8px;
  position: sticky;
  top: 1.5rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filters select,
.filters input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 0.9rem;
}

.results {
  flex: 1;
  min-width: 0;
}

.status {
  color: var(--muted);
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.movie-card {
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
}

.movie-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #000;
}

.movie-card__body {
  padding: 0.6rem 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.movie-card__title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
}

.movie-card__meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.movie-card__scores {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.score--critics { color: var(--accent); font-weight: 700; }
.score--user { color: var(--muted); }

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.pagination button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 700px) {
  .topbar {
    padding: 1rem;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  .layout {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .filters {
    flex: none;
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .filters label {
    flex: 1 1 45%;
    min-width: 130px;
  }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
  }

  .movie-card__title {
    font-size: 0.85rem;
  }

  .movie-card__scores {
    flex-direction: column;
    gap: 0.15rem;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
