/* ===== Jeu Labyrinthe : palette du site ===== */
:root {
    --tq1: #85ECE4; --tq2: #55E0D6; --tq3: #30D5C9; --tq4: #0CC9BB; --tq5: #00A094;
    --bl1: #91B0EE; --bl2: #6590E4; --bl3: #4275DB; --bl4: #205BD0; --bl5: #0C42AC;
    --vt1: #95F68B; --vt2: #6AF05C; --vt3: #46EB35; --vt4: #22E50E; --vt5: #14D200;
    --rouge1: #F58A6B; --rouge2: #D9553A; --rouge3: #A83A25;
    --colorBackLogo: rgb(149, 246, 139);
    --colorTextP: rgb(12, 66, 172);
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Roboto", Arial, sans-serif; }
[hidden] { display: none !important; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background-color: var(--bl1); }

.jeuLB {
    width: 100%; max-width: 900px; margin: 0 auto; padding: 20px 20px 70px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.titreLB { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 900; letter-spacing: 2px; text-align: center; color: var(--bl5); text-shadow: 0 2px 0 var(--tq1); }
.sousTitreLB { font-size: 1.2rem; text-align: center; color: var(--bl5); margin-bottom: 10px; }

.carteLB {
    width: 100%; padding: 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
    background-image: linear-gradient(160deg, var(--tq1), var(--tq2)), linear-gradient(135deg, var(--bl4), var(--vt3));
    background-origin: border-box; background-clip: padding-box, border-box;
    border: 4px solid transparent; border-radius: 28px; box-shadow: 0 10px 30px rgba(12, 66, 172, 0.35);
}
.consigneLB { font-size: 1.15rem; color: var(--bl5); }
.alerteLB { color: var(--rouge3); font-weight: 700; }

/* Choix du labyrinthe */
.choixLB { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.vignetteLB {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; text-decoration: none;
    background: #fff; border: 3px solid var(--vt3); border-radius: 14px; color: var(--bl5);
    transition: transform .2s, box-shadow .2s;
}
.vignetteLB:hover, .vignetteLB:focus-visible { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(12, 66, 172, .35); }
.vignetteLB img { width: 100%; height: auto; aspect-ratio: 600 / 424; object-fit: contain; border-radius: 6px; }
.nomLB { font-weight: 700; font-size: 1.05rem; }
.tailleLB { font-size: .85rem; color: var(--bl4); }

/* Partie */
#ecranJeu { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.infosLB { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; color: var(--bl5); font-weight: 700; }
.scene { position: relative; width: 100%; background: #FBFEFF; border: 4px solid var(--vt3); border-radius: 14px; overflow: hidden; }
#plateau { display: block; touch-action: none; outline: none; }
.finLB { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(12, 66, 172, .45); padding: 12px; }
.finLB .carteLB { max-width: 460px; }
.bravoLB { font-size: 1.5rem; font-weight: 900; color: var(--bl5); }
.boutonsFin { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.aideLB { font-size: .9rem; text-align: center; color: var(--bl5); max-width: 640px; }

.boutonLB {
    display: inline-block; padding: 10px 20px; font-size: 1rem; font-weight: 700; text-decoration: none; cursor: pointer;
    color: #fff; background: var(--bl5); border: none; border-radius: 22px; transition: background .3s;
}
.boutonLB:hover, .boutonLB:focus-visible { background: var(--bl4); }
.boutonLB.secondaire { background: var(--tq5); padding: 6px 14px; font-size: .9rem; }
.boutonLB.secondaire:hover, .boutonLB.secondaire:focus-visible { background: var(--tq4); }
.finLB .boutonLB.secondaire { padding: 10px 20px; font-size: 1rem; }

.lienLB { color: var(--bl5); font-weight: 700; }
.liensLB { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }

/* Croix de direction : seulement sur écran tactile */
.croix { display: none; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 6px; }
.croix button { font-size: 1.6rem; color: #fff; background: var(--bl5); border: none; border-radius: 14px; cursor: pointer; }
.croix button:active { background: var(--bl3); }
/* Pas de sélection des flèches ni de menu « Copier » quand le doigt appuie longtemps ou glisse sur la croix */
.croix, .croix button {
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}
.croix [data-dir="0"] { grid-column: 2; grid-row: 1; }
.croix [data-dir="3"] { grid-column: 1; grid-row: 2; }
.croix [data-dir="2"] { grid-column: 2; grid-row: 2; }
.croix [data-dir="1"] { grid-column: 3; grid-row: 2; }
@media (hover: none), (pointer: coarse) { .croix { display: grid; } }
