/* ============================================================
   Borne Explore Savoie — styles communs à toutes les pages
   Charte : Bricolage Grotesque, rouge #E4032E, navy éditorial
   Interface 100 % tactile (iPad) ; la souris fait la même chose.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --rouge: #E4032E; --rouge-fonce: #A50021;
  --vert: #1F9D55;  --vert-fonce: #12703B;
  --bleu: #2563EB;  --bleu-fonce: #1B49B8;
  --navy: #1B2B47;  --navy-deep: #101C33;
  --gris-texte: #5A6B8C;
  --texte-doux: #8fa0c6;
}

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('bricolage-latin.woff2') format('woff2');
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--navy-deep);
  font-family: "Avenir Next", "Segoe UI", Futura, sans-serif;
  user-select: none;
  color: #fff;
}

/* ---- Décor : nuit alpine + montagnes ---- */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #22355c 0%, transparent 60%),
    radial-gradient(ellipse 80% 40% at 50% 110%, #182a4a 0%, transparent 60%),
    linear-gradient(180deg, #101c33 0%, #16253f 55%, #12203a 100%);
  z-index: -2;
}
body::after {
  content: "";
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 30vh;
  z-index: -1; opacity: .45;
  pointer-events: none;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 340" preserveAspectRatio="xMidYMax slice"><path d="M0 340 L180 140 L300 250 L470 60 L620 220 L800 90 L960 240 L1130 110 L1300 260 L1450 150 L1600 340 Z" fill="%231d2c4e"/><path d="M0 340 L120 240 L280 300 L430 190 L600 310 L780 210 L950 320 L1120 230 L1310 330 L1470 260 L1600 340 Z" fill="%23243659"/></svg>') bottom center / cover no-repeat;
}
.flake {
  position: absolute; top: -4vh;
  color: #fff;
  animation: fall linear infinite;
  z-index: -1;
}
@keyframes fall { to { transform: translateY(110vh) translateX(6vw); } }

/* ---- Écrans ---- */
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3vh;
  padding: 4vh 6vw 16vh;
  text-align: center;
}
.screen.active { display: flex; }

.logo { height: 10vh; filter: drop-shadow(0 0 2vh rgba(159,178,232,.3)); }

