:root {
  --green: #3f9b2f;
  --green-d: #2d7a20;
  --red: #d6161d;
  --red-l: #fff1f1;
  --ink: #1f2a1c;
  --muted: #6b7768;
  --line: #e1e8dc;
  --bg: #f3f6f1;
  --card: #fff;
  --amber: #f39c12;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Nunito, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
body.festive { background: radial-gradient(ellipse at top, #2f6b2a 0%, #173d16 60%, #0f2a0f 100%); }
h1, h2, .btn, .steps, .target .name { font-family: Fredoka, Nunito, sans-serif; }

.wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; position: relative; z-index: 1; }
/* ---- logos (PNG transparents : aucun cadre sur le fond) */
.logo { display: block; width: min(320px, 80%); margin: 8px auto 20px; }
.brand { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 4vw, 22px); margin: 8px auto 22px; text-decoration: none; width: fit-content; }
.brand .santa { height: clamp(70px, 20vw, 96px); width: auto; }
.brand .lab { height: clamp(46px, 13vw, 62px); width: auto; }
.brand .sep { width: 3px; align-self: stretch; margin: 8px 0; background: #5e5e60; border-radius: 2px; opacity: .8; }
body.festive .brand { background: #fff; border-radius: 18px; padding: 10px 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(20, 50, 15, .10);
  border: 1px solid var(--line);
  border-top: 8px solid var(--red);
}
.card h1 { text-align: center; font-size: 30px; margin: 4px 0 8px; color: var(--green); line-height: 1.15; }
.card h1.red { color: var(--red); font-size: 38px; }
.lead { text-align: center; font-size: 19px; margin: 0 0 18px; line-height: 1.45; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.big-ico { font-size: 64px; text-align: center; line-height: 1; margin: 8px 0 10px; }

/* ---- stepper */
.steps { list-style: none; display: flex; padding: 0; margin: 0 0 22px; gap: 4px; }
.steps li { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 13px; font-weight: 600; }
.steps li:not(:first-child)::before {
  content: ""; position: absolute; top: 16px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: 0;
}
.steps li.done:not(:first-child)::before, .steps li.active:not(:first-child)::before { background: var(--green); }
.steps .dot {
  position: relative; z-index: 1; display: grid; place-items: center; margin: 0 auto 6px;
  width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--line); font-size: 15px;
}
.steps li.done { color: var(--green); }
.steps li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.steps li.active { color: var(--red); }
.steps li.active .dot { border-color: var(--red); color: var(--red); animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(214, 22, 29, .45); } 100% { box-shadow: 0 0 0 12px rgba(214, 22, 29, 0); } }

/* ---- form */
.form { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .row2 { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
input {
  font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: #fbfcfa; color: var(--ink); width: 100%;
}
input:focus { outline: none; border-color: var(--green); background: #fff; }
/* ---- raclette */
.raclette { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fbfcfa; display: grid; gap: 12px; }
.raclette.on { border-color: #f0c34a; background: #fffaeb; }
.raclette .check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; font-size: 16px; cursor: pointer; line-height: 1.35; }
.raclette .check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--green); cursor: pointer; }
.raclette .places { display: none; font-size: 15px; }
.raclette.on .places { display: grid; }
.raclette .places input { max-width: 140px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { background: var(--red-l); color: var(--red); border: 1px solid #f6c9cb; padding: 10px 14px; border-radius: 12px; margin: 0; font-weight: 700; }

.btn {
  font-size: 20px; font-weight: 600; border: 0; border-radius: 14px; padding: 15px 22px; cursor: pointer;
  background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); transition: transform .08s, box-shadow .08s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.btn.ghost { background: #fff; color: var(--green); border: 2px solid var(--green); box-shadow: none; }
.btn.small { font-size: 15px; padding: 9px 16px; }
a.btn { display: inline-block; text-decoration: none; }
.vote-link { margin: 18px 0 6px; }

/* ---- check mail */
.card.attention { border-top-color: var(--amber); }
.card.attention h1 { color: var(--red); }
.todo {
  background: #fff8e8; border: 2px dashed var(--amber); border-radius: 16px; padding: 16px; text-align: center;
  font-size: 17px; line-height: 1.9; margin-bottom: 14px; word-break: break-word;
}
.fake-btn { display: inline-block; background: var(--green); color: #fff; font-weight: 700; padding: 2px 12px; border-radius: 8px; line-height: 1.6; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.12) rotate(-6deg); } }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---- tirage */
.card.party { border-top-color: var(--green); }
.bounce { animation: bounce 1.8s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
.target {
  display: block; width: 100%; border: 3px dashed var(--red); background: var(--red-l); border-radius: 18px;
  padding: 22px 12px; margin: 0 0 20px; text-align: center; cursor: pointer; font: inherit; color: var(--red); position: relative;
}
.target .name { font-size: 34px; font-weight: 700; transition: filter .3s; word-break: break-word; }
.target .hint { display: none; position: absolute; inset: 0; place-items: center; font-weight: 700; color: var(--ink); font-size: 17px; }
.target.hidden .name { filter: blur(14px); }
.target.hidden .hint { display: grid; }
.target .hide-hint { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.target.hidden .hide-hint { visibility: hidden; }
.rules { display: grid; gap: 10px; }
.rule { display: flex; gap: 12px; align-items: flex-start; background: #f6f9f4; border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.4; }
.rule .ico { font-size: 24px; line-height: 1; }

/* ---- neige */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow i { position: absolute; top: -30px; color: #fff; font-style: normal; animation: fall linear infinite; }
@keyframes fall { to { transform: translate(30px, 110vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .snow, .pulse, .bounce, .steps li.active .dot { animation: none; display: revert; } .snow { display: none; } }

/* ================= vote de date ================= */
.wrap.wide { max-width: 880px; }
.okmsg { background: #e7f5e3; color: var(--green-d); font-weight: 700; text-align: center; padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; }

.when { text-align: center; margin: -2px 0 16px; }
.when { font-size: 18px; }
.when b { display: inline-block; background: var(--red); color: #fff; font-family: Fredoka, sans-serif; font-size: 22px; padding: 2px 14px; border-radius: 10px; margin-left: 4px; }
.infos { margin-bottom: 18px; }
.infos a { color: var(--green-d); font-weight: 700; white-space: nowrap; }
.whorow { display: flex; align-items: center; justify-content: center; gap: 12px; }
.whorow input { flex: 0 1 34%; min-width: 180px; }
.whorow span { font-size: 18px; font-weight: 700; white-space: nowrap; }
hr.mini { width: 90px; border: 0; border-top: 3px dotted #cfd6ca; margin: 0 auto 18px; }
/* barre des jours */
.daybar { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 0; margin: 4px 0 6px; }
.week { display: flex; gap: 8px; padding: 0 14px; }
.week + .week { border-left: 3px dashed var(--line); }
.day { width: 66px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; user-select: none; position: relative; font-weight: 400; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.day .dl { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; }
.day .dl b { display: block; color: var(--ink); font-size: 15px; white-space: nowrap; }
.day .box {
  width: 100%; height: 66px; border-radius: 14px; background: #dcdfd9; display: grid; place-items: center;
  font-family: Fredoka, sans-serif; font-weight: 700; font-size: 17px; color: transparent;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.day .box::after { content: "OUI !"; }
.day:hover .box { background: #cdd2c9; }
.day input:checked ~ .box { background: var(--green); color: #fff; transform: scale(1.06); box-shadow: 0 4px 0 var(--green-d); }
.day input:focus-visible ~ .box { outline: 3px solid var(--amber); outline-offset: 2px; }
@media (max-width: 820px) {
  .daybar { flex-direction: column; gap: 14px; }
  .week { padding: 0; gap: 6px; width: 100%; }
  .week + .week { border-left: 0; border-top: 3px dashed var(--line); padding-top: 14px; }
  .day { flex: 1; width: auto; min-width: 0; }
  .day .box { height: 58px; font-size: 15px; }
}

/* résultats */
.bestday { background: #fff3c4; border: 2px solid #f0c34a; border-radius: 14px; padding: 12px 16px; text-align: center; font-size: 17px; margin: 0 0 16px; }
.bestday b { color: #8a6200; }
.bestday span { color: var(--muted); }
.empty-votes { text-align: center; color: var(--muted); padding: 20px 0; }
.scroll { overflow-x: auto; margin: 0 -10px 10px; padding: 0 10px; }
table.res { border-collapse: separate; border-spacing: 4px; margin: 0 auto; }
table.res th, table.res td { padding: 0; }
table.res .nm { text-align: left; white-space: nowrap; font-weight: 700; padding-right: 10px; position: sticky; left: 0; background: #fff; z-index: 1; }
table.res th.nm { font-size: 13px; color: var(--muted); font-weight: 600; }
table.res .gap { width: 10px; min-width: 10px; border-left: 3px dashed var(--line); background: none; }
table.res th.dh { font-size: 12px; color: var(--muted); text-align: center; min-width: 50px; padding: 6px 2px; border-radius: 10px; line-height: 1.2; font-weight: 700; }
table.res th.dh b { display: block; color: var(--ink); font-size: 13px; white-space: nowrap; }
table.res td.c { height: 34px; border-radius: 8px; background: #eef1ec; text-align: center; font-weight: 700; font-size: 13px; color: #fff; }
table.res td.c.yes { background: var(--green); }
table.res .best { background: #fff3c4; }
table.res th.dh.best { color: #8a6200; }
table.res td.c.best:not(.yes) { background: #fff6d6; }
table.res td.c.yes.best { background: var(--green-d); box-shadow: inset 0 0 0 2px #f0c34a; }
table.res td.cnt { text-align: center; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 18px; padding: 6px 0; border-radius: 10px; background: #f6f9f4; line-height: 1.1; }
table.res td.cnt.best { background: #f0c34a; color: var(--ink); font-size: 20px; }
table.res tfoot .nm { color: var(--muted); }
