/* Charte Nidoko : dégradé bleu → violet, or des pièces, brun du lettrage */
@font-face {
  font-family: "Fredoka";
  src: url("/fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --blue: #3f97f0;
  --indigo: #6f7ef2;
  --purple: #b45df0;
  --gold: #ffc93c;
  --gold-light: #ffe58a;
  --gold-dark: #e09a1a;
  --brown: #5c3418;
  --cream: #fff8e1;
  --text: #2b1a0c;
  --muted: #5f4b37;
  --page: #fffdf6;
  --card: #ffffff;
  --link: #4a55c9;
  --gradient: linear-gradient(135deg, var(--blue), var(--indigo) 50%, var(--purple));
  /* Même dégradé, un ton plus profond : texte blanc lisible (contraste AA ≥ 4,5:1) */
  --gradient-text: linear-gradient(135deg, #2673cc, #5b66e0 50%, #9a44d8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #f4ecdf;
    --muted: #d3c4ae;
    --page: #17121f;
    --card: #221b2e;
    --cream: #2b2236;
    --link: #b3bbff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  color: var(--text);
  background: var(--page);
  line-height: 1.55;
  font-size: 18px;
  overflow-x: hidden;
}

a { color: var(--link); }
img { max-width: 100%; }
h1, h2, h3, .tagline { text-wrap: balance; }
p, li { text-wrap: pretty; }
:lang(ja) { word-break: auto-phrase; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 10;
  background: var(--gold); color: var(--brown); font-weight: 700;
  padding: 8px 16px; border-radius: 12px;
}
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* En-tête du site */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  position: relative;
  z-index: 3;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 24px; }
.topbar .brand img { width: 40px; height: 40px; border-radius: 10px; }

/* Sélecteur de langue (sans JavaScript) */
.langs { position: relative; }
.langs summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 999px;
  padding: 6px 16px;
  white-space: nowrap;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: " ▾"; }
.langs[open] summary { background: rgba(255,255,255,.18); }
.langs ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--card);
  border: 3px solid var(--gold-light);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(30,20,60,.3);
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  width: max-content;
  max-width: calc(100vw - 32px);
}
.langs a, .footer-langs a {
  display: block;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.langs a:hover, .footer-langs a:hover { background: var(--cream); }
.langs a[aria-current], .footer-langs a[aria-current] { font-weight: 700; background: var(--cream); }

/* Bandeau principal */
.hero {
  background: var(--gradient-text);
  color: #fff;
  padding-bottom: 72px;
  overflow: hidden;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
  align-items: center;
  padding-top: 16px;
  position: relative;
  z-index: 1;
}
.hero h1 { margin: 0 0 16px; font-weight: 700; }
.wordmark {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(64px, 12vw, 112px);
  font-weight: 700;
  line-height: 1.05;
  padding-top: .15em;
  color: #fff;
  -webkit-text-stroke: 6px var(--brown);
  paint-order: stroke fill;
  text-shadow: 0 6px 12px rgba(0,0,0,.25);
  direction: ltr;
}
[dir="rtl"] .wordmark { text-align: right; }
.wordmark .i { position: relative; display: inline-block; }
/* Étoile dorée à la place du point du i, comme sur l'icône */
.wordmark .star {
  position: absolute;
  width: .54em;
  height: .54em;
  left: 50%;
  top: -.18em;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
}
.tagline { display: block; font-size: clamp(26px, 4vw, 36px); font-weight: 600; margin: 8px 0 0; line-height: 1.25; }
.lead { font-size: 20px; max-width: 36ch; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.note { font-size: 16px; margin: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 20px;
  border: 3px solid var(--gold-dark);
  box-shadow: 0 6px 0 var(--gold-dark);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--gold-dark); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-dark); }
.btn.big { font-size: 22px; padding: 16px 30px; }
.play-icon { width: 1.3em; height: 1.3em; flex: none; }
.hero-shot { justify-self: center; }
.hero-shot img { display: block; width: min(320px, 70vw); height: auto; border-radius: 28px; box-shadow: 0 24px 48px rgba(30,20,60,.35); }

