/* ========== PAGE ÉDITION LIMITÉE + SWIPE GAME « KRITER DE SÉLECTION » ========== */
/* Titres : Syncopate (main.css) — Textes : Roboto — Écritures manuscrites : PNG fournis */
/* Desktop first : styles de base desktop, adaptations en max-width (1150px, 768px, 360px) */

@font-face {
  font-family: 'Roboto';
  src: url('/assets/fonts/roboto-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/assets/fonts/roboto-italic-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

.kriter-de-selection {
  --el-blue: #137FB3;
  --el-red: #CE122D;
  --el-green: #2E9D4F;
  --el-card-blue: #C8DFF0;
  --el-card-pale: #E3EEFA;
  --el-text: #3a3a3a;

  position: relative;
  overflow: hidden;
  overflow: clip;
  font-family: 'Roboto', sans-serif;
  color: var(--el-text);
}

.el-filigrane {
  position: absolute;
  top: 1rem;
  right: -4rem;
  width: 38rem;
  pointer-events: none;
  user-select: none;
}

/* ---------- Titre ---------- */
.el-hero {
  position: relative;
  padding: 4.5rem 1rem 1.5rem;
  text-align: center;
}

.el-hero h1 {
  margin: 0;
  font-weight: 400;
}

.el-hero__title {
  display: block;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: clamp(1.5rem, 5.5vw, 2.6rem);
  text-transform: lowercase;
  letter-spacing: .04em;
  color: var(--el-red);
}

.el-hero__script {
  display: block;
  width: clamp(11rem, 70vw, 22rem);
  height: auto;
  margin: -1rem auto 0;
}

/* ---------- Introduction ---------- */
.el-intro {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 6rem 2rem 5rem;
}

.el-intro__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 40%;
}

.el-intro__text h2 {
  margin: 0 0 1rem;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--el-blue);
}

.el-separator {
  width: 4rem;
  height: 3px;
  margin-bottom: 1.5rem;
  background-color: var(--el-red);
}

.el-intro__text p {
  color:#454545;
  font-size: 1rem;
  line-height: 1.35;
}

.el-dotations {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  align-items: center;
  justify-items: start;
  gap: .5rem;
}

.el-dotations__text {
  margin: 0 0 0 1.5rem;
  font-style: italic;
  text-align: left;
  color: var(--el-red) !important;
}

.el-dotations__text strong {
  font-weight: 700;
}

.el-dotations img {
  width: min(100%, 22rem);
  height: auto;
}

/* ---------- Bloc jeu ---------- */
.el-game {
  position: relative;
  padding: 2rem 1rem 6rem;
  text-align: center;
  overflow: hidden;
  overflow: clip;
}

.el-game__title {
  margin: 0 0 1.75rem;
  font-weight: 400;
}

.el-game__script {
  display: block;
  width: clamp(15rem, 62vw, 25.5rem);
  height: auto;
  margin: 0 auto .5rem;
}

.el-game__title-main {
  display: block;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: clamp(1.5rem, 5.5vw, 2.4rem);
  text-transform: lowercase;
  letter-spacing: .04em;
  color: var(--el-red);
}

.el-reglement {
  width: min(100%, 23.5rem);
  margin: .75rem auto 0;
  text-align: right;
  font-size: .8rem;
}

.el-reglement a {
  color: #666;
}

/* ========== Composant swipe game ========== */
/* Les paddings haut en % (relatifs à la largeur) calent le contenu sur les fonds de cartes */
.sg {
  --sg-yes: 0;
  --sg-no: 0;
  font-family: 'Roboto', sans-serif;
}

.sg-stage {
  position: relative;
  display: grid;
  width: min(100%, 23.5rem);
  margin: 0 auto;
}

/* Paquet de cartes en arrière-plan */
.sg[data-phase="question"] .sg-stage::before,
.sg[data-phase="question"] .sg-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: .6rem;
  background-color: var(--el-card-blue);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.sg[data-phase="question"] .sg-stage::before {
  transform: rotate(-3deg) translateY(6px);
}

.sg[data-phase="question"] .sg-stage::after {
  background-color: #d7e7f5;
  transform: rotate(2deg) translateY(3px);
}

.sg-card {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  /* Largeur fixée : si le contenu dépasse le ratio, la carte s'allonge au lieu de s'élargir */
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 797 / 1197;
  padding: 2rem 1.5rem 1rem;
  border-radius: .6rem;
  background: var(--el-card-pale) center top / cover no-repeat;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
  text-align: center;
  opacity: 1;
  transform: none;
  transition: opacity .35s ease, transform .35s ease;
}

.sg-card.is-entering {
  opacity: 0;
  transform: translateY(14px) scale(.96);
}

