* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f8fb;
  color: #202124;
}

.recs-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 80px;
}

.recs-header {
  margin-bottom: 24px;
}

.back-link {
  color: #1a73e8;
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

.recs-header h1 {
  margin: 18px 0 8px;
  font-size: 42px;
  letter-spacing: -1px;
}

.recs-header p {
  margin: 0;
  color: #5f6368;
}

.filter-card,
.table-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.filter-card {
  padding: 22px;
  margin-bottom: 22px;
}

.filter-top,
.table-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.filter-top h2,
.table-top h2 {
  margin: 0;
  font-size: 20px;
}

.filter-top p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.clear-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.clear-btn:hover {
  background: #f3f4f6;
}

.rating-filter {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  max-width: 240px;
  gap: 8px;
}

.rating-filter label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

.rating-filter input {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
}

.rating-filter input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.filter-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.civ-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.civ-btn {
  width: 58px;
  height: 58px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  cursor: pointer;
  padding: 6px;
  transition: all 0.15s ease;
  position: relative;
}

.civ-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.civ-btn span {
  display: none;
}

.civ-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.civ-btn.active {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
  background: #eff6ff;
}

.active-filters {
  margin-top: 16px;
  color: #5f6368;
  font-size: 14px;
}

.table-card {
  overflow: hidden;
}

.table-top {
  padding: 20px 22px;
  border-bottom: 1px solid #e5e7eb;
}

#resultsCount {
  color: #6b7280;
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f9fafb;
}

th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  white-space: nowrap;
}

td {
  padding: 16px 18px;
  border-top: 1px solid #eef0f3;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fafafa;
}

.rating {
  color: #6b7280;
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1a73e8;
  font-weight: 700;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1a73e8;
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.download-btn:hover {
  background: #1558b0;
  transform: translateY(-1px);
}

.empty-row {
  text-align: center;
  color: #6b7280;
  padding: 34px !important;
}

@media (max-width: 768px) {
  .recs-header h1 {
    font-size: 32px;
  }

  .filter-top,
  .table-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .civ-btn {
    width: 48px;
    height: 48px;
  }

  th,
  td {
    padding: 12px;
  }
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-top: 1px solid #e5e7eb;
}

.pagination button {
  border: 1px solid #d1d5db;
  background: white;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.filter-toggle {
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
