:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2b2b;
  --muted: #8a8a8a;
  --accent: #e8743b;
  --accent-ink: #ffffff;
  --line: #ece7df;
  --yes: #e23b6d;
  --no: #9aa0a6;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 16px;
}
.brand {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.foot {
  margin-top: auto;
  padding: 24px 0 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

h1 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; }
h2 { margin: 0; }
.lead { font-size: 18px; margin: 6px 0; }
.muted { color: var(--muted); }
code {
  background: #f1ece4;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.center { text-align: center; }

.btnrow {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.btnrow.sub { margin-top: 10px; }
button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
}
button.big { padding: 14px 28px; font-size: 17px; }
button.link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 6px;
}

.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.thumb {
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.counter { color: var(--muted); margin: 4px 0; }
.progress {
  width: 100%;
  max-width: 520px;
  height: 8px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
.progress .bar { height: 100%; background: var(--accent); transition: width 0.2s; }
.bigimg {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bigimg img { width: 100%; height: 100%; object-fit: contain; }
.bigimg.result { max-width: 480px; }

.choice {
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.choice.yes { background: var(--yes); }
.choice.no { background: var(--no); }

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.vs-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.05s;
}
.vs-pick:hover { border-color: var(--accent); }
.vs-pick:active { transform: scale(0.99); }
.vs-pick img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; }
.vs-pick span { font-weight: 600; color: var(--accent); }
.vs-or { color: var(--muted); font-weight: 600; }

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

/* Lightbox */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lb img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 8px; }
.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  background: none;
  border: none;
  color: #fff;
  padding: 0 14px;
}
.lb-nav.prev { left: 6px; }
.lb-nav.next { right: 6px; }
.lb-cap {
  position: absolute;
  bottom: 16px;
  color: #fff;
  opacity: 0.8;
  font-size: 14px;
}
