/* Enigmous : la page de présentation, posée sur /home.css (l'en-tête et le pied de page de FunArena).
   Palette tirée du jeu : prune de nuit, rose bonbon, menthe, citron, lavande. Police : Fredoka, celle du jeu. */

@font-face {
  font-family: "Fredoka";
  src: url("/enigmous/fonts/fredoka-latin.woff") format("woff");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --enm-panel: rgba(40, 21, 68, 0.84);
  --enm-line: rgba(255, 143, 195, 0.3);
  --enm-line-soft: rgba(255, 143, 195, 0.15);
  --enm-pink: #ff7eb6;
  --enm-pink-soft: #ffc2dd;
  --enm-mint: #54d6b0;
  --enm-mint-soft: #a8f0da;
  --enm-lemon: #ffcf3f;
  --enm-lemon-soft: #ffe58f;
  --enm-lavender: #b28cff;
  --enm-sky: #6fbaff;
  --enm-cream: #fff4fb;
  --enm-text: #e9dcf7;
  --enm-muted: #b8a4d2;
  --enm-plum: #3b0f33;
  --enm-font: "Fredoka", "Trebuchet MS", "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body.enigmous {
  background:
    radial-gradient(900px 520px at 50% -4%, rgba(255, 126, 182, 0.22), transparent 62%),
    radial-gradient(1000px 640px at 92% 78%, rgba(111, 186, 255, 0.13), transparent 60%),
    linear-gradient(180deg, #160a27, #25133d 42%, #160a27);
  color: var(--enm-text);
}

.enigmous .bg-grid {
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 194, 221, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 194, 221, 0.07) 1px, transparent 1px);
}

.enigmous .site-header,
.enigmous .site-footer {
  border-color: var(--enm-line);
  background: rgba(24, 11, 42, 0.8);
}

.enigmous .brand {
  color: var(--enm-cream);
}

.enigmous .site-header nav a:hover,
.enigmous .footer-links a:hover {
  color: var(--enm-pink-soft);
}

.enigmous .footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.enigmous .footer-links a {
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: #000;
  color: var(--enm-cream);
}

.skip:focus {
  left: 12px;
}

main {
  display: block;
}

/* ---------- Le haut de page ---------- */

.enm-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(1120px, 94vw);
  min-height: 620px;
  margin: 20px auto 0;
  padding: 54px 24px 40px;
  border: 1px solid var(--enm-line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 30px 90px rgba(8, 2, 18, 0.55);
}

.enm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("img/hero.webp") center / cover no-repeat;
}

/* Prune au centre, là où est le texte ; l'arc-en-ciel et le château restent visibles sur les côtés. */
.enm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 54% 76% at 50% 52%, rgba(34, 14, 58, 0.84) 0%, rgba(34, 14, 58, 0.58) 56%, rgba(34, 14, 58, 0) 100%),
    linear-gradient(180deg, rgba(34, 14, 58, 0.2) 0%, rgba(34, 14, 58, 0) 26%, rgba(34, 14, 58, 0) 64%, rgba(34, 14, 58, 0.72) 100%);
}

.enm-hero-text {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.enm-mascot {
  position: absolute;
  left: 2.5%;
  bottom: 8px;
  width: 250px;
  height: auto;
  z-index: 1;
  filter: drop-shadow(0 12px 26px rgba(34, 14, 58, 0.5));
  animation: enm-bob 5s ease-in-out infinite;
}

@keyframes enm-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.enm-kicker {
  margin: 0;
  color: var(--enm-lemon-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(20, 6, 36, 0.8);
}

.enm-hero h1 {
  margin: 6px 0 0;
  line-height: 0;
}

.enm-logo {
  display: block;
  width: min(430px, 76vw);
  height: auto;
  filter: drop-shadow(0 6px 22px rgba(24, 8, 44, 0.6));
}

.enm-sub {
  margin: 0;
  color: var(--enm-mint-soft);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: clamp(0.8rem, 1.7vw, 1rem);
  text-shadow: 0 2px 12px rgba(20, 6, 36, 0.8);
}

.enm-lead {
  max-width: 600px;
  margin: 22px 0 0;
  font-size: 1.14rem;
  line-height: 1.7;
  color: var(--enm-cream);
  text-shadow: 0 2px 12px rgba(20, 6, 36, 0.75);
}

.enm-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--enm-font);
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #ffd9ec, var(--enm-pink));
  color: var(--enm-plum);
  box-shadow: 0 10px 28px rgba(255, 126, 182, 0.34);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(255, 126, 182, 0.5);
}

.btn-ghost {
  background: rgba(34, 14, 58, 0.62);
  border-color: rgba(168, 240, 218, 0.6);
  color: var(--enm-cream);
}

