/* ════════════════════════════════
   RULES — carrousel de cartes + parchemin
   même esprit que login.css / profile.css / scoreboard.css
   ════════════════════════════════ */

.rules-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 2.5rem 1.5rem 3rem;
  font-family: var(--font-body);
}

.rules-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: #e8d9b5;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.rules-sub {
  font-size: 14px;
  color: #cbb98f;
  margin: 0 0 2rem;
  text-align: center;
}

/* ── Carrousel ── */
.rules-carousel {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.rules-nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(28, 23, 18, 0.75);
  color: #e8d9b5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.rules-nav:hover {
  background: rgba(212, 175, 55, 0.18);
  transform: scale(1.06);
}

.rules-nav:active {
  transform: scale(0.96);
}

.rules-viewport {
  position: relative;
  flex: 1;
  height: 420px;
  max-width: 720px;
  /* le "perspective" global donne de la profondeur au flip des cartes */
  perspective: 1400px;
  overflow: hidden;
}

.rules-viewport::before,
.rules-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  z-index: 20;
  pointer-events: none;
}

.rules-viewport::before {
  left: 0;
  background: linear-gradient(to right, rgba(17, 14, 10, 0.55), transparent);
}

.rules-viewport::after {
  right: 0;
  background: linear-gradient(to left, rgba(17, 14, 10, 0.55), transparent);
}

.card-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.card-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 330px;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s ease,
              filter 0.4s ease;
}

.card-slot.is-center {
  cursor: default;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.card-face,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2a2015;
  border: 1px solid rgba(212, 175, 55, 0.35);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  transform: rotateY(180deg);
}

/* ── Indicateurs (points) ── */
.rules-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 1.5rem 0 2rem;
  max-width: 640px;
}

.rules-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rules-dot:hover {
  transform: scale(1.2);
}

.rules-dot.active {
  background: #d4af37;
}

/* ── Parchemin de règles ── */
.rule-parchment {
  width: 100%;
  max-width: 560px;
  padding: 1.75rem 2.25rem;
  box-sizing: border-box;

  border: 2px solid #3a2e1f;
  background: rgba(235, 220, 190, 0.94);
  box-shadow: 0 0 0 4px rgba(180, 140, 70, 0.3), 0 8px 32px rgba(0, 0, 0, 0.6);

  text-align: center;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.rule-parchment.is-fading {
  opacity: 0;
  transform: translateY(4px);
}

.rule-card-name {
  font-family: var(--font-title);
  font-size: 22px;
  color: #3a2e1f;
  margin: 0 0 0.6rem;
  letter-spacing: 0.02em;
}

.rule-card-text {
  font-size: 16px;
  line-height: 1.5;
  color: #2a2015;
  margin: 0;
}

/* ════════════════════════════════
   MOBILE
   ════════════════════════════════ */
@media (max-width: 600px) {
  .rules-page {
    padding: 1.5rem 1rem 2.5rem;
  }

  .rules-carousel {
    gap: 0.4rem;
  }

  .rules-nav {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .rules-viewport {
    height: 320px;
  }

  .card-slot {
    width: 150px;
    height: 225px;
  }

  .rule-parchment {
    padding: 1.25rem 1.5rem;
  }

  .rule-card-name {
    font-size: 19px;
  }

  .rule-card-text {
    font-size: 14px;
  }
}