/* ==================================================================
   Pellicule — chambre noire numérique

   Signature : le décalage RVB. Les titres arrivent désalignés en
   cyan/magenta puis se mettent au point, et les vignettes se
   dérèglent au survol. Les images « se développent » : elles
   passent du flou au net en apparaissant.
   ================================================================== */

/* ------------------------------------------------------------------ *
   1. Jetons
 * ------------------------------------------------------------------ */

:root {
  --bg:         #0B0C10;
  --bg-2:       #0F1117;
  --surface:    #14171F;
  --surface-2:  #1A1E28;
  --line:       rgba(255, 255, 255, .07);
  --line-2:     rgba(255, 255, 255, .14);

  --text:       #ECEFF6;
  --muted:      #868FA3;
  --dim:        #5C6478;

  --c1:         #57E9D8;   /* canal cyan   */
  --c2:         #FF5FA2;   /* canal magenta */
  --danger:     #FF6B63;
  --ok:         #4ADE80;

  --grad:       linear-gradient(120deg, var(--c1), var(--c2));

  /* Couleur du texte posé sur un aplat clair (boutons, pastilles) */
  --on-light:   #0B0C10;
  --check-a:    #1D212B;
  --check-b:    #15181F;
  --glass:      rgba(11, 12, 16, .72);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --ease: cubic-bezier(.22, .8, .28, 1);
  --shell: 1140px;
}

/* ---- Thème clair ------------------------------------------------- */
[data-theme="light"] {
  --bg:        #F4F5F7;
  --bg-2:      #FFFFFF;
  --surface:   #FFFFFF;
  --surface-2: #EDEFF3;
  --line:      rgba(16, 20, 30, .10);
  --line-2:    rgba(16, 20, 30, .20);

  --text:      #14171F;
  --muted:     #5C6474;
  --dim:       #8A93A4;

  --c1:        #0FA79A;
  --c2:        #D6317C;

  --on-light:  #FFFFFF;
  --check-a:   #E2E5EA;
  --check-b:   #F7F8FA;
  --glass:     rgba(255, 255, 255, .78);
}

/* Sur fond clair, le bouton principal devient sombre */
[data-theme="light"] .btn { --btn-bg: var(--text); color: var(--on-light); }
[data-theme="light"] .btn:hover { box-shadow: 0 10px 30px -14px rgba(16, 20, 30, .55); }
[data-theme="light"] .chip:hover { color: var(--on-light); }
[data-theme="light"] .formats-tab.is-on { color: var(--on-light); }
[data-theme="light"] .lightbox { background: rgba(244, 245, 247, .9); }
[data-theme="light"] .lightbox-close:hover,
[data-theme="light"] .lightbox-nav:hover,
[data-theme="light"] .viewer-zoom:hover { color: var(--on-light); }
[data-theme="light"] .grain { opacity: .022; }
[data-theme="light"] .aura {
  background:
    radial-gradient(38% 38% at 18% 12%, rgba(15, 167, 154, .12), transparent 70%),
    radial-gradient(34% 34% at 82% 6%,  rgba(214, 49, 124, .10), transparent 70%);
}
[data-theme="light"] .theme-moon { display: block; }
[data-theme="light"] .theme-sun  { display: none; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(var(--shell), 100% - 2.5rem);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--c2); color: #FFF; }

/* ------------------------------------------------------------------ *
   2. Atmosphère : grain argentique et halos dérivants
 * ------------------------------------------------------------------ */

