* {
  box-sizing: border-box;
}

:root {
  --red: #e6332a;
  --black: #111;
  --paper: #fbf4e9;
  --cream: #fffaf0;
  --cream-2: #fff8ec;
  --sand: #f2dec0;
  --muted: #5f554a;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--black);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 210, 135, 0.36), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(230, 51, 42, 0.14), transparent 30%),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 34px 34px;
}

.app {
  width: 100%;
  margin: 0;
  padding: 34px 24px 44px;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
}

.hero,
.question-card,
.result-screen {
  position: relative;
  background: rgba(255, 250, 239, 0.95);
  border: 2px solid var(--black);
  border-radius: 34px;
  padding: 46px 42px;
  box-shadow: 12px 12px 0 var(--black);
}

.question-card {
  min-height: 620px;
  display: flex;
  flex-direction: column;
}

.result-screen {
  min-height: auto;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.label,
.stamp {
  display: inline-block;
  width: fit-content;
  margin: 0 0 24px;
  padding: 8px 16px;
  border: 2px solid var(--red);
  border-radius: 999px;
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fff7e8;
  transform: rotate(-3deg);
}

h1 {
  max-width: 100%;
  margin: 24px 0 26px;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: 0.95;
  color: var(--red);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

h2 {
  width: 100%;
  max-width: none;
  min-height: 96px;
  margin: 0 0 28px;
  font-size: clamp(1.55rem, 3.4vw, 2.55rem);
  line-height: 1.08;
  color: var(--black);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-wrap: normal;
}

/* SUBTITLE WORD CLOUD ANIMÉ */

.subtitle-wrapper {
  position: relative;
  max-width: 860px;
  height: 185px;
  margin: 0 auto -6px;
  overflow: hidden;
}

.subtitle-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 95px;

  background: linear-gradient(
    to bottom,
    rgba(255, 250, 239, 0) 0%,
    rgba(255, 250, 239, 0.75) 55%,
    rgba(255, 250, 239, 1) 100%
  );

  pointer-events: none;
  z-index: 2;
}

.subtitle {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 34px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.subtitle span {
  display: block;
  color: var(--black);
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.15;

  opacity: 0.18;
  transform: translateY(4px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.subtitle span.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-subtitle {
  position: relative;
  z-index: 3;

  display: block;
  max-width: 900px;
  margin: 12px auto 46px;

  color: var(--black);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
}

.hero-subtitle span {
  display: inline-block;
  font-size: 1.12em;
  font-weight: 900;
  letter-spacing: -0.01em;
  opacity: 1;
  transform: none;
}

button {
  font-family: Georgia, "Times New Roman", serif;
  border: 2px solid var(--black);
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

#startBtn,
#restartBtn {
  background: var(--red);
  color: white;
  font-weight: 900;
  border: 2px solid var(--black);
}

#startBtn {
  display: block;
  margin: 54px auto 0;
  padding: 28px 68px;

  font-size: clamp(1.65rem, 2.7vw, 2.25rem);
  font-weight: 900;

  background: var(--red);
  color: white;

  border-radius: 999px;
  box-shadow: 12px 12px 0 var(--black);

  letter-spacing: -0.01em;
  text-align: center;
}

#restartBtn {
  font-size: 1.45rem;
  padding: 24px 48px;
  box-shadow: 10px 10px 0 var(--black);
}

#startBtn:hover,
#restartBtn:hover {
  transform: translate(6px, 6px);
  box-shadow: 5px 5px 0 var(--black);
  background: #c92720;
}

.mini-map {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 0;
}

.mini-map span {
  border: 2px solid var(--black);
  background: var(--sand);
  padding: 13px 30px;
  text-align: center;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.12rem;
  box-shadow: 4px 4px 0 var(--black);
}

.mini-map span:nth-child(2),
.mini-map span:nth-child(4) {
  transform: rotate(2deg);
}

.intro-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  margin: 44px 0 0;
}

.intro-stats span {
  border: none;
  padding: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--black);
  opacity: 0.7;
  text-align: center;
  box-shadow: none;
}

.intro-stats span::before {
  content: "• ";
  color: var(--black);
  font-size: 1.2rem;
  line-height: 1;
}

.top {
  font-weight: 900;
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.progress {
  height: 12px;
  border: 2px solid var(--black);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--cream-2);
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f2b84b, var(--red));
  transition: width 0.38s cubic-bezier(.2,.8,.2,1);
}

