/* Thème « trattoria » du film : nappe vichy, crème, Bodoni rouge tomate, anglaise verte. */
:root {
  --creme: #f6efe0;
  --creme-fonce: #ede2cb;
  --rouge: #c8322b;
  --rose: #eeb2ac;
  --vert: #3c7d3e;
  --brun: #3b2a22;
  --blanc: #fff;
  --ombre: 0 10px 22px rgba(59, 42, 34, .28), 0 2px 4px rgba(59, 42, 34, .18);
  --bodoni: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", "Brush Script MT", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--creme); color: var(--brun); font-family: var(--bodoni); }
body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }

.vichy {
  height: 34px;
  background:
    repeating-linear-gradient(90deg, rgba(200,50,43,.55) 0 11px, transparent 11px 22px),
    repeating-linear-gradient(0deg, rgba(200,50,43,.55) 0 11px, transparent 11px 22px),
    var(--blanc);
  border-bottom: 5px solid var(--vert);
  box-shadow: inset 0 -8px 0 var(--blanc), inset 0 -11px 0 var(--rouge);
}
.pied .vichy, .entete .vichy:last-child { border-bottom: 0; border-top: 5px solid var(--vert);
  box-shadow: inset 0 8px 0 var(--blanc), inset 0 11px 0 var(--rouge); }

.entete { text-align: center; }
.titre { padding: 28px 16px 22px; }
h1 { margin: 0; font-size: clamp(64px, 13vw, 132px); font-weight: 700; letter-spacing: .08em;
  color: var(--rouge); line-height: 1; }
.filet { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 2px; }
.filet span { display: block; width: clamp(60px, 14vw, 140px); height: 3px; background: var(--vert); }
.corno { height: 56px; width: auto; }
.script { font-family: var(--script); color: var(--vert); font-size: clamp(34px, 7vw, 56px); margin: 0; line-height: 1.1; }
.script.grand { font-size: clamp(40px, 8vw, 72px); }
.capitales { font-variant: small-caps; letter-spacing: .28em; font-size: 15px; margin: 10px 0 0; color: var(--brun); }
.consigne { margin: 14px auto 0; max-width: 34em; font-style: italic; font-size: 17px; color: var(--brun); opacity: .85; }
.bouton {
  margin-top: 16px; padding: 12px 26px; border: 2px solid var(--rouge); border-radius: 999px;
  background: var(--rouge); color: var(--blanc); font: 700 17px var(--bodoni); letter-spacing: .08em;
  cursor: pointer; box-shadow: 0 3px 0 #8e211c;
}
.bouton:active { transform: translateY(2px); box-shadow: none; }
.bouton.petit { padding: 8px 16px; font-size: 15px; margin-top: 0; }
.bouton[disabled] { opacity: .35; cursor: default; }

/* ------------------------------------------------------------ le plan (la nappe) */
.plan {
  position: relative; margin: 10px auto 0; width: 100%; max-width: 1400px;
  aspect-ratio: 16 / 10; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.55), transparent 60%),
    repeating-linear-gradient(90deg, rgba(200,50,43,.06) 0 2px, transparent 2px 44px),
    repeating-linear-gradient(0deg, rgba(200,50,43,.06) 0 2px, transparent 2px 44px),
    var(--creme-fonce);
  border-top: 1px solid rgba(60,125,62,.35); border-bottom: 1px solid rgba(60,125,62,.35);
}
@media (max-width: 720px) { .plan { aspect-ratio: 3 / 5.4; } }
.chargement { position: absolute; inset: 0; display: grid; place-items: center; margin: 0;
  font-style: italic; color: var(--brun); opacity: .6; }

