/**
 * =============================================================================
 * This is the file where all your styling should go in.
 * Instead of modifying the styles found in the monogatari.css file or others,
 * you should overwrite those styles in this file.
 *
 * The CSS selectors shown are not an extensive list but they are the most
 * common you might want to change. To find what other elements are available,
 * you can take a look at the monogatari.css file or use your browser's dev
 * tools to inspect the elements.
 * =============================================================================
**/


/**
 * ===========================
 * General Styling
 * ===========================
**/


/* General Style */

body {}


/* Simple Button styles*/

button {
    /* background-image: url('../assets/icons/BOUTON\ JOUER.PNG'); */
}


/* Simple Button Style on Hover */

button:hover {}


/* General Styling for Menu Screens */

[data-screen] {
    background-image: url('../assets/images/brouillon_affiche.JPG');
    background-repeat: no-repeat;
}

/* Sur l'illustration seule, les réglages et les listes des menus étaient
   illisibles (Échap ouvre les préférences par-dessus le jeu) : un voile clair
   presque opaque, l'illustration restant devinable dessous. */
[data-screen="settings"],
[data-screen="load"],
[data-screen="save"],
[data-screen="help"],
[data-screen="gallery"],
[data-screen="credits"] {
    background-image: linear-gradient(rgba(247, 247, 247, 0.92), rgba(247, 247, 247, 0.92)),
        url('../assets/images/brouillon_affiche.JPG');
    background-size: cover;
}


/**
 * ===========================
 * Main Menu Styling
 * ===========================
**/


/* Main Menu Styling */

[data-screen="main"] {
    background-image: url('../assets/images/dessin_jaune_affiche.PNG');
    background-repeat: no-repeat;
}


/* Main Menu Buttons Styling */

[data-screen="main"] button {
    background-image: url('../assets/icons/BOUTON\ JOUER.PNG');
    background-size: cover;
}

[data-screen="main"] button:hover {
    transform: scale(1.1);
}

/* Le moteur ancre main-menu en bas à droite ; test.css compensait par des
   marges fixes (.main_button : 500px / 600px) qui ne tombaient juste que pour
   une taille d'écran. On centre plutôt le menu sur tout l'écran. */
[data-component="main-menu"] {
    inset: 0;
    align-self: stretch;
    align-items: center;
    justify-content: center;
}

[data-component="main-menu"] .main_button,
[data-component="main-menu"] .main_button:hover,
[data-component="main-menu"] .main_button:focus {
    margin: 0;
    /* L'image (394 × 102) a des bords transparents : le fond sombre du bouton
       les traversait en deux traits verticaux. Fond transparent, et bouton
       aux proportions exactes de l'image. */
    background-color: transparent;
    background-size: 100% 100%;
    box-shadow: none;
    height: auto;
    aspect-ratio: 394 / 102;
}


/**
 * ===========================
 * Save and Load Menus Styling
 * ===========================
**/


/* Slots Style */

[data-component="save-slot"] figure {}


/* Slot's Image Style */

[data-component="save-slot"] img {}


/* Slots Title Style */

[data-component="save-slot"] figcaption {}


/* Slots Delete Button Style */

[data-component="save-slot"] button {}


/**
 * ===========================
 * Game Elements Styling
 * ===========================
**/

[data-component="choice-container"] {
    width: 100%;
    height: 100%;
    justify-content: center;
}

/* Le conteneur occupe tout l'écran : c'est la colonne de boutons qu'il faut
   centrer, sans quoi elle s'empile en haut. */
[data-component="choice-container"] [data-content="wrapper"] {
    justify-content: center;
}


/* Choice Buttons style */

[data-component="choice-container"] button {
    border-radius: 3px;
    opacity: 0.9;
}


/* Choice Button Style on Hover */

[data-component="choice-container"] button:hover {}


/* Text Box styling */

[data-component="text-box"] {
    position: absolute;
}

[data-content="text"] {
    left: 100px;
}


/* Character Name Style */

[data-ui="who"] {}

[data-ui="face"] {
    display: inline-block;
    height: 150px;
    width: 150px;
    /* Le carré de 150 px déformait les dessins (887 × 509, bords transparents) :
       on les y cadre sans les étirer, en ne rognant que ces bords. */
    object-fit: cover;
    object-position: center top;
}


/* Style for Centered Text */

[data-component="centered-dialog"] {
    color: gray;
}


/* Character Images Styles */

[data-screen="game"] [data-character] {}


/* Other Images Styles */

[data-screen="game"] [data-image] {}


/**
 * ===========================
 * Quick Menu Styling
 * ===========================
**/


/* These styles are applied to the Mobile version of the Quick Menu */


/* Quick Menu Style */

[data-component="quick-menu"] {}


/* Quick Menu Buttons Style */

[data-component="quick-menu"] span {}


/* Quick Menu Buttons Style on Hover */

[data-component="quick-menu"] span:hover {}


/* Quick Menu Buttons Icon Style */

[data-component="quick-menu"]>span>.fa {}


/**
 * ===========================
 * Range Styling
 * ===========================
**/


/* Use the background property to set a color for these */

input[type=range]:focus::-webkit-slider-runnable-track {
    color: green;
}

input[type=range]::-webkit-slider-runnable-track {
    color: aqua;
}

input[type=range]:focus::-ms-fill-upper {
    color: pink;
}

input[type=range]:focus::-ms-fill-lower {}

input[type=range]::-moz-range-track {}

input[type=range]::-ms-fill-lower {}

input[type=range]::-ms-fill-upper {}


/* Styles for the desktop version of the Quick Menu*/

@media screen and (min-width: 37.56255em) {
    /* Quick Menu Style */
    [data-component="quick-menu"] {}
    /* Quick Menu Buttons Style */
    [data-component="quick-menu"] span {}
    /* Quick Menu Buttons Style on Hover */
    [data-component="quick-menu"] span:hover {}
}
/**
 * ===========================
 * GamiShT : accueil
 * ===========================
**/

/* Question d'accueil au-dessus des choix : centrée, marges latérales,
   fond sombre translucide pour rester lisible sur l'illustration. */
.accueil-question {
    position: absolute;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    box-sizing: border-box;
    width: max-content;
    max-width: min(92%, 60rem);
    padding: 1rem 2.5rem;
    border-radius: 14px;
    background: rgba(24, 20, 48, 0.72);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    color: #fff;
    text-align: center;
    font-size: clamp(1.1rem, 2.2vw, 1.75rem);
    line-height: 1.35;
}

.accueil-question p {
    margin: 0.2em 0;
}

/* Éditeur de texte (CKEditor) : boutons sous la zone de saisie */
#editeur {
    text-align: center;
}

#editeur .btn_txt,
#editeur .close_txt {
    display: inline-block;
    margin: 1.2rem 0.5rem;
    padding: 0.6rem 1.6rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
}

#editeur .btn_txt {
    background: #3b3270;
    color: #fff;
}

#editeur .close_txt {
    background: #e4e4ea;
    color: #222;
}

#editeur .btn_txt:hover,
#editeur .close_txt:hover {
    filter: brightness(1.12);
}

/**
 * ===========================
 * GamiShT : fenêtres (gamisht-ui.js)
 * ===========================
**/

.gamisht-modale {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 14, 32, 0.55);
    animation: gamisht-apparition 0.18s ease-out;
}

@keyframes gamisht-apparition {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gamisht-modale button {
    font: inherit;
    cursor: pointer;
}

/* monogatari.css fixe tous les boutons à 10rem × 3,5rem : on l'annule dans
   les fenêtres, avec une spécificité minimale pour que les classes ci-dessous
   gardent la main. */
:where(.gamisht-modale) button {
    width: auto;
    height: auto;
}

.gamisht-fermer {
    position: absolute;
    top: -2.6rem;
    right: 0;
    padding: 0.35rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 0.95rem;
}

.gamisht-fermer:hover {
    background: #fff;
    color: #b8321a;
}

/* Crâne OS : la fenêtre garde exactement les proportions du dessin
   (3024 × 1964), quelle que soit la taille de l'écran. */
.crane-os {
    position: relative;
}

.crane-os__fenetre {
    position: relative;
    width: min(92vw, calc(84vh * 3024 / 1964));
    aspect-ratio: 3024 / 1964;
    background: #fff url('../assets/images/crâneOS.JPG') center / 100% 100% no-repeat;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.crane-os__onglet {
    position: absolute;
    top: 5.2%;
    height: 10.4%;
    padding: 0;
    border: 0;
    background: transparent;
}

.crane-os__onglet::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 22%;
    bottom: 12%;
    height: 4px;
    border-radius: 2px;
    background: rgba(198, 58, 20, 0);
    transition: background 0.15s;
}

.crane-os__onglet:hover::after {
    background: rgba(198, 58, 20, 0.45);
}

.crane-os__onglet--actif::after,
.crane-os__onglet--actif:hover::after {
    background: rgba(198, 58, 20, 0.85);
}

.crane-os__croix {
    position: absolute;
    top: 7.5%;
    width: 2.8%;
    height: 6.5%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
}

.crane-os__croix:hover {
    background: rgba(198, 58, 20, 0.18);
}

.crane-os__contenu {
    position: absolute;
    top: 17%;
    left: 1.5%;
    right: 1.5%;
    bottom: 3%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crane-os__a-venir {
    max-width: 32rem;
    color: #333;
    text-align: center;
}

.crane-os__a-venir h2 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
}

/* Carte : l'image est inscrite dans la zone de contenu sans déformation,
   et la France est une zone visible au survol. */
.crane-os__carte {
    position: relative;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 1672 / 941;
}

.crane-os__carte img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: static;
    max-height: none;
}

.crane-os__pays {
    position: absolute;
    border: 2px dashed rgba(230, 150, 30, 0.7);
    border-radius: 30% 40% 35% 30%;
    background: rgba(255, 210, 120, 0.12);
    animation: gamisht-invite 2.4s ease-in-out infinite;
}

@keyframes gamisht-invite {
    50% { background: rgba(255, 210, 120, 0.3); }
}