.grain {
  position: fixed;
  inset: -120%;
  z-index: 60;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.4s steps(3) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-3%, 2%); }
  66%  { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

.aura {
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 38% at 18% 12%, rgba(87, 233, 216, .13), transparent 70%),
    radial-gradient(34% 34% at 82% 6%,  rgba(255, 95, 162, .11), transparent 70%),
    radial-gradient(45% 45% at 60% 90%, rgba(87, 233, 216, .06), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* ------------------------------------------------------------------ *
   3. Typographie
 * ------------------------------------------------------------------ */

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }

h1 { font-size: clamp(2.3rem, 6.2vw, 4.4rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.0625rem; letter-spacing: -.02em; }

p { margin: 0; }

a { color: var(--c1); text-decoration: none; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
}
.kicker::before {
  content: "";
  width: 28px; height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* --- Le décalage RVB : titres qui se mettent au point -------------- */

.split {
  position: relative;
  display: inline-block;
  isolation: isolate;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.split::before,
.split::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-background-clip: initial;
  background: none;
}
.split::before { color: var(--c1); animation: focus-a 1s var(--ease) .1s both; }
.split::after  { color: var(--c2); animation: focus-b 1s var(--ease) .1s both; }

@keyframes focus-a {
  0%   { transform: translate3d(-18px, -7px, 0); opacity: .85; filter: blur(3px); }
  70%  { opacity: .35; }
  100% { transform: none; opacity: 0; filter: none; }
}
@keyframes focus-b {
  0%   { transform: translate3d(18px, 7px, 0); opacity: .85; filter: blur(3px); }
  70%  { opacity: .35; }
  100% { transform: none; opacity: 0; filter: none; }
}

.split:hover::before { animation: nudge-a .5s var(--ease); }
.split:hover::after  { animation: nudge-b .5s var(--ease); }
@keyframes nudge-a {
  0%, 100% { transform: none; opacity: 0; }
  40%      { transform: translate3d(-5px, -2px, 0); opacity: .7; }
}
@keyframes nudge-b {
  0%, 100% { transform: none; opacity: 0; }
  40%      { transform: translate3d(5px, 2px, 0); opacity: .7; }
}

/* ------------------------------------------------------------------ *
   4. Barre supérieure
 * ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.topbar.is-stuck {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 0;
  transition: padding .3s var(--ease);
}
.topbar.is-stuck .topbar-inner { padding: .7rem 0; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 1.0625rem;
}

.logo-mark {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.logo-mark span {
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .4s var(--ease), background .4s var(--ease);
}
.logo-mark span:first-child { background: var(--c1); }
.logo-mark span:last-child  { background: var(--c2); }

.logo:hover .logo-mark span:first-child { transform: translate(-3px, -2px); }
.logo:hover .logo-mark span:last-child  { transform: translate(3px, 2px); }
.logo:hover .logo-mark span:nth-child(2) { transform: scaleY(1.15); }

.menu {
  display: flex;
  gap: .35rem;
  margin-left: auto;
}
.menu a {
  position: relative;
  padding: .4rem .8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .9375rem;
  transition: color .2s, background .2s;
}
.menu a:hover { color: var(--text); background: var(--surface); }
.menu a.is-active { color: var(--text); }
.menu a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1px;
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: translateX(-50%);
  animation: dash-in .4s var(--ease) both;
}
@keyframes dash-in { from { width: 0; opacity: 0; } to { width: 16px; opacity: 1; } }

.topbar-cta { flex-shrink: 0; }

/* ------------------------------------------------------------------ *
   5. Boutons
 * ------------------------------------------------------------------ */

.btn {
  --btn-bg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--on-light);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(87, 233, 216, .55); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-off { opacity: .4; pointer-events: none; }

.btn-sm { padding: .5rem .95rem; font-size: .875rem; }

.btn-quiet {
  background: transparent;
  border-color: var(--line-2);
  color: var(--text);
}
.btn-quiet:hover { background: var(--surface); box-shadow: none; }

.btn-danger {
  background: rgba(255, 107, 99, .12);
  border-color: rgba(255, 107, 99, .4);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 107, 99, .2); box-shadow: 0 10px 30px -14px rgba(255, 107, 99, .6); }

.linklike {
  border: 0; padding: 0;
  background: none;
  color: var(--c1);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .65rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { background: var(--text); color: var(--on-light); border-color: var(--text); }
.chip-danger:hover { background: var(--danger); border-color: var(--danger); color: #FFF; }

/* Bouton copier : la coche se dessine */
.copy-check {
  width: 0; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 26; stroke-dashoffset: 26;
  transition: width .2s var(--ease);
}
.js-copy.is-done { background: var(--ok); border-color: var(--ok); color: #08130C; }
.js-copy.is-done .copy-label { display: none; }
.js-copy.is-done .copy-check { width: 17px; animation: draw .35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------------ *
   6. Hero
 * ------------------------------------------------------------------ */

.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}
.hero h1 { max-width: 12ch; }
.hero-sm { padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; }
/* Les titres des pages secondaires sont plus longs : on leur laisse la place */
.hero-sm h1 { max-width: 22ch; }

/* Accueil : le texte et la zone de dépôt côte à côte */
.lead {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
@media (min-width: 1000px) {
  .lead { grid-template-columns: 1fr 1.15fr; }
  .lead .hero { padding-block: 0; }
  .lead .drop-section { margin-bottom: 0; }
}

.hero-lede {
  max-width: 52ch;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
}

/* ------------------------------------------------------------------ *
   7. Zone de dépôt
 * ------------------------------------------------------------------ */

.drop-section { margin-bottom: clamp(3rem, 7vw, 5rem); }

.dropzone {
  position: relative;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .4s var(--ease);
}

/* Liseré : discret au survol, tournant pendant le glisser */
.dropzone::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg,
    transparent 0 20%, var(--c1) 42%, var(--c2) 58%, transparent 80% 100%);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.dropzone::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}
.dropzone:hover { border-color: var(--line-2); }
.dropzone:hover::before { opacity: .35; }
.dropzone.is-dragging::before { opacity: 1; animation: spin 3.5s linear infinite; }
.dropzone.is-dragging { transform: scale(1.008); box-shadow: 0 30px 80px -40px rgba(87, 233, 216, .5); }

@keyframes spin { to { transform: rotate(1turn); } }

.dropzone-face,
.dropzone-bar { position: relative; z-index: 1; }

.dropzone-face {
  padding: clamp(2.75rem, 7vw, 4.5rem) 1.5rem clamp(2rem, 4vw, 2.75rem);
  text-align: center;
  cursor: pointer;
}

.dropzone-title {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 650;
  letter-spacing: -.03em;
  margin-bottom: .35rem;
}
.dropzone-sub { color: var(--muted); font-size: .9375rem; }

.dropzone-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.dropzone-tags li {
  padding: .2rem .6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .02);
  color: var(--dim);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .06em;
}

/* L'objectif : deux bagues qui respirent */
.lens {
  position: relative;
  width: 74px; height: 74px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
}
.lens-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  animation: pulse 3.4s var(--ease) infinite;
}
.lens-ring:last-of-type { animation-delay: 1.7s; }
.lens-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 30px rgba(87, 233, 216, .45);
  transition: transform .4s var(--ease);
}
.dropzone.is-dragging .lens-dot { transform: scale(1.35); }
.dropzone.is-dragging .lens-ring { animation-duration: 1.1s; }

@keyframes pulse {
  0%   { transform: scale(.55); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

.dropzone-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
}

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  transition: background .3s var(--ease);
}
.switch-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.switch input:checked + .switch-track { background: rgba(87, 233, 216, .18); border-color: var(--c1); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(18px); background: var(--c1); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--c1); outline-offset: 3px; }
.switch-label { color: var(--muted); font-size: .875rem; }