/* ---- Titres éditoriaux : Bricolage + barre rouge ---- */
h1, .title {
  font-family: 'Bricolage Grotesque', 'Avenir Next', sans-serif;
  font-size: 5.5vh; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: #fff;
}
h1::after, .title::after {
  content: "";
  display: block;
  width: 10vh; height: .7vh;
  background: var(--rouge);
  margin: 1.6vh auto 0;
  border-radius: .35vh;
}
.subtitle { font-size: 2.6vh; color: var(--texte-doux); letter-spacing: .1em; line-height: 1.5; max-width: 78vw; }
.subtitle b { color: #fff; }
.news-question {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 5vh; font-weight: 700;
  letter-spacing: .04em;
}

/* ---- Blocs lot / gain ---- */
.prize-teaser {
  background: var(--rouge);
  border-radius: 2vh;
  padding: 2.5vh 5vh;
  font-size: 2.8vh; font-weight: 700;
}
.prize-teaser b { color: #fff; }
.press-start { font-size: 3vh; font-weight: 700; animation: blink 1.4s ease-in-out infinite alternate; }
.press-start .dot { color: var(--vert); }
@keyframes blink { from { opacity: .45; } to { opacity: 1; } }

.win-box {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: linear-gradient(180deg, var(--rouge), var(--rouge-fonce));
  color: #fff;
  border-radius: 2.5vh;
  padding: 3.5vh 6vh;
  font-size: 4vh; font-weight: 700;
  letter-spacing: .1em;
  box-shadow: 0 0 8vh rgba(228,3,46,.5), 0 2vh 5vh rgba(0,0,0,.5);
  animation: winpulse .8s ease-in-out infinite alternate;
}
.win-box small { display: block; font-size: 2.4vh; font-weight: 700; margin-top: 1vh; letter-spacing: .02em; }
@keyframes winpulse { from { transform: scale(1); } to { transform: scale(1.04); } }

.score-big {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 12vh; font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4vh rgba(255,255,255,.2);
}

/* ---- Progression (quiz) ---- */
.progress { display: flex; gap: 1.5vh; }
.pdot { width: 2.4vh; height: 2.4vh; border-radius: 50%; background: #2a3560; border: .3vh solid #44507e; }
.pdot.current { background: #fff; border-color: #fff; box-shadow: 0 0 1.5vh rgba(255,255,255,.7); }
.pdot.good { background: var(--vert); border-color: var(--vert); }
.pdot.bad  { background: var(--rouge); border-color: var(--rouge); }

/* ---- Carte question + réponses colorées ---- */
.question-card {
  background: #fff; color: #17203f;
  border-radius: 2.5vh;
  padding: 4vh 6vh;
  font-size: 4.2vh; font-weight: 800;
  max-width: 80vw;
  box-shadow: 0 2vh 6vh rgba(0,0,0,.5);
  border-bottom: 1vh solid var(--rouge);
}
.answers { display: flex; gap: 3vh; width: 86vw; }
.answer {
  flex: 1;
  border-radius: 2vh;
  padding: 3.5vh 2vh 4.5vh;
  font-size: 3.2vh; font-weight: 700;
  color: #fff;
  position: relative;
  box-shadow: 0 1.5vh 4vh rgba(0,0,0,.45), inset 0 .4vh 0 rgba(255,255,255,.25);
  transition: transform .15s, filter .15s, opacity .3s;
}
.answer .btn-tag {
  position: absolute; top: -2.2vh; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 1vh;
  font-size: 2vh; font-weight: 800;
  padding: .6vh 1.6vh;
  box-shadow: 0 .5vh 1.5vh rgba(0,0,0,.4);
}
.answer.rouge { background: linear-gradient(180deg, var(--rouge), var(--rouge-fonce)); }
.answer.rouge .btn-tag { color: var(--rouge-fonce); }
.answer.vert  { background: linear-gradient(180deg, var(--vert), var(--vert-fonce)); }
.answer.vert .btn-tag { color: var(--vert-fonce); }
.answer.bleu  { background: linear-gradient(180deg, var(--bleu), var(--bleu-fonce)); }
.answer.bleu .btn-tag { color: var(--bleu-fonce); }
.answer.chosen { transform: scale(1.06); filter: brightness(1.15); }
.answer.correct { outline: .8vh solid #fff; transform: scale(1.06); }
.answer.faded { opacity: .3; }

.feedback { font-size: 3.4vh; font-weight: 800; min-height: 4.5vh; }
.feedback.good { color: var(--vert); }
.feedback.bad { color: var(--rouge); }

/* ---- Emojis animés (réponses niveau enfant) ---- */
.fun-icon {
  display: block;
  font-size: 6.5vh;
  line-height: 1.1;
  margin-bottom: .8vh;
}
.fun-0 { animation: fun-bounce 1.5s ease-in-out infinite; }
.fun-1 { animation: fun-wiggle 1.8s ease-in-out infinite; }
.fun-2 { animation: fun-float 2s ease-in-out infinite; }
@keyframes fun-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2vh); } }
@keyframes fun-wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes fun-float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-.8vh) scale(1.08); } }

/* ---- Chips de navigation (carrousels) ---- */
.chip-row { display: flex; gap: 3.5vh; font-size: 2.3vh; font-weight: 700; align-items: center; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 1vh;
  background: rgba(255,255,255,.08);
  border-radius: 100vh;
  padding: 1vh 2.2vh;
}
.cdot { width: 2.2vh; height: 2.2vh; border-radius: 50%; display: inline-block; }
.cdot.r { background: var(--rouge); }
.cdot.v { background: var(--vert); }
.cdot.b { background: var(--bleu); }

/* ---- Carrousel de cartes blanches (catégories) ---- */
.cat-row { display: flex; gap: 2vh; width: 92vw; }
.cat-card {
  flex: 1; min-width: 0;
  background: #fff; color: var(--navy);
  border-radius: 1.8vh;
  padding: 3vh 1vh 2.6vh;
  display: flex; flex-direction: column; align-items: center; gap: 1.4vh;
  opacity: .55;
  transition: transform .2s ease-out, box-shadow .2s ease-out, opacity .2s;
  cursor: pointer;
}
.cat-card.selected {
  opacity: 1;
  transform: scale(1.07);
  box-shadow: 0 0 0 .5vh var(--rouge), 0 2vh 5vh rgba(0,0,0,.5);
}
.cat-card svg { height: 5.5vh; width: auto; }
.cat-card .cname {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: min(2.1vh, 1.35vw);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.25;
  text-align: center;
}

