/* ===========================================================================
   Carrot Studio · models.carrotstudio.fr
   Les polices et la palette du site, rien de plus : un fond prune, des
   panneaux à peine plus clairs, le rose pour ce qui agit. Les textes sont
   blancs ; sur la 3D, une ombre seule, sans voile.
   =========================================================================== */

@font-face {
  font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/polices/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/polices/syne-latin.woff2') format('woff2');
}

:root {
  --fond: #170911;
  --fond-centre: #3E1E2C;
  --panneau: rgba(43, 19, 31, 0.6);
  --panneau-haut: #281426;
  --filet: rgba(244, 118, 174, 0.14);
  --filet-fort: rgba(244, 118, 174, 0.3);
  --creme: #FFF7F1;
  --encre: #F7ECE4;
  --encre-mid: #E1B6CB;
  --encre-bas: #B68599;
  --rose: #F44E8B;
  --rose-sourd: #CC3470;
  --rose-voile: rgba(244, 78, 139, 0.12);
  --alerte: #FF8A8A;
  --sans: 'Syne', 'Segoe UI', system-ui, sans-serif;
  --corps: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-s: 8px;
  --r: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: radial-gradient(1100px 520px at 12% -8%, rgba(244, 78, 139, 0.08), transparent 62%), var(--fond);
  color: var(--encre);
  font: 15px/1.55 var(--corps);
  -webkit-font-smoothing: antialiased;
  padding: 0 20px 80px;
}
body.sans-defilement { overflow: hidden; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.page { max-width: 1120px; margin: 0 auto; }

/* ------------------------------------------------------------ la tête */
.tete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 0 22px; border-bottom: 1px solid var(--filet); margin-bottom: 30px;
}
.marque { display: flex; flex-direction: column; gap: 2px; }
.marque small {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--rose);
}
.marque h1 { font-family: var(--sans); font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; color: var(--creme); line-height: 1.1; letter-spacing: -0.01em; }

/* ------------------------------------------------------------ boutons et champs */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--filet-fort); background: rgba(23, 9, 17, 0.5); color: var(--creme);
  font-family: var(--sans); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.bouton:hover { border-color: var(--rose); }
a.bouton { text-decoration: none; }
.bouton.plein-rose { background: var(--rose-sourd); border-color: var(--rose-sourd); }
.bouton.plein-rose:hover { background: var(--rose); border-color: var(--rose); }
.bouton.danger:hover { border-color: var(--alerte); color: #FFD9D9; }
.bouton:disabled { opacity: 0.45; cursor: progress; }
.bouton.petit { min-height: 30px; padding: 0 12px; font-size: 12px; }

.champ {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-s);
  border: 1px solid var(--filet-fort); background: rgba(23, 9, 17, 0.6); color: var(--creme);
}
.champ:focus { border-color: var(--rose); outline: none; }
.champ-nom { background: transparent; border-color: transparent; padding: 4px 6px; margin: -4px -6px; min-height: 0; font-weight: 600; }
.champ-nom:hover, .champ-nom:focus { border-color: var(--filet-fort); background: rgba(23, 9, 17, 0.6); }

/* ------------------------------------------------------------ connexion */
.connexion {
  max-width: 380px; margin: 12vh auto 0; padding: 30px 28px; border-radius: var(--r);
  background: var(--panneau); border: 1px solid var(--filet);
  display: flex; flex-direction: column; gap: 14px;
}
.connexion h1 { font-family: var(--sans); font-size: 24px; color: var(--creme); }
.connexion p { color: var(--encre-mid); font-size: 14px; }
.connexion .erreur { color: var(--alerte); min-height: 1.4em; }

/* ------------------------------------------------------------ sections */
.section { margin-bottom: 44px; }
.section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section h2 { font-family: var(--sans); font-size: 20px; font-weight: 700; color: var(--creme); }
.section-tete p { color: var(--encre-bas); font-size: 13px; }
.vide { color: var(--encre-bas); padding: 22px; border: 1px dashed var(--filet); border-radius: var(--r); text-align: center; }