/* ------------------------------------------------------------------ *
   8. File d'envoi
 * ------------------------------------------------------------------ */

.queue { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }

.qitem {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  animation: slide-in .45s var(--ease) both;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.qitem.is-gone { animation: slide-out .35s var(--ease) forwards; }
@keyframes slide-out {
  to { opacity: 0; transform: translateX(24px); height: 0; padding: 0; margin: 0; }
}

.qthumb {
  width: 54px; height: 54px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.qthumb img { width: 100%; height: 100%; object-fit: cover; }

.qbody { min-width: 0; }
.qname {
  font-size: .9375rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qstatus { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.qitem.is-error .qstatus { color: var(--danger); }
.qitem.is-done  .qstatus { color: var(--ok); }

.qbar {
  height: 3px;
  margin: .45rem 0 .35rem;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.qbar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--grad);
  transition: width .25s var(--ease);
}
.qitem.is-done .qbar i { background: var(--ok); }
.qitem.is-error .qbar i { background: var(--danger); }
.qitem.is-done .qbar,
.qitem.is-error .qbar { opacity: .35; }

.qactions { display: flex; gap: .4rem; }

/* ------------------------------------------------------------------ *
   10. Blocs et grille d'images
 * ------------------------------------------------------------------ */

.block { margin-bottom: clamp(3rem, 7vw, 5rem); }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.more { color: var(--muted); font-size: .875rem; transition: color .2s; }
.more:hover { color: var(--c1); }

.grid {
  columns: 4 230px;
  column-gap: 1rem;
}

.card {
  break-inside: avoid;
  margin: 0 0 1rem;
  position: relative;
}

.card-frame {
  position: relative;
  display: block;
  aspect-ratio: var(--ratio, 1);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease);
}
.card-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card-frame:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .9);
}
/* Le dérèglement des canaux au survol */
.card-frame:hover img {
  filter: drop-shadow(-3px 0 rgba(87, 233, 216, .55)) drop-shadow(3px 0 rgba(255, 95, 162, .55));
}

.card-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11, 12, 16, .75));
  opacity: 0;
  transition: opacity .35s;
}
.card-frame:hover .card-glow { opacity: 1; }