/* ---- Choix du niveau (Enfant / Adulte) ---- */
.level-row { display: flex; gap: 4vh; }
.level-card {
  width: 34vh;
  background: #fff; color: var(--navy);
  border-radius: 2vh;
  padding: 4vh 2vh 3vh;
  display: flex; flex-direction: column; align-items: center; gap: 1.4vh;
  position: relative;
  box-shadow: 0 1.5vh 4vh rgba(0,0,0,.45);
  cursor: pointer;
  transition: transform .15s ease-out;
}
.level-card:active { transform: scale(1.05); }
.level-card svg { height: 9vh; width: auto; }
.level-card .lname {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 3.2vh; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.level-card small { font-size: 2vh; font-weight: 600; color: var(--gris-texte); }
.ltag {
  position: absolute; top: -2.2vh; left: 50%; transform: translateX(-50%);
  color: #fff;
  border-radius: 1vh;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2vh; font-weight: 700;
  padding: .6vh 1.8vh;
  letter-spacing: .1em;
}
.ltag.r { background: var(--rouge); }
.ltag.b { background: var(--bleu); }

/* ---- Légende des boutons en bas ---- */
.btn-legend {
  position: fixed; left: 0; right: 0; bottom: 2.5vh;
  display: flex; justify-content: center; gap: 5vh;
  z-index: 5;
}
.btn-legend .b { display: flex; align-items: center; gap: 1.2vh; font-size: 2.2vh; font-weight: 700; color: var(--texte-doux); }
.pad {
  width: 5vh; height: 5vh; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 2.4vh; color: #fff;
  box-shadow: 0 .6vh 0 rgba(0,0,0,.45), inset 0 .4vh 0 rgba(255,255,255,.25);
  transition: transform .12s;
}
.pad.rouge { background: var(--rouge); }
.pad.vert { background: var(--vert); }
.pad.bleu { background: var(--bleu); }
.pad.pressed { transform: translateY(.5vh); }

/* ---- Newsletter (module partagé newsletter.js) ---- */
.yesno { display: flex; gap: 5vh; }
.yesno .choice {
  border-radius: 2vh; padding: 3vh 7vh;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 4vh; font-weight: 700; color: #fff;
  box-shadow: 0 1.5vh 4vh rgba(0,0,0,.45), inset 0 .4vh 0 rgba(255,255,255,.25);
  position: relative;
}
.yesno .choice .btn-tag {
  position: absolute; top: -2.2vh; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 1vh; font-size: 2vh; font-weight: 800; padding: .6vh 1.6vh;
}
.choice.oui { background: linear-gradient(180deg, var(--vert), var(--vert-fonce)); }
.choice.oui .btn-tag { color: var(--vert-fonce); }
.choice.non { background: linear-gradient(180deg, var(--rouge), var(--rouge-fonce)); }
.choice.non .btn-tag { color: var(--rouge-fonce); }

.chat-window {
  width: min(70vw, 90vh);
  max-height: 62vh;
  background: #f4f6fc;
  border-radius: 2.5vh;
  box-shadow: 0 3vh 8vh rgba(0,0,0,.6);
  overflow: hidden;
  display: flex; flex-direction: column;
  color: #17203f;
}
.chat-header {
  background: linear-gradient(160deg, var(--rouge-fonce), var(--rouge));
  color: #fff;
  padding: 1.8vh 3vh;
  font-weight: 800; font-size: 2.6vh;
  display: flex; align-items: center; gap: 1.5vh;
  text-align: left;
}
.chat-header img { height: 4vh; }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 2.5vh;
  display: flex; flex-direction: column; gap: 1.6vh;
}
.bubble {
  max-width: 80%;
  padding: 1.6vh 2.4vh;
  border-radius: 2vh;
  font-size: 2.6vh; font-weight: 600;
  line-height: 1.4;
  text-align: left;
}
.bubble.bot { background: #fff; border: 1px solid #d8def0; align-self: flex-start; border-bottom-left-radius: .5vh; }
.bubble.user { background: var(--bleu); color: #fff; align-self: flex-end; border-bottom-right-radius: .5vh; }
.bubble.user.email { font-family: "SF Mono", Menlo, monospace; letter-spacing: .05em; }
.mic-bar {
  padding: 1.8vh; display: flex; align-items: center; justify-content: center; gap: 1.5vh;
  background: #fff; border-top: 1px solid #d8def0;
  font-size: 2.4vh; font-weight: 700; color: #6b7bb4;
  min-height: 8vh;
}
.mic-dot {
  width: 3vh; height: 3vh; border-radius: 50%;
  background: var(--rouge);
  animation: micpulse 1s ease-in-out infinite;
}
@keyframes micpulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(228,3,46,.5); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 2vh rgba(228,3,46,0); }
}
.mic-bar input {
  font-size: 2.6vh; padding: 1vh 2vh;
  border: .3vh solid var(--bleu); border-radius: 1.2vh;
  width: 80%;
  font-family: "SF Mono", Menlo, monospace;
}