.answers {
  display: grid;
  gap: 18px;
  margin-top: auto;
}

.answer {
  width: 100%;
  min-height: 118px;
  background: var(--cream-2);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: 26px;
  padding: 22px 24px;
  text-align: left;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--black);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.38rem;
  font-weight: 900;
  line-height: 1.22;
}

.answer:hover {
  background: #f6e0ba;
  color: var(--black);
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--black);
}

.answer:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--black);
}

.answer:focus,
.answer:focus-visible,
.answer:focus-within {
  outline: none;
  background: var(--cream-2);
  transform: none;
  box-shadow: 6px 6px 0 var(--black);
}

@media (hover: none) {
  .answer:hover {
    background: var(--cream-2);
    transform: none;
    box-shadow: 6px 6px 0 var(--black);
  }
}

.answer small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.winner-card {
  background: var(--black);
  color: #fff8ec;
  padding: 22px;
  border-radius: 22px;
  margin: 26px 0;
  font-weight: 900;
  font-size: 1.2rem;
  line-height: 1.45;
}

.winner-card p {
  margin: 0;
}

.chart-card,
.budget-card,
.simulation-card {
  margin: 32px 0;
  padding: 26px;
  border: 2px solid var(--black);
  border-radius: 26px;
  background: var(--cream-2);
  box-shadow: 6px 6px 0 var(--black);
}

.chart-card h2,
.budget-card h2,
.simulation-card h2 {
  min-height: auto;
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--red);
}

.budget-card p,
.simulation-card p {
  margin: 0 0 22px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.bar-row {
  margin-bottom: 16px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 900;
  margin-bottom: 7px;
}

.bar-track {
  height: 16px;
  background: #ead8bd;
  border: 2px solid var(--black);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.7s cubic-bezier(.2,.8,.2,1);
}

.extra {
  background: var(--black);
  color: #fff8ec;
  padding: 22px;
  border-radius: 22px;
  margin-bottom: 30px;
  font-size: 1.1rem;
  line-height: 1.5;
}

.travel-icon {
  position: absolute;
  right: 34px;
  top: 28px;
  z-index: 2;
  color: var(--red);
  font-size: 3rem;
  line-height: 1;
  text-shadow: 3px 3px 0 var(--black);
  animation: symbolFloat 4.5s ease-in-out infinite;
}

.result-icon {
  position: absolute;
  right: 34px;
  top: 28px;
  margin: 0;
  font-size: 3.6rem;
  animation:
    resultPop 0.65s cubic-bezier(.2,1.35,.4,1) both,
    symbolFloat 4.5s ease-in-out infinite 0.65s;
}

.budget-table,
.simulation-table {
  width: 100%;
  border: 2px solid var(--black);
  border-radius: 20px;
  overflow: hidden;
  margin: 20px 0;
  background: var(--cream);
}

.budget-row,
.simulation-row {
  display: grid;
  border-bottom: 2px solid var(--black);
}

.budget-row {
  grid-template-columns: 1.4fr 1fr;
}

.simulation-row {
  grid-template-columns: minmax(90px, 0.75fr) minmax(0, 1.25fr);
}

.budget-row:last-child,
.simulation-row:last-child {
  border-bottom: none;
}

.budget-row span,
.budget-row strong,
.simulation-row span,
.simulation-row strong {
  min-width: 0;
  padding: 16px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.budget-row strong,
.simulation-row strong {
  color: var(--red);
  text-align: right;
  overflow-wrap: anywhere;
}

.budget-head,
.simulation-head {
  background: var(--black);
  color: #fff8ec;
  font-weight: 900;
}

.budget-head span,
.simulation-head span,
.simulation-head strong {
  color: #fff8ec;
}

.budget-note {
  font-style: italic;
  color: var(--muted);
}



@keyframes symbolFloat {
  0% {
    transform: translateY(0) rotate(-8deg) scale(1);
  }

  50% {
    transform: translateY(-8px) rotate(8deg) scale(1.08);
  }

  100% {
    transform: translateY(0) rotate(-8deg) scale(1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg) translateY(0);
  }

  50% {
    transform: rotate(180deg) translateY(-4px);
  }

  100% {
    transform: rotate(360deg) translateY(0);
  }
}

@keyframes resultPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.55);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 680px) {
  .app {
    padding: 18px 10px 28px;
  }

  .hero,
  .question-card,
  .result-screen {
    padding: 26px 22px;
    border-radius: 22px;
    box-shadow: 6px 6px 0 var(--black);
  }

  .question-card {
    min-height: 560px;
  }

  .label,
  .stamp {
    max-width: 82%;
    margin-bottom: 20px;
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.12;
    letter-spacing: 0.04em;
    transform: rotate(-2deg);
  }

  h1 {
    margin-bottom: 22px;
    font-size: clamp(2.2rem, 9vw, 3.6rem);
    line-height: 0.98;
  }

  h2 {
    min-height: 88px;
    margin-bottom: 24px;
    font-size: clamp(1.35rem, 6.2vw, 2.1rem);
    line-height: 1.12;
  }

  .subtitle-wrapper {
  position: relative;
  max-width: 100%;
  height: 190px;
  margin: 0 auto -54px;
  overflow: hidden;
}

.subtitle-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 130px;

  background: linear-gradient(
    to bottom,
    rgba(255, 250, 239, 0) 0%,
    rgba(255, 250, 239, 0.45) 25%,
    rgba(255, 250, 239, 0.85) 55%,
    rgba(255, 250, 239, 1) 78%,
    rgba(255, 250, 239, 1) 100%
  );

  pointer-events: none;
  z-index: 5;
}

