/* Questions de fond (template/espace/questions-de-fond.php, 2026-10-17): the sea at night. The light comes from the
   surface and fades as the couple dives (--qf-depth: 0 at the surface, 1 at the bottom, written by the script);
   bubbles rise; at each dive the question goes up and the next one rises from below. The three views (a question,
   the wall of the Pass, the bottom) share one place in a stage of fixed size, so nothing around them moves. Only
   transforms and opacity move; still for those who ask for less motion. */
.esp-page.qf {
  --qf-depth: 0;
  background: linear-gradient(180deg, #33246e 0%, #241a55 26%, #160f3a 58%, #0a0620 100%);
}

/* ---------- The sea ---------- */
.qf-sea {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.qf-sea span,
.qf-sea i {
  position: absolute;
  display: block;
}

.qf-sea__light {
  top: -32%;
  left: 50%;
  width: 170%;
  height: 72%;
  border-radius: 50%;
  translate: -50% 0;
  background: radial-gradient(closest-side, rgba(204, 176, 255, .46), rgba(150, 110, 255, .14) 55%, transparent);
  opacity: calc(1 - var(--qf-depth) * .85);
  transition: opacity 1.2s ease;
}

.qf-sea__rays {
  inset: 0;
  opacity: calc(.9 - var(--qf-depth));
  transition: opacity 1.2s ease;
}

.qf-sea__rays i {
  top: -12%;
  height: 78%;
  transform-origin: top center;
  background: linear-gradient(180deg, rgba(214, 196, 255, .24), rgba(214, 196, 255, 0));
  filter: blur(6px);
}

.qf-sea__rays i:nth-child(1) { left: 10%; width: 18%; rotate: 14deg; }
.qf-sea__rays i:nth-child(2) { left: 34%; width: 11%; rotate: 6deg; }
.qf-sea__rays i:nth-child(3) { left: 55%; width: 16%; rotate: -4deg; }
.qf-sea__rays i:nth-child(4) { left: 76%; width: 10%; rotate: -12deg; }

.qf-sea__bubbles i {
  bottom: -24px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border: 1px solid rgba(224, 210, 255, .55);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .04) 62%);
  opacity: 0;
}

/* The water that passes when the couple dives (up) or comes back up (down). */
.qf-sea__streaks i {
  top: 30%;
  width: 1px;
  height: 36%;
  background: linear-gradient(180deg, rgba(224, 210, 255, 0), rgba(224, 210, 255, .6), rgba(224, 210, 255, 0));
  opacity: 0;
}

.qf-sea__streaks i:nth-child(1) { left: 12%; }
.qf-sea__streaks i:nth-child(2) { left: 27%; height: 24%; }
.qf-sea__streaks i:nth-child(3) { left: 43%; }
.qf-sea__streaks i:nth-child(4) { left: 61%; height: 28%; }
.qf-sea__streaks i:nth-child(5) { left: 78%; }
.qf-sea__streaks i:nth-child(6) { left: 91%; height: 20%; }

.qf-sea__dark {
  inset: 0;
  background: #04020c;
  opacity: calc(var(--qf-depth) * .52);
  transition: opacity 1.2s ease;
}

/* ---------- The stage ---------- */
.qf .esp-game__shell {
  gap: 10px;
}

.qf-stage {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* The gauge on the side: the line of the dive, and where the couple is on it. */
.qf-gauge {
  position: absolute;
  top: 6%;
  bottom: 6%;
  left: 2px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(224, 210, 255, .55), rgba(224, 210, 255, .08));
}

.qf-gauge__mark {
  position: absolute;
  top: calc(var(--qf-depth) * 100%);
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #ffd98a;
  box-shadow: 0 0 0 4px rgba(255, 217, 138, .18), 0 0 14px rgba(255, 217, 138, .7);
  transition: top .9s cubic-bezier(.3, .7, .2, 1);
}

/* The depth, at the top of the line: never over the question. */
.qf-gauge__depth {
  position: absolute;
  top: -24px;
  left: -4px;
  color: #ffd98a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.qf-slide {
  display: grid;
  align-items: center;
  padding: 0 2px 0 34px;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1), opacity .34s ease;
}

.qf-slide.is-leaving-up { transform: translateY(-48px); opacity: 0; }
.qf-slide.is-leaving-down { transform: translateY(48px); opacity: 0; }
.qf-slide.is-coming-up { transform: translateY(48px); opacity: 0; transition: none; }
.qf-slide.is-coming-down { transform: translateY(-48px); opacity: 0; transition: none; }

.qf-view {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  visibility: hidden;
  opacity: 0;
}

.qf[data-qf-view="question"] .qf-view--question,
.qf[data-qf-view="wall"] .qf-view--wall,
.qf[data-qf-view="bottom"] .qf-view--bottom {
  visibility: visible;
  opacity: 1;
}

/* ---------- A question ---------- */
/* The depth of the question, and its heart. */
.qf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-bottom: -6px;
}

.qf-heart {
  margin: 0;
}

