:root {
  --boy: #4a90d9;
  --girl: #e76fa3;
  --bg: #fdf8f4;
  --card: #ffffff;
  --text: #333;
  --muted: #888;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #e8f1fb 0%, var(--bg) 50%, #fbe9f1 100%);
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.card.wide { max-width: 900px; }

h1 { margin: 0 0 8px; text-align: center; }
h2 { margin-top: 28px; font-size: 1.1rem; }
.lead { text-align: center; color: var(--muted); }
.error { background: #fdecea; color: #b3261e; padding: 10px; border-radius: 8px; text-align: center; }

.choices { display: flex; gap: 12px; margin: 24px 0; }
.choice { flex: 1; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block;
  text-align: center;
  padding: 20px 0;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid #ddd;
  border-radius: 12px;
  transition: all 0.15s;
}
.choice.boy input:checked + span { border-color: var(--boy); background: #eaf3fc; color: var(--boy); }
.choice.girl input:checked + span { border-color: var(--girl); background: #fdeef5; color: var(--girl); }
.choice input:focus-visible + span { outline: 3px solid #999; outline-offset: 2px; }

.field { display: block; margin-bottom: 16px; font-weight: 500; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.9em; }
.field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

button {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--boy), var(--girl));
  cursor: pointer;
}
button:hover { opacity: 0.92; }

.results { margin-top: 24px; }
.bar { display: flex; height: 36px; border-radius: 18px; overflow: hidden; background: #eee; }
.bar-boy { background: var(--boy); }
.bar-girl { background: var(--girl); }
.legend { display: flex; justify-content: space-between; margin-top: 10px; font-weight: 600; }
.boy-text { color: var(--boy); }
.girl-text { color: var(--girl); }
.total { text-align: center; color: var(--muted); }

textarea { width: 100%; font-family: inherit; padding: 8px; border-radius: 8px; border: 1px solid #ccc; }
.hint { color: var(--muted); margin-top: -8px; font-size: 0.9em; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