.crane-os__pays span {
    position: absolute;
    left: 50%;
    bottom: -2.2rem;
    transform: translateX(-50%);
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    background: rgba(24, 20, 48, 0.85);
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.crane-os__pays:hover {
    border-style: solid;
    background: rgba(255, 210, 120, 0.35);
    animation: none;
}

.crane-os__pays:hover span {
    opacity: 1;
}

.crane-os__consigne {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.4rem;
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    text-align: center;
}

/* Lieux : une grille de vignettes ; le survol agrandit la vignette par
   transform, sans déplacer ses voisines. */
.lieux {
    position: relative;
    width: min(92vw, 70rem);
    padding: 1.5rem 2rem 2rem;
    border-radius: 16px;
    background: rgba(24, 20, 48, 0.88);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.lieux__titre {
    margin: 0 0 1.2rem;
    color: #fff;
    font-size: 1.6rem;
    text-align: center;
}

.lieux__grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

@media (max-width: 40rem) {
    .lieux__grille {
        grid-template-columns: repeat(2, 1fr);
    }
}

.lieux__carte {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: #2c2650;
    color: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}

.lieux__carte img {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.lieux__carte span {
    padding: 0.6rem 0.5rem;
    font-size: 1.05rem;
    text-align: center;
}

.lieux__carte:hover,
.lieux__carte:focus-visible {
    transform: scale(1.05);
    border-color: #f0c060;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
    outline: none;
}

.lieux__carte--retour {
    background: #3d3566;
}

.lieux__carte--retour span::before {
    content: "← ";
}

/* Indication pour avancer dans le dialogue */
.gamisht-suite {
    position: absolute;
    right: 1.5rem;
    bottom: 0.8rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    pointer-events: none;
}

text-box.gamisht-attente .gamisht-suite {
    display: flex;
}

.gamisht-suite__consigne {
    display: none;
}

text-box.gamisht-apprentissage .gamisht-suite__consigne {
    display: inline;
}

.gamisht-suite__fleche {
    font-size: 1.4rem;
    animation: gamisht-clignote 1.1s ease-in-out infinite;
}

@keyframes gamisht-clignote {
    50% { opacity: 0.25; transform: translateX(3px); }
}

/* Court message (retour arrière impossible, etc.) */
.gamisht-avis {
    position: fixed;
    left: 50%;
    bottom: 5.5rem;
    z-index: 1100;
    transform: translateX(-50%);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    background: rgba(24, 20, 48, 0.9);
    color: #fff;
    font-size: 1rem;
    pointer-events: none;
    animation: gamisht-avis 2.6s ease-in-out forwards;
}

@keyframes gamisht-avis {
    0% { opacity: 0; transform: translate(-50%, 8px); }
    10%, 80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; }
}

/**
 * ===========================
 * GamiShT : choix, onglets, fenêtres (2)
 * ===========================
**/

/* Boutons de choix : même famille que le bandeau d'accueil, opaques pour
   rester lisibles sur l'illustration. Les touches 1 à 9 les choisissent sans
   numéro affiché (liste des raccourcis : bouton « Aide » du menu du bas). */
[data-component="choice-container"] {
    counter-reset: choix;
}

[data-component="choice-container"] [data-content="wrapper"] {
    align-items: center;
    gap: 0.9rem;
}

[data-component="choice-container"] button {
    counter-increment: choix;
    position: relative;
    width: auto;
    height: auto;
    min-width: min(22rem, 86vw);
    max-width: min(46rem, 90vw);
    margin: 0;
    padding: 0.85rem 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(24, 20, 48, 0.88);
    color: #fff;
    opacity: 1;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}



/* Survol et focus (Tab, flèches) changent l'apparence du choix, jamais sa
   position : les boutons restent fixes. */
[data-component="choice-container"] button:hover,
[data-component="choice-container"] button:focus-visible {
    background: rgba(59, 50, 112, 0.96);
    border-color: #f0c060;
    box-shadow: 0 0 0 3px rgba(240, 192, 96, 0.55), 0 6px 20px rgba(0, 0, 0, 0.35);
    outline: none;
}



/* Crâne OS : pas de fond gris au survol (règle button:hover du moteur) ;
   l'onglet survolé reçoit un trait fin, l'onglet actif un trait épais. */
.gamisht-modale .crane-os__onglet,
.gamisht-modale .crane-os__onglet:hover,
.gamisht-modale .crane-os__onglet:focus,
.gamisht-modale .crane-os__croix,
.gamisht-modale .crane-os__croix:hover {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.gamisht-modale .crane-os__onglet::after {
    height: 2px;
    bottom: 14%;
    transition: background 0.15s, height 0.15s;
}

.gamisht-modale .crane-os__onglet:hover::after {
    background: rgba(198, 58, 20, 0.45);
}

.gamisht-modale .crane-os__onglet--actif::after,
.gamisht-modale .crane-os__onglet--actif:hover::after {
    height: 5px;
    bottom: 12%;
    background: rgba(198, 58, 20, 0.9);
}

.gamisht-modale .crane-os__onglet--actif {
    cursor: default;
}

.gamisht-modale .crane-os__croix {
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.gamisht-modale .crane-os__croix:hover {
    border-color: rgba(198, 58, 20, 0.7);
}

/* Fenêtre du joueur : prénom et genre */
.joueur {
    width: min(92vw, 30rem);
    padding: 1.6rem 2rem 1.8rem;
    border-radius: 16px;
    background: rgba(24, 20, 48, 0.94);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: #fff;
    text-align: left;
}

.joueur h2 {
    margin: 0 0 1.2rem;
    font-size: 1.5rem;
    text-align: center;
}

.joueur__champ {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.joueur__champ input {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    font-size: 1.05rem;
}

.joueur__genre {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0 0 0.8rem;
    padding: 0;
    border: 0;
}

.joueur__genre legend {
    margin-bottom: 0.5rem;
    padding: 0;
}

.joueur__choix {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.joueur__choix input {
    appearance: auto;
    -webkit-appearance: radio;
    margin: 0;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #f0c060;
}

.joueur__aide {
    margin: 0.4rem 0 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.gamisht-modale .joueur__valider {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 0;
    border-radius: 10px;
    background: #f0c060;
    color: #241e3f;
    font-size: 1.1rem;
    font-weight: bold;
}

.gamisht-modale .joueur__valider:hover {
    background: #f6d07e;
}

/* Éditeur : une fenêtre centrée par-dessus le jeu, et non plus tout l'écran. */
#editeur {
    position: fixed;
    inset: 0;
    z-index: 900;
    align-items: center;
    justify-content: center;
    background: rgba(16, 14, 32, 0.55);
    text-align: left;
}

#editeur .centered {
    box-sizing: border-box;
    width: min(92vw, 56rem);
    max-height: 90vh;
    margin: 0;
    padding: 1.1rem 1.5rem 1.3rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#editeur .ck-editor__editable {
    min-height: 38vh;
    max-height: 58vh;
}

.editeur__entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.editeur__entete h2 {
    margin: 0;
    color: #241e3f;
    font-size: 1.35rem;
}

#editeur button {
    width: auto;
    height: auto;
    font: inherit;
    cursor: pointer;
}

#editeur .editeur__fermer {
    padding: 0.2rem 0.6rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #555;
    font-size: 1.3rem;
}

#editeur .editeur__fermer:hover {
    background: #f1eef8;
    color: #b8321a;
}

.editeur__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
}

#editeur .editeur__actions .btn_txt,
#editeur .editeur__actions .close_txt {
    margin: 0;
    border: 0;
}

/* Titre de scène sur le drap blanc (images/scene.png, 1196 × 1020) : image et
   texte partagent le même repère, ils restent alignés à toute taille. */
game-screen {
    --scene-l: min(46vw, 78vh);
    --scene-h: calc(var(--scene-l) * 1020 / 1196);
}

game-screen > img.scene {
    left: calc(50% - var(--scene-l) / 2);
    top: calc(50% - var(--scene-h) / 2);
    width: var(--scene-l);
    height: var(--scene-h);
    max-height: none;
}

game-screen > .scene_t {
    position: absolute;
    left: calc(50% - var(--scene-l) / 2 + var(--scene-l) * 0.22);
    top: calc(50% - var(--scene-h) / 2 + var(--scene-h) * 0.22);
    width: calc(var(--scene-l) * 0.62);
    height: calc(var(--scene-h) * 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #2a2a2a;
    font-size: calc(var(--scene-l) * 0.045);
    line-height: 1.3;
    text-align: center;
}

/* Les quatre traductions de Hamlet : posées sur le livre lui-même
   (scenes/livre.PNG, 3024 × 1964), qui s'inscrit dans l'écran sans rognure. */
.livre-pages {
    position: absolute;
    left: 50%;
    top: 47%;
    transform: translate(-50%, -50%);
    width: min(96vw, calc(86vh * 3024 / 1964));
    aspect-ratio: 3024 / 1964;
    background: url('../assets/scenes/livre.PNG') center / 100% 100% no-repeat;
    container-type: inline-size;
}

.livre-pages > div {
    position: absolute;
    top: 6%;
    bottom: 9%;
    width: 21%;
    left: auto;
    right: auto;
    height: auto;
    margin: 0;
    overflow-y: auto;
    color: #1d1d1d;
    font-size: clamp(9px, 1.25cqw, 16px);
    line-height: 1.35;
}

.livre-pages > .text_4_1 { left: 4%; }
.livre-pages > .text_4_2 { left: 26.5%; }
.livre-pages > .text_4_3 { left: 52.5%; }
.livre-pages > .text_4_4 { left: 75%; }

.livre-pages p {
    margin: 0;
}

/* Sur la page du livre, le choix « Continuer » se place en bas pour ne pas
   masquer les traductions. */
game-screen:has(.livre-pages) [data-component="choice-container"] [data-content="wrapper"] {
    justify-content: flex-end;
    padding-bottom: 3vh;
}

/* Fenêtre d'aide : raccourcis clavier */
.aide {
    position: relative;
    width: min(92vw, 34rem);
    padding: 1.6rem 2rem 1.4rem;
    border-radius: 16px;
    background: rgba(24, 20, 48, 0.95);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1rem;
}

.aide h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    text-align: center;
}

.aide__table {
    width: 100%;
    border-collapse: collapse;
}

.aide__table th,
.aide__table td {
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    font-weight: normal;
}

.aide__table th {
    width: 9rem;
    white-space: nowrap;
}

.aide kbd {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom-width: 3px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
}

.aide__note {
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

/**
 * ===========================
 * GamiShT : boîte de dialogue et sous-titres (soutitres/script_text.js)
 * ===========================
**/

/* La boîte assombrit le bas de l'écran ; le portrait du locuteur y a sa
   marge, le texte occupe la colonne de droite. Pas d'ascenseur horizontal. */
[data-component="text-box"] {
    overflow: hidden;
    box-sizing: border-box;
    padding: 0.9rem clamp(0.9rem, 2vw, 1.6rem) 0.9rem;
}

text-box > [data-content="wrapper"] {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.8rem, 1.6vw, 1.4rem);
    height: 100%;
    min-width: 0;
}

text-box [data-content="side-image"] {
    flex: 0 0 auto;
    position: static;
    align-self: center;
}

text-box [data-content="side-image"] [data-ui="face"] {
    display: block;
    width: clamp(90px, 9vw, 140px);
    height: clamp(90px, 9vw, 140px);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 16px rgba(0, 0, 0, 0.35);
}

text-box [data-content="text"] {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    padding: 0 !important;
}

text-box [data-content="text"] > [data-ui="who"] {
    padding: 0 0 0.25rem;
    /* +25 % (demande du 16/10) */
    font-size: clamp(1.25rem, 1.56vw, 1.5rem);
    font-weight: bold;
}

/* Lisibilité : 100 caractères au plus par ligne, interligne 1,5 ; la taille
   suit la largeur de l'écran pour que la ligne pleine approche ces 100
   caractères. Une réplique trop longue défile verticalement. */
text-box .subtitle {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    width: auto;
    max-width: 100ch;
    margin: 0 0 1.4rem;
    padding: 0 0.4rem 0 0;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    /* +25 % (demande du 16/10) ; 100 caractères par ligne au plus */
    font-size: clamp(1.25rem, 1.56vw, 1.69rem);
    line-height: 1.5;
    text-align: left;
    overflow-wrap: break-word;
}

text-box .subtitle .a-venir {
    visibility: hidden;
}

/* Mots : traduction au survol (pointillés), définition (soulignement doré). */
text-box .subtitle .mot {
    border-radius: 3px;
}

text-box .subtitle .mot.a-traduction,
text-box .subtitle .mot.a-definition {
    cursor: pointer;
}

text-box .subtitle .mot.a-traduction:hover,
text-box .subtitle .mot.a-definition:hover {
    background: rgba(255, 255, 255, 0.14);
}

text-box .subtitle .mot.a-traduction {
    text-decoration: underline dotted rgba(255, 255, 255, 0.55);
    text-underline-offset: 0.22em;
}

text-box .subtitle .mot.a-definition {
    text-decoration: underline solid #f0c060;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
}

/* Bulle de survol et fiche au clic, posées sur <body>. */
.gamisht-bulle,
.gamisht-fiche {
    position: fixed;
    z-index: 1200;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.12s;
}

.gamisht-bulle.visible,
.gamisht-fiche.visible {
    visibility: visible;
    opacity: 1;
}

.gamisht-bulle {
    max-width: 18rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: rgba(24, 20, 48, 0.95);
    color: #fff;
    font-size: 0.95rem;
    pointer-events: none;
}

.gamisht-fiche {
    width: min(24rem, 86vw);
    text-align: left;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    background: #fff;
    color: #222;
    font-size: 0.98rem;
    line-height: 1.45;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.gamisht-fiche__mot {
    display: block;
    margin-bottom: 0.3rem;
    color: #241e3f;
    font-size: 1.15rem;
}

.gamisht-fiche p {
    margin: 0 0 0.5rem;
}

.gamisht-fiche__traduction {
    color: #3b3270;
}

.gamisht-fiche a {
    color: #3b3270;
}

/* Crâne OS : les icônes du bureau réagissent au survol. */
game-screen > .wiki,
game-screen > .texte,
game-screen > .carte,
game-screen > .score,
game-screen > .para {
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

game-screen > .wiki:hover,
game-screen > .texte:hover,
game-screen > .carte:hover,
game-screen > .score:hover,
game-screen > .para:hover {
    transform: translateY(-4px) scale(1.07);
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)) brightness(1.06);
}

