/*
 * Gemmora Blast : la page de présentation, partie commune à toutes les pages (accueil, mentions légales, 404).
 * Mêmes couleurs que le jeu : un violet nuit profond, de l'or, le crème des cartes, et le vert du gros bouton « Jouer ».
 * La mise en scène de l'accueil (défilement épinglé, téléphone, parallaxe) est dans home.css.
 */
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

:root {
  --night: #140a3a;
  --night-2: #1d0d57;
  --indigo: #2a1680;
  --violet: #4b22b0;
  --line: rgb(255 255 255 / 14%);
  --ink: #f6f1ff;
  --muted: #cfc2f5;
  --gold: #ffc533;
  --gold-2: #ffab1f;
  --gold-3: #c97a06;
  --cream: #fff3df;
  --green: #4fdc74;
  --green-2: #1faa45;
  --green-dark: #14561e;
  --paper: #fff7e8;
  --paper-2: #ffeacc;
  --paper-ink: #3d1150;
  --paper-muted: #7a4f80;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1120px;
  --top-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--top-h) + 12px);
  -webkit-text-size-adjust: 100%;
  background: var(--night);
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--night);
  overflow-x: clip;
}
img {
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3,
p,
ul,
ol,
figure,
dl {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 10px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--gold);
  color: #4a1466;
  font-weight: 800;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}
