/* Cristalune, site vitrine. La page est une descente : on part de l'aube au-dessus des nuages, on finit au fond du Creux.
   Couleurs prises aux peintures du jeu : pêche et rose des nuages, cyan du Cœur, or du logo, violet du Creux.
   Polices : Titan One (celle du jeu) et Nunito ; en japonais et en coréen, les polices du système (rien à télécharger). */

@font-face { font-family: "Titan One"; src: url("/assets/fonts/TitanOne.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/Nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --dawn: #fce6cd;
  --peach: #fbd2b4;
  --rose: #f6bccb;
  --sky: #a9c6f5;
  --blue: #4f6fd0;
  --dusk: #3a3392;
  --night: #241a5e;
  --abyss: #150d38;
  --plum: #433a4d;
  --crystal: #4fdcff;
  --gold: #ffc53d;
  --gold-dark: #c97a10;
  --ink: #2b1e55;
  --ink-soft: #57487f;
  --snow: #fff9f0;
  --snow-soft: #cfc6ee;
  --paper: #fffaf2;
  --paper-ink: #2b2147;
  --paper-muted: #6a5f88;
  --paper-line: #eadfca;
  --link: #3f4fc4;
  --todo-bg: #ffe066;
  --todo-ink: #5a3b00;
  --title: "Titan One", "Hiragino Maru Gothic ProN", "Apple SD Gothic Neo", "Noto Sans CJK JP", "Noto Sans KR", sans-serif;
  --text: "Nunito", -apple-system, "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans JP", "Noto Sans KR", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #231a55;
    --paper-ink: #f1ecff;
    --paper-muted: #bcb2de;
    --paper-line: #3d3380;
    --link: #8fe6ff;
  }
}
:root[data-theme="dark"] {
  --paper: #231a55;
  --paper-ink: #f1ecff;
  --paper-muted: #bcb2de;
  --paper-line: #3d3380;
  --link: #8fe6ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--abyss); color: var(--ink); font: 500 1.0625rem/1.55 var(--text); overflow-x: hidden; }
img, video { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--title); font-weight: 400; line-height: 1.15; margin: 0; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ko) h1, :lang(ko) h2, :lang(ko) h3,
:lang(ja) .tagline, :lang(ko) .tagline { font-weight: 800; }
:lang(ja) { word-break: auto-phrase; }
h2 { font-size: clamp(1.9rem, 5.2vw, 3rem); }
:lang(ja) h2, :lang(ko) h2 { font-size: clamp(1.6rem, 4.6vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--crystal); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.sub { max-width: 40em; margin-top: .6em; }
section { padding-block: clamp(48px, 9vw, 96px); }
section + section { margin-top: -1px; } /* sans ça, le fond sombre de la page passe entre deux sections aux tailles fractionnaires */

/* Accueil : l'aube */
.hero { padding: 0; background: var(--dawn); }
.hero-art { position: relative; }
.hero-art > img { width: 100%; height: clamp(300px, 64vw, 78vh); object-fit: cover; object-position: 50% 30%; }
.hero-art::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, var(--dawn)); }
.hero h1 { position: absolute; top: clamp(10px, 2.4vw, 32px); left: clamp(12px, 3vw, 48px); width: clamp(170px, 26vw, 400px); z-index: 1; filter: drop-shadow(0 4px 10px rgba(43, 30, 85, .35)); }
.hero-copy { position: relative; z-index: 1; width: min(760px, 100% - 32px); margin: -6vw auto 0; padding-bottom: 44px; text-align: center; }
.tagline { font: 400 clamp(2rem, 6.4vw, 3.5rem)/1.1 var(--title); color: var(--ink); }
.lead { margin-top: .7em; color: var(--ink-soft); font-size: 1.125rem; font-weight: 600; }
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.store { display: inline-flex; align-items: center; gap: 10px; min-width: 176px; padding: 9px 18px 9px 14px; border-radius: 14px; background: #2b1e55; color: #fff; text-align: left; opacity: .82; cursor: not-allowed; box-shadow: 0 4px 0 #18102f; }
.store svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--gold); }
.store b { display: block; font-size: 1rem; line-height: 1.2; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 24px; }
.facts li { padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .6); color: var(--ink); font-weight: 800; font-size: .95rem; }

