/* Styles isolés du prototype : préfixe avent- pour limiter les conflits avec le site. */
:root {
  color-scheme: light;
  --avent-forest: #174d3a;
  --avent-green: #23734f;
  --avent-mint: #e7f5ec;
  --avent-red: #b83d49;
  --avent-gold: #f2c75c;
  --avent-cream: #fffaf0;
  --avent-ink: #20342c;
  --avent-muted: #60736a;
  --avent-border: #dce8df;
  --avent-shadow: 0 12px 34px rgba(23, 77, 58, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f4f8f4;
  color: var(--avent-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #e2a927;
  outline-offset: 3px;
}
.skip-link {
  position: absolute; left: 1rem; top: -5rem; z-index: 10;
  padding: .7rem 1rem; background: white; color: var(--avent-forest); border-radius: .6rem;
}
.skip-link:focus { top: 1rem; }
.hero {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem 3.3rem;
  background: radial-gradient(circle at 12% 15%, rgba(255,255,255,.13) 0 2px, transparent 3px),
              radial-gradient(circle at 85% 25%, rgba(255,255,255,.18) 0 3px, transparent 4px),
              linear-gradient(135deg, #123d31, #1f6749 62%, #174b3b);
}
.hero::before, .hero::after {
  content: "❄"; position: absolute; color: rgba(255,255,255,.25); font-size: 4rem;
}
.hero::before { left: 7%; top: 17%; transform: rotate(-15deg); }
.hero::after { right: 8%; bottom: 16%; font-size: 3rem; }
.hero__sparkle { position: absolute; right: 22%; top: 18%; color: var(--avent-gold); font-size: 2rem; }
.eyebrow, .section-kicker {
  margin: 0 0 .35rem; color: var(--avent-green); font-size: .76rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}
.hero .eyebrow { color: #f5d98c; }
.hero h1 { margin: .2rem 0 .75rem; font-size: clamp(2.4rem, 7vw, 4.7rem); line-height: 1.02; letter-spacing: -.045em; }
.hero h1 span { color: #f8d977; }
.hero__intro { max-width: 650px; margin: 0 auto; color: #edf8f0; font-size: clamp(1rem, 2vw, 1.2rem); }
.dragon { position: relative; display: inline-block; margin-top: 1rem; font-size: 3.3rem; animation: dragon-bob 3s ease-in-out infinite; }
.dragon span { position: absolute; top: 0; right: -.8rem; color: #d8f3ff; font-size: 1.3rem; }
@keyframes dragon-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-7px) rotate(3deg); } }
.page-shell { width: min(1080px, calc(100% - 2rem)); margin: -1.2rem auto 3rem; position: relative; }
.level-panel, .progress-panel, .game-card, .friendly-note {
  background: #fff; border: 1px solid var(--avent-border); border-radius: 1.25rem; box-shadow: var(--avent-shadow);
}
.level-panel { padding: clamp(1.1rem, 3vw, 1.7rem); display: grid; grid-template-columns: .8fr 1.5fr; gap: 1.5rem; align-items: center; }
h2 { margin: 0; color: var(--avent-forest); font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.2; }
.muted { margin: .4rem 0 0; color: var(--avent-muted); font-size: .95rem; }
.level-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.level-button {
  min-width: 0; padding: .8rem .45rem; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  border: 2px solid var(--avent-border); border-radius: .9rem; color: var(--avent-ink); background: #fff;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.level-button:hover { transform: translateY(-2px); border-color: #91c4a4; }
.level-button.is-selected { background: var(--avent-mint); border-color: var(--avent-green); box-shadow: inset 0 0 0 1px var(--avent-green); }
.level-emoji { font-size: 1.65rem; }
.level-name { font-weight: 800; font-size: .92rem; }
.level-age { color: var(--avent-muted); font-size: .75rem; text-align: center; }
.progress-panel { padding: 1.25rem clamp(1rem, 3vw, 1.6rem); margin-top: 1.2rem; }
.progress-top, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.progress-count { margin: 0; color: var(--avent-muted); white-space: nowrap; }
.progress-count strong { color: var(--avent-green); font-size: 1.7rem; }
.progress-track { overflow: hidden; height: 9px; margin: 1rem 0 .75rem; border-radius: 20px; background: #eaf0eb; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2c8c5d, #f2c75c); transition: width .35s ease; }
.treasure-row { display: flex; gap: .6rem; }
.treasure { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .7rem; background: #fff4d5; font-size: 1.25rem; }
.treasure.is-locked { filter: grayscale(1); opacity: .4; background: #edf0ed; }
.calendar-section { margin: 2.2rem 0 1.25rem; }
.section-heading { margin-bottom: 1rem; }
.demo-tag { padding: .35rem .7rem; border-radius: 99px; background: #fff0d2; color: #79571b; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.calendar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.day-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 190px;
  padding: 1.1rem; text-align: left; border: 2px solid var(--avent-border); border-radius: 1rem;
  background: linear-gradient(145deg, #fff, #f8fcf8); color: var(--avent-ink);
  box-shadow: 0 5px 15px rgba(23,77,58,.05); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.day-card:hover { transform: translateY(-3px); box-shadow: var(--avent-shadow); }
.day-card.is-active { border-color: var(--avent-green); box-shadow: 0 0 0 3px rgba(35,115,79,.12); }
.day-card.is-complete { background: linear-gradient(145deg, #f1fbf3, #fff); border-color: #91c4a4; }
.day-number { position: absolute; top: .7rem; right: .8rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--avent-forest); color: #fff; font-weight: 900; }
.day-icon { margin: .2rem 0 .8rem; font-size: 2.2rem; }
.day-title { max-width: 13rem; font-size: 1.06rem; font-weight: 850; line-height: 1.25; }
.day-status { margin-top: auto; padding-top: .75rem; color: var(--avent-muted); font-size: .82rem; font-weight: 700; }
.day-card.is-complete .day-status { color: var(--avent-green); }
.game-card { padding: clamp(1.1rem, 4vw, 2rem); }
.game-card__top { display: flex; align-items: center; gap: .9rem; }
.game-icon { display: grid; place-items: center; flex: 0 0 3.5rem; height: 3.5rem; border-radius: 1rem; background: var(--avent-mint); font-size: 1.8rem; }
.game-card__top .section-kicker { margin-bottom: .2rem; }
.challenge-points { margin-left: auto; align-self: flex-start; padding: .35rem .75rem; border-radius: 99px; background: #fcfabd; color: #79571b; font-size: 2.4rem; font-weight: 800; white-space: nowrap; }
.challenge-instruction { margin: 1.25rem 0; font-size: 1.05rem; }
.enigme { display: flex; align-items: center;}
.letter-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1.2rem 0; min-height: 3.7rem; }
.letter-tile { display: grid; place-items: center; width: 2.8rem; height: 3.2rem; border: 1px solid #d7c69b; border-bottom: 4px solid #c7ae79; border-radius: .45rem; background: #fff3cf; color: #3b382d; font-size: 1.4rem; font-weight: 900; box-shadow: 0 2px 0 rgba(75,57,20,.06); }
.hint-line { margin: .5rem 0 1.2rem; color: var(--avent-muted); font-size: 1.4rem; }
#answer-form label { display: block; margin-bottom: .45rem; font-weight: 800; }
.answer-row { display: flex; gap: .65rem; }
.answer-row input { width: 100%; min-width: 0; padding: .8rem 1rem; border: 2px solid #cddbd1; border-radius: .75rem; color: var(--avent-ink); background: #fff; text-transform: uppercase; }
.answer-row input:focus { border-color: var(--avent-gold); }
.submit-button, .next-button {
  border: 0; border-radius: .75rem; padding: .8rem 1.1rem; background: var(--avent-green); color: #fff; font-weight: 850;
  transition: background .18s ease, transform .18s ease;
}
.submit-button:hover, .next-button:hover { background: var(--avent-forest); transform: translateY(-1px); }
.game-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .8rem; }
.text-button, .reset-button { padding: .45rem .2rem; border: 0; background: transparent; color: var(--avent-green); text-decoration: underline; text-underline-offset: 3px; font-weight: 750; }
.text-button:hover, .reset-button:hover { color: var(--avent-red); }
.feedback { min-height: 1.5rem; margin-top: .8rem; font-weight: 750; }
.feedback.is-error { color: #a72d3b; }
.feedback.is-good { color: var(--avent-green); }
.success-panel { display: flex; align-items: center; gap: .9rem; margin-top: 1rem; padding: 1rem; border: 1px solid #b8dfc2; border-radius: .9rem; background: #effaf1; }
.success-medal { font-size: 2.3rem; }
.success-panel h3 { margin: 0; color: var(--avent-forest); }
.success-panel p { margin: .2rem 0 0; }
.next-button { display: block; margin: 1rem 0 0 auto; }
.friendly-note { display: flex; align-items: flex-start; gap: .8rem; margin-top: 1.2rem; padding: 1rem 1.2rem; background: #fffaf0; border-color: #f0e1b6; box-shadow: none; }
.friendly-note > span { font-size: 1.5rem; }
.friendly-note p { margin: 0; }
.reset-row { text-align: center; margin: 1.2rem 0; }
.reset-button { color: var(--avent-muted); font-size: .85rem; }
.site-footer { padding: 1.3rem; text-align: center; background: #123d31; color: #eaf6ed; font-size: .88rem; }
.site-footer p { margin: 0; }
.reset-dialog { width: min(420px, calc(100% - 2rem)); padding: 1.5rem; border: 0; border-radius: 1rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--avent-ink); }
.reset-dialog::backdrop { background: rgba(8, 31, 23, .55); }
.reset-dialog h2 { font-size: 1.4rem; }
.reset-dialog p { color: var(--avent-muted); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1rem; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .level-panel { grid-template-columns: 1fr; gap: 1rem; }
  .calendar-grid { gap: .65rem; }
  .day-card { min-height: 170px; padding: .8rem; }
  .day-title { font-size: .94rem; }
  .day-number { top: .55rem; right: .55rem; width: 1.7rem; height: 1.7rem; font-size: .85rem; }
  .day-icon { font-size: 1.8rem; }
}
@media (max-width: 520px) {
  .page-shell { width: min(100% - 1rem, 1080px); }
  .level-options { gap: .4rem; }
  .level-button { padding: .7rem .25rem; }
  .level-name { font-size: .78rem; }
  .level-age { font-size: .68rem; }
  .calendar-grid { grid-template-columns: 1fr; }
  .day-card { min-height: 0; display: grid; grid-template-columns: 2.2rem 2.5rem 1fr; align-items: center; gap: .5rem; padding: .8rem; }
  .day-number { position: static; grid-row: span 2; }
  .day-icon { margin: 0; grid-row: span 2; }
  .day-title { max-width: none; }
  .day-status { margin: 0; padding: 0; }
  .section-heading { align-items: flex-start; }
  .demo-tag { font-size: .68rem; }
  .game-card__top { align-items: flex-start; gap: .65rem; }
  .game-icon { flex-basis: 2.8rem; height: 2.8rem; font-size: 1.5rem; }
  .challenge-points { font-size: .68rem; padding: .3rem .45rem; }
  .answer-row { flex-direction: column; }
  .answer-row .submit-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Affichage spécifique de l'énigme du dragon */
.riddle-text {
  margin: 1.2rem 0;
  padding: 1.2rem 1.4rem;
  border: 2px solid #dce8df;
  border-left: 5px solid #23734f;
  border-radius: 12px;
  background: #f4faf5;
  color: #20342c;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
}

.riddle-text[hidden] {
  display: none;
}