.subtitle {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 8px;
}

.subtitle span {
  font-size: clamp(0.78rem, 4vw, 0.95rem);
  white-space: nowrap;
  line-height: 1.1;
}

.hero-subtitle {
  position: relative;
  z-index: 6;

  margin: 0 auto 42px;
  font-size: clamp(1.35rem, 6vw, 1.8rem);
  line-height: 1.12;
}

.hero-subtitle span {
  white-space: normal;
}

  .mini-map {
    gap: 10px;
  }

  .mini-map span {
    padding: 10px 16px;
    font-size: 0.95rem;
    box-shadow: 3px 3px 0 var(--black);
  }

  #startBtn {
    width: 100%;
    min-width: 0;
    margin-top: 38px;
    padding: 22px 20px;
    font-size: clamp(1.45rem, 7vw, 2rem);
    box-shadow: 8px 8px 0 var(--black);
  }

  .intro-stats {
    gap: 10px 14px;
    margin-top: 34px;
  }

  .intro-stats span {
    font-size: 0.85rem;
  }

  .travel-icon {
    right: 22px;
    top: 22px;
    font-size: 2.4rem;
  }

  .result-icon {
    right: 22px;
    top: 22px;
    font-size: 2.6rem;
  }

  .progress {
    margin-bottom: 24px;
  }

  .answer {
    min-height: 108px;
    font-size: 1.18rem;
    padding: 18px 20px;
    border-radius: 22px;
    box-shadow: 4px 4px 0 var(--black);
  }

  .answer small {
    font-size: 0.92rem;
  }

  .bar-head {
    flex-direction: column;
    gap: 2px;
  }

  .budget-row {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .simulation-row {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .budget-row span,
  .budget-row strong,
  .simulation-row span,
  .simulation-row strong {
    padding: 14px 10px;
    font-size: 0.95rem;
  }

  .budget-row strong,
  .simulation-row strong {
    font-size: 1rem;
  }
}

/* FIX PAGE RÉSULTAT */

.result-screen {
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

#resultTitle {
  max-width: 100%;
  margin-bottom: 34px;

  font-size: clamp(3rem, 6vw, 5.2rem);
  line-height: 0.95;
  text-align: left;
}

#resultText {
  display: block;
  width: 100%;
  max-width: 1000px;

  margin: 0 0 54px;

  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.35;
  font-weight: 700;
  text-align: left;
}

.winner-card {
  width: 100%;
  overflow-wrap: anywhere;
}

.winner-card p {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  #resultTitle {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
    line-height: 0.95;
    margin-bottom: 26px;
  }

  #resultText {
    max-width: 100%;
    margin-bottom: 38px;

    font-size: 1.15rem;
    line-height: 1.4;
  }

  .winner-card {
    font-size: 1rem;
    line-height: 1.35;
  }

  .subtitle span:nth-child(n+16) {
  opacity: 0 !important;
  visibility: hidden;
}
}

/* LARGEUR UNIFORME DES ÉCRANS */

.hero,
.question-card,
.result-screen {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.progress {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.top {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (hover: none), (pointer: coarse) {
  .answer:hover,
  .answer:focus,
  .answer:active {
    background: var(--cream-2) !important;
    transform: none !important;
    box-shadow: 6px 6px 0 var(--black) !important;
    outline: none !important;
  }
}