.qf-kicker {
  margin: 0;
  color: #ffd98a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.qf-turn {
  margin: -6px 0 0;
  color: rgba(255, 255, 255, .66);
  font-size: 14px;
  font-weight: 700;
}

.qf-question {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 6.3vw, 28px);
  line-height: 1.34;
  text-wrap: balance;
}

.qf-word {
  white-space: nowrap;
}

/* The opinion of the couple: the thumb above its word. Once given, the other one steps back. */
.qf-rate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.qf-rate__button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 18px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease, opacity .25s ease;
}

.qf-rate__button svg {
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.qf-rate__button:hover {
  background: rgba(255, 255, 255, .13);
}

.qf-rate__button:active {
  transform: scale(.98);
}

.qf-rate__button:disabled {
  cursor: default;
}

.qf-rate__button[aria-pressed="true"] {
  border-color: rgba(255, 217, 138, .75);
  background: rgba(255, 217, 138, .16);
  color: #ffd98a;
}

.qf-rate__button[aria-pressed="true"] svg {
  transform: translateY(-2px) rotate(-10deg) scale(1.12);
}

.qf-rate__button--down[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.qf-rate__button--down[aria-pressed="true"] svg {
  transform: translateY(2px) rotate(10deg) scale(1.12);
}

.qf-rate.is-rated .qf-rate__button[aria-pressed="false"] {
  opacity: .5;
}

/* What the opinion or the heart just did: one line, its place kept so that nothing moves. */
.qf-said {
  min-height: 21px;
  margin: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  transition: opacity .25s ease;
}

.qf-said.is-shown {
  opacity: 1;
}

/* ---------- The wall of the Pass, and the bottom ---------- */
.qf-view--wall,
.qf-view--bottom {
  align-items: flex-start;
}

.qf-view__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 217, 138, .12);
  box-shadow: 0 0 0 1px rgba(255, 217, 138, .35);
  color: #ffd98a;
}

.qf-view__title {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}

.qf-view__text {
  margin: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Dive, come back up ---------- */
.qf-moves {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 10px;
}

.qf-up {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px 0 4px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .78);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.qf-up:disabled {
  visibility: hidden;
}

.qf-dive {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b63ff, #e0156f);
  box-shadow: 0 14px 30px rgba(139, 99, 255, .35);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, opacity .2s ease;
}

.qf-dive:active {
  transform: scale(.98);
}

.qf-dive:disabled {
  opacity: .45;
  cursor: default;
}

.qf-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(255, 255, 255, .55);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

/* The smallest phones: the opinions and « Question suivante » stay on one line; « Précédente » keeps its arrow and
   says its name to screen readers only. */
@media (max-width: 359px) {
  .qf-rate__button {
    padding: 10px 6px;
    font-size: 13px;
  }

  .qf-dive {
    padding: 0 16px;
    font-size: 15px;
    white-space: nowrap;
  }

  .qf-up {
    padding: 0 12px;
  }

  .qf-up__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Short screens: a long question (in German, up to seven lines) still fits without moving the page. */
@media (max-height: 700px) {
  .qf-question {
    font-size: clamp(19px, 5.8vw, 24px);
  }
}

/* ---------- The movements, for those who want them ---------- */
@media (prefers-reduced-motion: no-preference) {
  .qf-sea__bubbles i {
    animation: qf-bubble var(--d) linear var(--delay) infinite;
  }

  .qf-sea__rays i {
    animation: qf-ray 9s ease-in-out infinite alternate;
  }

  .qf-sea__rays i:nth-child(2n) {
    animation-duration: 12s;
    animation-delay: -4s;
  }

  .qf.is-diving .qf-sea__streaks i {
    animation: qf-stream-up .8s ease-out;
  }

  .qf.is-rising .qf-sea__streaks i {
    animation: qf-stream-down .8s ease-out;
  }

  .qf-sea__streaks i:nth-child(2n) {
    animation-delay: .08s !important;
  }

  .qf-dive__arrow {
    animation: qf-nudge 2.6s ease-in-out infinite;
  }

  /* The chip Favoris, when the first heart brings it. */
  .qf-levels .esp-cat.is-new {
    animation: qf-pop .5s cubic-bezier(.2, .8, .2, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qf-slide,
  .qf-gauge__mark,
  .qf-rate__button svg {
    transition: none;
  }
}

@keyframes qf-pop {
  0% { opacity: 0; transform: scale(.7); }
  100% { opacity: 1; transform: none; }
}

@keyframes qf-bubble {
  0% { opacity: 0; transform: translate(0, 0); }
  12% { opacity: .85; }
  50% { transform: translate(9px, -52vh); }
  88% { opacity: .5; }
  100% { opacity: 0; transform: translate(-7px, -104vh); }
}

@keyframes qf-ray {
  from { opacity: .5; }
  to { opacity: 1; }
}

@keyframes qf-stream-up {
  0% { opacity: 0; transform: translateY(120%); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-90%); }
}

@keyframes qf-stream-down {
  0% { opacity: 0; transform: translateY(-90%); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translateY(120%); }
}

@keyframes qf-nudge {
  0%, 60%, 100% { transform: none; }
  75% { transform: translateY(3px); }
}
