/* ===== Thème Elyade (elyade.com) + touches de Noël ===== */
@font-face { font-family: "Work Sans"; font-weight: 400 700; src: url(/fonts/worksans.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Open Sans"; font-weight: 400; src: url(/fonts/opensans-regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Open Sans"; font-weight: 600; src: url(/fonts/opensans-semibold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Open Sans"; font-weight: 700; src: url(/fonts/opensans-bold.woff2) format("woff2"); font-display: swap; }

:root {
  --brand: #ca0088;       /* magenta Elyade */
  --brand-hover: #a2006d;
  --plum: #650044;
  --black: #000;
  --ink: #000;
  --muted: #707070;
  --line: #e6e6e6;
  --line-2: #cacaca;
  --bg: #f2f2f2;
  --card: #fff;
  --gold: #ffae00;
  --pine: #1f5e3a;
  --ok: #157539;
  --warn: #805700;
  --bad: #c00;
  --head-font: "Work Sans", helvetica, roboto, arial, sans-serif;
  --body-font: "Open Sans", helvetica, roboto, arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex; flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--head-font); font-weight: 500; }
/* La police Work Sans du site a une table de crénage défectueuse (ex. « RGPD » tronqué) : on la désactive. */
h1, h2, h3, .qtext, .timer, .countdown .num, .qhead .progress { font-kerning: none; font-feature-settings: "kern" 0; }
.no-select { user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }
.mt { margin-top: 18px; }

/* ----- En-tête ----- */
header.top {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: #fff; border-bottom: 3px solid var(--brand);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); }
.logo { position: relative; display: inline-block; line-height: 0; }
.logo img.logo-img { height: 46px; width: auto; }
.logo .hat { position: absolute; width: 32px; left: -11px; top: -9px; transform: rotate(-18deg); }
header.top h1 { font-size: 20px; margin: 0; letter-spacing: .01em; }
header.top h1 small { display: block; font-family: var(--body-font); font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
header.top .who { font-size: 13px; color: var(--muted); text-align: right; }
header.top .who a { color: var(--brand); font-weight: 600; text-decoration: none; }
header.top .who a:hover { text-decoration: underline; }
.garland {
  height: 34px; margin-top: -3px; position: relative; z-index: 4; pointer-events: none;
  background: url(/img/garland.svg) repeat-x 0 0 / 240px 34px;
}

main { width: 100%; max-width: 860px; margin: 0 auto; padding: 18px 16px 56px; flex: 1; position: relative; z-index: 2; }
main.wide { max-width: 1200px; }

footer.bottom {
  background: var(--black); color: #fff; font-size: 12px; text-align: center;
  padding: 18px 16px; position: relative; z-index: 2;
}
footer.bottom .holly { width: 28px; vertical-align: middle; margin: 0 8px; }

/* ----- Cartes & typographie ----- */
.card {
  background: var(--card); border: 1px solid var(--line);
  padding: 30px; margin-bottom: 20px; position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.card::before { /* liseré magenta façon logo */
  content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 4px; background: var(--brand);
}
.center { text-align: center; }
.center.card::before { left: 50%; transform: translateX(-50%); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { margin: 0 0 12px; font-size: 26px; }
h3 { margin: 0 0 10px; font-size: 18px; }
.title-holly { width: 34px; vertical-align: -4px; margin-left: 8px; }

/* ----- Boutons (angles droits comme sur elyade.com) ----- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 0; padding: .9em 1.6em;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff; letter-spacing: .02em;
  transition: background-color .25s ease-out, color .25s ease-out;
}
.btn:hover, .btn:focus-visible { background: var(--brand-hover); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--black); border-color: var(--black); }
.btn.secondary:hover { background: var(--black); color: #fff; }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.big { padding: 1em 2.4em; font-size: 18px; }

.pill { display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.pill.ok { background: #e2f3e8; color: var(--ok); }
.pill.warn { background: #fff3d6; color: var(--warn); }
.pill.bad { background: #fde6e6; color: var(--bad); }
.pill.neutral { background: #f7e1f0; color: var(--plum); }

/* ----- Compte à rebours : des cadeaux ----- */
.countdown { display: flex; justify-content: center; gap: 22px; margin: 40px 0 26px; flex-wrap: wrap; }
.countdown .unit {
  position: relative; min-width: 112px; padding: 22px 10px 16px;
  background: var(--black); color: #fff;
  border-bottom: 5px solid var(--brand);
}
.countdown .unit::before { /* ruban vertical */
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 10px; transform: translateX(-50%);
  background: var(--gold); opacity: .9; z-index: 0;
}
.countdown .unit::after { /* nœud */
  content: ""; position: absolute; top: -18px; left: 50%; width: 40px; height: 24px; transform: translateX(-50%);
  background: url(/img/bow.svg) no-repeat center / contain;
}
.countdown .num, .countdown .lbl { position: relative; z-index: 1; background: var(--black); display: table; margin: 0 auto; }
.countdown .num { font-family: var(--head-font); font-size: 50px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; padding: 4px 8px; }
.countdown .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; margin-top: 6px; font-weight: 700; padding: 2px 6px; }

/* ----- Quiz ----- */
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.qhead .progress { font-family: var(--head-font); font-weight: 600; font-size: 18px; }
.timer { font-family: var(--head-font); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--brand); }
.timer.low { color: var(--bad); }
.bar { height: 6px; background: var(--line); overflow: hidden; margin-bottom: 24px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--plum), var(--brand)); width: 100%; transition: width .2s linear; }
.bar.low > div { background: var(--bad); }
.qtext { font-family: var(--head-font); font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.qhint { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.choices { display: grid; gap: 10px; margin-bottom: 24px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line-2); cursor: pointer; background: #fff;
  border-left: 4px solid var(--line-2);
  transition: border-color .15s, background-color .15s;
}
.choice:hover { border-color: var(--brand); }
.choice.selected { border-color: var(--brand); border-left-color: var(--brand); background: #fcf0f8; }
.choice input { width: 18px; height: 18px; accent-color: var(--brand); }
.qfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.rules { text-align: left; margin: 20px auto; max-width: 580px; padding: 0; list-style: none; }
.rules li { margin: 10px 0; padding-left: 28px; position: relative; }
.rules li::before { content: "❄"; position: absolute; left: 0; color: var(--brand); }

/* ----- Alerte anti-triche ----- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.overlay .card { max-width: 520px; text-align: center; border-top: 6px solid var(--bad); }
.overlay .card::before { display: none; }
.overlay h2 { color: var(--bad); }

/* ----- Neige ----- */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.snow span {
  position: absolute; top: -20px; color: #fff; user-select: none;
  text-shadow: 0 0 3px rgba(101, 0, 68, .35);
  animation: snowfall linear infinite;
}
@keyframes snowfall {
  0% { transform: translate3d(0, -20px, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift, 30px), 105vh, 0) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .snow { display: none; } }

/* ----- Admin ----- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
label.field { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
label.field input, label.field textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line-2); border-radius: 0; background: #fff;
}
label.field input:focus, label.field textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea { min-height: 160px; font-family: Consolas, monospace; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #fff; background: var(--black); }
td input.dur { width: 72px; padding: 6px 8px; border: 1px solid var(--line-2); font: inherit; }
.ans { color: var(--ok); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.status { padding: 10px 14px; margin-top: 10px; font-size: 14px; }
.status.ok { background: #e2f3e8; color: var(--ok); }
.status.err { background: #fde6e6; color: var(--bad); }
details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.rank { font-weight: 700; font-size: 18px; }
.podium-1 { background: #fff6dc; }
.podium-2 { background: #f4f4f4; }
.podium-3 { background: #fbeee4; }
tr.test { opacity: .55; }
.tabs { display: flex; gap: 0; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 2px solid var(--black); }
.tabs button {
  border: 0; background: transparent; color: var(--black); padding: 12px 20px;
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 0;
}
.tabs button:hover { color: var(--brand); }
.tabs button.active { background: var(--black); color: #fff; }

@media (max-width: 600px) {
  header.top { padding: 12px 16px; }
  header.top h1 { font-size: 16px; }
  .logo img.logo-img { height: 36px; }
  .countdown .unit { min-width: 76px; }
  .countdown .num { font-size: 34px; }
  .card { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { .garland { background-image: url(/img/garland-static.svg); } }