game-screen > .wiki:hover p,
game-screen > .texte:hover p,
game-screen > .carte:hover p,
game-screen > .score:hover p,
game-screen > .para:hover p {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Menu d'accueil : « Charger » en bas à droite de l'écran, en bouton
   secondaire, « JOUER » restant seul au centre (la règle
   [data-screen="main"] button lui donnait l'image de « JOUER »). */
[data-component="main-menu"] button:not(.main_button) {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.55rem 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: rgba(24, 20, 48, 0.85);
    color: #fff;
    font-size: 1.05rem;
}

[data-component="main-menu"] button:not(.main_button):hover {
    background: rgba(59, 50, 112, 0.95);
    border-color: #f0c060;
    transform: none;
}

/**
 * ===========================
 * GamiShT : jeu des insultes (Monogatari-/dist/js/insult.js)
 * ===========================
**/
game-screen > .insultes__bulle {
    position: absolute;
    left: 42%;
    top: 6%;
    z-index: 12;
    max-width: min(34rem, 50vw);
    max-height: none;
}

game-screen > .insultes__bulle .insultes__source {
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.85em;
    font-style: italic;
}

game-screen > .insultes {
    position: absolute;
    left: 50%;
    bottom: 4.5rem;
    z-index: 13;
    transform: translateX(-50%);
    box-sizing: border-box;
    width: min(56rem, 94vw);
    padding: 1rem 1.4rem 1.2rem;
    border-radius: 16px;
    background: rgba(24, 20, 48, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color: #fff;
    text-align: center;
}

.insultes__consigne,
.insultes__verdict {
    margin: 0 0 0.8rem;
    font-size: 1.1rem;
}

.insultes__note {
    margin: -0.4rem 0 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

.insultes__choix {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

@media (max-width: 40rem) {
    .insultes__choix {
        grid-template-columns: 1fr;
    }
}

game-screen > .insultes button {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

game-screen > .insultes button:hover,
game-screen > .insultes button:focus-visible {
    background: rgba(59, 50, 112, 0.96);
    border-color: #f0c060;
    box-shadow: 0 0 0 3px rgba(240, 192, 96, 0.55);
    outline: none;
}

game-screen > .insultes .insultes__suivant {
    text-align: center;
    background: #f0c060;
    color: #241e3f;
    font-weight: bold;
}

game-screen > .insultes .insultes__suivant:hover {
    background: #f6d07e;
    color: #241e3f;
}

.crane-os__score {
    margin: 0.2rem 0 0.6rem;
    color: #b8321a;
    font-size: 2.2rem;
    font-weight: bold;
}

game-screen > .insultes__riposte {
    position: absolute;
    left: 6%;
    top: 4%;
    z-index: 12;
    max-width: min(30rem, 42vw);
    max-height: none;
}

/* Choix « Par quelle pièce commencer ? » (passage redo) : trois cartes, et
   les trois boutons alignés horizontalement dessous, chacun sous sa carte. */
game-screen > .pieces {
    position: absolute;
    left: 50%;
    top: 7%;
    z-index: 12;
    transform: translateX(-50%);
    box-sizing: border-box;
    width: min(70rem, 94vw);
    color: #fff;
    text-align: center;
}

.pieces__titre {
    display: inline-block;
    margin: 0 0 1.2rem;
    padding: 0.6rem 2rem;
    border-radius: 14px;
    background: rgba(24, 20, 48, 0.82);
    font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.pieces__cartes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.pieces__cartes article {
    padding: 1.1rem 1.3rem;
    border-radius: 14px;
    background: rgba(24, 20, 48, 0.82);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    text-align: left;
}

.pieces__cartes h3 {
    margin: 0 0 0.5rem;
    color: #f0c060;
    font-size: 1.25rem;
}

.pieces__cartes p {
    margin: 0;
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    line-height: 1.5;
}

game-screen:has(> .pieces) [data-component="choice-container"] {
    top: auto;
    bottom: auto;
    height: auto;
    width: min(70rem, 94vw);
    transform: translateX(-50%);
}

game-screen:has(> .pieces) [data-component="choice-container"] [data-content="wrapper"] {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.2rem;
    width: 100%;
}

game-screen:has(> .pieces) [data-component="choice-container"] button {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
}

@media (max-width: 48rem) {
    .pieces__cartes {
        grid-template-columns: 1fr;
    }

    game-screen:has(> .pieces) [data-component="choice-container"] [data-content="wrapper"] {
        flex-direction: column;
    }
}

/* Bureau du joueur : les objets cliquables sont signalés (halo qui pulse,
   étiquette) et réagissent au survol ; les autres n'ont plus la main. */
game-screen > .bureau_post,
game-screen > .bureau_pop,
game-screen > .bureau_mug {
    cursor: default;
}

/* Halo fixe : un objet cliquable se signale sans clignoter. */
game-screen > .bureau-cliquable {
    cursor: pointer;
    transition: filter 0.15s ease;
    filter: drop-shadow(0 0 8px rgba(240, 192, 96, 0.75));
}

game-screen > .bureau-cliquable:focus-visible {
    outline: none;
    filter: drop-shadow(0 0 6px rgba(240, 192, 96, 1)) drop-shadow(0 0 18px rgba(240, 192, 96, 0.9)) brightness(1.08);
}

@keyframes gamisht-halo {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(240, 192, 96, 0)); }
    50% { filter: drop-shadow(0 0 14px rgba(240, 192, 96, 0.9)); }
}

/* Au survol, un halo plus vif mais aucune transformation : agrandir l'image
   déplaçait aussi ce qu'elle dessine autour de l'objet (câble, tasse…). */
game-screen > .bureau-cliquable:hover {
    animation: none;
    filter: drop-shadow(0 0 6px rgba(240, 192, 96, 1)) drop-shadow(0 0 18px rgba(240, 192, 96, 0.9)) brightness(1.08);
}

game-screen > .bureau-etiquette {
    position: absolute;
    z-index: 5;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    background: rgba(24, 20, 48, 0.88);
    color: #fff;
    font-size: 1.15rem;
    pointer-events: none;
}

game-screen > .bureau-etiquette--bureau_ordi {
    left: 56%;
    top: 50%;
}

game-screen > .bureau-etiquette--bureau_book {
    left: 4%;
    top: 3%;
}

game-screen > .bureau-sortie {
    position: absolute;
    right: 2.5%;
    top: 3%;
    z-index: 6;
    width: auto;
    height: auto;
    padding: 0.7rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(24, 20, 48, 0.9);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
}

game-screen > .bureau-sortie:hover {
    background: rgba(59, 50, 112, 0.96);
    border-color: #f0c060;
}

/* Onglet Texte de Crâne OS : l'éditeur occupe la zone de la fenêtre. */
.crane-os__contenu:has(> .crane-os__texte) {
    align-items: stretch;
}

.crane-os__texte {
    display: flex;
    width: 100%;
    height: 100%;
}

.crane-os__texte .centered {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-height: none;
    margin: 0;
    padding: 0.4rem 0.6rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.crane-os__texte .editeur__entete {
    display: none;
}

.crane-os__texte .ck.ck-editor {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.crane-os__texte .ck.ck-editor__main {
    flex: 1 1 auto;
    min-height: 0;
}

.crane-os__texte .ck-editor__editable {
    height: 100%;
    min-height: 0 !important;
    max-height: none !important;
}

.crane-os__texte .editeur__actions {
    margin-top: 0.6rem;
}

.crane-os__texte .btn_txt,
.crane-os__texte .close_txt {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.5rem 1.4rem;
    border: 0;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}

.crane-os__texte .btn_txt {
    background: #3b3270;
    color: #fff;
}

.crane-os__texte .close_txt {
    background: #e4e4ea;
    color: #222;
}

.crane-os__texte .centered,
.crane-os__texte .ck.ck-editor {
    width: 100%;
    max-width: none;
}

/* ---------- Crâne OS : le wiki ----------
   Sommaire à gauche, fiche à droite ; chaque colonne défile seule. */
.crane-os__contenu:has(> .crane-wiki) {
    align-items: stretch;
}

.crane-wiki {
    display: grid;
    grid-template-columns: minmax(10rem, 24%) 1fr;
    grid-template-rows: 100%;
    gap: 1.2rem;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    color: #2b2420;
    font-size: 1.05rem;
    text-align: left;
}

.crane-wiki__sommaire {
    overflow-y: auto;
    padding: 0.4rem 0.6rem 0.4rem 0;
    border-right: 2px solid rgba(43, 36, 32, 0.25);
}

.crane-wiki__sommaire h3 {
    margin: 0.9rem 0 0.25rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a3a1c;
}

.crane-wiki__entree {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.crane-wiki__entree:hover {
    background: rgba(198, 58, 20, 0.12);
}

.crane-wiki__entree--active {
    background: #c63a14;
    color: #fff;
}

.crane-wiki__entree--active:hover {
    background: #c63a14;
}

.crane-wiki__fiche {
    overflow-y: auto;
    padding: 0.4rem 1rem 0.4rem 0;
    line-height: 1.5;
}

.crane-wiki__fiche h2 {
    margin: 0 0 0.2rem;
    font-size: 1.8rem;
}

.crane-wiki__sous-titre {
    margin-top: 0;
    font-style: italic;
    color: #6b5a50;
}

.crane-wiki__image {
    float: right;
    max-width: 38%;
    max-height: 14rem;
    margin: 0 0 0.8rem 1rem;
    border-radius: 8px;
    object-fit: contain;
}

.crane-wiki__lien {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #b0320f;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.crane-wiki__lien:hover {
    color: #7a1f05;
    background: none;
}

.crane-wiki__voir {
    clear: both;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(43, 36, 32, 0.2);
}

/* ---------- Crâne OS : score et parcours (parcours.js) ---------- */
.crane-os__contenu:has(> .parcours) {
    align-items: stretch;
}

.parcours {
    display: grid;
    grid-template-columns: minmax(16rem, 2fr) 3fr;
    gap: 2rem;
    width: 100%;
    height: 100%;
    min-height: 0;
    color: #2b2420;
    text-align: left;
}

.parcours__colonne {
    overflow-y: auto;
    min-height: 0;
    padding: 0.4rem 0.6rem;
}

.parcours__colonne--liste {
    border-left: 2px solid rgba(43, 36, 32, 0.25);
    padding-left: 1.4rem;
}

.parcours h2 {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
}

.parcours h3 {
    margin: 1rem 0 0.3rem;
    font-size: 1.1rem;
}

.parcours__axes {
    display: grid;
    gap: 0.45rem;
    margin: 0.8rem 0;
}

.parcours__axe {
    display: grid;
    grid-template-columns: 6.5rem 1fr 2rem;
    align-items: center;
    gap: 0.6rem;
}

.parcours__jauge {
    height: 0.8rem;
    border-radius: 999px;
    background: rgba(43, 36, 32, 0.12);
    overflow: hidden;
}

.parcours__jauge-plein {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #c63a14;
}

.parcours__jauge-plein--traduction { background: #2d5b8f; }
.parcours__jauge-plein--genre { background: #8f2d6b; }
.parcours__jauge-plein--humour { background: #d08a12; }

.parcours__axe-valeur {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.parcours__aide {
    color: #6b5a50;
    font-size: 0.95rem;
}

.parcours__extraits,
.parcours__notes {
    margin: 0.3rem 0;
    padding-left: 0;
    list-style: none;
}

.parcours__notes {
    padding-left: 1.4rem;
    list-style: decimal;
}

.parcours__extraits li {
    display: flex;
    gap: 0.6rem;
    padding: 0.2rem 0;
    color: #8a7a70;
}

.parcours__extraits li.parcours__extrait--vu {
    color: #2b2420;
}

.parcours__coche {
    width: 1.2rem;
    color: #2d7a3f;
    font-weight: 700;
}

.parcours__notes li {
    margin: 0.25rem 0;
}

.parcours__numero {
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: #8a7a70;
}

.gamisht-modale .parcours__finir {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 10px;
    background: #c63a14;
    color: #fff;
    font-size: 1.05rem;
}

.gamisht-modale .parcours__finir:hover:not([disabled]) {
    background: #a52f0f;
}

.gamisht-modale .parcours__finir[disabled] {
    background: rgba(43, 36, 32, 0.15);
    color: #6b5a50;
    cursor: not-allowed;
}

/* ---------- Crâne OS : onglet Texte, premier jet + notes ---------- */
.crane-os__texte {
    gap: 1.2rem;
}

.crane-texte__brouillon {
    display: flex;
    flex-direction: column;
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    color: #2b2420;
    text-align: left;
}

.crane-os__texte .centered {
    flex: 1 1 50%;
    min-width: 0;
}

.crane-texte__entete {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.crane-texte__entete h2 {
    margin: 0;
    font-size: 1.4rem;
}

.crane-texte__badge {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(43, 36, 32, 0.1);
    font-size: 0.8rem;
}

.gamisht-modale .crane-texte__copier {
    margin-left: auto;
    padding: 0.3rem 0.8rem;
    border: 1px solid rgba(43, 36, 32, 0.3);
    border-radius: 8px;
    background: #fff;
    color: inherit;
}

.crane-texte__document {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0.5rem;
    padding: 0.8rem 1.1rem;
    border: 1px solid #c4c4c4;
    background: #fbfaf7;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.5;
    user-select: text;
}

.crane-texte__document h2 { margin: 0 0 0.2rem; font-size: 1.3rem; }
.crane-texte__document h3 { margin: 1rem 0 0.2rem; font-size: 1.05rem; }
.crane-texte__document p { margin: 0.3rem 0; }
.crane-texte__document ul { margin: 0.3rem 0; padding-left: 1.3rem; }

.crane-texte__aide {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: #6b5a50;
}

/* L'en-tête de l'éditeur sert de titre « Mes notes » dans l'onglet. */
.crane-os__texte .editeur__entete {
    display: flex;
}

.crane-os__texte .editeur__entete h2 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    color: #2b2420;
}

.crane-os__texte .editeur__fermer {
    display: none;
}

/* ---------- Lieux : déjà visités, présenter sa pièce ---------- */
.lieux__carte {
    position: relative;
}

.lieux__vu {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(45, 122, 63, 0.92);
    color: #fff;
    font-size: 0.85rem;
    font-style: normal;
}

.lieux__fin {
    max-width: 26rem;
    margin: 1.2rem auto 0;
}

/* ---------- Choix des pièces : quatre cartes avec le hasard ---------- */
.pieces__cartes:has(> .pieces__hasard) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pieces__cartes .pieces__hasard {
    border: 2px dashed rgba(240, 192, 96, 0.6);
}

/* ---------- Icône « Ma pièce » ---------- */
.gamisht-ma-piece {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 0.45rem 0.9rem;
    border: 2px solid rgba(240, 192, 96, 0.8);
    border-radius: 999px;
    background: rgba(24, 20, 48, 0.85);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.gamisht-ma-piece:hover {
    background: rgba(48, 40, 96, 0.95);
}

.gamisht-ma-piece[hidden] {
    display: none;
}

/* ---------- Sous-titres : notions du wiki, version française ---------- */
text-box .subtitle .mot.a-concept {
    cursor: pointer;
    color: #d9b8ff;
    text-decoration: underline solid #b07cf0;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
}

text-box .subtitle .mot.a-concept:hover {
    background: rgba(176, 124, 240, 0.2);
}

.gamisht-fiche--concept .gamisht-fiche__mot {
    color: #6b2fb3;
}

.gamisht-fiche__wiki {
    display: inline-block;
    width: auto;
    height: auto;
    min-width: 0;
    margin-top: 0.4rem;
    padding: 0.35rem 0.8rem;
    border: 0;
    border-radius: 8px;
    background: #6b2fb3;
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

text-box.gamisht-vf::before {
    content: 'VF — trad. François-Victor Hugo';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    padding: 0.1rem 0.6rem;
    border-radius: 6px;
    background: rgba(24, 20, 48, 0.85);
    color: #f0c060;
    font-size: 0.85rem;
}

[data-action="gamisht-vf"].gamisht-vf--actif {
    color: #f0c060;
}

/* ---------- Consentement (accueil, aide) ---------- */
.joueur__recherche,
.aide__recherche {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin: 0.8rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
}

.joueur__recherche input,
.aide__recherche input {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.1rem;
}

/* ---------- Livres du bureau ---------- */
.livres,
.livre-ouvert {
    position: relative;
    width: min(70rem, 94vw);
}

.livres {
    padding: 1.6rem 2rem;
    border-radius: 16px;
    background: #f6efe2;
    color: #2b2420;
    text-align: center;
}

.livres__titre {
    margin: 0 0 1.2rem;
}

.livres__etagere {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0 1rem 0.6rem;
    border-bottom: 14px solid #7a5534;
}

.gamisht-modale .livres__dos {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 7.5rem;
    height: 16rem;
    padding: 1rem 0.5rem;
    border: 0;
    border-radius: 4px 4px 0 0;
    background: var(--couleur);
    color: #f6e7c1;
    box-shadow: inset -6px 0 0 rgba(0, 0, 0, 0.18), 0 6px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.gamisht-modale .livres__dos:hover,
.gamisht-modale .livres__dos:focus-visible {
    transform: translateY(-10px);
}

.livres__dos span {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.livres__dos small {
    font-size: 0.8rem;
    opacity: 0.85;
}

.livres__constat {
    margin: 1rem 0 0.4rem;
    font-style: italic;
}

.gamisht-modale .livres__wiki,
.gamisht-modale .livre-ouvert__wiki,
.gamisht-modale .livre-ouvert__tourner {
    padding: 0.45rem 1rem;
    border: 1px solid rgba(43, 36, 32, 0.35);
    border-radius: 8px;
    background: #fff;
    color: #2b2420;
}

.gamisht-modale .livres__wiki:hover,
.gamisht-modale .livre-ouvert__wiki:hover,
.gamisht-modale .livre-ouvert__tourner:hover {
    background: #f0c060;
}

/* Le livre ouvert : LIVRE OUVERT.PNG (3024 × 1964), pages relevées à
   3-48 % et 50-96 % de la largeur, 5-91 % de la hauteur. */
.livre-ouvert__double {
    position: relative;
    aspect-ratio: 3024 / 1964;
    max-height: 78vh;
    margin: 0 auto;
    background: url('../assets/images/LIVRE OUVERT.PNG') center / contain no-repeat;
    color: #2b2420;
    font-family: Georgia, 'Times New Roman', serif;
}

.livre-ouvert__page {
    position: absolute;
    top: 6%;
    bottom: 10%;
    overflow-y: auto;
    padding: 0 3%;
    text-align: left;
}

.livre-ouvert__page--gauche {
    left: 4%;
    right: 53%;
    text-align: center;
}

.livre-ouvert__page--droite {
    left: 52%;
    right: 5%;
    line-height: 1.45;
}

.livre-ouvert__portrait {
    margin: 0.5rem auto 0.6rem;
}

.livre-ouvert__portrait img {
    max-width: 70%;
    max-height: 22rem;
    border: 6px solid #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.livre-ouvert__portrait figcaption {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    font-style: italic;
    color: #6b5a50;
}

.livre-ouvert__frontispice {
    margin: 3rem auto 1rem;
    font-size: 6rem;
    color: #7a5534;
}

.livre-ouvert__page h2 {
    margin: 0.3rem 0 0;
    font-size: 1.7rem;
}

.livre-ouvert__dates {
    margin: 0.2rem 0;
    font-style: italic;
}

.livre-ouvert__extrait {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    border-left: 4px solid #c63a14;
    background: rgba(198, 58, 20, 0.06);
}

.livre-ouvert__extrait p {
    margin: 0;
    font-style: italic;
}

.livre-ouvert__extrait cite {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    font-style: normal;
    color: #6b5a50;
}

.livre-ouvert__navigation {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.6rem;
}

/* ---------- Téléphone ---------- */
.telephone {
    position: relative;
    text-align: center;
}

.telephone__de {
    margin: 0.6rem 0 0.7rem;
    color: #fff;
    font-size: 1.1rem;
}

.telephone__appareil {
    width: min(32rem, 82vw);
    padding: 1.6rem 0.8rem;
    border-radius: 2.4rem;
    background: #15131f;
    box-shadow: 0 0 0 3px #3b3850, 0 18px 40px rgba(0, 0, 0, 0.5);
}

.telephone__ecran {
    overflow: hidden;
    border-radius: 1rem;
    background: #fff;
}

.telephone__ecran img,
.telephone__ecran video {
    display: block;
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    background: #000;
}

.telephone__ecran audio {
    width: 100%;
    margin: 2rem 0;
}

.telephone__legende {
    margin: 0;
    padding: 0.6rem 0.8rem;
    color: #2b2420;
    font-size: 0.95rem;
}

/* ---------- Fin de partie ---------- */
.fin {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(76rem, 94vw);
    max-height: 88vh;
    padding: 1.4rem 1.8rem;
    border-radius: 16px;
    background: #f6efe2;
    color: #2b2420;
    text-align: left;
}

.fin__titre {
    margin: 0;
    font-size: 1.8rem;
}

.fin__verdict {
    margin: 0.3rem 0 0.8rem;
    font-size: 1.1rem;
    font-style: italic;
}

.fin__colonnes {
    display: grid;
    grid-template-columns: minmax(16rem, 2fr) 3fr;
    gap: 1.6rem;
    min-height: 0;
    overflow: hidden;
}

.fin__score {
    overflow-y: auto;
}

.fin__score h3 {
    margin: 1rem 0 0.3rem;
}

.fin__liens,
.fin__biblio {
    margin: 0.3rem 0;
    padding-left: 1.2rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.fin__biblio {
    color: #6b5a50;
}

.fin__liens a {
    color: #a52f0f;
}

.fin__piece {
    margin-top: 0;
}

.fin__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.gamisht-modale .fin__bouton {
    padding: 0.55rem 1rem;
    border: 1px solid rgba(43, 36, 32, 0.35);
    border-radius: 8px;
    background: #fff;
    color: #2b2420;
    font-size: 1rem;
    text-decoration: none;
}

.gamisht-modale .fin__bouton--principal {
    border-color: #c63a14;
    background: #c63a14;
    color: #fff;
}

@media (max-width: 50rem) {
    .parcours,
    .fin__colonnes {
        grid-template-columns: 1fr;
    }
}

/* ---------- Crâne OS : la carte plein cadre ----------
   Sous la ligne noire des onglets (15,8 % de la hauteur de crâneOS.JPG),
   d'un bord à l'autre ; les coins arrondis du bas de la fenêtre sont
   conservés. L'image est agrandie en partant du coin haut gauche. */
.crane-os__contenu:has(> .crane-os__carte) {
    top: 16.1%;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
}

.crane-os__carte {
    position: absolute;
    inset: 0;
    height: auto;
    max-width: none;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: 0 0 10px 10px;
}

.crane-os__carte-calque {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 1672 / 941;
}

.crane-os__carte-calque img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.crane-os__carte .crane-os__consigne {
    left: 50%;
    right: auto;
    bottom: 0.8rem;
    transform: translateX(-50%);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
}

/* ---------- Bureau Crâne OS : icônes et libellés ----------
   Chaque icône est un div.x contenant un img.x de même classe : l'image
   héritait de la position absolue du bloc (test.css) et le libellé, placé
   au jugé, chevauchait le dessin. Image puis libellé, en colonne. */
game-screen > div:is(.wiki, .texte, .carte, .score, .para) {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
}

game-screen > div:is(.wiki, .texte, .carte, .score, .para) > img {
    position: static;
    display: block;
    width: 100%;
    height: 110px;
    object-fit: contain;
}

game-screen > div:is(.wiki, .texte, .carte, .score, .para) > br {
    display: none;
}

game-screen > div:is(.wiki, .texte, .carte, .score, .para) > p {
    position: static;
    margin: 0.7rem 0 0;
    color: #fff;
    font-size: 1.15rem;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

/* Sur le fond sombre du choix des lieux, le bouton de fin désactivé
   doit rester lisible. */
.gamisht-modale .lieux__fin .parcours__finir[disabled] {
    background: rgba(255, 255, 255, 0.12);
    color: #d6d0e8;
}

.fin__score h3 {
    font-size: 1.15rem;
}

/* ---------- Rendre sa production : export .docx, envoi au professeur ---------- */
.crane-texte__rendre {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.gamisht-modale .crane-texte__action {
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(43, 36, 32, 0.3);
    border-radius: 8px;
    background: #fff;
    color: #2b2420;
    font-size: 0.92rem;
}

.gamisht-modale .crane-texte__action--principal {
    border-color: #2d5b8f;
    background: #2d5b8f;
    color: #fff;
}

.envoi {
    position: relative;
    width: min(34rem, 92vw);
    padding: 1.5rem 1.8rem;
    border-radius: 16px;
    background: #f6efe2;
    color: #2b2420;
    text-align: left;
}

.envoi h2 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}

.envoi__aide {
    margin: 0 0 1rem;
    color: #6b5a50;
}

.envoi__champ {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.envoi__champ input,
.envoi__champ textarea {
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(43, 36, 32, 0.35);
    border-radius: 8px;
    background: #fff;
    color: #2b2420;
    font: inherit;
}

.envoi__etat {
    min-height: 1.4em;
    margin: 0.4rem 0;
    font-size: 0.95rem;
}

.envoi__etat--ok {
    color: #2d7a3f;
}

.envoi__actions {
    display: flex;
    gap: 0.6rem;
}

.gamisht-modale .envoi__envoyer,
.gamisht-modale .envoi__retour {
    padding: 0.55rem 1.2rem;
    border: 1px solid #2d5b8f;
    border-radius: 8px;
    background: #2d5b8f;
    color: #fff;
}

.gamisht-modale .envoi__retour {
    border-color: rgba(43, 36, 32, 0.35);
    background: #fff;
    color: #2b2420;
}

.gamisht-modale .envoi__envoyer[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* ---------- Langues (attribut lang, soutitres/script_text.js) ---------- */
/* Un mot dans une autre langue que sa réplique : en italique, selon l'usage. */
text-box .subtitle .mot.langue-etrangere {
    font-style: italic;
}

/* Textes balisés hors du dialogue (livre des traductions, leçon d'anglais). */
.gamisht-annote .mot.a-traduction {
    cursor: help;
    text-decoration: underline dotted rgba(0, 0, 0, 0.45);
    text-underline-offset: 0.2em;
}

.gamisht-annote .mot.a-traduction:hover {
    background: rgba(240, 192, 96, 0.35);
}

.joueur__langues,
.aide__langues {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    margin: 0.8rem 0;
    padding: 0.5rem 0.8rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.aide__langues {
    border-color: rgba(43, 36, 32, 0.2);
}

.joueur__langue {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.95rem;
    text-align: left;
}

.joueur__langue select,
.gamisht-modale .joueur__langue select {
    min-width: 9rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(43, 36, 32, 0.35);
    border-radius: 8px;
    background: #fff;
    color: #222;
    font: inherit;
}

[data-action="gamisht-vf"].gamisht-vf--indisponible {
    opacity: 0.45;
}

/* Le conteneur des choix couvre tout l'écran : il captait la souris au-dessus
   des textes posés par les scènes (livre des traductions, leçon d'anglais),
   dont les mots ne se traduisaient plus au survol. Seuls ses boutons
   reçoivent les clics. */
game-screen [data-component="choice-container"] {
    pointer-events: none;
}

game-screen [data-component="choice-container"] button {
    pointer-events: auto;
}

/* Même chose pour la couche des particules du moteur (vide dans GamiShT). */
[data-ui="particles"] {
    pointer-events: none;
}

/* ---------- Duel d'insultes : les bulles ----------
   L'adversaire (à droite, .duel : 63-83 % de la largeur, 4-44 % de la
   hauteur) parle dans une bulle placée sous lui, pointe vers le haut ;
   Diana (à gauche, tête vers 24 % de la largeur, image dès 20 % de la
   hauteur) dans une bulle au-dessus d'elle, pointe vers le bas. Aucune ne
   couvre un personnage, et chacune porte le nom de qui parle. */
game-screen > .duel-bulle {
    position: absolute;
    z-index: 12;
    box-sizing: border-box;
    width: max-content;
    max-width: min(30rem, 40vw);
    max-height: none;
    margin: 0;
    padding: 0.7rem 1.1rem 0.8rem;
    border-radius: 16px;
    background: #fff;
    color: #222;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.4;
    text-align: left;
}

game-screen > .duel-bulle p {
    margin: 0;
}

game-screen > .duel-bulle .duel-bulle__qui {
    display: block;
    margin-bottom: 0.2rem;
    color: #c63a14;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

game-screen > .duel-bulle--diana .duel-bulle__qui {
    color: #2d5b8f;
}

game-screen > .duel-bulle::after {
    content: '';
    position: absolute;
    border: 14px solid transparent;
}

game-screen > .duel-bulle--adversaire {
    left: 73%;
    top: 46%;
    right: auto;
    transform: translateX(-50%);
}

game-screen > .duel-bulle--adversaire::after {
    bottom: 100%;
    left: 50%;
    margin-left: -14px;
    border-bottom-color: #fff;
}

game-screen > .duel-bulle--diana {
    left: 26%;
    top: 1.5%;
    right: auto;
    transform: translateX(-50%);
}

game-screen > .duel-bulle--diana::after {
    top: 100%;
    left: 50%;
    margin-left: -14px;
    border-top-color: #fff;
}

/* Choix sélectionné au clavier (flèches, puis Entrée). */
.gamisht-choix--selection,
game-screen [data-component="choice-container"] button.gamisht-choix--selection,
game-screen > .insultes button.gamisht-choix--selection {
    outline: 3px solid #f0c060;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(240, 192, 96, 0.3);
}

/* ---------- Écran d'accueil : choix du jeu (config-jeux.js) ---------- */
.gamisht-jeux {
    position: absolute;
    left: 50%;
    top: calc(50% - 9.5rem);
    z-index: 5;
    transform: translateX(-50%);
    padding: 0.7rem 1rem 0.9rem;
    border-radius: 14px;
    background: rgba(24, 20, 48, 0.85);
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.gamisht-jeux__titre {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.gamisht-jeux__liste {
    display: flex;
    gap: 0.6rem;
}

[data-screen="main"] .gamisht-jeux__jeu,
.gamisht-jeux__jeu {
    width: auto;
    height: auto;
    min-width: 8rem;
    margin: 0;
    padding: 0.5rem 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: transparent;
    background-image: none;
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
}

[data-screen="main"] .gamisht-jeux__jeu--choisi,
.gamisht-jeux__jeu--choisi {
    border-color: #f0c060;
    background: #f0c060;
    color: #181430;
    font-weight: 600;
}

/* ---------- Introduction ---------- */
/* Le carton se pose dans le ciel de la vue sur Paris (scenes/intro_paris.png). */
game-screen > .intro-carton {
    position: absolute;
    left: 50%;
    top: 7%;
    z-index: 20;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2.4rem 1.2rem;
    border-radius: 16px;
    background: rgba(28, 24, 48, 0.72);
    color: #f6efe2;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    animation: intro-apparition 1.2s ease;
}

.intro-carton__lieu {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: 0.04em;
}

.intro-carton__sous {
    margin: 0.6rem 0 0;
    color: #f0c060;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-style: italic;
}

@keyframes intro-apparition {
    from { opacity: 0; }
    to { opacity: 1; }
}

game-screen > .intro-consigne {
    position: absolute;
    left: 50%;
    bottom: 12%;
    z-index: 12;
    transform: translateX(-50%);
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    background: rgba(24, 20, 48, 0.9);
    color: #fff;
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

game-screen > .intro-consigne p {
    margin: 0;
}

/* Les livres à ouvrir pendant l'étape guidée : un halo plus marqué. */
game-screen > .bureau-cliquable--guide {
    filter: drop-shadow(0 0 6px rgba(240, 192, 96, 1)) drop-shadow(0 0 16px rgba(240, 192, 96, 0.9));
}

@keyframes gamisht-halo-guide {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(240, 192, 96, 0.6)); }
    50% { filter: drop-shadow(0 0 22px rgba(240, 192, 96, 1)); }
}

.gamisht-passer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 900;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: rgba(24, 20, 48, 0.8);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.gamisht-passer:hover {
    background: rgba(48, 40, 96, 0.95);
}

.gamisht-passer[hidden] {
    display: none;
}

/* ---------- Clavier : focus toujours visible ---------- */
game-screen [tabindex]:focus-visible,
game-screen button:focus-visible,
.gamisht-modale :focus-visible,
.gamisht-ma-piece:focus-visible,
.gamisht-passer:focus-visible,
[data-screen] button:focus-visible,
.gamisht-jeux__jeu:focus-visible {
    outline: 3px solid #f0c060;
    outline-offset: 3px;
}

/* Les onglets de Crâne OS sont des zones transparentes sur le dessin. */
.gamisht-modale .crane-os__onglet:focus-visible {
    outline: 3px solid #c63a14;
    outline-offset: -4px;
}

/* Icône du bureau Crâne OS focalisée : comme au survol. */
game-screen > div[data-icone]:focus-visible {
    border-radius: 12px;
    background: rgba(240, 192, 96, 0.18);
}

.crane-wiki__precedent {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* VF / VO mis en évidence quand une réplique de Shakespeare traduisible est
   à l'écran (et pas encore traduite). */
[data-action="gamisht-vf"].gamisht-vf--suggere {
    color: #f0c060;
    animation: gamisht-vf-appel 1.6s ease-in-out infinite;
}

@keyframes gamisht-vf-appel {
    0%, 100% { text-shadow: none; }
    50% { text-shadow: 0 0 10px rgba(240, 192, 96, 0.9); }
}

text-box.gamisht-vf-dispo::before {
    content: 'Traduction française disponible : bouton « VF / VO », en bas à droite';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    padding: 0.1rem 0.6rem;
    border-radius: 6px;
    background: rgba(240, 192, 96, 0.92);
    color: #181430;
    font-size: 0.85rem;
}

.intro-consigne__suite,
.livres__suite {
    margin-top: 0.4rem !important;
    font-size: 0.9em;
    opacity: 0.85;
}

.livres__suite {
    color: #8a3a1c;
}

/* La fenêtre Aide s'est allongée (raccourcis clavier, langues) : elle défile
   au lieu de dépasser de l'écran. */
.gamisht-modale--aide .aide {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
}

.gamisht-modale--aide .gamisht-fermer {
    top: 0.7rem;
    right: 0.8rem;
}

/* ---------- Café : personnages posés sur la terrasse ----------
   Dessinés à 820 px et agrandis à 110 % (test.css), ils occupaient 90 % de la
   hauteur, tête à l'enseigne, pieds sous le bord de l'écran : ils semblaient
   flotter. À l'échelle des clients assis au premier plan de la photo, une
   personne debout fait environ 60 % de la hauteur : on les ramène à 63 %, les
   pieds sur le trottoir (3 % du bas), groupés devant la porte, avec une ombre
   portée qui les rattache au sol. */
[data-screen="game"] [data-character].L_cafe,
[data-screen="game"] [data-character].J_cafe,
[data-screen="game"] [data-character].H_cafe,
[data-screen="game"] [data-character].D_cafe {
    height: 63%;
    max-height: none;
    top: auto;
    bottom: 3%;
    transform: none;
    filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.35));
}

/* Groupe serré devant la porte : Léna dégagée de la chaise du premier plan. */
[data-screen="game"] [data-character].L_cafe { left: 39%; }
[data-screen="game"] [data-character].J_cafe { left: 45.5%; }
[data-screen="game"] [data-character].H_cafe { left: 52%; }
[data-screen="game"] [data-character].D_cafe { left: 59%; }

/* test.css agrandissait Jules au survol : la scène ne bouge plus. */
[data-screen="game"] [data-character].J_cafe:hover { transform: none; }

/* Bureau du joueur : fond et objets placés dans un même cadre, agrandi
   proportionnellement depuis le centre jusqu'à couvrir l'écran (cadrerBureau,
   gamisht-ui.js). Le fond n'est plus étiré à 100 % × 97 % de l'écran, ce qui
   le déformait et laissait un vide en bas. Positions en fraction du cadre
   (celles de test.css, ramenées de 97 % à 100 % de hauteur). */
/* Le cadre déborde de l'écran (c'est le principe de « cover ») : ce qui
   dépasse est coupé, sans barre de défilement. */
game-screen:has(> .bureau_fond) {
    overflow: hidden;
}

game-screen > .bureau_fond,
game-screen > .bureau_book,
game-screen > .bureau_post,
game-screen > .bureau_ordi,
game-screen > .bureau_pop,
game-screen > .bureau_mug {
    /* monogatari.css borne toute image de scène (max-height: 90 %,
       max-width: 100 %) : c'est ce qui laissait un vide sous le fond. */
    max-width: none;
    max-height: none;
}

game-screen > .bureau_fond {
    left: var(--bureau-x, 0px);
    top: var(--bureau-y, 0px);
    width: var(--bureau-l, 100%);
    height: var(--bureau-h, 100%);
}

/* Pile de livres décalée vers la gauche (-9 % au lieu de -1,5 %) : la
   figurine « Pop Shakespeare » avait les pieds dedans. */
game-screen > .bureau_book {
    left: calc(var(--bureau-x, 0px) + var(--bureau-l, 100%) * -0.09);
    top: var(--bureau-y, 0px);
    height: calc(var(--bureau-h, 100%) * 0.608);
}

game-screen > .bureau_post {
    left: calc(var(--bureau-x, 0px) + var(--bureau-l, 100%) * 0.515);
    top: calc(var(--bureau-y, 0px) + var(--bureau-h, 100%) * 0.072);
    height: calc(var(--bureau-h, 100%) * 0.206);
}

game-screen > .bureau_ordi {
    left: calc(var(--bureau-x, 0px) + var(--bureau-l, 100%) * 0.325);
    top: calc(var(--bureau-y, 0px) + var(--bureau-h, 100%) * 0.33);
    height: calc(var(--bureau-h, 100%) * 0.701);
}

game-screen > .bureau_pop {
    left: calc(var(--bureau-x, 0px) + var(--bureau-l, 100%) * 0.425);
    top: calc(var(--bureau-y, 0px) + var(--bureau-h, 100%) * 0.113);
    height: calc(var(--bureau-h, 100%) * 0.351);
}

game-screen > .bureau_mug {
    left: calc(var(--bureau-x, 0px) + var(--bureau-l, 100%) * 0.125);
    top: calc(var(--bureau-y, 0px) + var(--bureau-h, 100%) * 0.412);
    height: calc(var(--bureau-h, 100%) * 0.351);
}

/*
 * Agent 001 — charte graphique (projets/carte/doc/CHARTE_Couleurs_Police_CNDDH.md
 * et consigne du 16/10/2026) : orange #FF9400 pour ce qui se clique, rouge
 * #FB0019 pour l'accent et l'élément actif, vert pour la réussite, blanc pour
 * le texte, noir pour les fonds ; pas de jaune. Focus : contour blanc.
 */
@font-face {
    font-family: 'Frutiger Neue LT Regular';
    font-display: swap;
    src: url('../../../agent-001/ressources/fonts/Frutiger Neue LT.woff') format('woff');
}

@font-face {
    font-family: 'Frutiger Bold';
    font-display: swap;
    src: url('../../../agent-001/ressources/fonts/Frutiger_bold.woff') format('woff');
}

@font-face {
    font-family: 'AndrewAndyStencil';
    font-display: swap;
    src: url('../../../agent-001/ressources/fonts/AndrewAndyStencilBold.ttf') format('truetype');
}

/* Polices prévues par Agent 001 (agent-001/ressources/fonts) : Frutiger pour
   le texte et les boutons, AndrewAndyStencil pour les titres. */
body.agent001-actif,
.agent001-dock,
.agent001-acces-directs,
.agent001-mini-jeu,
.carte-module {
    --a001-orange: #ff9400;
    --a001-rouge: #fb0019;
    --a001-vert: #1f9d55;
    --a001-noir: rgb(0 0 0 / 70%);
    --a001-police: 'Frutiger Neue LT Regular', 'Frutiger Bold', Arial, sans-serif;
    --a001-police-forte: 'Frutiger Bold', 'Frutiger Neue LT Regular', Arial, sans-serif;
    --a001-police-titre: 'AndrewAndyStencil', 'Frutiger Bold', Arial, sans-serif;
}

/* Agent 001 : mini-jeux toujours quittables, sans masquer leur surface. */
.agent001-mini-jeu {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.5rem;
    height: 100dvh;
    inset: 0;
    position: fixed;
    /* Le haut reste aux icônes d'Agent 001 (options, choix, carte). */
    padding: 2.75rem 0.5rem 0.5rem;
    width: 100%;
}

.agent001-mini-jeu__cadre {
    border: 0;
    height: 100% !important;
    min-height: 0;
    position: static !important;
    width: 100% !important;
}

.agent001-mini-jeu__commandes {
    align-items: center;
    background: var(--a001-noir, rgb(0 0 0 / 70%));
    border-radius: 0.5rem;
    color: #fff;
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    z-index: 2;
}

.agent001-mini-jeu__etat {
    font: 400 1.1rem/1.35 var(--a001-police, sans-serif);
    margin: 0;
    max-width: 46rem;
}

.agent001-etape-suivante {
    background: var(--a001-orange, #ff9400);
    border: 0;
    border-radius: 0.45rem;
    color: #000;
    cursor: pointer;
    flex: 0 0 auto;
    font: 400 1rem/1.2 var(--a001-police-forte, sans-serif);
    height: auto;
    min-height: 2.75rem;
    padding: 0.65rem 1.1rem;
    white-space: nowrap;
    width: auto;
}

.agent001-etape-suivante:hover,
.agent001-etape-suivante:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.agent001-mini-jeu--gagne .agent001-etape-suivante,
.agent001-mini-jeu__commandes--gagne .agent001-etape-suivante {
    animation: agent001-appel-suite 800ms ease-in-out 2;
    background: var(--a001-vert, #1f9d55);
    box-shadow: 0 0 0 4px rgb(31 157 85 / 35%);
}

@keyframes agent001-appel-suite {
    50% { transform: scale(1.06); }
}

@media (max-width: 599px) {
    .agent001-mini-jeu__commandes {
        align-items: stretch;
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
    }
}

/*
 * Agent 001 : menu des chapitres (« Aller directement à… »), fenêtre ouverte
 * à la demande (touche M, bouton « Chapitres » de l'accueil). Desktop : au
 * milieu du bas de l'écran, près de la souris ; portrait : en bas, en grille.
 */
.agent001-acces-directs {
    background: rgb(0 0 0 / 88%);
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 0.75rem;
    bottom: calc(var(--agent001-bas, 0px) + 0.75rem);
    box-sizing: border-box;
    color: #fff;
    font-family: var(--a001-police, sans-serif);
    left: 50%;
    max-height: calc(100dvh - var(--agent001-bas, 0px) - 4rem);
    max-width: min(94vw, 52rem);
    overflow: auto;
    padding: 0.75rem 0.9rem 0.6rem;
    position: fixed;
    transform: translateX(-50%);
    width: max-content;
    z-index: 30;
}

.agent001-acces-directs__entete {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 0 0.55rem;
}

.agent001-acces-directs h2 {
    font: 400 1.15rem/1.2 var(--a001-police-titre, sans-serif);
    letter-spacing: 0.03em;
    margin: 0;
}

.agent001-acces-directs__fermer {
    background: transparent;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font: 700 0.9rem/1 var(--a001-police, sans-serif);
    height: 2rem;
    width: 2rem;
}

.agent001-acces-directs__liste {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    min-width: min(88vw, 40rem);
}

.agent001-acces-directs__liste button {
    background: transparent;
    border: 1px solid var(--a001-orange, #ff9400);
    border-radius: 0.4rem;
    color: #fff;
    cursor: pointer;
    font: 600 0.9rem/1.2 var(--a001-police, sans-serif);
    height: auto;
    min-height: 2.4rem;
    padding: 0.4rem 0.6rem;
    text-align: left;
    width: auto;
}

.agent001-acces-directs__liste button.agent001-acces-directs__mini-jeu {
    border-color: var(--a001-vert, #1f9d55);
}

.agent001-acces-directs__liste button:hover {
    background: var(--a001-orange, #ff9400);
    color: #000;
}

.agent001-acces-directs__liste button.agent001-acces-directs__mini-jeu:hover {
    background: var(--a001-vert, #1f9d55);
    color: #000;
}

.agent001-acces-directs button:focus-visible,
.agent001-chapitres-bouton:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.agent001-acces-directs__aide {
    color: rgb(255 255 255 / 65%);
    font: 400 0.8rem/1.3 var(--a001-police, sans-serif);
    margin: 0.5rem 0 0;
    text-align: center;
}

@media (orientation: portrait), (max-width: 599px) {
    .agent001-acces-directs {
        border-radius: 0.75rem 0.75rem 0 0;
        bottom: 0;
        max-height: 70dvh;
        width: min(100vw, 34rem);
    }

    .agent001-acces-directs__liste {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }
}

/* Bouton discret « Chapitres » de l'accueil, à côté de « Commencer le jeu ». */
.agent001-chapitres-bouton {
    background: transparent;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: 0.35rem;
    color: #fff;
    cursor: pointer;
    font: 600 0.9rem/1.2 var(--a001-police, sans-serif);
    height: auto;
    margin: 0.4rem 0.25rem;
    padding: 0.5rem 0.9rem;
    vertical-align: middle;
    width: auto;
}

.agent001-chapitres-bouton:hover {
    border-color: var(--a001-orange, #ff9400);
    color: var(--a001-orange, #ff9400);
}

/*
 * Agent 001 : mise en page décidée par Agent001.mettreEnPage() à chaque
 * passage et à chaque changement de taille. Le bas de l'écran empile, de bas
 * en haut, ce qui est posé sous les choix (dock en desktop, contrôles vidéo en
 * portrait : --agent001-sous-choix) puis les choix ; le média occupe le reste
 * (--agent001-bas), entier (contain) et centré, sur un fond assorti à ses
 * bords (--agent001-fond).
 */
body.agent001-actif {
    background: #000;
    overflow: hidden;
}

body.agent001-actif #storyData,
body.agent001-actif tw-story,
body.agent001-actif tw-passage.agent001-passage {
    box-sizing: border-box;
    height: 100dvh;
    inset: 0;
    margin: 0;
    max-height: 100dvh;
    max-width: 100vw;
    overflow: hidden;
    padding: 0;
    position: fixed;
    width: 100vw;
}

body.agent001-actif tw-passage.agent001-passage {
    background-color: #000;
    /* Desktop : hauteur réservée à une ligne de choix (agent001.js, en px). */
    --agent001-ligne-choix: 50px;
}

/* Photo à 360° : l'image de transition (version portrait) ne s'affiche pas
   avant elle. */
body.agent001-actif tw-passage.agent001-passage:has(> iframe[src*="photo360"]) > img.imagefond {
    display: none !important;
}

body.agent001-actif tw-passage.agent001-passage > video,
body.agent001-actif tw-passage.agent001-passage > img.imagefond,
body.agent001-actif tw-passage.agent001-passage > iframe {
    border: 0;
    box-sizing: border-box;
    display: block;
    height: calc(100dvh - var(--agent001-bas, 0px)) !important;
    left: 0;
    margin: 0 !important;
    max-height: none;
    max-width: none;
    object-fit: contain !important;
    position: fixed !important;
    top: 0 !important;
    transform: none !important;
    width: 100vw !important;
}

body.agent001-actif tw-passage.agent001-passage > .choix {
    background: var(--a001-noir);
    bottom: var(--agent001-sous-choix, 0px);
    box-sizing: border-box;
    left: 0;
    padding: 0 0.5rem;
    position: fixed;
    text-align: center;
    width: 100vw;
    z-index: 21;
}

body.agent001-actif tw-passage.agent001-passage > .choix > a {
    background: var(--a001-orange);
    border: 2px solid transparent;
    border-radius: 0.35rem;
    box-sizing: border-box;
    color: #000;
    cursor: pointer;
    display: inline-block;
    font: 400 1rem/1.25 var(--a001-police-forte);
    left: auto !important;
    margin: 0.4rem 0.25rem;
    max-width: calc(100vw - 1rem);
    padding: 0.55rem 1rem;
    position: static !important;
    top: auto !important;
    transform: none !important;
    vertical-align: middle;
    width: auto;
}

/* Lien vierge laissé par la remise à zéro des choix (agent001.js). */
body.agent001-actif tw-passage.agent001-passage > .choix > a:empty {
    display: none;
}

/* Survol à la souris = sélection aux flèches : un seul effet, le contour
   blanc (le fond rouge au survol est abandonné). */
body.agent001-actif tw-passage.agent001-passage > .choix > a:hover,
body.agent001-actif tw-passage.agent001-passage > .choix > a:focus-visible,
body.agent001-actif tw-passage.agent001-passage > .choix > a.agent001-selection {
    outline: 3px solid #fff;
    outline-offset: 1px;
}

body.agent001-actif tw-passage.agent001-passage[data-mode="portrait"] > .choix > a {
    display: block;
    margin: 0.4rem auto;
    width: min(100%, 26rem);
}

/* Icônes de motor.js (options, choix, carte) : dans les coins du haut (portrait). */
body.agent001-actif .boutonOptions,
body.agent001-actif .boutonchoix,
body.agent001-actif .boutoncarte {
    bottom: auto !important;
    filter: drop-shadow(0 0 2px rgb(0 0 0 / 80%));
    position: fixed !important;
    top: 0.5rem !important;
    transform: none !important;
    z-index: 22;
}

body.agent001-actif .boutonOptions {
    left: 0.5rem !important;
}

body.agent001-actif .boutonchoix {
    left: 3rem !important;
}

body.agent001-actif .boutoncarte {
    left: auto !important;
    right: 0.5rem !important;
}

/* Contrôles de la vidéo : sobres, sans couleur vive. */
.agent001-controles-video {
    align-items: center;
    background: var(--a001-noir, rgb(0 0 0 / 70%));
    bottom: 0;
    box-sizing: border-box;
    display: flex;
    gap: 0.55rem;
    height: 3.25rem;
    justify-content: center;
    left: 0;
    padding: 0.5rem;
    position: fixed;
    width: 100vw;
    z-index: 21;
}

.agent001-controles-video .boutonplay,
.agent001-controles-video .boutonpause,
.agent001-controles-video .boutonreplay,
.agent001-controles-video .boutonscript {
    background: transparent !important;
    border: 1px solid rgb(255 255 255 / 45%) !important;
    border-radius: 0.35rem;
    bottom: auto !important;
    color: #fff;
    cursor: pointer;
    display: grid;
    font: 700 0.85rem/1 var(--a001-police, sans-serif);
    height: 2.1rem;
    inset: auto !important;
    min-width: 2.4rem;
    overflow: visible;
    place-items: center;
    position: static !important;
    transform: none !important;
    width: auto !important;
}

.agent001-controles-video .boutonplay:hover,
.agent001-controles-video .boutonpause:hover,
.agent001-controles-video .boutonreplay:hover,
.agent001-controles-video .boutonscript:hover {
    border-color: var(--a001-orange, #ff9400) !important;
    color: var(--a001-orange, #ff9400);
}

.agent001-controles-video button[hidden] {
    display: none !important;
}

.agent001-controles-video button:focus-visible,
.agent001-controles-video #custom-seekbar:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Barre de progression : sobre mais lisible sur fond noir (piste grise,
   avancée blanche) ; le remplissage reste dans sa barre. */
.agent001-controles-video #custom-seekbar {
    background: rgb(255 255 255 / 38%);
    border-radius: 999px;
    bottom: auto;
    cursor: pointer;
    flex: 1 1 20rem;
    height: 6px;
    left: auto;
    max-width: 32rem;
    outline: 0;
    overflow: hidden;
    position: relative !important;
    transition: height 120ms ease;
    width: auto !important;
}

.agent001-controles-video #custom-seekbar:hover {
    height: 9px;
}

.agent001-controles-video #custom-seekbar span {
    background: #fff;
    display: block;
    height: 100% !important;
    left: 0;
    position: absolute !important;
    top: 0;
    width: 0;
}

@media (max-width: 599px) {
    .agent001-controles-video {
        gap: 0.3rem;
    }

    .agent001-controles-video #custom-seekbar {
        flex-basis: 7rem;
    }
}

/*
 * Desktop : le dock au milieu du bas de l'écran regroupe tout ce qui se clique
 * (icônes, contrôles de la vidéo, commandes d'un mini-jeu) ; les choix se
 * posent juste au-dessus, centrés. Le mobile (portrait) n'est pas concerné.
 */
.agent001-dock {
    align-items: center;
    background: var(--a001-noir, rgb(0 0 0 / 70%));
    border-radius: 999px;
    bottom: 0.75rem;
    box-sizing: border-box;
    display: flex;
    gap: 0.75rem;
    left: 50%;
    max-width: calc(100vw - 1.5rem);
    padding: 0.35rem 0.9rem;
    position: fixed;
    transform: translateX(-50%);
    z-index: 22;
}

.agent001-dock[hidden] {
    display: none;
}

.agent001-dock__outils,
.agent001-dock__action {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.agent001-dock__action:empty {
    display: none;
}

.agent001-dock__outils + .agent001-dock__action {
    border-left: 1px solid rgb(255 255 255 / 25%);
    padding-left: 0.75rem;
}

body.agent001-actif .agent001-dock .boutonOptions,
body.agent001-actif .agent001-dock .boutonchoix,
body.agent001-actif .agent001-dock .boutoncarte {
    filter: none;
    flex: 0 0 auto;
    inset: auto !important;
    margin: 0 !important;
    position: static !important;
    transform: none !important;
}

.agent001-dock .agent001-controles-video {
    background: transparent;
    height: auto;
    padding: 0;
    position: static;
    width: auto;
}

.agent001-dock .agent001-controles-video #custom-seekbar {
    flex: 0 0 auto;
    width: clamp(10rem, 22vw, 22rem) !important;
}

.agent001-dock .agent001-mini-jeu__commandes {
    background: transparent;
    padding: 0;
}

body.agent001-actif tw-passage.agent001-passage[data-commandes="dock"] > .choix {
    background: transparent;
    left: 50%;
    max-width: calc(100vw - 2rem);
    padding: 0;
    transform: translateX(-50%);
    width: max-content;
}

body.agent001-actif tw-passage.agent001-passage[data-commandes="dock"] .agent001-mini-jeu {
    padding-bottom: calc(var(--agent001-sous-choix, 4rem) + 0.5rem);
}

/* Carte : un bouton « Fermer » au milieu du bas de l'écran, près de la souris. */
.agent001-carte-fermer {
    background: #ff9400;
    border: 0;
    border-radius: 999px;
    bottom: 1rem;
    box-shadow: 0 2px 8px rgb(0 0 0 / 35%);
    color: #000;
    cursor: pointer;
    font: 400 0.95rem/1.2 var(--a001-police-forte, Arial, sans-serif);
    left: 50%;
    padding: 0.6rem 1.4rem;
    position: fixed;
    transform: translateX(-50%);
    white-space: nowrap;
    width: auto;
    z-index: 2;
}

.agent001-carte-fermer:hover {
    background: #fb0019;
}

.agent001-carte-fermer:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* Desktop : les icônes sont dans le dock, le haut de l'écran est libre. */
body.agent001-actif tw-passage.agent001-passage[data-commandes="dock"] .agent001-mini-jeu {
    padding-top: 0.5rem;
}

/* Desktop : textes un peu plus petits. */
body.agent001-actif tw-passage.agent001-passage[data-commandes="dock"] > .choix > a,
body.agent001-actif tw-passage.agent001-passage[data-commandes="dock"] .agent001-chapitres-bouton {
    font-size: calc(var(--agent001-taille-choix, 16px) * 1.1);
    margin: 0.35rem 0.25rem;
    padding: 0.45rem 0.85rem;
}

.agent001-dock .agent001-mini-jeu__etat {
    font-size: 1.05rem;
}

.agent001-dock .agent001-etape-suivante {
    font-size: 0.9rem;
    min-height: 2.3rem;
    padding: 0.45rem 0.9rem;
}

/* Outils ajoutés par agent001.js : retour arrière, retour avant (pictogrammes
   d'origine), menu des chapitres. */
body.agent001-actif .agent001-outil {
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 0;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 0 2px rgb(0 0 0 / 80%));
    font: 400 1.35rem/1 var(--a001-police-forte, sans-serif);
    height: 32px;
    padding: 0;
    width: 32px;
    z-index: 22;
}

body.agent001-actif .agent001-outil--reculer {
    background-image: url('../../../agent-001/ressources/medias/picto/arrowleft.png');
    font-size: 0;
}

body.agent001-actif .agent001-outil--avancer {
    background-image: url('../../../agent-001/ressources/medias/picto/arrowright.png');
    font-size: 0;
}

body.agent001-actif .agent001-outil--reculer:hover:not(:disabled) {
    background-image: url('../../../agent-001/ressources/medias/picto/arrowleftorg.png');
}

body.agent001-actif .agent001-outil--avancer:hover:not(:disabled) {
    background-image: url('../../../agent-001/ressources/medias/picto/arrowrightorg.png');
}

body.agent001-actif .agent001-outil--chapitres:hover {
    color: var(--a001-orange, #ff9400);
}

body.agent001-actif .agent001-outil:disabled {
    cursor: default;
    opacity: 0.3;
}

body.agent001-actif .agent001-outil:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Hors dock (mobile) : flèches en haut au centre, chapitres à gauche de la carte. */
body.agent001-actif tw-passage > .agent001-outil {
    bottom: auto !important;
    left: auto;
    position: fixed !important;
    top: 0.5rem !important;
}

body.agent001-actif tw-passage > #btnRetourArriere {
    left: calc(50% - 40px) !important;
}

body.agent001-actif tw-passage > #btnRetourAvant {
    left: calc(50% + 8px) !important;
}

body.agent001-actif tw-passage > #agent001-chapitres {
    right: 3rem;
}

body.agent001-actif .agent001-dock .agent001-outil {
    filter: none;
    flex: 0 0 auto;
    position: static !important;
}

/* Fenêtres d'Agent 001 (options, crédits) au-dessus des choix et du dock. */
body.agent001-actif .options,
body.agent001-actif .scripts {
    position: fixed !important;
    z-index: 40 !important;
}

/* Les crédits s'ouvrent depuis les options : par-dessus elles. */
body.agent001-actif .scripts {
    z-index: 45 !important;
}

body.agent001-actif .scripts > *,
body.agent001-actif .scripts > h1 {
    z-index: 46 !important;
}

body.agent001-actif .options > h1,
body.agent001-actif .scripts > h1,
body.agent001-actif .closeOptions,
body.agent001-actif .boutonAide,
body.agent001-actif .closescript {
    z-index: 41 !important;
}

/* Options et crédits d'Agent 001 : fond noir, titre centré en
   AndrewAndyStencil, texte en Frutiger, bouton « Crédits » orange. */
body.agent001-actif .options,
body.agent001-actif .scripts {
    background-color: rgb(0 0 0 / 92%) !important;
    font-family: var(--a001-police, Arial, sans-serif);
}

body.agent001-actif .options > h1,
body.agent001-actif .scripts > h1 {
    font-family: var(--a001-police-titre, sans-serif) !important;
    left: 0 !important;
    letter-spacing: 0.04em;
    margin: 1.5rem 0 0 !important;
    right: 0 !important;
    text-align: center !important;
    width: 100% !important;
}

body.agent001-actif .boutonAide {
    background: var(--a001-orange, #ff9400) !important;
    border: 0;
    color: #000 !important;
    font-family: var(--a001-police-forte, sans-serif) !important;
}

body.agent001-actif .boutonAide:hover {
    outline: 3px solid #fff !important;
    outline-offset: 3px;
}

/* Sous-titres remontés quand les choix débordent sur la vidéo (agent001.js). */
body.agent001-actif tw-passage.agent001-passage > video::-webkit-media-text-track-container {
    /* Un peu au-dessus du bas de la vidéo (3 % de l'écran), plus le
       débordement éventuel des choix. */
    transform: translateY(calc(-1 * (var(--agent001-decalage-st, 0px) + var(--agent001-marge-st, 28px))));
    transition: transform 200ms ease;
}

/* Élément sélectionné au clavier (flèches) : contour blanc bien visible. */
body.agent001-actif .boutonOptions:focus-visible,
body.agent001-actif .boutonchoix:focus-visible,
body.agent001-actif .boutoncarte:focus-visible,
body.agent001-actif .agent001-dock button:focus-visible,
body.agent001-actif .agent001-controles-video button:focus-visible,
.carte-module button:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 3px;
}

/* Options : contenu défilant, sans titre « Raccourcis clavier », tableau
   resserré, « Crédits » juste dessous. */
/* Seulement ouvertes (options.js leur donne 100 % de hauteur) : fermées,
   une marge leur redonnait 32 px de haut, au premier plan, qui captaient
   les clics sur les icônes du haut (dont la carte). */
body.agent001-actif .options[style*="height: 100%"] {
    overflow-y: auto;
    padding-bottom: 2rem;
}

body.agent001-actif .options:not([style*="height: 100%"]),
body.agent001-actif .scripts:not([style*="height: 100%"]) {
    overflow: hidden !important;
    padding: 0 !important;
    pointer-events: none;
}

body.agent001-actif .options .KeyboardShortcutText {
    display: none !important;
}

body.agent001-actif .options .KeyboardShortcutDiv {
    height: auto !important;
    max-width: 94vw;
}

/* Tableau des raccourcis centré dans la fenêtre. */
body.agent001-actif .options .KeyboardShortcutDiv table {
    margin: 0 auto;
}

body.agent001-actif .options table td {
    font-size: 0.95rem;
    padding: 0.2rem 0.7rem;
}

body.agent001-actif .options .boutonAide {
    bottom: auto !important;
    display: block !important;
    left: auto !important;
    margin: 1.2rem auto 0 !important;
    position: static !important;
    top: auto !important;
    transform: none !important;
}

/* Curseur de taille du texte : lisible sur fond noir. */
body.agent001-actif .options input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: rgb(255 255 255 / 55%);
    border-radius: 999px;
    height: 4px;
}

body.agent001-actif .options input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--a001-orange, #ff9400);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    height: 18px;
    width: 18px;
}

/* Préférence d'affichage : automatique, portrait ou paysage. */
body.agent001-actif .agent001-orientation {
    align-items: center;
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin: 1rem auto 0.4rem;
}

body.agent001-actif .agent001-orientation__libelle {
    color: #fff;
    font-family: var(--a001-police, sans-serif);
    margin-right: 0.4rem;
}

body.agent001-actif .agent001-orientation button {
    background: transparent;
    border: 1px solid var(--a001-orange, #ff9400);
    border-radius: 0.35rem;
    color: #fff;
    cursor: pointer;
    font: 400 0.9rem/1.2 var(--a001-police-forte, sans-serif);
    padding: 0.35rem 0.7rem;
}

body.agent001-actif .agent001-orientation button[aria-checked="true"] {
    background: var(--a001-orange, #ff9400);
    color: #000;
}

body.agent001-actif .agent001-orientation button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Fin de partie : texte final par-dessus la dernière image de la vidéo. */
.agent001-fin {
    animation: agent001-apparition 900ms ease both;
    color: #fff;
    font-family: var(--a001-police-forte, Arial, sans-serif);
    font-size: clamp(1.8rem, 4.5vw, 3.6rem);
    left: 50%;
    line-height: 1.25;
    pointer-events: none;
    position: fixed;
    text-align: center;
    text-shadow: 0 2px 10px rgb(0 0 0 / 55%);
    top: 18%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 20;
}

.agent001-fin p {
    margin: 0;
}

@keyframes agent001-apparition {
    from { opacity: 0; }
}

/* Crédits : fond noir, noms répartis sur la hauteur libre (agent001.js),
   défilement lent s'ils n'y tiennent pas. */
body.agent001-actif .scripts {
    background-color: #000 !important;
}

body.agent001-actif .scripts > p {
    font-family: var(--a001-police, sans-serif);
    font-size: clamp(1rem, 2.3vh, 1.45rem) !important;
    height: var(--agent001-credits-hauteur, 60vh) !important;
    left: 0;
    overflow: hidden;
    top: var(--agent001-credits-haut, 12%) !important;
    width: 100%;
}

.agent001-credits-defile {
    display: block;
}

.agent001-credits--defile .agent001-credits-defile {
    animation: agent001-credits var(--agent001-credits-duree, 24s) linear infinite;
}

@keyframes agent001-credits {
    from { transform: translateY(var(--agent001-credits-hauteur, 60vh)); }
    to { transform: translateY(-100%); }
}

/* Interrupteur des sous-titres : orange (charte), plus de bleu. */
body.agent001-actif .options input:checked + .slider {
    background-color: var(--a001-orange, #ff9400) !important;
}

body.agent001-actif .options input:focus + .slider {
    box-shadow: 0 0 0 2px #fff !important;
}

/* Texte des boutons : réglage « Taille du texte des boutons » des options
   (16 px par défaut, 10 à 25 px), un peu agrandi. */
body.agent001-actif tw-passage.agent001-passage > .choix > a,
body.agent001-actif .agent001-chapitres-bouton,
body.agent001-actif .agent001-etape-suivante {
    font-size: calc(var(--agent001-taille-choix, 16px) * 1.1);
}

/* Sous-titres : taille selon la hauteur de l'écran, réglable de 60 à 160 %. */
body.agent001-actif tw-passage.agent001-passage > video::cue {
    font-size: var(--agent001-taille-st, 26px);
}

/* Options ouvertes : rangées centrées, espacement régulier, boutons étroits. */
body.agent001-actif .options[style*="height: 100%"] .subDiv,
body.agent001-actif .options[style*="height: 100%"] .fontDiv,
body.agent001-actif .options[style*="height: 100%"] .agent001-sous-titres,
body.agent001-actif .options[style*="height: 100%"] .agent001-orientation {
    align-items: center;
    display: flex !important;
    gap: 1rem;
    height: auto !important;
    justify-content: center;
    margin: 1.1rem auto 0 !important;
    width: auto !important;
}

body.agent001-actif .options .subDiv > .optionsText,
body.agent001-actif .options .fontDiv > *,
body.agent001-actif .options .agent001-sous-titres > * {
    left: auto !important;
    margin: 0 !important;
    opacity: 1 !important;
    position: static !important;
}

/* L'interrupteur garde son repère : son curseur est positionné dedans. */
body.agent001-actif .options .subDiv > .switch {
    flex: 0 0 auto;
    left: auto !important;
    margin: 0 !important;
    position: relative !important;
}

/* Première rangée sous le titre (positionné en absolu). */
body.agent001-actif .options[style*="height: 100%"] .subDiv {
    margin-top: 6.5rem !important;
}

body.agent001-actif .options .agent001-sous-titres__libelle {
    color: #fff;
    font-family: var(--a001-police, sans-serif);
}

body.agent001-actif .options input[type="range"] {
    width: 9rem !important;
}

body.agent001-actif .options .agent001-orientation__libelle {
    margin-right: 0;
}

body.agent001-actif .agent001-orientation button {
    height: auto !important;
    min-width: 0 !important;
    width: auto !important;
}

body.agent001-actif .options .KeyboardShortcutDiv {
    margin-top: 1.4rem !important;
}

body.agent001-actif .options .fontDiv > .optionsText,
body.agent001-actif .options .subDiv > .optionsText,
body.agent001-actif .options .agent001-sous-titres__libelle,
body.agent001-actif .options .agent001-orientation__libelle {
    font-size: 1.05rem !important;
    white-space: nowrap;
    width: auto !important;
}

body.agent001-actif .agent001-orientation button {
    font-size: 0.95rem !important;
    padding: 0.35rem 0.75rem !important;
}

/* Mobile (commandes à leur place d'origine) : sur une vidéo, les choix se
   posent au milieu de l'image et non sous elle ; la vidéo occupe toute la
   hauteur au-dessus de ses contrôles (agent001.js : --agent001-bas). */
body.agent001-actif tw-passage.agent001-passage[data-commandes="origine"]:has(> video) > .choix {
    background: transparent;
    bottom: auto;
    top: calc((100dvh - var(--agent001-bas, 0px)) / 2);
    transform: translateY(-50%);
}

/* La vidéo est cadrée sur son image (agent001.js, ajusterCadreVideo) : les
   sous-titres restent dans l'image au lieu de tomber dans les bandes noires. */
body.agent001-actif tw-passage.agent001-passage > video {
    height: var(--agent001-video-h, calc(100dvh - var(--agent001-bas, 0px))) !important;
    left: var(--agent001-video-x, 0px);
    top: var(--agent001-video-y, 0px) !important;
    width: var(--agent001-video-l, 100vw) !important;
}

/* Accueil en desktop (agent001.js, habillerAccueil) : la photo couvre tout
   l'écran, ajustée en hauteur et recadrée à gauche et à droite ; le titre est
   écrit en haut, en grandes lettres. */
body.agent001-actif tw-passage.agent001-passage.agent001-accueil[data-mode="desktop"] > img.imagefond {
    height: 100dvh !important;
    object-fit: cover !important;
    object-position: center;
}

body.agent001-actif tw-passage.agent001-passage.agent001-accueil > .agent001-accueil-titre {
    color: #fff;
    font: 700 clamp(2.5rem, 6.5vw, 7rem)/1.05 var(--a001-police-titre);
    left: 0;
    letter-spacing: 0.02em;
    margin: 0;
    padding: 0 1rem;
    pointer-events: none;
    position: fixed;
    text-align: center;
    background: none;
    text-shadow: 0 2px 12px rgb(0 0 0 / 55%);
    top: clamp(1.5rem, 5vh, 4rem);
    width: 100vw;
    box-sizing: border-box;
    z-index: 20;
}

/* Infobulle des boutons d'action (agent001.js) : après 1 s de survol. */
.agent001-infobulle {
    background: #000;
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 0.3rem;
    color: #fff;
    font: 400 0.95rem/1.3 var(--a001-police, sans-serif);
    max-width: min(22rem, calc(100vw - 16px));
    padding: 0.35rem 0.6rem;
    pointer-events: none;
    position: fixed;
    z-index: 1000;
}

.agent001-infobulle[hidden] {
    display: none;
}

/* Agent 001 : destination annoncée pendant la spirale du voyage dans le
   temps (agent001.js, suivreVoyage) ; la taille et l'échelle sont posées par
   le script, calées sur l'image de la vidéo. */
.agent001-voyage {
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    font: 700 100px/1.08 var(--a001-police, sans-serif);
    left: 50%;
    pointer-events: none;
    position: fixed;
    text-align: center;
    text-shadow: 0 0 0.08em rgb(0 0 0 / 70%), 0 0 0.25em rgb(0 0 0 / 45%);
    top: 50%;
    transform: translate(-50%, -50%) scale(0.08);
    transform-origin: center;
    white-space: nowrap;
    will-change: transform;
    z-index: 19;
}

/* Agent 001 : époque du passage (étiquette Twine « epoque-… », data-epoque
   posé par agent001.js). Seules les photos de déplacement et les photos à
   360° sont teintées ; les vidéos et les mini-jeux gardent leurs couleurs. */
body.agent001-actif tw-passage.agent001-passage[data-epoque^="195"] > img.imagefond,
body.agent001-actif tw-passage.agent001-passage[data-epoque^="195"] > iframe[src*="photo360"] {
    filter: grayscale(1) contrast(1.08);
}

body.agent001-actif tw-passage.agent001-passage[data-epoque^="197"] > img.imagefond,
body.agent001-actif tw-passage.agent001-passage[data-epoque^="197"] > iframe[src*="photo360"] {
    /* Pellicule des années 70, réglée sur les vidéos AJP (17/10/2026) :
       bleus écrasés, verts olive, orangé dans les tons moyens, blancs
       crème, noirs un peu levés. Un sépia fort et désaturé faisait années 30. */
    filter: sepia(0.7) saturate(2.6) hue-rotate(-12deg) contrast(0.9) brightness(1.15);
}

/* Agent 001 : appel entrant (étiquette Twine « appel-entrant ») : l'avis
   précède « Répondre à Edna Silème ». */
body.agent001-actif tw-passage.agent001-passage > .choix > .agent001-appel-entrant {
    animation: agent001-sonnerie 1.2s ease-in-out infinite;
    color: #fff;
    font: 700 1.45rem/1.3 var(--a001-police-forte, sans-serif);
    letter-spacing: 0.02em;
    margin: 0.5rem 0 0.1rem;
}

body.agent001-actif tw-passage.agent001-passage > .choix > .agent001-appel-entrant::before {
    content: "☎ ";
}

@keyframes agent001-sonnerie {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    body.agent001-actif tw-passage.agent001-passage > .choix > .agent001-appel-entrant {
        animation: none;
    }
}

/* Agent 001 : compte à rebours d'un mini-jeu (Agent001.miniJeu, duree). */
.agent001-mini-jeu__minuteur {
    font: 700 1.35rem/1 var(--a001-police-forte, sans-serif);
    font-variant-numeric: tabular-nums;
    margin: 0;
    min-width: 4.5ch;
    text-align: center;
}

.agent001-mini-jeu__minuteur--urgent {
    color: var(--a001-orange, #ff9400);
}

/* Agent 001 : image de fin d'appel (data-image-fin, agent001.js
   placerImageFin) posée sur l'image noire de la fin de transmission, à la
   place exacte de la vidéo, sous les choix. */
body.agent001-actif tw-passage.agent001-passage > .agent001-image-fin {
    object-fit: cover;
    pointer-events: none;
    position: fixed;
    z-index: 2;
}

/* Agent 001 : réplique d'un personnage sans vidéo (Agent001.replique). */
body.agent001-actif tw-passage.agent001-passage > .choix > .agent001-replique {
    color: #fff;
    font: 400 1.15rem/1.4 var(--a001-police, sans-serif);
    margin: 0.6rem auto 0.2rem;
    max-width: 46rem;
}

/* Agent 001 : bouton « Aide » du taquin (coups de pouce), avant « Étape
   suivante » : orange comme tout ce qui se clique, mais en contour, pour
   rester secondaire. */
.agent001-mini-jeu__aide {
    background: transparent;
    border: 2px solid var(--a001-orange, #ff9400);
    border-radius: 0.45rem;
    color: #fff;
    cursor: pointer;
    flex: 0 0 auto;
    font: 400 1rem/1.2 var(--a001-police-forte, sans-serif);
    height: auto;
    min-height: 2.75rem;
    padding: 0.55rem 1rem;
    white-space: nowrap;
    width: auto;
}

.agent001-mini-jeu__aide:hover,
.agent001-mini-jeu__aide:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.agent001-mini-jeu__aide:disabled {
    cursor: default;
    opacity: 0.45;
}

.agent001-dock .agent001-mini-jeu__aide {
    font-size: 0.9rem;
    min-height: 2.3rem;
    padding: 0.4rem 0.85rem;
}

/* Agent 001 : le moteur impose « button:hover, button:focus { background-color:
   var(--main-color) } », plus précis que .agent001-etape-suivante : au survol,
   « Étape suivante » devenait tout noir (fond sombre, texte noir). Les fonds
   sont donc redonnés au survol et au focus. */
.agent001-etape-suivante:hover,
.agent001-etape-suivante:focus {
    background: var(--a001-orange, #ff9400);
}

.agent001-mini-jeu--gagne .agent001-etape-suivante:hover,
.agent001-mini-jeu--gagne .agent001-etape-suivante:focus,
.agent001-mini-jeu__commandes--gagne .agent001-etape-suivante:hover,
.agent001-mini-jeu__commandes--gagne .agent001-etape-suivante:focus {
    background: var(--a001-vert, #1f9d55);
}

.agent001-mini-jeu__aide:hover,
.agent001-mini-jeu__aide:focus {
    background: transparent;
}

/* Agent 001 : phrase du récit (Agent001.replique sans personnage). */
body.agent001-actif tw-passage.agent001-passage > .choix > .agent001-replique--recit {
    font-style: italic;
    text-shadow: 0 1px 3px #000, 0 0 8px #000;
}

/* Agent 001 : dialogue Monogatari entre deux vidéos (passage sans étiquette
   agent001, bloc posant body.agent001-dialogue) : le menu rapide de GamiShT
   (Sauvegarder, Charger, VF / VO, Quitter) n'y a pas sa place. */
body.agent001-dialogue [data-component="quick-menu"] {
    display: none;
}

/* ---------- Catalogue des jeux (config-jeux.js, plusieurs jeux actifs) ----------
   Couvre l'écran d'accueil de Monogatari (fond et JOUER de GamiShT) : une
   carte par jeu, « Jouer » mène à l'adresse où le jeu se lance seul. */
.gamisht-catalogue {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    overflow: auto;
    background: #151922 radial-gradient(ellipse at top, #2b3350, #151922 70%);
    color: #fff;
}

.gamisht-catalogue__titre {
    position: static;
    width: auto;
    transform: none;
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
}

.gamisht-catalogue__liste {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 60rem;
}

.gamisht-catalogue__jeu {
    display: flex;
    flex-direction: column;
    flex: 1 1 16rem;
    max-width: 22rem;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.07);
    color: inherit;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.gamisht-catalogue__jeu:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.gamisht-catalogue__image {
    display: block;
    aspect-ratio: 16 / 9;
    background: #2b3350 var(--gamisht-affiche, url('../assets/images/dessin_jaune_affiche.PNG')) center / cover no-repeat;
}

.gamisht-catalogue__nom {
    position: static;
    width: auto;
    transform: none;
    margin: 0;
    padding: 0.9rem 1rem 0.2rem;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: left;
}

.gamisht-catalogue__description {
    flex: 1 1 auto;
    margin: 0;
    padding: 0 1rem 0.8rem;
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.85;
    text-align: left;
}

.gamisht-catalogue__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 1rem 1rem;
}

.gamisht-catalogue__jouer,
.gamisht-catalogue__fiche {
    flex: 1 1 auto;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.gamisht-catalogue__jouer {
    background: #ff9400;
    color: #000;
}

.gamisht-catalogue__fiche {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
}

.gamisht-catalogue__jouer:hover,
.gamisht-catalogue__jouer:focus-visible,
.gamisht-catalogue__fiche:hover,
.gamisht-catalogue__fiche:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}