.card-foot {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .2rem 0;
  font-size: .8125rem;
}
.card-name {
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-data { color: var(--dim); font-family: var(--mono); font-size: .6875rem; white-space: nowrap; }

.card-tools {
  position: absolute;
  top: .6rem; right: .6rem;
  display: flex;
  gap: .35rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.card:hover .card-tools,
.card:focus-within .card-tools { opacity: 1; transform: none; }

/* Le « développement » : du flou vers le net.

   Une image est visible PAR DÉFAUT. C'est le JavaScript qui la masque
   volontairement, juste avant de la surveiller, en posant .is-pending.
   Conséquence : si app.js ne se charge pas ou lève une erreur, les images
   restent affichées au lieu de disparaître. L'animation est un bonus,
   jamais une condition d'affichage. */
.develop {
  transition: opacity .6s var(--ease), filter .9s var(--ease), transform .9s var(--ease);
}
.develop.is-pending {
  opacity: 0;
  filter: blur(16px) saturate(.35);
  transform: scale(1.05);
}
.develop.is-loaded { opacity: 1; filter: none; transform: none; }

/* Damier de transparence */
.checker {
  background-color: var(--check-b);
  background-image:
    linear-gradient(45deg, var(--check-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--check-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--check-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--check-a) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* ------------------------------------------------------------------ *
   11. Étapes
 * ------------------------------------------------------------------ */

.steplist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: step;
}
.steplist li {
  padding: 1.5rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  transition: border-color .3s, transform .35s var(--ease);
}
.steplist li:hover { border-color: var(--line-2); transform: translateY(-3px); }
.step-num {
  display: block;
  margin-bottom: .9rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .12em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.steplist h3 { margin-bottom: .35rem; }
.steplist p { color: var(--muted); font-size: .9375rem; }

/* ------------------------------------------------------------------ *
   12. Visionneuse d'une image
 * ------------------------------------------------------------------ */

.viewer { padding-top: 2rem; margin-bottom: 2rem; }

.viewer-stage {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: .5rem;
}
.viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  width: auto; height: auto;
  border-radius: calc(var(--r-lg) - 8px);
  cursor: zoom-in;
}

.viewer-zoom {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s, transform .3s, background .2s;
}
.viewer-zoom svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.viewer-stage:hover .viewer-zoom { opacity: 1; transform: none; }
.viewer-zoom:hover { background: var(--text); color: var(--on-light); }

.viewer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 1.25rem;
}
.viewer-title {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 650;
  letter-spacing: -.03em;
  word-break: break-word;
}
.viewer-sub { color: var(--muted); font-family: var(--mono); font-size: .8125rem; }

/* ------------------------------------------------------------------ *
   13. Panneaux et fiche technique
 * ------------------------------------------------------------------ */

.panel-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.panel {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
}
.panel-title {
  margin-bottom: 1.1rem;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--dim);
}

.spec { margin: 0; }
.spec > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.spec > div:last-child { border-bottom: 0; }
.spec dt { color: var(--muted); font-size: .875rem; }
.spec dd { margin: 0; font-family: var(--mono); font-size: .8125rem; text-align: right; }

/* ------------------------------------------------------------------ *
   14. Sélecteur de format
 * ------------------------------------------------------------------ */

.formats { margin-bottom: 1.25rem; }

.formats-tabs {
  position: relative;
  /* Sans JavaScript les onglets ne peuvent pas changer la valeur du champ :
     on ne les affiche pas plutôt que de proposer des boutons inertes. */
  display: none;
}
.js .formats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  padding: .25rem;
  margin-bottom: .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  width: fit-content;
  max-width: 100%;
}
.formats-tab {
  position: relative;
  z-index: 1;
  padding: .35rem .85rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .8125rem;
  cursor: pointer;
  transition: color .25s;
}
.formats-tab.is-on { color: var(--on-light); }
.formats-ink {
  position: absolute;
  z-index: 0;
  top: .25rem; left: 0;
  height: calc(100% - .5rem);
  border-radius: 999px;
  background: var(--text);
  transition: transform .35s var(--ease), width .35s var(--ease);
}

.formats-row { display: flex; gap: .5rem; }
.formats-row input,
.danger-row input {
  flex: 1;
  min-width: 0;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: .8125rem;
  transition: border-color .2s, background .2s;
}
.formats-row input:focus { border-color: var(--c1); outline: none; background: var(--surface-2); }

.danger-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
  padding: .75rem;
  border: 1px solid rgba(255, 107, 99, .25);
  border-radius: var(--r-sm);
  background: rgba(255, 107, 99, .05);
}
.danger-row input { color: var(--danger); border-color: rgba(255, 107, 99, .2); background: transparent; }
.danger-tag {
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--danger);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ *
   15. Fiche détaillée (résultat, suppression)
 * ------------------------------------------------------------------ */

.detail {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
}
.detail-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.detail-name {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -.02em;
  word-break: break-word;
}
.detail-meta {
  margin: .2rem 0 1.1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
}

.center-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: center;
  margin: 2rem 0 3rem;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: clamp(3rem, 8vw, 5rem) 0;
  color: var(--muted);
  text-align: center;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 2.5rem 0 3rem;
}
.pager-pos { font-family: var(--mono); font-size: .8125rem; color: var(--muted); }

/* ------------------------------------------------------------------ *
   16. Bandeaux et notifications
 * ------------------------------------------------------------------ */

