:root {
  color-scheme: light;
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-soft: #fbfaf8;
  --text: #181716;
  --muted: #68635d;
  --line: #ded9d0;
  --line-strong: #c9c1b6;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #dcefeb;
  --ink: #24211f;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(31, 28, 24, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #efede8 0, #f7f6f3 320px, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }

button, .button, .linkButton {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover, .button:hover, .linkButton:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  border-color: var(--ink);
  background: #f4f1eb;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid rgba(201, 193, 182, 0.72);
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.1; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }

.siteNav {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.siteNav a {
  min-height: 34px;
  border-radius: 6px;
  padding: 8px 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.siteNav a:hover { color: var(--text); background: #f4f1eb; }
.siteNav a.active { background: var(--ink); color: #fff; }

.pageShell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.pageShell.narrow { width: min(960px, calc(100% - 40px)); }

.pageIntro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pageIntro.split { align-items: center; }
.pageIntro.compactIntro { align-items: center; justify-content: space-between; padding: 18px; }
.pageIntro.compactIntro h1 { font-size: 24px; }
.headerActions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1, h2, p { margin: 0; }
h1 { font-size: 34px; line-height: 1.08; }
h2 { font-size: 18px; line-height: 1.2; }
p { color: var(--muted); line-height: 1.55; }

.notice, .empty, .formPanel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.notice {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff7f5;
  color: var(--danger);
}

.notice.success { display: none; }

.revealPanel {
  margin-top: 20px;
  border: 1px solid rgba(15, 118, 110, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, #f0faf7 0%, #ffffff 100%);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: revealIn 420ms ease-out both;
}

.revealIntro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.18);
}

.revealIntro span, .revealCard span {
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.revealIntro strong {
  font-size: 18px;
}

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

.revealCard {
  border: 1px solid rgba(201, 193, 182, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  transform: translateY(8px);
  opacity: 0;
  animation: revealCardIn 360ms ease-out 140ms both;
}

.revealCard:nth-child(2) { animation-delay: 220ms; }

.revealCard.winner {
  border-color: rgba(15, 118, 110, 0.55);
  background: #f8fffc;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.revealCard h2 { margin-top: 8px; }
.revealCard p { margin-top: 6px; }

@keyframes revealIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes revealCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty code {
  display: block;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  background: #f2efe9;
  color: #1f1d1b;
  font-size: 13px;
}

.promptPanel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.promptPanel strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
}

.promptPanel p {
  max-width: 1100px;
}

.matchSummary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.matchSummary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.matchSummary span, .tablePanel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.matchSummary strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.comparisonGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.setCard {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fffdfa;
}

.setHeader p { margin-top: 5px; font-size: 14px; }
.voteButton { min-width: 138px; }

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

.assetFrame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f5f0;
}

.assetFrame img {
  display: block;
  width: 100%;
  height: 330px;
  object-fit: contain;
  background: #fff;
}

.assetFrame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.assetFrame figcaption span { white-space: nowrap; }

.tablePanel {
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f4f1eb; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
td { color: var(--ink); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaf8; }
td strong, td small { display: block; }
td small { margin-top: 4px; }

.rankBadge {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 850;
}

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

.methodGrid article {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.methodGrid span {
  display: inline-flex;
  margin-bottom: 26px;
  color: #9a5b13;
  font-size: 12px;
  font-weight: 850;
}

.methodGrid h2 { margin-bottom: 8px; }

.aboutContent {
  margin-top: 20px;
  display: grid;
  gap: 20px;
}

.aboutContent article {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.aboutContent article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.aboutContent h2 {
  margin-bottom: 8px;
}

.formPanel form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--ink); font-weight: 750; }
textarea, input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.siteFooter {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.siteFooter a {
  color: var(--ink);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .siteHeader, .pageIntro, .pageIntro.split { align-items: stretch; flex-direction: column; }
  .brand { min-width: 0; }
  .siteHeader { position: static; padding: 16px 20px; }
  .siteNav { width: 100%; overflow-x: auto; }
  .siteNav a { flex: 1; text-align: center; }
  .comparisonGrid, .methodGrid, .revealGrid { grid-template-columns: 1fr; }
  .headerActions { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .pageShell, .pageShell.narrow { width: min(100% - 24px, 1480px); padding-top: 20px; }
  .pageIntro { padding: 20px; }
  h1 { font-size: 28px; }
  .matchSummary { grid-template-columns: 1fr; }
  .setHeader, .headerActions { align-items: stretch; flex-direction: column; }
  .assetGrid { grid-template-columns: 1fr; }
  .assetFrame img { height: 280px; }
  .tablePanel { overflow-x: auto; }
  table { min-width: 680px; }
}