/* ------------------------------------------------------------ dépôt */
.depot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 24px; border-radius: var(--r); text-align: center; cursor: pointer;
  border: 1.5px dashed var(--filet-fort); background: rgba(43, 19, 31, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.depot:hover, .depot.survol { border-color: var(--rose); background: var(--rose-voile); }
.depot strong { font-family: var(--sans); color: var(--creme); font-size: 15px; }
.depot span { color: var(--encre-bas); font-size: 13px; }

.envois { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.envoi {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px;
  padding: 16px; border-radius: var(--r); background: var(--panneau); border: 1px solid var(--filet);
}
.envoi-scene {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-s); overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, var(--fond-centre), var(--fond));
}
.envoi-scene canvas { touch-action: none; }
.envoi-etat {
  position: absolute; left: 12px; bottom: 10px; font-size: 13px; color: var(--creme);
  text-shadow: 0 1px 6px rgba(12, 5, 8, 0.9); pointer-events: none;
}
.envoi-reglages { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.envoi-reglages label { font-size: 12px; color: var(--encre-bas); display: flex; flex-direction: column; gap: 6px; }
.envoi-reglages .coche { flex-direction: row; align-items: center; gap: 8px; color: var(--encre-mid); font-size: 13px; cursor: pointer; }
.envoi-reglages .ligne { display: flex; flex-wrap: wrap; gap: 8px; }
.envoi-reglages .note { font-size: 12px; color: var(--encre-bas); }
.envoi-reglages .erreur { color: var(--alerte); font-size: 13px; }
@media (max-width: 760px) { .envoi { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ grilles de cartes */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.carte {
  display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden;
  background: var(--panneau); border: 1px solid var(--filet);
}
.carte-image {
  position: relative; aspect-ratio: 16 / 10; padding: 0; border: 0; cursor: pointer; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, var(--fond-centre), var(--fond));
}
.carte-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.carte-image:hover img { transform: scale(1.03); }
.carte-image .voir {
  position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(23, 9, 17, 0.7); font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--creme);
}
.carte-corps { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.carte-titre { font-weight: 600; color: var(--creme); font-size: 15px; }
.carte-infos { font-size: 12px; color: var(--encre-bas); font-variant-numeric: tabular-nums; }
.carte-infos strong { color: var(--encre-mid); font-weight: 600; }
.carte-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ------------------------------------------------------------ liens */
.liens { display: flex; flex-direction: column; gap: 14px; }
.lien {
  padding: 16px; border-radius: var(--r); background: var(--panneau); border: 1px solid var(--filet);
  display: flex; flex-direction: column; gap: 12px;
}
.lien-tete { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.lien-adresse { display: flex; gap: 8px; }
.lien-adresse .champ { font-size: 13px; color: var(--encre-mid); }
.lien-modeles { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: rgba(23, 9, 17, 0.6); border: 1px solid var(--filet); font-size: 12px; color: var(--encre-mid);
}
.puce img { width: 34px; height: 22px; object-fit: cover; border-radius: 999px; }
.puce b { color: var(--creme); font-weight: 600; font-variant-numeric: tabular-nums; }
.choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.choix label {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--r-s); cursor: pointer;
  border: 1px solid var(--filet); background: rgba(23, 9, 17, 0.5); font-size: 13px;
}
.choix label:has(input:checked) { border-color: var(--rose); background: var(--rose-voile); }
.choix img { aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.choix input { accent-color: var(--rose); }
.formulaire { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--panneau); border: 1px solid var(--filet-fort); margin-bottom: 16px; }

/* ------------------------------------------------------------ la page d'un lien */
.lien-page .tete { border-bottom: 0; margin-bottom: 18px; }
.message { margin: 18vh auto 0; max-width: 420px; text-align: center; color: var(--encre-mid); }
.message h1 { font-family: var(--sans); color: var(--creme); font-size: 24px; margin-bottom: 8px; }

/* ------------------------------------------------------------ le plein écran */
.plein {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse 55% 62% at 50% 52%, var(--fond-centre), var(--fond));
  animation: entre 0.18s ease;
}
@keyframes entre { from { opacity: 0; } to { opacity: 1; } }
.plein-scene { position: absolute; inset: 0; }
.visionneuse-toile { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.visionneuse-toile:active { cursor: grabbing; }
.plein-titre {
  position: absolute; top: 20px; left: 22px; right: 80px; font-family: var(--sans); font-size: 22px; font-weight: 700;
  color: var(--creme); text-shadow: 0 1px 10px rgba(12, 5, 8, 0.8); pointer-events: none;
}
.plein-attente {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: var(--creme); font-size: 14px; text-shadow: 0 1px 6px rgba(12, 5, 8, 0.9);
}
.plein-fermer {
  position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(23, 9, 17, 0.6); border: 1px solid var(--filet-fort); color: var(--creme);
}
.plein-fermer:hover { border-color: var(--rose); }
.plein-fleche {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: rgba(23, 9, 17, 0.5); border: 1px solid var(--filet-fort); color: var(--creme); cursor: pointer;
  font-size: 24px; line-height: 1;
}
.plein-fleche:hover { border-color: var(--rose); }
.plein-avant { left: 16px; }
.plein-apres { right: 16px; }
.plein-aide {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--creme);
  text-shadow: 0 1px 6px rgba(12, 5, 8, 0.9); pointer-events: none;
}
.plein-reglages {
  position: absolute; left: 16px; bottom: 48px; width: min(300px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r);
  background: rgba(23, 9, 17, 0.72); border: 1px solid var(--filet-fort);
}
.plein-reglages label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--creme); }
.plein-reglages output { display: inline; color: var(--encre-mid); font-variant-numeric: tabular-nums; }
.plein-reglages input[type=range] { width: 100%; accent-color: var(--rose); }
.plein-reglages .ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.reglages-envoi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reglages-envoi input[type=range] { width: 100%; accent-color: var(--rose); }
.reglages-envoi output { color: var(--encre-mid); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  body { padding: 0 14px 60px; }
  .plein-reglages { bottom: 100px; }
  .plein-titre { font-size: 18px; top: 18px; left: 16px; }
  .plein-fleche { top: auto; bottom: 52px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .plein { animation: none; }
  .carte-image img { transition: none; }
}