.wrap {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
}
.wrap--narrow {
  width: min(100% - 40px, 780px);
}
.nowrap {
  white-space: nowrap;
}
.muted {
  opacity: 0.75;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    filter 0.2s,
    box-shadow 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(1px);
}
.btn--small {
  min-height: 44px;
  padding: 0 20px;
  font-size: 1rem;
}
.btn--big {
  min-height: 62px;
  padding: 0 38px;
  font-size: 1.32rem;
}
/* Le bouton or du bandeau du haut. */
.btn--gold {
  color: #4a1466;
  background: linear-gradient(180deg, #ffe07a 0%, var(--gold-2) 100%);
  box-shadow:
    0 3px 0 var(--gold-3),
    0 8px 16px rgb(0 0 0 / 30%),
    inset 0 2px 0 rgb(255 255 255 / 60%);
}
/* Le gros bouton vert du jeu, cerné d'or. */
.btn--play {
  color: #fff;
  border: 3px solid var(--gold);
  background: linear-gradient(180deg, #6ff08f 0%, var(--green) 38%, var(--green-2) 100%);
  text-shadow: 0 2px 0 var(--green-dark);
  box-shadow:
    0 4px 0 var(--gold-3),
    0 10px 22px rgb(10 60 20 / 45%),
    inset 0 3px 0 rgb(255 255 255 / 45%);
}
.btn--play svg {
  flex: none;
  filter: drop-shadow(0 2px 2px rgb(10 50 20 / 55%));
}
.btn--ghost {
  color: var(--cream);
  background: rgb(255 255 255 / 8%);
  border: 2px solid rgb(255 255 255 / 38%);
  backdrop-filter: blur(6px);
}
.btn--ink {
  color: var(--paper-ink);
  background: rgb(61 17 80 / 6%);
  border: 2px solid rgb(61 17 80 / 22%);
}

/* ---------- Bandeau du haut ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--top-h);
  padding: 0 max(20px, calc((100% - var(--wrap)) / 2));
  background: rgb(20 10 58 / 72%);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.top__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gold);
}
.top__brand img {
  border-radius: 12px;
}

/* ---------- Langue écrite de droite à gauche (arabe) : <html data-rtl> ----------
   La mise en page ne se retourne pas (le téléphone épinglé et la galerie qui défile sont placés par la gauche et la droite) : seul le
   texte change de sens, bloc par bloc, et s'aligne à droite là où il s'alignait à gauche. */
[data-rtl] :is(h1, h2, h3, h4, p, li, ol, ul, summary, dt, dd, figcaption) {
  direction: rtl;
}
[data-rtl] .langs :is(ul, li) {
  direction: ltr;
}

/* ---------- Choix de la langue (barre du haut) : un bouton au drapeau de la page, la liste des langues dessous ---------- */
.top__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.langs {
  position: relative;
}
.langs summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  list-style: none;
  cursor: pointer;
}
.langs summary::-webkit-details-marker {
  display: none;
}
.langs img {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.langs ul {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: min(330px, calc(100vw - 24px));
  max-height: min(70vh, 460px);
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 18px;
  background: var(--night-2);
  box-shadow: 0 18px 40px rgb(0 0 0 / 45%);
}
.langs a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.langs a:hover,
.langs a[aria-current] {
  background: rgb(255 255 255 / 12%);
}
.langs a[aria-current] {
  color: var(--gold);
}

/* Sur téléphone, la barre du haut est étroite : le bouton ne garde que le drapeau, dans un rond de 44 px. */
@media (max-width: 560px) {
  .top {
    gap: 8px;
    padding-inline: 12px;
  }
  .top__brand {
    gap: 8px;
    white-space: nowrap;
  }
  .top__actions {
    gap: 6px;
  }
  .langs summary {
    justify-content: center;
    width: 44px;
    padding: 0;
    border-color: transparent;
  }
  .langs summary span {
    display: none;
  }
  .langs summary img {
    width: 28px;
    height: 28px;
  }
  /* La liste prend la largeur de l'écran, sous la barre (le bouton n'est pas au bord : elle déborderait). */
  .langs ul {
    position: fixed;
    top: calc(var(--top-h) + 6px);
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* Petits téléphones : le nom du jeu, le drapeau, « Jouer » (plus long dans d'autres langues) et le menu doivent tenir sur une ligne. */
@media (max-width: 400px) {
  .top {
    gap: 6px;
    padding-inline: 10px;
  }
  .top__brand {
    gap: 6px;
    font-size: 1.1rem;
  }
  .top__brand img {
    width: 36px;
    height: 36px;
  }
  .top__actions {
    gap: 4px;
  }
  .top .btn--small {
    padding-inline: 12px;
  }
  .langs summary {
    width: 40px;
  }
}

/* ---------- Pied de page ---------- */
.foot {
  position: relative;
  z-index: 2;
  padding: 30px 0 calc(30px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #0d0628;
  color: var(--muted);
  font-size: 0.95rem;
}
.foot__row {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-weight: 800;
}
.foot nav a {
  text-decoration: none;
}
.foot nav a:hover {
  color: var(--gold);
}
@media (min-width: 860px) {
  .foot__row {
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    text-align: left;
  }
  .foot__row p {
    justify-self: center;
    text-align: center;
  }
}

/* ---------- Listes à déplier (installation, questions) ---------- */
.os,
.faq {
  display: grid;
  gap: 10px;
}
.os__item,
.faq details {
  border-radius: 20px;
  background: rgb(255 255 255 / 7%);
  border: 1px solid var(--line);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.os__item[open],
.faq details[open] {
  background: rgb(255 255 255 / 11%);
  border-color: rgb(255 197 51 / 45%);
}
.os summary,
.faq summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.os summary::-webkit-details-marker,
.faq summary::-webkit-details-marker {
  display: none;
}
.os summary::after,
.faq summary::after {
  content: '';
  flex: none;
  width: 11px;
  height: 11px;
  margin-left: auto;
  border-right: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate 0.25s var(--ease);
}
.os details[open] > summary::after,
.os__item[open] > summary::after,
.faq details[open] > summary::after {
  rotate: 225deg;
  translate: 0 2px;
}
.os__ico {
  font-size: 1.4rem;
}
.you {
  display: none;
  margin-left: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #4a1466;
  font-family: var(--font);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.os__item.is-you .you {
  display: inline-block;
}
.os__item ol {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px 18px;
  counter-reset: s;
}
.os__item li {
  position: relative;
  padding-left: 40px;
  counter-increment: s;
}
.os__item li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #4a1466;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.os__item strong {
  color: var(--gold);
}
.faq p {
  padding: 0 18px 18px;
  color: var(--cream);
}

.toast {
  min-height: 1.4em;
  margin-top: 8px;
  color: var(--gold);
  font-weight: 800;
}

/* ---------- Page 404 ---------- */
.lost {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 40px 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgb(120 80 255 / 35%), transparent 70%),
    linear-gradient(180deg, var(--night), var(--night-2));
}
.lost__box {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}
.lost__box img {
  width: min(60%, 200px);
  filter: drop-shadow(0 14px 18px rgb(0 0 0 / 40%));
}
.lost h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  color: var(--gold);
}

/* ---------- Mentions légales et confidentialité ---------- */
.legal {
  background: linear-gradient(180deg, var(--night), var(--night-2));
}
.legal__main {
  padding-block: 32px 64px;
  display: grid;
  gap: 16px;
}
.legal__main h1 {
  font-family: var(--font-display, inherit);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin: 0;
}
.legal__card {
  padding: 18px 18px 8px;
  border-radius: 18px;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 14%);
}
.legal__card h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}
.legal__card p,
.legal__card li,
.legal__card dd {
  line-height: 1.55;
}
.legal__card ul {
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  list-style: disc;
}
.legal__card p {
  margin-bottom: 12px;
}
.legal__card dl {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}
.legal__card dt {
  font-weight: 800;
  opacity: 0.75;
  font-size: 0.85rem;
}
.legal__card dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.legal__card a,
.legal__main > p a {
  color: var(--gold);
  overflow-wrap: anywhere;
}