.btn-ghost:hover {
  border-color: var(--enm-mint);
  color: var(--enm-mint-soft);
}

.btn-off {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--enm-line-soft);
  color: var(--enm-muted);
  cursor: default;
}

.enm-promise {
  margin: 20px 0 0;
  color: var(--enm-lemon-soft);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 10px rgba(20, 6, 36, 0.8);
}

.chips {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--enm-line);
  background: rgba(34, 14, 58, 0.66);
  color: var(--enm-text);
  font-size: 0.9rem;
}

.chip em {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--enm-muted);
}

.chip.live {
  border-color: rgba(168, 240, 218, 0.65);
}

.chip.live em {
  color: var(--enm-mint-soft);
}

/* ---------- Les sections ---------- */

.enm-section {
  width: min(1120px, 94vw);
  margin: 46px auto 0;
}

.enm-section h2 {
  margin: 0 0 18px;
  font-family: var(--enm-font);
  font-weight: 600;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
  color: var(--enm-cream);
}

.enm-section h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--enm-pink), var(--enm-lemon) 55%, var(--enm-mint));
}

.enm-intro {
  max-width: 760px;
  margin: -4px 0 20px;
  line-height: 1.65;
  color: var(--enm-text);
}

.enm-card {
  padding: 22px;
  border: 1px solid var(--enm-line);
  border-radius: 16px;
  background: var(--enm-panel);
}

.enm-card h3 {
  margin: 0 0 8px;
  font-family: var(--enm-font);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--enm-cream);
}

.enm-card p {
  margin: 0;
  line-height: 1.65;
  color: var(--enm-text);
}

.enm-note {
  margin: 14px 0 0;
  color: var(--enm-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.enm-note a {
  color: var(--enm-pink-soft);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.steps .icon {
  display: block;
  margin-bottom: 14px;
}

.steps .enm-card:nth-child(1) .icon {
  color: var(--enm-mint);
}

.steps .enm-card:nth-child(2) .icon {
  color: var(--enm-lemon);
}

.steps .enm-card:nth-child(3) .icon {
  color: var(--enm-pink);
}

.facts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.facts li {
  padding: 18px 10px 16px;
  text-align: center;
  border: 1px solid var(--enm-line);
  border-radius: 14px;
  background: rgba(36, 18, 62, 0.74);
}

.facts b {
  display: block;
  font-family: var(--enm-font);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1.1;
}

.facts li:nth-child(6n + 1) b {
  color: var(--enm-pink);
}

.facts li:nth-child(6n + 2) b {
  color: var(--enm-lemon);
}

.facts li:nth-child(6n + 3) b {
  color: var(--enm-mint);
}

.facts li:nth-child(6n + 4) b {
  color: var(--enm-lavender);
}

.facts li:nth-child(6n + 5) b {
  color: var(--enm-sky);
}

.facts li:nth-child(6n) b {
  color: var(--enm-pink-soft);
}

.facts span {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--enm-muted);
}

/* ---------- Les dix mondes ---------- */

.worlds {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.worlds li {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--enm-line);
  border-radius: 14px;
  background: #1a0b2c;
}

.worlds img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.worlds li:hover img {
  transform: scale(1.05);
  filter: brightness(1.06);
}

.worlds .w-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 54px 12px 12px;
  background: linear-gradient(180deg, transparent, rgba(24, 8, 42, 0.94) 62%);
}

.worlds .w-num {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--enm-lemon-soft);
}

.worlds h3 {
  margin: 3px 0 0;
  font-family: var(--enm-font);
  font-weight: 600;
  font-size: 1.04rem;
  line-height: 1.2;
  color: var(--enm-cream);
}

.worlds h3::before {
  content: "";
  display: block;
  width: 30px;
  height: 4px;
  margin-bottom: 7px;
  border-radius: 4px;
  background: var(--accent, var(--enm-pink));
}

.worlds p {
  margin: 5px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--enm-text);
}

/* ---------- Les énigmes et les gardiens ---------- */

.ticks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  margin-top: 10px;
  padding-left: 28px;
  line-height: 1.6;
  color: var(--enm-text);
}

.ticks li:first-child {
  margin-top: 0;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.5em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tick, var(--enm-pink));
  box-shadow: 0 0 10px var(--tick, var(--enm-pink));
}

.ticks li:nth-child(5n + 1) {
  --tick: var(--enm-pink);
}

.ticks li:nth-child(5n + 2) {
  --tick: var(--enm-lemon);
}

.ticks li:nth-child(5n + 3) {
  --tick: var(--enm-mint);
}

.ticks li:nth-child(5n + 4) {
  --tick: var(--enm-lavender);
}

