/* ===== Les Bureaucrasses (histoire définitive, The Office) : carte, écrans, cinématiques =====
   Fichier dédié, chargé après style.css. Préfixe of-*. Open space beige, moquette grise, stores aux fenêtres,
   vieux écrans, caméra de faux documentaire (cadre de visée et « REC »), tasse « Meilleur patron du monde »,
   ferme de betteraves. Décors 100 % CSS/emojis, aucun visuel officiel. Le style de base décrit l'état final. */

/* --- Carte du hub : mur beige, store, bureau avec écran et tasse, voyant d'enregistrement --- */
.saga-office { background: linear-gradient(180deg, #d9cfb4 0%, #8a8270 48%, #2a2a2e 100%); color: var(--texte); }
.saga-office .saga-nom { color: #fff3c4; text-shadow: 0 2px 6px #000, 0 0 8px #0008; }
.of-carte, .of-carte > span { position: absolute; display: block; }
.of-carte { inset: 0; overflow: hidden; }
.of-carte-mur { inset: 0 0 auto 0; height: 104px; background: linear-gradient(180deg, #e8dfc4, #cfc3a2); }
.of-carte-fenetre { left: 8%; top: 12px; width: 38%; height: 44px; background: repeating-linear-gradient(180deg, #f6f2e6 0 4px, #b8c8d8 4px 7px); box-shadow: 0 0 0 3px #8a8270; }
.of-carte-bureau { left: 42%; top: 74px; width: 52%; height: 14px; background: #6a5038; box-shadow: 0 4px 0 #4a3828; }
.of-carte-ecran { left: 56%; top: 46px; width: 30px; height: 26px; border-radius: 3px; background: radial-gradient(circle at 50% 45%, #9fd6c8, #3a6a6a 70%); box-shadow: 0 0 0 4px #d8d0b8, 0 6px 0 2px #b8b098; }
.of-carte-tasse { left: 80%; top: 60px; width: 14px; height: 14px; border-radius: 0 0 5px 5px; background: #fff; box-shadow: 5px 2px 0 -2px #fff; }
.of-carte-camera { right: 6%; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; animation: of-rec 1s steps(2, jump-none) infinite; }
@keyframes of-rec { from { opacity: 1; } to { opacity: 0.2; } }

/* --- Écrans de départ et de jeu : open space beige et moquette grise --- */
.hp-scene[data-theme="office"], .hi-scene[data-theme="office"] { border-color: #b8a878; background: linear-gradient(180deg, #4a4638 0%, #34322a 60%, #24231e 100%); }
.hp-scene[data-theme="office"]::before, .hi-scene[data-theme="office"]::before { content: "● REC"; position: absolute; right: 16px; top: 12px; z-index: 0; pointer-events: none; color: #ff5d5d; font: 700 0.8rem "Courier New", monospace; letter-spacing: 0.08em; animation: of-rec 1s steps(2, jump-none) infinite; }
[data-theme="office"] .hp-ciel { display: none; }
[data-theme="office"] .hp-parchemin { background: linear-gradient(180deg, #fbf8ee, #ece4cc); border-top: 4px solid #6a5038; }
[data-theme="office"] .hp-barre > span { background: linear-gradient(90deg, #6a5038, #e9c46a); }
[data-theme="office"] .rayon { display: none; }
[data-theme="office"] .hi-chapitres li { background: #24231ed9; }
[data-theme="office"] .hi-niveau, [data-theme="office"] .hi-sur-titre { color: #e9c46a; }
[data-theme="office"] .hi-titre { font-family: Georgia, "Times New Roman", serif; }
[data-theme="office"] .hi-infos, [data-theme="office"] .hi-retour, [data-theme="office"] .hp-sauver { color: var(--texte); }

/* --- Éléments communs des cinématiques --- */
.of-collegue { position: absolute; width: 6%; height: 30%; }
.of-collegue .tete { position: absolute; left: 24%; top: 0; width: 52%; aspect-ratio: 1; border-radius: 50%; background: #eac4a0; box-shadow: inset 0 5px 0 #5a3a22; }
.of-collegue .corps { position: absolute; left: 6%; right: 6%; top: 28%; bottom: 0; border-radius: 40% 40% 10% 10%; background: linear-gradient(90deg, var(--c) 0 44%, #f6f2e6 44% 56%, var(--c) 56%); }
.of-collegue .corps::after { content: ""; position: absolute; left: 45%; top: 4%; width: 10%; height: 46%; background: #8a2a2a; clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%); }
.of-mur { inset: 0; background: linear-gradient(180deg, #e8dfc4 0 68%, #cfc3a2 68%); }
.of-fenetres { left: 6%; right: 6%; top: 8%; height: 34%; display: flex; gap: 3%; }
.of-fenetres i { flex: 1; background: repeating-linear-gradient(180deg, #f6f2e6 0 6px, #b8c8d8 6px 10px); box-shadow: 0 0 0 4px #8a8270; }
.of-moquette { left: 0; right: 0; bottom: 0; height: 24%; background: radial-gradient(#0001 1px, transparent 1.5px) 0 0 / 8px 8px, #8a8a86; }
.of-confettis { inset: 0; pointer-events: none; }
.of-confettis i { position: absolute; left: calc(var(--i) * 6% + 2%); top: 104%; width: 1.2%; height: 2.4%; background: hsl(calc(var(--i) * 40deg) 80% 60%); animation: of-confetti 2.6s linear calc(4.2s + var(--i) * 0.08s) 2 both; }
@keyframes of-confetti { from { top: -6%; rotate: 0deg; } to { top: 104%; rotate: 540deg; } }
@keyframes of-pop { from { opacity: 0; scale: 0.2; } 70% { scale: 1.2; } to { opacity: 1; scale: 1; } }

/* 1. L'open space et la caméra du documentaire : le patron lève sa tasse, regard caméra. */
.of-bureaux { left: 4%; right: 4%; bottom: 14%; height: 22%; display: flex; justify-content: space-between; }
.of-bureaux i { position: relative; width: 26%; background: linear-gradient(180deg, #7a5c40 0 22%, #5a4430 22%); }
.of-bureaux i::before { content: ""; position: absolute; left: 30%; bottom: 100%; width: 34%; height: 80%; border-radius: 4px; background: radial-gradient(circle at 50% 45%, #9fd6c8, #3a6a6a 70%); box-shadow: 0 0 0 5px #d8d0b8; }
.of-collegue.patron { left: 30%; bottom: 10%; width: 8%; height: 46%; }
.of-tasse-patron { left: 38%; bottom: 40%; font-size: clamp(1rem, 3.4vw, 2rem); animation: of-leve-tasse 1.2s ease-in-out 1s both; }
@keyframes of-leve-tasse { from { transform: translateY(40%) rotate(0); } 60% { transform: translateY(-20%) rotate(-15deg); } to { transform: none; } }
.of-collegue.rival { left: 70%; bottom: 10%; width: 7%; height: 40%; }
.of-camera { inset: 3%; pointer-events: none; background: linear-gradient(#fff, #fff) 0 0 / 8% 3px no-repeat, linear-gradient(#fff, #fff) 0 0 / 3px 12% no-repeat, linear-gradient(#fff, #fff) 100% 0 / 8% 3px no-repeat, linear-gradient(#fff, #fff) 100% 0 / 3px 12% no-repeat, linear-gradient(#fff, #fff) 0 100% / 8% 3px no-repeat, linear-gradient(#fff, #fff) 0 100% / 3px 12% no-repeat, linear-gradient(#fff, #fff) 100% 100% / 8% 3px no-repeat, linear-gradient(#fff, #fff) 100% 100% / 3px 12% no-repeat; opacity: 0.85; }
.of-camera .rec { position: absolute; left: 3%; top: 4%; padding: 0 0.3em; background: #0007; color: #ff4a4a; font: 700 clamp(0.6rem, 1.8vw, 1rem) "Courier New", monospace; animation: of-rec 1s steps(2, jump-none) infinite; }
.of-camera .objectif { position: absolute; right: 3%; top: 4%; padding: 0 0.3em; background: #0007; color: #fff; font: 700 clamp(0.5rem, 1.4vw, 0.8rem) "Courier New", monospace; }
.of-camera .objectif::after { content: "00:12:34"; }
.of-regard { left: 33%; bottom: 58%; font-size: clamp(0.9rem, 2.6vw, 1.5rem); animation: of-pop 0.5s ease-out 3.9s both; }

/* 2. L'agrafeuse dans la gelée : colère du rival, clin d'œil du farceur. */
.of-bureau-seul { left: 30%; right: 30%; bottom: 14%; height: 18%; background: linear-gradient(180deg, #7a5c40 0 22%, #5a4430 22%); }
.of-bureau-seul .gelee { position: absolute; left: 30%; bottom: 100%; width: 40%; height: 90%; border-radius: 10px 10px 4px 4px; background: linear-gradient(160deg, #fff6a0cc, #f2d23acc 60%, #d9b21acc); box-shadow: inset 0 0 12px #fff8, 0 0 14px #f2d23a88; animation: of-tremble 0.2s ease-in-out infinite alternate; }
.of-bureau-seul .agrafeuse { position: absolute; left: 22%; top: 40%; width: 56%; height: 22%; border-radius: 4px 12px 4px 4px; background: #c0392b; box-shadow: inset 0 -4px 0 #7a1f14; opacity: 0.85; }
@keyframes of-tremble { from { transform: skewX(-1.5deg); } to { transform: skewX(1.5deg); } }
.of-collegue.furieux { left: 22%; bottom: 10%; width: 7%; height: 42%; animation: of-colere 0.15s linear 2.6s 14 alternate; }
@keyframes of-colere { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
.of-collegue.farceur { left: 80%; bottom: 10%; width: 7%; height: 40%; }
.of-cri { left: 10%; top: 12%; color: #c0392b; font: 900 clamp(1rem, 3.8vw, 2.3rem) Georgia, serif; text-shadow: 2px 2px 0 #fff; transform: rotate(-6deg); animation: of-pop 0.5s ease-out 2.4s both; }
.of-clin { left: 79%; bottom: 54%; font-size: clamp(1rem, 3vw, 1.8rem); animation: of-pop 0.5s ease-out 3.8s both; }

/* 3. L'exercice d'incendie : fumée, alarme rouge, panique générale, extincteur. */
.of-fumee { inset: 0; pointer-events: none; }
.of-fumee i { position: absolute; bottom: 10%; left: calc(var(--i) * 13% + 2%); width: 18%; aspect-ratio: 1; border-radius: 50%; background: #6a6a70aa; filter: blur(8px); animation: of-fumee 3s ease-out calc(var(--i) * 0.35s) infinite; }
@keyframes of-fumee { from { transform: translateY(10%) scale(0.5); opacity: 0; } 30% { opacity: 0.9; } to { transform: translateY(-260%) scale(1.6); opacity: 0; } }
.of-alarme { left: 46%; top: 2%; width: 8%; aspect-ratio: 1; border-radius: 50% 50% 10% 10%; background: conic-gradient(from 0deg, #ff3b3b 0 25%, #8a1f1f 25% 100%); box-shadow: 0 0 30px 10px #ff3b3b66; animation: of-gyro 0.6s linear infinite; }
@keyframes of-gyro { to { rotate: 360deg; } }
.of-collegue.panique { bottom: 10%; width: 6%; height: 36%; animation: of-court 0.9s ease-in-out infinite alternate; }
.of-collegue.p0 { left: 8%; } .of-collegue.p1 { left: 26%; animation-delay: -0.3s; } .of-collegue.p2 { left: 46%; animation-delay: -0.6s; } .of-collegue.p3 { left: 64%; animation-delay: -0.2s; } .of-collegue.p4 { left: 82%; animation-delay: -0.5s; }
@keyframes of-court { from { transform: translateX(-60%) rotate(-6deg); } to { transform: translateX(60%) rotate(6deg); } }
.of-extincteur { left: 56%; bottom: 40%; font-size: clamp(1.2rem, 4vw, 2.4rem); animation: of-pop 0.4s ease-out 2.6s both, of-secoue 0.1s linear 3s 20 alternate; }
@keyframes of-secoue { from { rotate: -8deg; } to { rotate: 8deg; } }
.of-panneau { left: 6%; top: 46%; padding: 0.2em 0.6em; border-radius: 4px; background: #c0392b; color: #fff; font: 900 clamp(0.7rem, 2.2vw, 1.3rem) Georgia, serif; animation: of-pop 0.5s ease-out 3.6s both; }

/* 4. La soirée des Dondies : restaurant rouge, petite scène, projecteur, trophée. */
.of-restaurant { inset: 0; background: linear-gradient(180deg, #8a2a1e 0 62%, #5a3020 62%); }
.of-scene-dondies { left: 22%; right: 22%; bottom: 24%; height: 8%; background: linear-gradient(180deg, #4a2a18, #2a180e); }
.of-titre-dondies { left: 50%; top: 6%; transform: translateX(-50%); padding: 0.15em 0.8em; border: 3px solid #f2c94c; border-radius: 8px; background: #1a120c; color: #f2c94c; font: italic 900 clamp(1rem, 3.6vw, 2.1rem) Georgia, serif; text-shadow: 0 0 10px #f2a33a; white-space: nowrap; }
.of-projecteur { left: 38%; top: 0; width: 24%; height: 78%; background: linear-gradient(180deg, #fff6c855, transparent); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.of-collegue.presentateur { left: 47%; bottom: 32%; width: 7%; height: 40%; }
.of-micro { left: 54%; bottom: 46%; width: 1%; height: 16%; background: #333; }
.of-micro::before { content: ""; position: absolute; left: -100%; top: -12%; width: 300%; aspect-ratio: 1; border-radius: 50%; background: #555; }
.of-trophee { left: 58%; bottom: 52%; font-size: clamp(1.2rem, 4vw, 2.4rem); animation: of-pop 0.6s ease-out 3.6s both, of-brille 1s ease-in-out 4.2s infinite alternate; }
@keyframes of-brille { from { filter: drop-shadow(0 0 2px #f2c94c); } to { filter: drop-shadow(0 0 14px #f2c94c); } }
.of-tables { left: 4%; right: 4%; bottom: 4%; height: 16%; display: flex; justify-content: space-between; }
.of-tables i { width: 24%; border-radius: 50% / 30%; background: radial-gradient(ellipse at 50% 30%, #f6eedb 0 50%, #c9b98e 52%); }

/* 5. Victoire : plaque sur la porte, tasse géante « Meilleur patron du monde », applaudissements. */
.of-porte-bureau { left: 8%; bottom: 24%; width: 22%; height: 62%; background: linear-gradient(90deg, #8a6a48, #a8845c 50%, #8a6a48); box-shadow: inset 0 0 0 4px #5a4430; }
.of-porte-bureau .plaque { position: absolute; left: 10%; right: 10%; top: 16%; padding: 4% 2%; border-radius: 3px; background: linear-gradient(180deg, #f2d27a, #c9a24a); color: #2a1a0a; text-align: center; font: 700 clamp(0.4rem, 1.3vw, 0.8rem) Georgia, serif; overflow: hidden; word-break: break-word; animation: of-pop 0.6s ease-out 1s both; }
.of-grande-tasse { left: 40%; bottom: 26%; width: 20%; height: 40%; border-radius: 6px 6px 22% 22%; background: linear-gradient(90deg, #e8e8e8, #fff 40%, #e0e0e0); box-shadow: 0 8px 20px #0005; animation: of-tasse 1s cubic-bezier(0.2, 1.4, 0.4, 1) 3.6s both; }
.of-grande-tasse::after { content: ""; position: absolute; right: -24%; top: 18%; width: 30%; height: 48%; border: 8px solid #f2f2f2; border-left: 0; border-radius: 0 50% 50% 0; box-sizing: border-box; }
.of-grande-tasse .texte { position: absolute; inset: 22% 8%; display: grid; place-items: center; text-align: center; color: #1a1a1a; font: 900 clamp(0.45rem, 1.5vw, 0.95rem) Georgia, serif; text-transform: uppercase; }
@keyframes of-tasse { from { opacity: 0; transform: translateY(60%) scale(0.4); } to { opacity: 1; transform: none; } }
.of-collegue.applaudit { bottom: 6%; width: 6%; height: 34%; animation: of-applaudit 0.35s ease-in-out infinite alternate; }
.of-collegue.a0 { left: 64%; } .of-collegue.a1 { left: 72%; animation-delay: 0.1s; } .of-collegue.a2 { left: 80%; animation-delay: 0.2s; } .of-collegue.a3 { left: 88%; animation-delay: 0.05s; }
@keyframes of-applaudit { from { transform: translateY(0); } to { transform: translateY(-6%); } }
.of-banniere { left: 50%; top: 3%; max-width: 88%; transform: translateX(-50%); padding: 0.3em 0.8em; border: 2px solid #e9c46a; border-radius: 10px; background: #2a2418e6; color: #fff6dc; font: 900 clamp(0.85rem, 3vw, 1.6rem) Georgia, serif; text-shadow: 0 0 10px #e9c46a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: of-banniere 0.9s ease-out 4.8s both; }
@keyframes of-banniere { from { opacity: 0; transform: translate(-50%, -40%) scale(0.8); } to { opacity: 1; transform: translateX(-50%); } }

/* 6. Défaite : exil sous la pluie à la ferme de betteraves. */
.of-ciel-gris { inset: 0; background: linear-gradient(180deg, #5a6068 0%, #8a9098 100%); }
.of-champ { left: 0; right: 0; bottom: 0; height: 42%; background: repeating-linear-gradient(180deg, #5a3a22 0 10px, #4a2e1a 10px 18px); }
.of-grange { right: 8%; bottom: 36%; width: 24%; height: 34%; background: #9a2a1e; clip-path: polygon(0 34%, 50% 0, 100% 34%, 100% 100%, 0 100%); }
.of-grange .porte { position: absolute; left: 34%; right: 34%; bottom: 0; height: 46%; background: repeating-linear-gradient(45deg, #f6f2e6 0 3px, transparent 3px 14px), #7a1f14; }
.of-betteraves { left: 4%; right: 36%; bottom: 6%; height: 26%; display: flex; flex-wrap: wrap; justify-content: space-around; align-content: space-around; }
.of-betteraves i { position: relative; width: 9%; aspect-ratio: 1; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 40% 40%, #b03a6a, #6a1a3a); }
.of-betteraves i::before { content: ""; position: absolute; left: 30%; bottom: 80%; width: 40%; height: 80%; border-radius: 50% 50% 0 0; background: #4a8a3a; }
.of-collegue.exile { left: 52%; bottom: 14%; width: 7%; height: 38%; filter: saturate(0.6); animation: of-triste 2s ease-in-out infinite alternate; }
@keyframes of-triste { from { transform: rotate(-2deg); } to { transform: rotate(2deg) translateY(2%); } }
.of-pluie { inset: 0; overflow: hidden; pointer-events: none; }
.of-pluie i { position: absolute; left: calc(var(--i) * 6% + 2%); top: 40%; width: 1px; height: 14%; background: linear-gradient(transparent, #dfe8f2cc); animation: of-pluie calc(0.6s + var(--i) * 0.03s) linear calc(var(--i) * -0.17s) infinite; }
@keyframes of-pluie { from { top: -20%; } to { top: 110%; } }

@media (prefers-reduced-motion: reduce) {
  .of-carte *, .cine-scene [class^="of-"], .cine-scene [class^="of-"] *, [data-theme="office"]::before { animation: none !important; }
  .of-pluie i { top: 30%; }
  .of-fumee i { opacity: 0.6; transform: translateY(-80%); }
}
