:root {
  --bg: #f3efe6;
  --panel: rgba(255, 252, 246, 0.92);
  --ink: #1d1c1a;
  --muted: #6f675b;
  --accent: #a34a28;
  --accent-strong: #7f3418;
  --border: rgba(29, 28, 26, 0.12);
  --shadow: 0 18px 50px rgba(42, 32, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(163, 74, 40, 0.18), transparent 30%),
    linear-gradient(180deg, #f8f3ea 0%, #efe8dc 100%);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  padding: 24px 0 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
.rank {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  line-height: 0.96;
}

.lede {
  max-width: 44rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff7f1;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.button-secondary {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(127, 52, 24, 0.24);
  box-shadow: none;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding: 18px;
}

.card-head {
  margin-bottom: 12px;
}

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

.stack,
.row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  flex-direction: row;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: 0;
}

.label {
  color: var(--muted);
}

.value {
  text-align: right;
}

.muted {
  color: var(--muted);
}

.error {
  color: #9e2f16;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
}

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

.actions .button {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
}

.options-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

.options-table th,
.options-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.options-table th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

@media (max-width: 800px) {
  .grid,
  .cards {
    grid-template-columns: 1fr;
  }

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

  .section-header {
    flex-direction: column;
  }
}

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