/* Générateur « J'y serai ! » — mini-site autonome, palette de l'affiche (bleu royal & or) */
@font-face { font-family: "Clash"; src: url("/jyserai/fonts/ClashDisplay-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Clash"; src: url("/jyserai/fonts/ClashDisplay-Semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/jyserai/fonts/sora-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/jyserai/fonts/sora-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --navy: #071A52; --royal: #0E3BB0; --night: #040D33; --line: #1E3A8A;
  --gold-300: #FFD24D; --gold-500: #F2B21C; --gold-700: #C98A0C;
  --ink: #EAF0FF; --muted: #A9BFEA; --wa: #1FC77E;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh; font-family: Sora, system-ui, sans-serif; color: var(--ink); line-height: 1.55;
  background: radial-gradient(90% 55% at 50% 0%, #123FB8 0%, transparent 70%), linear-gradient(180deg, #061A63, var(--night) 60%);
  background-attachment: fixed;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1120px; margin: 0 auto; }
.brand img { height: 40px; width: auto; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 4px 16px 40px; }
.intro { text-align: center; margin: 6px auto 20px; max-width: 680px; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-300); }
h1 { margin-top: 10px; font-family: Clash, Sora, sans-serif; font-weight: 700; font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1; text-transform: uppercase; color: #fff; }
h1 span { display: block; background: linear-gradient(180deg, #FFF0B8, #FFD24D 35%, #F2B21C 65%, #C98A0C); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 12px; color: var(--muted); font-size: 15px; }

.studio { display: grid; gap: 18px; }
@media (min-width: 900px) { .studio { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 32px; } }

/* Aperçu carré : il tient dans l'écran sans gêner le défilement */
.preview { position: relative; margin: 0 auto; width: 100%; max-width: min(560px, 62svh); }
@media (min-width: 900px) { .preview { max-width: min(620px, 82svh); position: sticky; top: 16px; } }
.preview canvas {
  width: 100%; height: auto; aspect-ratio: 1; border-radius: 20px;
  box-shadow: 0 0 0 1px rgb(255 210 77 / .35), 0 30px 80px -30px rgb(0 0 0 / .8);
  background: var(--navy);
  touch-action: pan-y pinch-zoom; /* le doigt fait défiler la page… */
  cursor: grab;
}
.preview canvas.adjusting { touch-action: none; box-shadow: 0 0 0 3px var(--gold-300), 0 30px 80px -30px rgb(242 178 28 / .6); } /* …sauf en mode « Déplacer » */
.preview canvas.dragging { cursor: grabbing; }
.preview .add { position: absolute; left: 70%; top: 42%; transform: translate(-50%, -50%); height: 52px; padding: 0 22px; font-size: 16px; white-space: nowrap; }
.preview figcaption { margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }

.panel { display: grid; gap: 16px; padding: 18px; border-radius: 22px; background: linear-gradient(180deg, rgb(7 26 82 / .85), rgb(4 13 51 / .9)); border: 1px solid rgb(255 255 255 / .1); }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgb(242 178 28 / .14); border: 1px solid rgb(255 210 77 / .5); color: var(--gold-300); font-family: Clash, sans-serif; font-weight: 600; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 14px; color: #fff; }
.note { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.zlabel { color: var(--muted); font-weight: 600; width: 10px; text-align: center; }

input[type="text"] { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--night); color: #fff; font: inherit; font-size: 16px; }
input[type="text"]:focus { outline: 2px solid var(--gold-300); outline-offset: 1px; }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--gold-500); height: 32px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .2s, box-shadow .2s, background-color .2s; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; }
.btn.gold { color: var(--navy); background: linear-gradient(180deg, #FFD24D, #E09A12); box-shadow: 0 12px 32px -12px rgb(242 178 28 / .9); }
.btn.wa { color: var(--navy); background: var(--wa); box-shadow: 0 12px 32px -12px rgb(31 199 126 / .8); }
.btn.ghost { height: 46px; padding: 0 14px; color: var(--ink); background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .14); }
.btn.ghost[aria-pressed="true"] { color: var(--navy); background: var(--gold-300); border-color: var(--gold-300); }
.btn.small { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.big { width: 100%; height: 56px; font-size: 16px; }
.btn.file { position: relative; height: 52px; padding: 0 18px; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.top .btn.small { height: 40px; padding: 0 16px; font-size: 14px; }

.actions { display: grid; gap: 10px; margin-top: 2px; }
.status { min-height: 1.2em; font-size: 13px; text-align: center; color: var(--gold-300); }
.book { display: block; text-align: center; font-size: 14px; color: var(--muted); text-decoration: none; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / .1); }
.book b { color: var(--gold-300); }

.foot { text-align: center; padding: 20px 16px 32px; font-size: 12px; color: var(--muted); }
.foot .fine { margin-top: 4px; font-size: 11px; opacity: .7; }
[hidden] { display: none !important; }