.banner {
  margin-top: 1rem;
  padding: .8rem 1.1rem;
  border: 1px solid var(--line-2);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .9375rem;
  animation: slide-in .45s var(--ease) both;
}
.banner-error   { border-left-color: var(--danger); }
.banner-success { border-left-color: var(--ok); }

.toasts {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  z-index: 70;
  display: grid;
  gap: .5rem;
  width: min(340px, calc(100vw - 2.5rem));
}
.toast {
  position: relative;
  padding: .8rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: .875rem;
  overflow: hidden;
  animation: toast-in .4s var(--ease) both;
}
.toast.is-gone { animation: toast-out .3s var(--ease) forwards; }
.toast-error { border-color: rgba(255, 107, 99, .5); }
.toast-success { border-color: rgba(74, 222, 128, .45); }
.toast::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 100%;
  background: var(--grad);
  transform-origin: left;
  animation: countdown 4s linear forwards;
}
@keyframes toast-in  { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes countdown { to { transform: scaleX(0); } }

/* ------------------------------------------------------------------ *
   17. Visionneuse plein écran
 * ------------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(6, 7, 10, .88);
  backdrop-filter: blur(14px);
  animation: fade-in .3s var(--ease) both;
}
.lightbox.is-gone { animation: fade-out .25s var(--ease) forwards; }
@keyframes fade-in  { from { opacity: 0; } }
@keyframes fade-out { to   { opacity: 0; } }

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--r);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9);
  animation: zoom-in .4s var(--ease) both;
}
@keyframes zoom-in { from { opacity: 0; transform: scale(.94); } }

.lightbox-bar {
  position: absolute;
  left: 50%; bottom: clamp(1rem, 3vw, 2rem);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--glass);
  font-size: .8125rem;
  color: var(--muted);
  max-width: calc(100% - 2rem);
}
.lightbox-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-dims { font-family: var(--mono); font-size: .75rem; white-space: nowrap; }

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lightbox-close:hover { background: var(--text); color: var(--on-light); transform: rotate(90deg); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.lightbox-nav:hover { background: var(--text); color: var(--on-light); }
.lightbox-prev { left: clamp(.5rem, 2vw, 1.5rem); }
.lightbox-next { right: clamp(.5rem, 2vw, 1.5rem); }

/* ------------------------------------------------------------------ *
   18. Pied de page
 * ------------------------------------------------------------------ */

.footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .015));
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  padding: 2.5rem 0;
}
.footer-brand { font-weight: 700; letter-spacing: -.03em; }
.footer-note { max-width: 38ch; margin-top: .3rem; color: var(--muted); font-size: .875rem; }

.footer-specs { display: flex; flex-wrap: wrap; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.footer-specs li { display: grid; gap: .15rem; }
.footer-specs span { color: var(--dim); font-family: var(--mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .12em; }
.footer-specs b { font-weight: 600; font-size: .9375rem; }

/* ------------------------------------------------------------------ *
   19. Apparition au défilement
 * ------------------------------------------------------------------ */

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ *
   20. Adaptation aux petits écrans
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 2rem); }

  /* Trop d'éléments pour une seule rangée : le menu passe en dessous. */
  .topbar-inner { flex-wrap: wrap; row-gap: .4rem; gap: .5rem; }
  .menu {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 0;
    justify-content: space-between;
  }
  .menu a { padding: .35rem .5rem; font-size: .8125rem; }
  .theme-toggle { margin-left: auto; }
  .topbar-cta { display: none; }
  .account-chip { padding: .2rem .25rem .2rem .6rem; }
  .account-coins { font-size: .75rem; }
  .hero { max-width: none; }
  .hero h1 { max-width: none; }
  .detail { grid-template-columns: 1fr; }
  .detail-thumb { max-width: 160px; }
  .dropzone-bar { flex-direction: column; align-items: stretch; }
  .dropzone-bar .btn { justify-content: center; }
  .grid { columns: 2 140px; column-gap: .7rem; }
  .card { margin-bottom: .7rem; }
  /* Sur mobile le nom prend toute la largeur, les dimensions passent à la trappe */
  .card-data { display: none; }
  .danger-row { flex-wrap: wrap; }
  .toasts { right: 1rem; left: 1rem; width: auto; }
}

/* ------------------------------------------------------------------ *
   21. Mouvement réduit
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .develop, .develop.is-pending { opacity: 1; filter: none; transform: none; }
  .grain, .aura { display: none; }
  .split::before, .split::after { display: none; }
}

/* ==================================================================
   22. Ajouts : bascule de thème, filtres, palette, expiration
   ================================================================== */

/* ---- Bascule clair / sombre -------------------------------------- */

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .35s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); transform: rotate(-12deg); }
.theme-toggle svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.theme-moon { display: none; }
.theme-sun  { display: block; }

