:root {
  --red: #c8102e;
  --red-dark: #9e0c24;
  --green: #1f6f4a;
  --cream: #fffaf3;
  --ink: #1f2328;
  --muted: #5b6470;
  --line: #e6dccd;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}
a { color: var(--green); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 880px; margin: 0 auto; padding: 16px;
}
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.site-header nav a { margin-left: 16px; text-decoration: none; color: var(--muted); }

main { max-width: 880px; margin: 0 auto; padding: 0 16px 40px; }
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.25; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin: 16px 0;
}
.card h3 { margin: 0 0 4px; }
.optional { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.hint { color: var(--muted); margin: 0 0 12px; font-size: 0.95rem; }

.people { padding-left: 1.4em; margin: 0 0 12px; }
.people li { margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
input[type=text], input[type=date], select {
  width: 100%; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--green); border-color: transparent; }
.icon-btn {
  flex: none; border: none; background: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; padding: 6px 8px;
}
.icon-btn:hover { color: var(--red); }

.rules .rule { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.rules .rule select { width: auto; flex: 1 1 120px; }
.rules .rule label { display: flex; align-items: center; gap: 4px; font-size: 0.9rem; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.grid-2 label { font-size: 0.9rem; color: var(--muted); display: grid; gap: 4px; }

button { font: inherit; cursor: pointer; }
.btn-primary {
  background: var(--red); color: #fff; border: none; border-radius: 999px;
  padding: 14px 32px; font-size: 1.1rem; font-weight: 700;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary {
  background: #fff; color: var(--green); border: 1px solid var(--green);
  border-radius: 999px; padding: 8px 16px;
}
.btn-secondary:hover { background: #eef6f1; }
.draw-row { text-align: center; margin: 20px 0; }
.error { color: var(--red); min-height: 1.4em; margin: 8px 0 0; }

.links { list-style: none; padding: 0; margin: 0 0 12px; }
.links li {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  border-bottom: 1px dashed var(--line); padding: 10px 0;
}
.links .who { font-weight: 600; }
.links .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.links .actions a, .links .actions button {
  font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none;
}
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.content { margin-top: 32px; }
.content h2 { font-size: 1.35rem; margin: 28px 0 8px; }
.steps li { margin-bottom: 8px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--muted); }

.site-footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 24px 16px; border-top: 1px solid var(--line); }

/* reveal page */
.reveal { text-align: center; padding-top: 16px; }
.wheel-wrap { position: relative; width: min(340px, 86vw); margin: 16px auto; }
.wheel-wrap canvas { width: 100%; height: auto; display: block; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 26px solid var(--ink);
}
.result-name { font-size: 2rem; font-weight: 800; color: var(--red); margin: 8px 0; }
.meta { color: var(--muted); }

/* simple pages */
.page { max-width: 720px; }
.page h1 { margin-top: 8px; }