/* Pièces décoratives */
.coin {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-light), var(--gold) 60%);
  border: 6px solid var(--gold-dark);
  opacity: .9;
}
.coin::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold-dark); font-size: 60%; }

/* Sections */
section { padding: 64px 0; }
section.tint { background: var(--cream); }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; margin: 0 0 12px; color: var(--text); }
.section-lead { color: var(--muted); margin: 0 0 24px; max-width: 62ch; }

.features {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px;
}
.card {
  background: var(--card);
  border: 4px solid var(--gold-light);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(92,52,24,.08);
}
.card .icon { font-size: 36px; line-height: 1; }
.card h3 { margin: 12px 0 6px; font-size: 22px; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); }

/* Captures : bande défilante à accroche magnétique */
.shots {
  list-style: none;
  margin: 0 -16px;
  padding: 8px 16px 24px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}
.shots li { flex: none; scroll-snap-align: start; }
.shots img { display: block; width: min(260px, 62vw); height: auto; border-radius: 24px; box-shadow: 0 12px 28px rgba(30,20,60,.2); }
.shots-note { color: var(--muted); font-size: 16px; margin: 0 0 16px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.panel { background: var(--cream); border-radius: 32px; padding: 36px 28px; }
.ticks, .safety ul { margin: 16px 0 0; padding-inline-start: 22px; }
.ticks li, .safety li { margin: 10px 0; }
.ticks li::marker { content: "★  "; color: var(--gold-dark); }

.safety { background: var(--gradient-text); color: #fff; border-radius: 32px; padding: 36px 28px; }
.safety h2 { color: #fff; }

.download { text-align: center; }
.download .section-lead { margin-left: auto; margin-right: auto; }
.download .note { color: var(--muted); margin-top: 20px; }

footer { padding: 40px 0 56px; color: var(--muted); font-size: 16px; text-align: center; border-top: 2px solid var(--cream); }
footer a { color: var(--link); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.footer-langs {
  list-style: none; margin: 24px auto 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  max-width: 820px;
}
.footer-langs a { padding: 4px 10px; color: var(--muted); }
.footer-langs.big a { font-size: 20px; padding: 10px 16px; color: var(--text); border: 2px solid var(--gold-light); }

/* Page racine (choix de la langue, avant redirection) */
body.chooser .hero { text-align: center; padding: 40px 0 48px; }
body.chooser .wordmark { text-align: center; }
.chooser-logo { border-radius: 24px; }
body.chooser main { padding: 40px 0 64px; text-align: center; }

/* Pages de texte (politique de confidentialité) */
body.doc > header { background: var(--gradient-text); color: #fff; text-align: center; padding: 32px 16px 24px; }
body.doc > header h1 { margin: 8px 0 4px; }
body.doc > header .meta { margin: 0; opacity: .95; font-size: 15px; }
body.doc > header .meta a { color: #fff; }
body.doc > main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
body.doc > main h2 { font-size: 24px; margin-top: 32px; }

/* Page de repli des liens d'ajout (/rejoindre/<CODE>) */
body.join > main { text-align: center; }
.join-message { font-size: 20px; }
.join-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 16px; }
.join-open { font-size: 22px; padding: 18px 32px; }
[hidden] { display: none !important; }

/* Page d'action de compte (/compte/action) : adresse confirmée, nouveau mot de passe */
.account-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 16px auto 0; text-align: start; }
.account-email { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.account-password { display: flex; gap: 8px; }
.account-password input {
  flex: 1; min-width: 0; font: inherit; padding: 12px 14px; border-radius: 12px;
  border: 2px solid var(--indigo); background: var(--card); color: var(--text);
}
.account-toggle { font: inherit; font-size: 15px; border: 0; background: none; color: var(--link); cursor: pointer; padding: 0 8px; }
.account-form .btn { align-self: center; border: 0; cursor: pointer; font: inherit; }
body.account-action .join-actions button.btn { border: 0; cursor: pointer; font: inherit; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .wordmark, [dir="rtl"] .wordmark { text-align: center; }
  .coin-top { display: none; }
  .lead { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .cta .note { flex-basis: 100%; }
  section { padding: 48px 0; }
  .two { grid-template-columns: 1fr; }
  .langs ul { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