.sg-card.is-leaving {
  z-index: 2;
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

[data-sg-focus]:focus {
  outline: none;
}

[data-sg-focus]:focus-visible {
  outline: 2px solid var(--el-blue);
  outline-offset: 4px;
}

/* Étiquettes BRAVO / DOMMAGE / Le jeu interactif / Gagnants */
.sg-tag {
  display: inline-block;
  margin: 0;
  padding: .3em .8em .2em;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: .04em;
  color: #fff;
}

.sg-tag--blue {
  background-color: var(--el-blue);
}

.sg-tag--red {
  background-color: var(--el-red);
}

/* Boutons pilule */
.sg-btn {
  display: inline-block;
  min-width: 62%;
  margin-top: auto;
  padding: .75rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background-color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .14);
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #111;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.sg-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.sg-btn:focus-visible,
.sg-choice:focus-visible {
  outline: 3px solid var(--el-blue);
  outline-offset: 3px;
}

.sg-btn:disabled {
  cursor: default;
  opacity: .6;
  transform: none;
}

.sg-progress {
  margin: .9rem 0 0;
  font-size: .8rem;
  letter-spacing: .05em;
  color: #8a9aa8;
}

.sg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Intro (logo incrusté dans le fond) ---------- */
.sg-intro {
  padding-top: 55%;
  background-color: var(--el-card-blue);
  background-image: url('/assets/img/kriter-de-selection/cartes/carte-debut.jpg');
}

.sg-intro__tag {
  font-size: .95rem;
  text-transform: lowercase;
}

.sg-intro__script {
  width: 86%;
  margin: .3rem 0 0;
  line-height: 0;
}

.sg-intro__script img {
  width: 100%;
  height: auto;
}

.sg-intro__text {
  margin: auto 0 1.5rem;
  padding-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.85;
  color: #222;
}

/* ---------- Carte question (« Affirmation N » + visuel incrustés dans le fond) ---------- */
.sg-question {
  padding-top: 50%;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sg-question.is-dragging {
  cursor: grabbing;
  transition: none;
}

.sg-question.is-returning {
  transition: transform .45s cubic-bezier(.2, 1.4, .4, 1);
}

.sg-question.is-flying {
  z-index: 3;
  pointer-events: none;
  transition: transform .45s cubic-bezier(.4, 0, .9, .6), opacity .45s ease-in;
  opacity: 0;
}

.sg-question__statement {
  margin: 0 0 1rem;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-transform: lowercase;
  color: #111;
}

.sg-question__actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: auto;
}

.sg-choice {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .14);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.sg-choice img {
  height: auto;
  pointer-events: none;
}

.sg-choice--no img {
  width: 1.6rem;
}

.sg-choice--yes img {
  width: 1.9rem;
}

.sg-choice--no {
  transform: scale(calc(1 + var(--sg-no) * .15));
}

.sg-choice--yes {
  transform: scale(calc(1 + var(--sg-yes) * .15));
}

.sg-choice:hover {
  box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
}

.sg-choice:disabled {
  cursor: default;
}

.sg-stamp {
  position: absolute;
  top: 1.25rem;
  padding: .25rem .6rem .15rem;
  border: 3px solid;
  border-radius: .35rem;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, .8);
  pointer-events: none;
}

.sg-stamp--no {
  right: 1rem;
  color: var(--el-red);
  transform: rotate(12deg);
  opacity: var(--sg-no);
}

.sg-stamp--yes {
  left: 1rem;
  color: var(--el-green);
  transform: rotate(-12deg);
  opacity: var(--sg-yes);
}

/* ---------- Carte feedback (ornement incrusté dans le fond) ---------- */
.sg-feedback {
  padding-top: 31%;
}

.sg-feedback--good {
  background-color: var(--el-card-blue);
}

.sg-feedback--good .sg-feedback__tag {
  background-color: var(--el-blue);
}

.sg-feedback--good .sg-feedback__title {
  color: var(--el-blue);
}

.sg-feedback--bad {
  background-color: #000;
}

.sg-feedback--bad .sg-feedback__tag {
  background-color: var(--el-red);
}

.sg-feedback--bad .sg-feedback__title,
.sg-feedback--bad .sg-feedback__text {
  color: #fff;
}

.sg-feedback--bad .sg-progress {
  color: #8a8a8a;
}

.sg-feedback__title {
  margin: 2.25rem 0 1.25rem;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: .95rem;
  line-height: 1.3;
  text-transform: lowercase;
}

.sg-feedback__text {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.85;
  color: #222;
}

/* ---------- Carte finale (« Ce n'est pas terminé ! » incrusté dans le fond) ---------- */
.sg-final {
  padding-top: 32%;
}

.sg-final__title {
  margin: 0;
  font-family: 'Syncopate Bold', sans-serif;
  font-size: .95rem;
  line-height: 1.2;
  text-transform: lowercase;
  color: var(--el-blue);
}

.sg-final__title .sg-tag {
  position: relative;
  z-index: 1;
  display: table;
  margin: .3rem auto 0;
  font-size: 1.15rem;
  text-transform: lowercase;
}

.sg-final__img {
  display: block;
  width: 86%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin-top: -.2rem;
  object-fit: cover;
  object-position: 50% 42%;
}

.sg-final__text {
  margin: 1rem 0 1.25rem;
  font-size: .95rem;
  line-height: 1.4;
  color: #222;
}

/* ---------- Tablette ---------- */
@media screen and (max-width: 1150px) {
  .el-filigrane {
    right: -6rem;
    width: 30rem;
  }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 768px) {
  .el-filigrane {
    right: -9rem;
    width: 20rem;
  }

  .el-hero {
    padding-top: 3rem;
  }

  .el-intro {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 2rem;
    padding: 4rem 1rem 3rem;
  }

  .el-dotations {
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-items: center;
  }

  .el-dotations__text {
    text-align: center;
  }
}

/* ---------- Petits écrans ---------- */
@media screen and (max-width: 360px) {
  .sg-card {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .sg-question__statement,
  .sg-feedback__title {
    font-size: .88rem;
  }
}

/* ---------- Réduction des animations ---------- */
@media (prefers-reduced-motion: reduce) {
  /* La carte suit toujours le doigt (geste direct), seules les animations automatiques sont supprimées */
  .sg-card:not(.is-dragging) {
    transform: none !important;
    transition: opacity .15s linear;
  }

  .sg-btn,
  .sg-choice {
    transition: none;
  }

  .sg-btn:hover {
    transform: none;
  }
}