/* Le royaume */
.story { background: linear-gradient(var(--dawn), var(--peach)); }
.two { display: grid; gap: 28px; align-items: center; }
.story p { margin-top: .7em; }
.bubbles { display: grid; gap: 12px; }
.bubbles li { padding: 14px 18px; border-radius: 20px 20px 20px 6px; background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 3px 0 rgba(43, 30, 85, .12); }
.bubbles li:nth-child(2) { margin-left: 8%; border-radius: 20px 20px 6px 20px; background: #e6f8ff; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* Le jeu */
.play { background: linear-gradient(var(--peach), var(--rose)); }
.shots { display: flex; gap: 12px; margin: 24px -16px 0; padding: 4px 16px 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots img { flex: 0 0 86%; width: 86%; border-radius: 14px; scroll-snap-align: center; background: var(--night); box-shadow: 0 6px 0 rgba(43, 30, 85, .25); }
@media (min-width: 900px) {
  .shots { display: grid; grid-template-columns: repeat(6, 1fr); margin: 28px 0 0; padding: 0; overflow: visible; gap: 14px; }
  .shots img { width: 100%; grid-column: span 2; }
  .shots img:nth-child(1), .shots img:nth-child(2) { grid-column: span 3; }
}
.feats { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 620px) { .feats { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .feats { grid-template-columns: repeat(3, 1fr); } }
.card { padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .72); }
.card h3 { color: var(--dusk); }
.card p { margin-top: .35em; font-size: 1rem; }

/* La ville */
.city { background: linear-gradient(var(--rose), var(--sky)); }
.city-art { width: 100%; margin-top: 24px; border-radius: 18px; background: var(--peach); box-shadow: 0 6px 0 rgba(43, 30, 85, .22); }
.places { display: grid; gap: 14px 28px; margin-top: 24px; }
@media (min-width: 620px) { .places { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .places { grid-template-columns: repeat(3, 1fr); } }
.places h3 { color: var(--dusk); font-size: 1.15rem; }
.places p { margin-top: .2em; font-size: .98rem; }

/* Les classes : on passe sous les nuages */
.classes { background: linear-gradient(var(--sky), var(--blue) 26%, var(--dusk)); color: var(--snow); }
.classes h2, .classes .sub { text-shadow: 0 2px 8px rgba(36, 26, 94, .45); }
.tabs { display: flex; gap: 6px; margin: 22px -16px 0; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; width: 76px; padding: 6px 2px; border: 0; border-radius: 14px; background: none; color: var(--snow); font: 800 .78rem/1.15 var(--text); cursor: pointer; }
.tabs button img { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 50%; }
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px var(--gold); }
@media (min-width: 1000px) { .picker-classe .tabs { justify-content: space-between; margin-inline: 0; padding-inline: 0; overflow: visible; } }
.hero-card { display: grid; gap: 16px; margin-top: 10px; }
.portrait { max-height: 300px; width: auto; margin-inline: auto; -webkit-mask-image: linear-gradient(#000 86%, transparent); mask-image: linear-gradient(#000 86%, transparent); }
.hero-text h3 { font-size: 1.9rem; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pills li { padding: 1px 10px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-weight: 800; font-size: .85rem; }
.hero-text p { margin-top: 10px; }
.tips { margin-top: 10px; }
.tips li { position: relative; padding-left: 20px; font-size: .98rem; }
.tips li::before { content: ""; position: absolute; left: 3px; top: .5em; width: 9px; height: 9px; transform: rotate(45deg); background: var(--crystal); }
.fx { margin: 0; }
.clip { width: 100%; border-radius: 14px; background: var(--plum); }
.fx figcaption { margin-top: 6px; font-size: .92rem; color: var(--snow-soft); }
.fx figcaption b { color: var(--gold); }
@media (min-width: 900px) {
  .hero-card { grid-template-columns: 300px 1fr; column-gap: 32px; align-items: start; }
  .portrait { grid-row: span 2; max-height: 400px; }
  .fx { max-width: 460px; }
}

/* Les biomes : plus on descend, plus il fait nuit */
.world { background: linear-gradient(var(--dusk), var(--night)); color: var(--snow); }
.isles { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 14px; margin-top: 28px; }
.isles li { text-align: center; }
.isles img { width: 100%; aspect-ratio: 1; object-fit: contain; animation: bob 7s ease-in-out infinite alternate; }
.isles li:nth-child(even) img { animation-delay: -3.5s; }
.isles h3 { margin-top: 6px; font-size: 1.1rem; }
.isles small { display: block; font-weight: 800; color: var(--gold); }
.isles p { margin-top: 4px; color: var(--snow-soft); font-size: .92rem; line-height: 1.4; }
@media (min-width: 900px) {
  .isles { grid-template-columns: repeat(5, 1fr); gap: 34px 20px; }
  .isles li:nth-child(even) { margin-top: 44px; }
}
@keyframes bob { from { transform: translateY(-5px); } to { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .isles img { animation: none; } }

/* Le bestiaire */
.bestiary { background: linear-gradient(var(--night), var(--abyss)); color: var(--snow); }
.picker-boss .tabs button { width: 72px; }
.picker-boss .tabs button img { border-radius: 14px; margin-bottom: 0; }
@media (min-width: 800px) { .picker-boss .tabs { margin-inline: 0; padding-inline: 0; } }
.boss-card { display: grid; gap: 14px; margin-top: 10px; }
.boss-card .clip { max-width: 420px; }
.boss-card h3 { font-size: 1.7rem; color: var(--gold); }
.quip { margin-top: 6px; font-size: 1.15rem; font-weight: 700; }
@media (min-width: 760px) { .boss-card { grid-template-columns: 420px 1fr; gap: 32px; align-items: center; } }
.crowd { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 28px; }
.crowd img { width: clamp(52px, 12vw, 72px); height: auto; }

/* La fin */
.cta { background: var(--abyss); color: var(--snow); text-align: center; padding-inline: 16px; }
.cta img { width: 92px; margin: 0 auto 12px; filter: drop-shadow(0 0 26px rgba(79, 220, 255, .75)); }
.cta p { margin-top: .4em; color: var(--snow-soft); }
.cta .store { background: #31276f; box-shadow: 0 4px 0 #0e0826; opacity: 1; }

/* Jauge de descente, sur grand écran */
.gauge { display: none; }
@media (min-width: 1280px) {
  .gauge { --k: 0; display: block; position: fixed; right: 18px; top: 16vh; height: 68vh; width: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); z-index: 5; }
  .gauge i { position: absolute; left: 50%; top: calc(var(--k) * 100%); width: 16px; height: 16px; margin: -8px 0 0 -8px; transform: rotate(45deg); background: var(--crystal); box-shadow: 0 0 14px var(--crystal); }
  .gauge span { position: absolute; right: 14px; top: calc(var(--k) * 100%); transform: translateY(-50%); padding: 1px 8px; border-radius: 99px; background: rgba(21, 13, 56, .72); color: #fff; font: 800 .75rem/1.5 var(--text); white-space: nowrap; }
}

/* Pied de page */
.foot { background: var(--abyss); color: var(--snow-soft); font-size: .92rem; }
.foot-in { width: min(1080px, 100% - 32px); margin-inline: auto; padding: 24px 0 32px; border-top: 1px solid rgba(255, 255, 255, .14); }
.foot-links, .langs { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a { padding: 3px 0; color: var(--snow); }
.langs { margin-top: 12px; }
.langs a { padding: 3px 0; color: var(--snow-soft); text-decoration: none; }
.langs a:hover { text-decoration: underline; }
.langs a[aria-current] { color: var(--gold); font-weight: 800; }
.copy { margin-top: 12px; font-size: .85rem; }

/* Pages de texte */
body.legal { background: var(--peach); }
.bar { padding: 14px 16px; text-align: center; background: linear-gradient(var(--sky), var(--peach)); }
.bar img { width: 190px; margin-inline: auto; }
.paper { width: min(760px, 100% - 24px); margin: 0 auto 32px; padding: clamp(20px, 5vw, 44px); border-radius: 18px; background: var(--paper); color: var(--paper-ink); font-size: 1rem; line-height: 1.6; overflow-wrap: break-word; }
.paper h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
.paper h2 { margin-top: 1.6em; font-size: 1.3rem; }
.paper h3 { margin-top: 1.2em; font: 800 1.02rem/1.3 var(--text); }
.paper p { margin-top: .7em; }
.paper ul, .paper ol { margin-top: .6em; padding-left: 1.4em; list-style: revert; }
.paper li { margin-top: .25em; }
.paper a { color: var(--link); }
.paper table { width: 100%; margin-top: .8em; border-collapse: collapse; font-size: .92rem; }
.paper th, .paper td { padding: 7px 8px; border: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
@media (max-width: 620px) {
  .paper table, .paper tbody, .paper tr, .paper td { display: block; border: 0; }
  .paper tr:first-child { display: none; }
  .paper tr { padding: 8px 0; border-top: 1px solid var(--paper-line); }
  .paper td { padding: 1px 0; }
  .paper td:first-child { font-weight: 800; }
}
.paper .updated { color: var(--paper-muted); font-size: .9rem; }
.draft { padding: 7px 12px; border-radius: 10px; background: var(--todo-bg); color: var(--todo-ink); font-weight: 800; font-size: .92rem; }
mark.todo { padding: 0 3px; border-radius: 3px; background: var(--todo-bg); color: var(--todo-ink); }
.button { display: inline-block; padding: 9px 18px; border-radius: 12px; background: var(--gold); box-shadow: 0 3px 0 var(--gold-dark); font-weight: 800; text-decoration: none; }
.paper a.button { color: #2b1e55; }
.mail { display: inline-block; margin-left: 8px; color: var(--paper-muted); }
.warn { font-weight: 800; }
.credits span { color: var(--paper-muted); }
.paper ul.lang-list { padding: 0; list-style: none; columns: 2; }