/* ---- Clavier virtuel 3 boutons (module newsletter) ---- */
.vkb {
  display: none;
  flex-direction: column; gap: 1.4vh;
  padding: 1.8vh 2vh;
  background: #fff;
  border-top: 1px solid #d8def0;
}
.vkb.open { display: flex; }
.vkb-buffer {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 3vh; font-weight: 700;
  color: #17203f;
  background: #f0f3fa;
  border: .3vh solid var(--bleu);
  border-radius: 1vh;
  padding: 1vh 1.5vh;
  text-align: center;
  min-height: 5.5vh;
  overflow: hidden; white-space: nowrap;
}
.vkb-cursor { color: var(--rouge); animation: blink .9s step-end infinite; }
.vkb-strip {
  display: flex; gap: 1vh;
  justify-content: center; align-items: center;
  min-height: 7vh;
}
.vkb-tile {
  min-width: 5vh; height: 6vh;
  padding: 0 1.2vh;
  border-radius: 1vh;
  background: #eef1f8; color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 2.8vh; font-weight: 700;
  opacity: .55;
  cursor: pointer;
  white-space: nowrap;
}
.vkb-tile.sel {
  background: var(--navy); color: #fff;
  transform: scale(1.18);
  opacity: 1;
  box-shadow: 0 0 0 .4vh var(--rouge);
}
.vkb-tile.wide { font-family: inherit; font-size: 1.9vh; }
.vkb-tile.ok { background: var(--vert); color: #fff; opacity: .8; }
.vkb-tile.ok.sel { background: var(--vert-fonce); opacity: 1; }
.vkb-tile.cancel { background: var(--rouge); color: #fff; opacity: .8; }
.vkb-tile.cancel.sel { background: var(--rouge-fonce); opacity: 1; }

/* ---- Bandeau d'erreur de données (validateur) ---- */
.data-erreurs {
  position: fixed; left: 50%; top: 2vh; transform: translateX(-50%);
  background: var(--rouge); color: #fff;
  font-size: 2vh; font-weight: 700;
  padding: 1.2vh 3vh; border-radius: 1.2vh;
  z-index: 100;
  box-shadow: 0 1vh 3vh rgba(0,0,0,.5);
}

/* ---- Options cliquables de la barre du bas du chat (chips colorées,
        lisibles avec les boutons physiques comme au doigt) ---- */
.mic-opt {
  display: inline-flex; align-items: center;
  padding: 1vh 2.4vh;
  border-radius: 100vh;
  color: #fff;
  font-weight: 700; font-size: 2.2vh;
  margin: 0 .8vh;
  cursor: pointer;
}
.mic-opt.vert { background: var(--vert); }
.mic-opt.rouge { background: var(--rouge); }
.mic-opt.bleu { background: var(--bleu); }

/* ---- Mode tactile (classe "tactile" posée sur <html>) ---- */
html.tactile body { touch-action: manipulation; }
html.tactile .btn-legend,
html.tactile .btn-tag,
html.tactile .ltag,
html.tactile .chip-row,
html.tactile .keys { display: none !important; }
html.tactile .si-boutons { display: none !important; }
.si-tactile { display: none; }
html.tactile .si-tactile { display: inline; }
html.tactile .press-start,
html.tactile .answer,
html.tactile .choice,
html.tactile .cat-card,
html.tactile .level-card,
html.tactile .game { cursor: pointer; }

.btn-menu-tactile {
  position: fixed; right: 2vh; top: 2vh;
  z-index: 60;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2.2vh; font-weight: 700;
  padding: 1.2vh 2.6vh;
  border-radius: 100vh;
  cursor: pointer;
  letter-spacing: .06em;
}

/* ---- Accessibilité mouvement ---- */
@media (prefers-reduced-motion: reduce) {
  .flake { display: none; }
  .press-start, .win-box, .fun-icon,
  .cat-card, .level-card, .pad { animation: none !important; transition: none !important; }
}
