:root {
  --orange: #ff751b;
  --orange-dark: #ff5200;
  --yellow: #ffd84d;
  --pink: #ff5c8a;
  --blue: #3b82f6;
  --mint: #33d6ad;
  --ink: #171717;
  --muted: #6f6a66;
  --white: #ffffff;
  --grey: #939393;
  --page-pad: clamp(18px, 3vw, 48px);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  background: var(--orange);
}
button { font: inherit; }
button:focus-visible { outline: 4px solid rgba(59,130,246,.4); outline-offset: 4px; }
[hidden] { display: none !important; }

.party-shell {
  min-height: 100vh;
  padding: var(--page-pad);
  background-color: var(--orange);
  background-image: linear-gradient(rgba(255,117,27,.04),rgba(255,117,27,.04)), url("../images/bg.png");
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.blob-card {
  width: min(980px, 92vw);
  min-height: min(760px, calc(100vh - 72px));
  padding: clamp(74px, 10vw, 140px) clamp(54px, 9vw, 126px);
  background: url("../images/OpBG.png") center / 100% 100% no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.intro-content, .quiz-inner, .result-inner {
  width: min(650px, 100%);
  text-align: center;
  position: relative;
  z-index: 2;
}

.party-kicker {
  display: inline-block;
  font-size: clamp(13px, 1.4vw, 18px);
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--orange-dark);
  margin-bottom: 15px;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 22px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 950;
}
.intro-lead {
  max-width: 580px;
  margin: 0 auto 28px;
  color: #34302d;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.45;
  font-weight: 650;
}

.fake-stats {
  margin: 0 auto 31px;
  display: flex;
  justify-content: center;
  gap: clamp(10px, 2vw, 24px);
  flex-wrap: wrap;
}
.fake-stats > div {
  min-width: 120px;
  padding: 12px 18px;
  border: 2px solid #eee6e0;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
}
.fake-stats strong { display: block; font-size: 21px; }
.fake-stats span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }

.main-cta {
  border: 0;
  border-radius: 999px;
  padding: 17px 28px;
  min-height: 58px;
  background: var(--orange);
  color: white;
  font-weight: 950;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 11px 0 #da4b00, 0 16px 28px rgba(145,58,0,.2);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.main-cta span { margin-left: 9px; }
.main-cta:hover { transform: translateY(-2px); background: #ff6810; box-shadow: 0 13px 0 #da4b00, 0 20px 28px rgba(145,58,0,.2); }
.main-cta:active { transform: translateY(7px); box-shadow: 0 4px 0 #da4b00; }
.tiny-note { margin: 20px 0 0; color: #88817d; font-size: 12px; font-weight: 700; }

.progress-bubble {
  width: 128px;
  height: 128px;
  position: absolute;
  left: clamp(18px, 5vw, 78px);
  top: clamp(18px, 5vw, 66px);
  z-index: 5;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 12px 36px rgba(101,49,13,.18);
}
.progress-bubble svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-track, .progress-ring { fill: none; stroke-width: 11; }
.progress-track { stroke: #f2eee9; }
.progress-ring {
  stroke: var(--orange-dark);
  stroke-linecap: round;
  stroke-dasharray: 307.88;
  stroke-dashoffset: 307.88;
  transition: stroke-dashoffset .5s ease, stroke .3s ease;
}
.progress-copy {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  text-align: center;
  line-height: .85;
}
.progress-copy strong { font-size: 35px; }
.progress-copy span { font-size: 15px; font-weight: 900; color: var(--muted); }

.quiz-card { min-height: min(820px, calc(100vh - 52px)); }
.quiz-inner { width: min(720px, 100%); }
.question-topline {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 25px;
  font-weight: 950;
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--orange-dark);
}
/* Mini terminal d'analyse : intégré au fond blanc, sans cadre. */
.analysis-terminal {
  position: relative;
  max-width: min(720px, 100%);
  min-height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #111;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .015em;
  text-transform: none;
}
.analysis-terminal::after { display: none; content: none; }
.analysis-terminal[data-level="fun"],
.analysis-terminal[data-level="warn"],
.analysis-terminal[data-level="danger"],
.analysis-terminal[data-level="final"] {
  color: #111;
  animation: none;
}
.terminal-status {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #111;
  box-shadow: none;
}
.terminal-app {
  color: #111;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.terminal-separator { color: #777; font-size: 13px; }
.terminal-prompt {
  color: #111;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  white-space: nowrap;
}
.terminal-prompt::before { content: "["; opacity: .7; }
.terminal-prompt::after { content: "]"; opacity: .7; }
.terminal-text {
  min-width: 0;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-cursor {
  width: 6px;
  height: 14px;
  flex: 0 0 6px;
  border-radius: 0;
  background: #111;
  animation: terminalCursor .9s steps(1,end) infinite;
}
@keyframes terminalCursor { 50% { opacity: .12; } }
.question-text {
  margin: 0 auto;
  max-width: 720px;
  font-size: clamp(30px, 4.3vw, 54px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 950;
}
.answers {
  width: 100%;
  margin: clamp(35px, 6vw, 64px) auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.answer {
  min-height: 112px;
  border: 0;
  border-radius: 60px;
  padding: 18px 26px 18px 70px;
  position: relative;
  background: #9b9b9b;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: clamp(15px, 1.7vw, 21px);
  line-height: 1.15;
  text-align: center;
  transition: transform .16s ease, background .2s ease, box-shadow .2s ease;
}
.answer::before {
  content: attr(data-letter);
  width: 48px;
  height: 48px;
  position: absolute;
  left: 12px;
  top: 12px;
  border-radius: 50%;
  background: white;
  color: var(--ink);
  border: 2px solid #aaa;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.answer:hover { transform: translateY(-4px) rotate(-.4deg); background: #7e7e7e; }
.answer.selected { background: var(--orange); box-shadow: 0 11px 0 #dc5100; transform: translateY(-4px); }
.answer.selected::before { border-color: var(--orange); color: var(--orange-dark); }
.answer.fun-pink.selected { background: var(--pink); box-shadow: 0 11px 0 #d63b68; }
.answer.fun-blue.selected { background: var(--blue); box-shadow: 0 11px 0 #2466c9; }
.answer.fun-mint.selected { background: var(--mint); box-shadow: 0 11px 0 #1ea381; }
.answer.final-no { overflow: visible; }
.answer.final-no.jiggle { animation: jiggle .36s ease; }

.quiz-footer {
  width: min(390px, 100%);
  margin: 50px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 24px;
  font-weight: 950;
}
.nav-btn {
  width: 62px; height: 62px;
  border: 0; border-radius: 50%;
  background: #ededed;
  color: #777;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transition: .18s ease;
}
.nav-btn:hover:not(:disabled) { background: var(--orange); color: white; transform: scale(1.06); }
.nav-btn:disabled { opacity: .22; cursor: not-allowed; }
.nav-next:not(:disabled) { background: var(--orange); color: white; }

.reaction {
  position: fixed;
  left: 50%;
  bottom: max(24px, 4vh);
  transform: translate(-50%, 30px) scale(.92);
  width: min(620px, calc(100vw - 36px));
  padding: 16px 20px;
  border: 3px solid #222;
  border-radius: 24px;
  background: #fff;
  box-shadow: 8px 8px 0 rgba(0,0,0,.18);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.8,.3,1.2);
}
.reaction.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.reaction-icon { font-size: 34px; flex: none; }
.reaction-text { font-size: clamp(15px, 1.8vw, 20px); font-weight: 900; line-height: 1.25; }

.final-joke {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.8) rotate(-3deg);
  z-index: 30;
  width: min(520px, calc(100vw - 34px));
  padding: 24px;
  border: 4px solid #171717;
  border-radius: 28px;
  background: var(--yellow);
  box-shadow: 12px 12px 0 rgba(0,0,0,.18);
  font-size: clamp(20px, 3vw, 33px);
  text-align: center;
  opacity: 0;
  transition: opacity .18s ease, transform .24s cubic-bezier(.2,.8,.3,1.25);
}
.final-joke.show { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(1deg); }
.final-joke span { display: block; font-size: 45px; margin-bottom: 7px; }

.result-inner { max-width: 640px; }
.result-card h2 { font-size: clamp(38px, 5vw, 62px); margin-bottom: 22px; letter-spacing: -.04em; }
.score-orbit { width: clamp(175px, 24vw, 220px); aspect-ratio: 1; margin: 0 auto 18px; position: relative; }
.score-orbit svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-track, .score-ring { fill: none; stroke-width: 18; }
.score-track { stroke: #eee8e3; }
.score-ring { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 571.77; stroke-dashoffset: 571.77; transition: stroke-dashoffset 1s ease; }
.score-value { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; }
.score-value strong { font-size: clamp(55px, 8vw, 78px); line-height: 1; }
.score-value span { font-size: 24px; font-weight: 950; }
.result-level { font-size: clamp(24px, 3vw, 34px); font-weight: 950; color: var(--orange-dark); margin-bottom: 10px; }
.result-copy { max-width: 560px; margin: 0 auto 18px; color: #514b47; font-size: clamp(16px, 1.8vw, 20px); font-weight: 700; line-height: 1.45; }
.result-alert { max-width: 560px; margin: 0 auto 26px; padding: 14px 18px; border: 3px solid #171717; border-radius: 18px; background: var(--yellow); font-weight: 950; }

.future-visual {
  position: absolute;
  right: 4.5%;
  bottom: 7%;
  width: min(240px, 24vw);
  display: none;
  z-index: 2;
  pointer-events: none;
}
.intro-visual { width: min(250px, 25vw); bottom: 8%; }
.result-visual { width: min(230px, 23vw); bottom: 8%; }
.quiz-visual { right: 2.2%; bottom: 4.2%; }
.character-visual-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.12));
  transform-origin: center bottom;
  transition: transform .22s ease, filter .22s ease, opacity .18s ease;
}
.quiz-visual .character-visual-img { transform: translateY(0) scale(1); }
.future-visual.is-hidden { display: none !important; }
.quiz-visual.is-reacting .character-visual-img {
  transform: translateY(-4px) scale(1.03);
  filter: drop-shadow(0 14px 20px rgba(0,0,0,.16));
}

.confetti-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.c { position: absolute; width: 14px; height: 30px; border-radius: 4px; opacity: .75; transform: rotate(20deg); }
.c1{left:4%;top:13%;background:var(--yellow);transform:rotate(18deg)} .c2{left:11%;top:75%;background:var(--pink);transform:rotate(-32deg)}
.c3{left:19%;top:8%;background:var(--blue);transform:rotate(67deg)} .c4{left:29%;top:91%;background:var(--mint);transform:rotate(12deg)}
.c5{left:42%;top:4%;background:var(--pink);transform:rotate(-18deg)} .c6{left:52%;top:94%;background:var(--yellow);transform:rotate(41deg)}
.c7{left:65%;top:7%;background:var(--mint);transform:rotate(-65deg)} .c8{left:74%;top:88%;background:var(--blue);transform:rotate(28deg)}
.c9{left:86%;top:15%;background:var(--yellow);transform:rotate(-27deg)} .c10{left:94%;top:72%;background:var(--pink);transform:rotate(52deg)}
.c11{left:6%;top:45%;background:var(--mint);width:20px;height:20px;border-radius:50%} .c12{left:96%;top:38%;background:var(--blue);width:18px;height:18px;border-radius:50%}
.c13{left:35%;top:13%;background:var(--yellow);width:10px;height:10px;border-radius:50%} .c14{left:81%;top:52%;background:var(--mint);width:11px;height:11px;border-radius:50%}
.c15{left:17%;top:31%;background:var(--pink);width:9px;height:9px;border-radius:50%}

.party-pop { position: fixed; pointer-events: none; z-index: 40; width: 12px; height: 22px; border-radius: 3px; animation: popfall 1.8s ease-out forwards; }
@keyframes popfall { from { transform: translate(0,0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
@keyframes jiggle { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px) rotate(-1deg)} 50%{transform:translateX(7px) rotate(1deg)} 75%{transform:translateX(-4px)} }
@keyframes questionIn { from { opacity:0; transform:translateY(16px) scale(.98)} to{opacity:1;transform:none} }
.question-in { animation: questionIn .32s ease both; }

@media (min-width: 1160px) {
  .future-visual { display: block; }
  .intro-content, .quiz-inner, .result-inner { padding-right: 90px; }
}

@media (max-width: 900px) {
  .progress-bubble { width: 100px; height: 100px; left: 18px; top: 18px; }
  .progress-copy strong { font-size: 28px; }
  .blob-card { width: min(920px, 98vw); padding-left: 9vw; padding-right: 9vw; }
  .answers { gap: 13px; }
  .answer { min-height: 92px; border-radius: 46px; padding-left: 62px; }
  .answer::before { width: 42px; height: 42px; font-size: 18px; }
}

@media (max-width: 620px) {
  .party-shell { padding: 10px; align-items: start; }
  .blob-card {
    width: 100%;
    min-height: 760px;
    margin-top: 10px;
    padding: 105px 32px 90px;
    background-size: 132% 100%;
  }
  h1 { font-size: 43px; }
  .fake-stats { gap: 7px; }
  .fake-stats > div { min-width: 92px; padding: 9px 11px; }
  .progress-bubble { position: fixed; width: 82px; height: 82px; left: 14px; top: 14px; }
  .progress-copy strong { font-size: 23px; }
  .progress-copy span { font-size: 11px; }
  .answers { grid-template-columns: 1fr; margin-top: 30px; }
  .answer { min-height: 72px; border-radius: 36px; font-size: 16px; padding: 14px 19px 14px 58px; }
  .answer::before { width: 34px; height: 34px; top: 10px; left: 10px; font-size: 15px; }
  .question-topline { margin-bottom: 16px; }
  .analysis-terminal {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 0;
    font-size: 10px;
  }
  .terminal-app, .terminal-separator { display: none; }
  .terminal-text { white-space: normal; }
  .question-text { font-size: 29px; }
  .quiz-footer { margin-top: 28px; }
  .nav-btn { width: 54px; height: 54px; font-size: 29px; }
  .reaction { bottom: 16px; padding: 13px 15px; border-radius: 18px; }
  .reaction-icon { font-size: 27px; }
  .result-card { padding-top: 105px; }
}



/* Responsive desktop par hauteur : équivalent visuel à un zoom navigateur ~90% */
@media (min-width: 621px) and (max-height: 920px) {
  :root { --page-pad: 12px; }

  .party-shell {
    min-height: 100vh;
    padding: 12px;
  }

  .blob-card {
    width: min(930px, 94vw);
    min-height: calc(100vh - 24px);
    padding: clamp(52px, 7vh, 76px) clamp(48px, 7.5vw, 96px);
  }

  .quiz-card { min-height: calc(100vh - 24px); }
  .quiz-inner { width: min(690px, 100%); }

  .question-topline {
    gap: 10px;
    margin-bottom: 14px;
    font-size: 12px;
  }

  .analysis-terminal {
    min-height: 20px;
    font-size: 11px;
    gap: 6px;
  }

  .question-text {
    max-width: 680px;
    font-size: clamp(28px, 3.6vw, 44px);
    line-height: 1.04;
  }

  .answers {
    margin-top: clamp(22px, 3.5vh, 34px);
    gap: 12px;
  }

  .answer {
    min-height: 88px;
    border-radius: 46px;
    padding: 14px 22px 14px 60px;
    font-size: clamp(14px, 1.45vw, 18px);
    line-height: 1.12;
  }

  .answer::before {
    width: 40px;
    height: 40px;
    left: 10px;
    top: 10px;
    font-size: 18px;
  }

  .quiz-footer {
    width: min(330px, 100%);
    margin-top: clamp(18px, 3vh, 28px);
    gap: 16px;
    font-size: 19px;
  }

  .nav-btn {
    width: 50px;
    height: 50px;
    font-size: 28px;
  }

  .progress-bubble {
    width: 104px;
    height: 104px;
    left: clamp(14px, 3vw, 42px);
    top: clamp(14px, 3vh, 34px);
  }

  .progress-copy strong { font-size: 28px; }
  .progress-copy span { font-size: 12px; }

  .future-visual {
    width: min(190px, 18vw);
    right: 3.5%;
    bottom: 4.5%;
  }

  .intro-visual { width: min(205px, 19vw); }
  .result-visual { width: min(190px, 18vw); }
  .quiz-visual { right: 1.7%; bottom: 2.8%; }

  .intro-content, .quiz-inner, .result-inner { padding-right: 66px; }

  /* La réaction se place en haut : elle ne peut plus recouvrir les flèches */
  .reaction {
    top: 18px;
    bottom: auto;
    width: min(560px, calc(100vw - 180px));
    padding: 12px 16px;
    border-width: 2px;
    border-radius: 18px;
    box-shadow: 5px 5px 0 rgba(0,0,0,.14);
  }

  .reaction-icon { font-size: 28px; }
  .reaction-text { font-size: clamp(13px, 1.4vw, 17px); }

  h1 { font-size: clamp(39px, 5vw, 62px); }
  .intro-lead { margin-bottom: 20px; font-size: clamp(16px, 1.7vw, 20px); }
  .fake-stats { margin-bottom: 22px; }
  .main-cta { min-height: 52px; padding: 14px 24px; }

  .result-card h2 { font-size: clamp(34px, 4.4vw, 52px); margin-bottom: 14px; }
  .score-orbit { width: clamp(145px, 19vh, 185px); margin-bottom: 12px; }
  .result-copy { font-size: clamp(15px, 1.5vw, 18px); margin-bottom: 13px; }
  .result-alert { margin-bottom: 18px; padding: 11px 15px; }
}

/* Écrans desktop particulièrement bas : 1366x768, petits laptops, fenêtre OBS réduite */
@media (min-width: 621px) and (max-height: 780px) {
  :root { --page-pad: 6px; }

  .party-shell { padding: 6px; }
  .blob-card {
    width: min(890px, 92vw);
    min-height: calc(100vh - 12px);
    padding: 42px 78px 38px;
  }
  .quiz-card { min-height: calc(100vh - 12px); }

  .question-topline { margin-bottom: 9px; }
  .question-text { font-size: clamp(25px, 3.25vw, 39px); }

  .answers {
    margin-top: 18px;
    gap: 10px;
  }

  .answer {
    min-height: 76px;
    border-radius: 40px;
    padding: 11px 18px 11px 54px;
    font-size: clamp(13px, 1.3vw, 17px);
  }

  .answer::before {
    width: 36px;
    height: 36px;
    left: 9px;
    top: 9px;
    font-size: 16px;
  }

  .quiz-footer {
    margin-top: 15px;
    width: min(300px, 100%);
    font-size: 17px;
  }

  .nav-btn { width: 44px; height: 44px; font-size: 24px; }
  .future-visual { width: min(160px, 16vw); bottom: 3%; }
  .quiz-visual { right: 1.2%; bottom: 1.6%; }
  .intro-content, .quiz-inner, .result-inner { padding-right: 54px; }

  .progress-bubble { width: 88px; height: 88px; }
  .progress-copy strong { font-size: 24px; }

  .reaction {
    top: 10px;
    width: min(520px, calc(100vw - 150px));
    padding: 9px 13px;
  }

  .reaction-icon { font-size: 24px; }
  .reaction-text { font-size: 13px; }

  .party-kicker { margin-bottom: 9px; }
  h1 { margin-bottom: 14px; font-size: clamp(36px, 4.5vw, 54px); }
  .intro-lead { margin-bottom: 15px; line-height: 1.3; }
  .fake-stats { margin-bottom: 16px; }
  .fake-stats > div { padding: 9px 14px; }
  .tiny-note { margin-top: 13px; }

  .result-card h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 8px; }
  .score-orbit { width: 132px; margin-bottom: 8px; }
  .score-value strong { font-size: 51px; }
  .result-level { font-size: clamp(20px, 2.3vw, 27px); margin-bottom: 7px; }
  .result-copy { font-size: 14px; line-height: 1.3; margin-bottom: 9px; }
  .result-alert { margin-bottom: 12px; padding: 8px 12px; }
}

/* Sur tablette/mobile, la réaction reste basse mais est remontée au-dessus des contrôles */
@media (max-width: 620px) {
  .reaction { bottom: 86px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
