@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --bg: #f6f2ea;
  --panel: #fffdf8;
  --ink: #1c1a16;
  --muted: #6b6356;
  --accent: #d4772f;
  --accent-dark: #9f4c0f;
  --line: #e3d9cc;
  --shadow: 0 14px 40px rgba(40, 30, 20, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(212, 119, 47, 0.18), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(30, 79, 61, 0.12), transparent 55%),
    radial-gradient(circle at 30% 90%, rgba(194, 77, 106, 0.12), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 6vw 12px;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 34px;
}

.site-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.source-note {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.source-note a {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.source-note a:hover {
  border-color: var(--accent-dark);
}

main {
  display: grid;
  gap: 20px;
  padding: 0 6vw 40px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-text h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", serif;
  font-size: 24px;
}

.hero-text p {
  margin: 0;
  color: var(--muted);
}

.status {
  min-width: 240px;
  background: #fff6ee;
  border: 1px solid #f0d9c7;
  border-radius: 16px;
  padding: 14px 16px;
}

.status-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-body {
  margin-top: 8px;
  color: var(--muted);
}

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

.profile {
  display: grid;
  gap: 14px;
}

.profile-header h3 {
  margin: 0 0 6px;
  font-family: "Fraunces", serif;
  font-size: 20px;
}

.profile-header p {
  margin: 0;
  color: var(--muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-rank {
  font-weight: 600;
  color: var(--accent-dark);
}

.dataset-toggle {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  font-weight: 500;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

label {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

select,
input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button#reset {
  background: transparent;
  color: var(--accent-dark);
  border-color: var(--accent-dark);
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
}

.pager {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.choices {
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}

.choices-title {
  font-weight: 600;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #fdf4ea;
  position: sticky;
  top: 0;
  z-index: 1;
  cursor: pointer;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:hover td {
  background: #fff8f0;
}

.site-footer {
  padding: 18px 6vw 36px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .site-header {
    padding: 24px 6vw 8px;
  }

  .hero {
    flex-direction: column;
  }

  .filters,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }

  .dataset-toggle {
    gap: 8px;
  }

  .table-wrap {
    border: none;
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    background: #fff8f0;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 8px 10px;
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 6px;
    border-bottom: 1px dashed var(--line);
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
  }
}