.ticks li:nth-child(5n) {
  --tick: var(--enm-sky);
}

.puzzles .ticks {
  columns: 2;
  column-gap: 40px;
}

.puzzles .ticks li {
  break-inside: avoid;
  margin-top: 0;
  padding-bottom: 12px;
}

.story-text {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--enm-cream);
}

.guardians {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guardians li {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--enm-line);
  background: rgba(24, 11, 42, 0.6);
  font-size: 0.92rem;
  color: var(--enm-text);
}

.guardians li::before {
  content: counter(g, decimal-leading-zero);
  margin-right: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--enm-lemon-soft);
}

.guardians {
  counter-reset: g;
}

.guardians li {
  counter-increment: g;
}

/* ---------- La galerie ---------- */

.shots {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 250px));
  justify-content: center;
  gap: 24px 18px;
}

.shots a {
  display: block;
  color: var(--enm-text);
  text-decoration: none;
}

.shots .frame {
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--enm-line);
  border-radius: 20px;
  background: #000;
  box-shadow: 0 16px 40px rgba(6, 1, 14, 0.55);
}

.shots img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.shots a:hover img,
.shots a:focus-visible img {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.shots .cap {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--enm-muted);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--enm-mint);
  outline-offset: 3px;
}

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--enm-cream);
}

.lightbox::backdrop {
  background: rgba(14, 5, 26, 0.93);
}

.lightbox figure {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4vh 70px;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border: 1px solid var(--enm-line);
  border-radius: 14px;
  background: #000;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
}

.lightbox figcaption {
  text-align: center;
  font-size: 0.98rem;
}

.lb-count {
  margin-left: 8px;
  color: var(--enm-muted);
}

.lb-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--enm-line);
  background: rgba(30, 12, 52, 0.85);
  color: var(--enm-cream);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.lb-btn:hover {
  border-color: var(--enm-pink);
  color: var(--enm-pink-soft);
}

.lb-close {
  top: 18px;
  right: 18px;
}

.lb-prev {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- Gratuit ou sans pub ; où jouer ---------- */

.offer {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.enm-card .tag {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #06241c;
  background: linear-gradient(120deg, var(--enm-mint-soft), var(--enm-mint));
}

.enm-card.offer-full {
  border-color: rgba(255, 207, 63, 0.5);
  box-shadow: inset 0 0 40px rgba(255, 207, 63, 0.06);
}

.enm-card.offer-full .tag {
  color: #2b1d00;
  background: linear-gradient(120deg, var(--enm-lemon-soft), var(--enm-lemon));
}

.offer-free p + .ticks {
  margin-top: 12px;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.platform {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.platform p {
  color: var(--enm-muted);
  margin-bottom: 14px;
}

.platform .btn {
  margin-top: auto;
}

.platform.live {
  border-color: rgba(168, 240, 218, 0.5);
}

.enm-foot {
  width: min(1120px, 94vw);
  margin: 34px auto 26px;
  text-align: center;
  font-size: 0.92rem;
}

.enm-foot a {
  color: var(--enm-muted);
}

.enm-foot a:hover {
  color: var(--enm-pink-soft);
}

/* ---------- Apparition douce (seulement si le script tourne) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .enm-mascot {
    animation: none;
  }

  .shots img,
  .worlds img,
  .btn {
    transition: none;
  }
}

/* ---------- Petits écrans ---------- */

@media (max-width: 1060px) {
  .enm-mascot {
    position: static;
    width: 150px;
    margin: -8px 0 4px;
  }
}

@media (max-width: 960px) {
  .facts {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .steps,
  .offer,
  .platforms {
    grid-template-columns: 1fr;
  }

  .worlds {
    grid-template-columns: repeat(2, 1fr);
  }

  .shots {
    grid-template-columns: repeat(2, minmax(0, 250px));
  }

  .puzzles .ticks {
    columns: 1;
  }

  .enm-hero {
    min-height: 0;
    padding: 36px 18px 32px;
  }

  .lightbox figure {
    padding: 8vh 14px 14px;
  }

  .lb-prev {
    top: auto;
    bottom: 14px;
    left: 14px;
    transform: none;
  }

  .lb-next {
    top: auto;
    bottom: 14px;
    right: 14px;
    transform: none;
  }
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .worlds {
    gap: 8px;
  }

  .worlds .w-caption {
    padding: 40px 8px 9px;
  }

  .worlds h3 {
    font-size: 0.92rem;
  }

  .worlds p {
    display: none;
  }

  .shots {
    gap: 18px 10px;
  }

  .shots .cap {
    font-size: 0.8rem;
  }

  .btn {
    width: 100%;
  }

  .enm-actions {
    width: 100%;
  }
}
