:root {
  --bg: #f6f3ee; --card: #fff; --text: #1d1b19; --muted: #6b655e; --line: #e4ded5;
  --primary: #c0392b; --primary-ink: #fff; --wa: #1fa855; --ok: #1f7a4d; --err: #b3261e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161413; --card: #211e1c; --text: #f1ece6; --muted: #a39b92; --line: #38322e;
    --primary: #e0574a; --ok: #5cc48f; --err: #ff8a80; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; padding: 16px; }
.top { text-align: center; margin: 16px auto 24px; }
.top h1 { margin: 0; font-size: 2rem; }
h2 { font-size: 1.1rem; margin: 24px 0 12px; }
.card { max-width: 820px; margin: 0 auto 24px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.row.space { justify-content: space-between; }
.participant input { flex: 1 1 160px; }
.num { width: 1.6em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn { font: inherit; border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.big { width: 100%; padding: 14px; font-size: 1.1rem; margin-top: 16px; }
.btn.icon { padding: 6px 10px; }
.btn.wa { background: var(--wa); color: #fff; border-color: transparent; padding: 6px 14px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; }
.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; }
.error { color: var(--err); min-height: 1em; }
.small { font-size: .8rem; }
.notice { background: color-mix(in srgb, var(--ok) 12%, transparent); border-radius: 10px; padding: 12px; margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th, .table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.right { text-align: right; }
.mono { font-family: ui-monospace, monospace; font-size: .9rem; }
.tag { font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { color: var(--ok); } .tag.sent { color: var(--wa); } .tag.err { color: var(--err); }
@media (max-width: 560px) { .table th:nth-child(2), .table td:nth-child(2) { display: none; } }

/* Página de revelación */
.reveal { max-width: 440px; text-align: center; margin-top: 10vh; }
.reveal h1 { margin: 4px 0 12px; }
.secret { font-size: 2.2rem; font-weight: 800; color: var(--primary); margin: 16px 0; animation: pop .5s ease-out; }
.details { list-style: none; padding: 0; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