/* ---- Barre de filtres -------------------------------------------- */

.filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.filters-search {
  position: relative;
  display: flex;
  align-items: center;
}
.filters-search svg {
  position: absolute;
  left: .85rem;
  width: 17px; height: 17px;
  fill: none; stroke: var(--dim);
  stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.filters-search input {
  width: 100%;
  padding: .7rem 2.4rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  transition: border-color .2s, background .2s;
}
.filters-search input:focus { outline: none; border-color: var(--c1); background: var(--surface-2); }
.filters-search input::-webkit-search-cancel-button { display: none; }

.filters-clear {
  position: absolute;
  right: .6rem;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.filters-clear:hover { background: var(--surface-2); color: var(--text); }

.filters-side { display: flex; align-items: center; gap: .6rem; }

/* Menus déroulants */
.select { display: inline-flex; align-items: center; gap: .5rem; }
.select-label {
  color: var(--dim);
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  white-space: nowrap;
}
.select select {
  appearance: none;
  padding: .55rem 2rem .55rem .8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .2s;
}
.select select:hover { border-color: var(--text); }
.select select:focus { outline: none; border-color: var(--c1); }
.select-inline { flex-direction: column; align-items: flex-start; gap: .35rem; }

/* Filtres par format */
.filters-types {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .06em;
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.tag span { color: var(--dim); }
.tag:hover { color: var(--text); border-color: var(--line-2); }
.tag.is-on {
  background: var(--text);
  border-color: var(--text);
  color: var(--on-light);
}
.tag.is-on span { color: var(--on-light); opacity: .6; }

/* ---- Réglages de la zone de dépôt -------------------------------- */

.dropzone-options {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .85rem;
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--line);
}
.dropzone-hint {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
}
.dropzone-hint.is-ready { color: var(--c1); }

/* ---- Badge d'expiration sur les vignettes ------------------------ */

.card-badge {
  position: absolute;
  z-index: 2;
  left: .55rem; top: .55rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
}

.spec .is-warn { color: #FFBE50; }

/* ---- Palette de couleurs ----------------------------------------- */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.swatch {
  display: grid;
  gap: .45rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.swatch-chip {
  display: block;
  width: 62px; height: 62px;
  border-radius: var(--r-sm);
  background: var(--c);
  border: 1px solid var(--line-2);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.swatch:hover .swatch-chip { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 24px -14px var(--c); }
.swatch-hex {
  font-family: var(--mono);
  font-size: .6875rem;
  text-align: center;
}
.swatch.is-done .swatch-hex { color: var(--ok); }
.swatch.is-done .swatch-chip { border-color: var(--ok); }

.panel-note {
  margin-top: 1rem;
  color: var(--dim);
  font-size: .8125rem;
}
.panel-empty { color: var(--muted); font-size: .9375rem; }

/* ---- Petits écrans ----------------------------------------------- */

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr; }
  .filters-side { justify-content: space-between; }
  .theme-toggle { width: 34px; height: 34px; }
  .swatch-chip { width: 52px; height: 52px; }
}

/* ==================================================================
   23. Pied de page complet, pages de contenu, formulaires
   ================================================================== */

/* ---- Pied de page ------------------------------------------------ */

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding: 3rem 0 2.25rem;
}

.footer-brand-col .logo { margin-bottom: 1rem; }
.footer-note { max-width: 34ch; color: var(--muted); font-size: .875rem; }

.footer-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.footer-specs li { display: grid; gap: .15rem; }
.footer-specs span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: .625rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.footer-specs b { font-weight: 600; font-size: .875rem; }

.footer-head {
  margin-bottom: .9rem;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--dim);
}
.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.footer-col a {
  color: var(--muted);
  font-size: .9375rem;
  text-decoration: none;
  transition: color .2s;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  padding: 1.15rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: .8125rem;
}
.footer-claim { font-family: var(--mono); font-size: .75rem; }

/* ---- Pages de contenu -------------------------------------------- */

.prose {
  max-width: 68ch;
  margin-bottom: clamp(3rem, 7vw, 5rem);
  color: var(--muted);
}
.prose h2 {
  margin: 2.5rem 0 .85rem;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  color: var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 1rem; line-height: 1.7; }
.prose ul { margin: 0 0 1.25rem; padding-left: 1.15rem; }
.prose li { margin-bottom: .5rem; line-height: 1.65; }
.prose b { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.prose-p { color: var(--muted); font-size: .9375rem; line-height: 1.65; }

/* Repère visible tant qu'une information légale manque */
.todo {
  padding: .05em .4em;
  border-radius: 4px;
  background: rgba(255, 190, 80, .14);
  color: #FFBE50;
  font-family: var(--mono);
  font-size: .8125rem;
}

.legal-list { margin: 0 0 1.5rem; }
.legal-list > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.legal-list dt { color: var(--dim); font-size: .875rem; }
.legal-list dd { margin: 0; color: var(--text); font-size: .9375rem; }

/* ---- Documentation ----------------------------------------------- */

.doc {
  display: grid;
  gap: 2.5rem;
  min-width: 0;
  max-width: 78ch;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
/* Sans min-width, un bloc de code long élargit toute la grille */
.doc-block { min-width: 0; }
.doc-block h2 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.doc-block p { margin-bottom: 1rem; color: var(--muted); line-height: 1.7; }
.doc-block p:last-child { margin-bottom: 0; }

.doc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.doc-table th,
.doc-table td {
  padding: .6rem .75rem;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: .9375rem;
  font-weight: 400;
}
.doc-table th {
  width: 160px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: .8125rem;
}
.doc-table td { color: var(--muted); }
.doc-params th { width: 130px; }

.req {
  display: inline-block;
  margin-right: .4rem;
  padding: .05em .45em;
  border-radius: 4px;
  background: rgba(87, 233, 216, .14);
  color: var(--c1);
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

code {
  padding: .12em .4em;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .85em;
}

pre.code {
  max-width: 100%;
  margin: 0 0 1rem;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
pre.code code {
  padding: 0;
  background: none;
  font-size: .8125rem;
  line-height: 1.7;
  white-space: pre;
  color: var(--text);
}

.doc-list { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.doc-list li { margin-bottom: .5rem; line-height: 1.65; }

/* ---- Formulaires -------------------------------------------------- */

.split-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.form { display: grid; gap: 1rem; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field label {
  display: block;
  margin-bottom: .35rem;
  font-size: .8125rem;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c1);
  background: var(--surface-2);
}
.field ::placeholder { color: var(--dim); }

/* Champ piège : invisible sans casser la soumission du formulaire */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand-col { grid-column: 1 / -1; }
  .split-cols { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .form-pair { grid-template-columns: 1fr; }
  .legal-list > div { grid-template-columns: 1fr; gap: .2rem; }
  .doc-table th { width: 110px; font-size: .75rem; }
}

/* ==================================================================
   24. Comptes Discord, pièces et mini-jeux
   ================================================================== */

/* ---- Bouton Discord ---------------------------------------------- */

.btn-discord {
  --btn-bg: #5865F2;
  color: #fff;
  border-color: #5865F2;
}
.btn-discord:hover { box-shadow: 0 10px 30px -12px rgba(88, 101, 242, .8); }
.btn-discord svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }

/* ---- Pastille de compte dans la barre ---------------------------- */

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
  padding: .25rem .3rem .25rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.account-chip:hover { border-color: var(--text); background: var(--surface); }
.account-chip img { border-radius: 50%; display: block; }
.account-coins {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 600;
}
.account-coins i {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Invitation à se connecter ----------------------------------- */

.cta-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem;
  margin-bottom: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
}
.cta-box h2 { margin-bottom: .4rem; font-size: 1.15rem; }
.cta-box p { max-width: 52ch; color: var(--muted); font-size: .9375rem; }

/* ---- Bourse ------------------------------------------------------- */

.wallet {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
}
.wallet-label {
  display: block;
  color: var(--dim);
  font-family: var(--mono);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.wallet-amount {
  display: block;
  margin-top: .2rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wallet-amount i {
  font-style: normal;
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}
.wallet-side { display: grid; gap: .7rem; justify-items: flex-start; }
.wallet-note { color: var(--muted); font-size: .875rem; }
.wallet-note b { color: var(--text); }

/* ---- Cartes de jeu ------------------------------------------------ */

.games { display: grid; gap: 1rem; margin-bottom: clamp(3rem, 7vw, 5rem); }

.game {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  overflow: hidden;
}
.game-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.game-head h2 { font-size: 1.1rem; margin-bottom: .25rem; }
.game-head p { color: var(--muted); font-size: .875rem; }
.game-gain {
  flex-shrink: 0;
  padding: .25rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--c1);
  white-space: nowrap;
}

.game-body { display: grid; gap: 1rem; justify-items: flex-start; padding: 1.5rem; }
.game-status { color: var(--muted); font-size: .9375rem; }

/* Jeu verrouillé pendant le délai d'attente */
.game.is-waiting { opacity: .75; }
.game.is-waiting [data-visual] { filter: grayscale(.6); }

.cooldown {
  padding: .35rem .8rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
}

.pick-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Pièce */
.coin {
  display: grid;
  place-items: center;
  width: 78px; height: 78px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--surface);
  font-size: 1.9rem;
  font-weight: 700;
  transition: border-color .3s, color .3s, transform .3s var(--ease);
}
.coin span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.coin.is-spinning { animation: flip-coin .7s linear; }
.coin.is-win  { border-color: var(--ok); }
.coin.is-lose { border-color: var(--danger); }
@keyframes flip-coin {
  0%   { transform: rotateY(0) scale(1); }
  50%  { transform: rotateY(900deg) scale(1.15); }
  100% { transform: rotateY(1800deg) scale(1); }
}

/* Cartes */
.cards-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.playcard {
  display: grid;
  place-items: center;
  width: 78px; height: 106px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s, background .25s;
}
.playcard:hover:not(:disabled) { transform: translateY(-5px); border-color: var(--text); }
.playcard:disabled { cursor: default; }
.playcard.is-open { background: var(--surface-2); color: var(--text); animation: card-flip .4s var(--ease); }
.playcard.is-win  { border-color: var(--ok); color: var(--ok); background: rgba(74, 222, 128, .1); }
.playcard.is-lose { border-color: var(--danger); color: var(--danger); background: rgba(255, 107, 99, .08); }
@keyframes card-flip { from { transform: rotateY(90deg); } }

/* Dé — les points sont dessinés, pas écrits : aucune police requise */
.die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  width: 78px; height: 78px;
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color .3s;
}
.die span {
  border-radius: 50%;
  background: transparent;
  transition: background .2s;
}
.die.is-rolling { animation: shake-die .7s var(--ease); }
.die.is-win { border-color: var(--ok); }
@keyframes shake-die {
  0%, 100% { transform: rotate(0) scale(1); }
  25%      { transform: rotate(-18deg) scale(1.1); }
  60%      { transform: rotate(20deg) scale(1.1); }
}

/* Chaque face allume les points qui lui correspondent.
   Cases numérotées de 1 à 9, de haut en bas et de gauche à droite. */
.die[data-face="1"] span:nth-child(5),
.die[data-face="2"] span:nth-child(3),
.die[data-face="2"] span:nth-child(7),
.die[data-face="3"] span:nth-child(3),
.die[data-face="3"] span:nth-child(5),
.die[data-face="3"] span:nth-child(7),
.die[data-face="4"] span:nth-child(1),
.die[data-face="4"] span:nth-child(3),
.die[data-face="4"] span:nth-child(7),
.die[data-face="4"] span:nth-child(9),
.die[data-face="5"] span:nth-child(1),
.die[data-face="5"] span:nth-child(3),
.die[data-face="5"] span:nth-child(5),
.die[data-face="5"] span:nth-child(7),
.die[data-face="5"] span:nth-child(9),
.die[data-face="6"] span:nth-child(1),
.die[data-face="6"] span:nth-child(3),
.die[data-face="6"] span:nth-child(4),
.die[data-face="6"] span:nth-child(6),
.die[data-face="6"] span:nth-child(7),
.die[data-face="6"] span:nth-child(9) {
  background: var(--text);
}

/* Face 0 : dé au repos, un point pâle au centre */
.die[data-face="0"] span:nth-child(5) { background: var(--dim); }

/* ---- Tarifs -------------------------------------------------------- */

.dropzone-price {
  position: relative;
  z-index: 1;
  padding: .8rem 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}
.dropzone-price b { color: var(--text); }

/* ---- Classement ---------------------------------------------------- */

.ranking { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.ranking li {
  display: grid;
  grid-template-columns: 28px 28px 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.ranking li.is-me { border-color: var(--c1); }
.rank-pos { color: var(--dim); font-family: var(--mono); font-size: .8125rem; text-align: center; }
.rank-avatar { border-radius: 50%; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; }
.rank-coins { font-family: var(--mono); font-size: .875rem; font-weight: 600; }

/* ---- Compte -------------------------------------------------------- */

.account-head { display: flex; gap: 1.25rem; align-items: center; }
.account-avatar { border-radius: 50%; border: 1px solid var(--line-2); }

.ledger { width: 100%; border-collapse: collapse; font-size: .875rem; }
.ledger th {
  padding: .5rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  color: var(--dim);
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.ledger td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.ledger-date, .ledger-detail { color: var(--muted); }
.ledger-amount, .ledger-balance { text-align: right; font-family: var(--mono); }
.ledger-amount.is-plus { color: var(--ok); }
.ledger-amount.is-minus { color: var(--danger); }

@media (max-width: 720px) {
  .wallet, .cta-box { flex-direction: column; align-items: flex-start; }
  .playcard { width: 68px; height: 94px; }
  .coin, .die { width: 66px; height: 66px; }
  .die { padding: 9px; gap: 3px; }
  .account-chip { padding-left: .5rem; }
  .ledger-detail, .ledger th:nth-child(3) { display: none; }
  .ranking li { grid-template-columns: 22px 24px 1fr auto; gap: .5rem; }
}