.polaroid {
  position: absolute; left: 0; top: 0; width: var(--w, 150px); padding: 8px 8px 0;
  background: var(--blanc); border-radius: 3px; box-shadow: var(--ombre);
  transform: translate(var(--x), var(--y)) rotate(var(--r)); transform-origin: 50% 50%;
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  transition: box-shadow .15s;
}
.polaroid.saisi { cursor: grabbing; box-shadow: 0 24px 40px rgba(59,42,34,.4), 0 4px 8px rgba(59,42,34,.2); transition: none; }
.polaroid .photo { position: relative; aspect-ratio: var(--ratio, 9 / 16); background: #222 center/cover no-repeat; overflow: hidden; }
.polaroid .photo img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.polaroid .photo::after {
  content: "▶"; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; background: rgba(200,50,43,.88); color: var(--blanc); font-size: 18px;
  display: grid; place-items: center; padding-left: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.polaroid .nom { margin: 0; height: 40px; padding: 0 4px; display: grid; place-items: center; text-align: center;
  font-family: var(--script); color: var(--vert); font-size: clamp(16px, 1.6vw, 22px); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.polaroid .duree { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff;
  font: 12px/1 var(--bodoni); padding: 4px 7px; border-radius: 999px; letter-spacing: .05em; }
.polaroid .scotch {
  position: absolute; left: 50%; top: -12px; width: 74px; height: 24px; margin-left: -37px; transform: rotate(-4deg);
  background: repeating-linear-gradient(90deg, rgba(200,50,43,.5) 0 6px, rgba(255,255,255,.7) 6px 12px);
  opacity: .9; box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* ------------------------------------------------------------ la liste */
.liste { max-width: 720px; margin: 36px auto 40px; padding: 0 16px; }
.liste h2 { font-variant: small-caps; letter-spacing: .25em; font-weight: 400; font-size: 18px;
  text-align: center; color: var(--rouge); margin: 0 0 14px; }
.liste ol { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px dashed rgba(200,50,43,.35); cursor: pointer; }
.liste li:hover { background: rgba(255,255,255,.5); }
.liste img { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; border: 3px solid var(--blanc); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.liste .n { font-family: var(--script); color: var(--vert); font-size: 30px; line-height: 1; flex: 1; }
.liste .d { font-size: 14px; letter-spacing: .08em; opacity: .7; }

.pied { text-align: center; padding-bottom: 28px; }
.pied .script { margin-top: 22px; }

/* ------------------------------------------------------------ la modale */
.modale { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; }
.modale[hidden] { display: none; }
.modale-fond { position: absolute; inset: 0; background: rgba(30, 20, 15, .9); }
.lecteur { position: relative; width: min(96vw, 1100px); max-height: 96vh; display: flex; flex-direction: column;
  background: var(--blanc); border-radius: 6px; padding: 12px 12px 10px; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.lecteur video { width: 100%; max-height: calc(96vh - 130px); background: #000; border-radius: 3px; object-fit: contain; }
.modale-bas { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 4px 0; flex-wrap: wrap; }
.modale-bas .script { font-size: 38px; }
.nav { display: flex; gap: 8px; }
.fermer { position: absolute; right: -6px; top: -14px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--rouge); color: #fff; font: 26px/1 var(--bodoni); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); z-index: 2; }
@media (max-width: 720px) {
  .lecteur { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); justify-content: center; }
  .lecteur video { max-height: calc(100vh - 140px); }
  .fermer { right: 10px; top: 10px; }
}

/* ------------------------------------------------------------ le studio */
.boutons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.boutons .bouton { margin-top: 0; }
.bouton.secondaire { background: var(--blanc); color: var(--rouge); box-shadow: 0 3px 0 rgba(200,50,43,.35); }
.lecteur.studio { max-width: 560px; padding: 18px 18px 16px; text-align: center; }
.lecteur.studio h2 { margin: 0 0 6px; font-size: 44px; }
.erreur { min-height: 1.2em; margin: 0 0 6px; color: var(--rouge); font-style: italic; }
.champ { display: block; text-align: left; margin: 10px 0; font-variant: small-caps; letter-spacing: .12em; font-size: 15px; color: var(--brun); }
.champ input, .champ textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1.5px solid rgba(200,50,43,.45);
  border-radius: 6px; background: var(--creme); font: 18px var(--bodoni); color: var(--brun); font-variant: normal; letter-spacing: 0; }
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--vert); border-color: transparent; }
.obligatoire { color: var(--rouge); }
.cadre-video { position: relative; background: #000; border-radius: 6px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 60vh; }
.cadre-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
#apercu { transform: scaleX(-1); }
.jauge-fond { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.35); }
.jauge-fond.grande { position: static; height: 14px; border-radius: 999px; background: rgba(200,50,43,.2); margin: 14px 0; overflow: hidden; }
.jauge { height: 100%; width: 0; background: var(--rouge); transition: width .2s linear; }
.chrono { position: absolute; top: 10px; left: 12px; background: rgba(0,0,0,.55); color: #fff; font: 15px var(--bodoni); padding: 4px 10px; border-radius: 999px; letter-spacing: .06em; }
.rec { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--blanc); background: var(--rouge); color: var(--blanc);
  font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 0 0 3px var(--rouge), 0 6px 14px rgba(0,0,0,.3); }
.rec.en-cours { animation: pulse 1s infinite; }
.rec[disabled] { opacity: .4; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--rouge), 0 6px 14px rgba(0,0,0,.3); } 50% { box-shadow: 0 0 0 10px rgba(200,50,43,.35), 0 6px 14px rgba(0,0,0,.3); } }
.petit-gris { font-size: 14px; opacity: .6; }
.polaroid .nouveau { position: absolute; left: -6px; top: 14px; transform: rotate(-8deg); background: var(--vert); color: #fff;
  font: 11px var(--bodoni); letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.polaroid .attente { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font: 11px var(--bodoni); padding: 3px 0; text-align: center; letter-spacing: .08em; }
@media (max-width: 720px) { .lecteur.studio { justify-content: flex-start; overflow-y: auto; } .lecteur.studio h2 { font-size: 36px; } }
