/* -----------------------------------------
   STYLE GLOBAL
----------------------------------------- */
body {
    background: url("solitarius.jpg") no-repeat center center fixed;
    background-size: cover; 
    color: #f0e6d2;
    font-family: "Cinzel", serif;
    text-align: center;
    padding: 20px;
    margin: 0;
}

h1 {
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 0 12px #d1b38a;
}

/* -----------------------------------------
   SCORE EN HAUT (aligné et centré)
----------------------------------------- */

#top-info {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
}

.info-block {
    background: rgba(80, 60, 45, 0.45);
    padding: 10px 15px;
    border: 1px solid #8c6239;
    border-radius: 8px;
    font-size: 18px;
}

/* -----------------------------------------
   LAYOUT CENTRAL (gauche = menu / centre = plateau)
----------------------------------------- */

#layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
    margin-top: 10px;
}


.player-name {
  font-size: 12px;
  opacity: 0.65;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
}



.player-name:hover {
  opacity: 0.9;
  text-shadow: 0 0 6px rgba(255, 210, 127, 0.35);
}

/* -----------------------------------------
   PANNEAU GAUCHE (sélecteur de plateaux)
----------------------------------------- */

#left-panel {
    width: 100px;
    background: rgba(60, 50, 40, 0.45);
    border: 2px solid #8c6239;
    padding: 15px;
    border-radius: 10px;
}

#left-panel h2 {
    color: #f0e6d2;
    font-size: 22px;
    margin-bottom: 15px;
}

/* ── Pastilles de page ── */

#plateauSelector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.plateau-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(107, 74, 43, 0.7);
    border: 2px solid #8c6239;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: transform .2s, border-color .2s, background .2s;
    padding: 0;
}

.plateau-btn:hover {
    background: rgba(140, 98, 57, 0.9);
    border-color: #d4a853;
    transform: scale(1.08);
}

.pastille-num {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: #f0e6d2;
    line-height: 1;
}

.score-plateau {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    color: #ffd27f;
    line-height: 1;
}

.score-max {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    color: rgba(212,168,83,.8);
    line-height: 1;
}
.score-max:not(:empty)::before {
    content: "/ ";
}

.remaining-points {
    display: none; /* masqué dans la pastille */
}

.plateau-btn.active {
    background: rgba(164, 120, 77, 0.95) !important;
    border-color: #f0c97a !important;
    box-shadow: 0 0 12px rgba(212,168,83,.4);
}
.plateau-btn.active .pastille-num {
    color: #fff;
}


/* -----------------------------------------
   CONTENEUR DU PLATEAU
----------------------------------------- */

#board-container {
 position: relative;
 display: flex;
 justify-content: center;
 align-items: center;
 overflow: hidden;
}
/* PLATEAU 7×7 */
#board {
    width: 560px;
    height: 560px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 4px;

    background: rgba(44, 38, 35, 0.65); /* opacité 65% */
    border: 3px solid #8c6239;
    border-radius: 10px;
}

/* -----------------------------------------
   CASES DU PLATEAU
----------------------------------------- */

.cell {
    width: 100%;
    height: 100%;
    background: rgba(43, 43, 43, 0.55);
    border: 1px solid rgba(61, 61, 61, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell { position: relative; }      /* ✅ nécessaire pour placer le ghost */
.marble.ghost { pointer-events: none; }


/* Cases mur (infranchissables) */
.wall {
    background: radial-gradient(circle, #663c3c 20%, #2a1a1a 80%);
    border: 2px solid #5a4a4a;
    position: relative;
}

.wall::after {
    content: "";
    position: absolute;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    background: radial-gradient(circle, #ffffff88 0%, #00000000 60%);
    clip-path: polygon(
        50% 0%,
        80% 30%,
        60% 60%,
        70% 90%,
        40% 70%,
        20% 90%,
        30% 50%,
        10% 20%
    );
    filter: drop-shadow(0 0 3px #ffb2b2aa);
}


/* Cases spéciales (bonus fin de partie) */

.special {
    border: 2px solid #c7a456;
    box-shadow: 0 0 20px rgba(255, 220, 140, 0.7);
}

/* -----------------------------------------
   BILLES
----------------------------------------- */

.marble {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-weight: bold;
    color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

    /* Volume */
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255,255,255,0.9),
        rgba(255,255,255,0.3) 30%,
        rgba(0,0,0,0.15) 60%
    );

    box-shadow:
        inset -4px -6px 8px rgba(0,0,0,0.35),
        inset 3px 3px 6px rgba(255,255,255,0.4),
        0 6px 12px rgba(0,0,0,0.6);

    transition: transform 0.2s, box-shadow 0.2s;
}

.marble::before {
    content: "";
    position: absolute;
    top: 12%;
    left: 18%;
    width: 35%;
    height: 35%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255,255,255,0.8),
        rgba(255,255,255,0)
    );
    opacity: 0.6;
}

.marble:hover {
    transform: scale(1.12);
    box-shadow: 0 0 10px #fff;
}

/* Bille sélectionnée */

.marble[selected],
.marble:focus {
    outline: 3px solid yellow !important;
}


.marble.dissolve {
    animation: dissolve 0.6s ease-out forwards;
}

@keyframes dissolve {
    to {
        transform: scale(0.2);
        opacity: 0;
        filter: blur(4px);
    }
}

.marble.ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  pointer-events: none;
}

#alchemy-panel {
    width: 180px;
    background: rgba(60, 50, 40, 0.45);
    border: 2px solid #8c6239;
    padding: 15px;
    border-radius: 10px;
    color: #f0e6d2;
    flex-shrink: 0;  /* IMPORTANT */
}


#alchemy-panel h2 {
    font-size: 22px;
    margin-bottom: 15px;
}

/* Séquence alchimique — billes colorées */
#alchemy-sequence {
    display: flex;
    flex-direction: column;  /* colonne sur grand écran */
    gap: 10px;
    align-items: center;
    padding: 4px 0;
}

.alchemy-ball {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(212, 168, 83, 0.5);
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.4);
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: default;
}

/* Bille collectée : grisée */
.alchemy-ball--collected {
    background: #444 !important;
    border-color: rgba(255,255,255,0.1);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.5);
    opacity: 0.5;
    transform: scale(0.88);
}

/* Prochaine bille à collecter : légère pulsation dorée */
.alchemy-ball--next {
    border-color: rgba(212, 168, 83, 0.9);
    box-shadow:
        inset 0 -3px 6px rgba(0,0,0,0.35),
        0 0 8px 2px rgba(212, 168, 83, 0.5);
    animation: nextBallPulse 1.4s ease-in-out infinite;
}
@keyframes nextBallPulse {
    0%, 100% { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35), 0 0 6px 1px rgba(212,168,83,0.4); }
    50%       { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35), 0 0 14px 4px rgba(212,168,83,0.75); }
}


/* ═══════════════════════════════════════════
   ANIMATIONS ALCHIMIQUES
   ═══════════════════════════════════════════ */

/* ── 1. Explosion bille éliminée ── */
.marble.explode {
    animation: marbleExplode 0.35s ease-out forwards;
    pointer-events: none;
}
@keyframes marbleExplode {
    0%   { transform: scale(1);   opacity: 1; filter: brightness(1); }
    40%  { transform: scale(1.4); opacity: 1; filter: brightness(2); }
    100% { transform: scale(0);   opacity: 0; filter: blur(3px); }
}

/* Particules d'explosion */
.explode-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleFly var(--dur, 0.55s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes particleFly {
    0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
    70%  { opacity: 0.7; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* Anneau doré d'explosion */
.explode-ring {
    position: fixed;
    border-radius: 50%;
    border: 2px solid rgba(212, 168, 83, 0.9);
    pointer-events: none;
    z-index: 9998;
    animation: ringExpand 0.5s ease-out forwards;
}
@keyframes ringExpand {
    0%   { transform: translate(-50%, -50%) scale(0.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3);   opacity: 0; }
}


/* ── 2. Trajet de la bille ── */
.marble.jumping {
    position: fixed !important;
    z-index: 9999;
    pointer-events: none;
    transition: none;
    animation: marbleJump var(--jump-dur, 0.28s) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes marbleJump {
    0%   { transform: translate(var(--x0), var(--y0)) scale(1); }
    45%  { transform: translate(
               calc((var(--x0) + var(--x1)) / 2),
               calc((var(--y0) + var(--y1)) / 2 - 18px)
           ) scale(1.15); }
    100% { transform: translate(var(--x1), var(--y1)) scale(1); }
}


/* ── 3. Pulse billes jouables ── */
.marble.playable {
    animation: marblePulse 2.2s ease-in-out infinite;
}
@keyframes marblePulse {
    0%, 100% { box-shadow: 0 0 0px rgba(212, 168, 83, 0); }
    50%       { box-shadow: 0 0 8px 3px rgba(212, 168, 83, 0.55); }
}


/* ── 4. Déblocage alchimique ── */

/* Onde de transmutation depuis le centre du plateau */
.transmutation-wave {
    will-change: transform, opacity;
    position: absolute;
    top: 50%; left: 50%;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(212, 168, 83, 0.9);
    pointer-events: none;
    z-index: 100;
    animation: waveExpand 0.8s ease-out forwards;
}
@keyframes waveExpand {
    0%   { transform: translate(-50%, -50%) scale(0.5);  opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(12);   opacity: 0; }
}

/* Texte "Transmutation !" */
.transmutation-text {
    will-change: transform, opacity;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: #f0c97a;
    text-shadow:
        0 0 10px rgba(212, 168, 83, 0.9),
        0 0 30px rgba(212, 168, 83, 0.5);
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    animation: textRiseLocal 1.6s ease-out forwards;
}
@keyframes textRiseLocal {
    0%   { transform: translate(-50%, -40%) scale(0.7); opacity: 0; }
    20%  { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    70%  { transform: translate(-50%, -55%) scale(1);   opacity: 1; }
    100% { transform: translate(-50%, -65%) scale(0.9); opacity: 0; }
}

/* Flash doré global — dans board-container */
.transmutation-flash {
    will-change: opacity;
    position: absolute;
    inset: -20px;
    background: radial-gradient(
        ellipse at center,
        rgba(212, 168, 83, 0.22) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 9990;
    animation: globalFlash 0.9s ease-out forwards;
}
@keyframes globalFlash {
    0%   { opacity: 0; }
    25%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Billes de séquence illuminées lors du déblocage */
.alchemy-ball.alchemy-unlocking {
    animation: alchemyGlow 0.5s ease-out forwards;
}
@keyframes alchemyGlow {
    0%   { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35), 0 0 0px rgba(212,168,83,0); }
    50%  { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35), 0 0 16px 5px rgba(212,168,83,0.9); }
    100% { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35), 0 0 0px rgba(212,168,83,0); }
}


/* ── Héritage ancien système (compat) ── */
.magic-flash {
    position: absolute; top: 50%; left: 50%;
    width: 40%; height: 40%;
    pointer-events: none; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,240,180,0.6), rgba(255,240,180,0) );
    transform: translate(-50%,-50%) scale(0.1);
    animation: flashSoft 1s ease-out forwards; z-index: 20;
}
@keyframes flashSoft {
    0%   { transform: translate(-50%,-50%) scale(0.3); opacity: 1; }
    50%  { transform: translate(-50%,-50%) scale(0.8); opacity: 0.8; }
    100% { transform: translate(-50%,-50%) scale(1.2); opacity: 0; }
}
.magic-spark {
    position: absolute; width: 4px; height: 4px;
    background: rgba(255,240,180,0.8); border-radius: 50%;
    animation: sparkSoft 0.5s ease-out forwards; z-index: 15;
}
@keyframes sparkSoft {
    from { transform: translate(0,0) scale(1); opacity: 1; }
    to   { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* Lien classement dans top-info */
.classement-link {
    color: var(--or, #d4a853);
    color: #d4a853;
    text-decoration: none;
    border-bottom: 1px dashed rgba(212,168,83,.4);
    transition: border-color .2s, color .2s;
}
.classement-link:hover {
    color: #f0c97a;
    border-bottom-color: #d4a853;
}

/* Rang du joueur — cliquable avec tooltip natif */
.classement-rank-inline {
    cursor: pointer;
    border-bottom: 1px dotted rgba(212,168,83,.5);
    transition: color .2s;
}
.classement-rank-inline:hover {
    color: #d4a853;
}

.codex-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #ffd27f;
    font-size: 18px;
    text-decoration: none;
}

.codex-link:hover {
    text-decoration: underline;
}


#no-move-overlay {
 position: absolute;
 inset: 0;
 background: rgba(20, 15, 10, 0.75);
 display: none;
 justify-content: center;
 align-items: center;
 z-index: 100;  /* sous la visite guidée (z-index 8000+) */
 border-radius: 10px;
 pointer-events: all;
}
.no-move-text {
    color: #ffd27f;
    font-size: 24px;
    text-align: center;
    text-shadow: 0 0 12px #000;
}

.no-move-text span {
    display: block;
    font-size: 16px;
    opacity: 0.8;
    margin-top: 8px;
}

.clickable-ranking {
    cursor: pointer;
    color: #ffd27f;
    text-decoration: underline;
}

.clickable-ranking:hover {
    text-shadow: 0 0 6px #ffd27f;
}

@media (max-width: 1000px) and (min-width: 600px) {

    #layout {
        gap: 20px;  
        justify-content: center;
        align-items: flex-start;
    }

    /* Panels latéraux légèrement réduits */
    #left-panel,
    #alchemy-panel {
        width: 150px;
        flex-shrink: 0;
    }

    /* Plateau redimensionné proprement */
    #board {
        width: 420px;
        height: 420px;
        max-width: 80vw;
        max-height: 80vw;
    }

    /* cellules adaptatives */
    .cell {
        min-width: 0;
        min-height: 0;
    }

    /* Billes réduites mais centrées */
    .marble {
        width: 70%;
        height: 70%;
        font-size: 16px;
    }

    /* Bandeau du haut plus compact */
    #top-info {
        flex-wrap: wrap;
        gap: 15px;
    }

    .info-block {
        font-size: 16px;
        padding: 8px 12px;
    }
}



@media (max-width: 600px) {

    #layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #left-panel,
    #alchemy-panel {
        width: 90%;
        max-width: 400px;
        padding: 10px;
    }

    #alchemy-panel {
        display: flex;
        flex-direction: column-reverse;  /* billes au-dessus du titre sur mobile */
        gap: 8px;
    }

    #alchemy-panel h2 {
        margin-bottom: 0;
    }

    h1 {
        font-size: 28px;
    }

    #alchemy-sequence {
        flex-direction: row;   /* ligne sur petit écran */
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .alchemy-ball {
        width: 30px;
        height: 30px;
    }

    #left-panel {
        width: 90% !important;
        max-width: 400px;
    }

    #plateauSelector {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }

    .plateau-btn {
        width: 58px;
        height: 58px;
    }

    .pastille-num { font-size: 18px; }
    .score-plateau { font-size: 10px; }

    #board {
        width: min(95vmin, 360px);
        height: min(95vmin, 360px);
    }

    .marble {
        width: 75%;
        height: 75%;
        font-size: clamp(12px, 2vmin, 18px);
    }

    #top-info {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .info-block {
        padding: 6px 10px;
        font-size: 14px;
    }
}
/* -----------------------------------------
   MODALE CHANGEMENT DE NOM
----------------------------------------- */
#name-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 7, 4, 0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  backdrop-filter: blur(3px);
  text-align: left;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#name-modal.open {
  visibility: visible;
  pointer-events: all;
  opacity: 1;
}

#name-modal-box {
  background: rgba(44, 34, 22, 0.97);
  border: 2px solid #8c6239;
  border-radius: 10px;
  padding: 30px 28px 24px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 0 40px rgba(0,0,0,0.7), 0 0 18px rgba(140,98,57,0.25);
  text-align: center;
}

#name-modal-title {
  font-family: "Cinzel", serif;
  font-size: 18px;
  color: #f0e6d2;
  letter-spacing: 2px;
  margin-bottom: 18px;
  text-shadow: 0 0 10px rgba(209,179,138,0.4);
}

#name-modal-input {
  width: 100%;
  background: rgba(20, 15, 10, 0.7);
  border: 1px solid #8c6239;
  border-radius: 6px;
  color: #f0e6d2;
  font-family: "Cinzel", serif;
  font-size: 15px;
  padding: 10px 12px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

#name-modal-input:focus {
  border-color: #d1b38a;
  box-shadow: 0 0 8px rgba(209,179,138,0.3);
}

#name-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: center;
}

#name-modal-cancel,
#name-modal-confirm {
  padding: 8px 22px;
  border-radius: 6px;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  border: 2px solid #8c6239;
  transition: background 0.2s, transform 0.15s;
}

#name-modal-cancel {
  background: rgba(60, 50, 40, 0.5);
  color: #a08060;
}

#name-modal-cancel:hover {
  background: rgba(80, 65, 50, 0.6);
  color: #f0e6d2;
}

#name-modal-confirm {
  background: #6b4a2b;
  color: #f0e6d2;
}

#name-modal-confirm:hover {
  background: #8c6239;
  transform: scale(1.04);
}

/* ═══════════════════════════════════════════
   VISITE GUIDÉE
   ═══════════════════════════════════════════ */

/* Bouton ? permanent */
#tour-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(30, 22, 12, 0.92);
    border: 1.5px solid rgba(212,168,83,.6);
    color: #d4a853;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.5);
    transition: border-color .2s, color .2s, transform .2s;
}
#tour-btn:hover {
    border-color: #d4a853;
    color: #f0c97a;
    transform: scale(1.1);
}

/* Overlay sombre avec "trou" sur l'élément ciblé */
#tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 8100;
    pointer-events: all;
}

/* Les 4 bandes sombres autour de l'élément ciblé */
.tour-band {
    position: fixed;
    background: rgba(8, 5, 2, 0.82);
    z-index: 8100;
    transition: all .35s cubic-bezier(.4,0,.2,1);
}

/* Contour doré autour de l'élément ciblé */
#tour-highlight {
    position: fixed;
    border: 2px solid rgba(212,168,83,.8);
    border-radius: 8px;
    box-shadow:
        0 0 0 3px rgba(212,168,83,.15),
        0 0 30px rgba(212,168,83,.2);
    z-index: 8150;
    pointer-events: none;
    transition: all .35s cubic-bezier(.4,0,.2,1);
    animation: highlightPulse 2s ease-in-out infinite;
}
@keyframes highlightPulse {
    0%,100% { box-shadow: 0 0 0 3px rgba(212,168,83,.15), 0 0 20px rgba(212,168,83,.15); }
    50%      { box-shadow: 0 0 0 5px rgba(212,168,83,.25), 0 0 40px rgba(212,168,83,.3); }
}

/* Bulle de texte */
#tour-bubble {
    position: fixed;
    z-index: 8200;
    background: linear-gradient(160deg, #1e160a 0%, #150f07 100%);
    border: 1px solid rgba(212,168,83,.45);
    border-radius: 12px;
    padding: 22px 26px 18px;
    max-width: 320px;
    min-width: 240px;
    box-shadow:
        0 8px 40px rgba(0,0,0,.7),
        inset 0 1px 0 rgba(212,168,83,.1);
    transition: opacity .25s, transform .25s;
}
#tour-bubble.entering {
    opacity: 0;
    transform: translateY(8px) scale(.97);
}

/* Flèche de la bulle */
#tour-bubble::before {
    content: "";
    position: absolute;
    width: 10px; height: 10px;
    background: #1e160a;
    border: 1px solid rgba(212,168,83,.45);
    transform: rotate(45deg);
}
#tour-bubble.arrow-top::before    { top: -6px;    left: 24px; border-bottom: none; border-right: none; }
#tour-bubble.arrow-bottom::before { bottom: -6px; left: 24px; border-top: none;    border-left: none; }
#tour-bubble.arrow-left::before   { left: -6px;   top: 22px;  border-top: none;    border-right: none; }
#tour-bubble.arrow-right::before  { right: -6px;  top: 22px;  border-bottom: none; border-left: none; }
#tour-bubble.arrow-none::before   { display: none; }

/* Contenu de la bulle */
.tour-step-num {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(212,168,83,.5);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.tour-title {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    color: #f0c97a;
    margin-bottom: 10px;
    line-height: 1.3;
}
.tour-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 15px;
    color: #d4c4a8;
    line-height: 1.6;
}
.tour-text strong { color: #f0c97a; }

/* Boutons navigation */
.tour-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 10px;
}
.tour-dots {
    display: flex;
    gap: 5px;
    flex: 1;
    justify-content: center;
}
.tour-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(212,168,83,.25);
    transition: background .2s;
}
.tour-dot.active { background: #d4a853; }

.tour-nav-btn {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 7px 14px;
    border-radius: 5px;
    border: 1px solid rgba(212,168,83,.4);
    background: transparent;
    color: #d4a853;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.tour-nav-btn:hover { background: rgba(212,168,83,.1); border-color: #d4a853; }
.tour-nav-btn.primary {
    background: rgba(212,168,83,.15);
    border-color: rgba(212,168,83,.7);
}
.tour-nav-btn.primary:hover { background: rgba(212,168,83,.25); }
.tour-skip-btn {
    font-size: 10px;
    color: rgba(212,168,83,.35);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-family: 'EB Garamond', serif;
    transition: color .2s;
}
.tour-skip-btn:hover { color: rgba(212,168,83,.6); }

@media (max-width: 600px) {
    #tour-btn { bottom: 14px; right: 14px; width: 36px; height: 36px; font-size: 16px; }

    /* Drawer mobile — glisse depuis le bas */
    #tour-bubble {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px 18px 0 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        padding: 18px 20px 32px !important;
        box-shadow: 0 -8px 40px rgba(0,0,0,.7) !important;
        transform: none !important;
    }
    /* Masquer la flèche directionnelle sur mobile */
    #tour-bubble::before { display: none !important; }

    /* Variante haut */
    #tour-bubble.drawer-top {
        bottom: auto !important;
        top: 0 !important;
        border-radius: 0 0 18px 18px !important;
        box-shadow: 0 8px 40px rgba(0,0,0,.7) !important;
    }

    /* Animation drawer : entre par le bas */
    #tour-bubble.entering {
        opacity: 0 !important;
        transform: translateY(40px) !important;
    }

    .tour-text { font-size: 14px; }

    /* Bandes sombres : sur mobile, overlay simple (pas de découpe) */
    .tour-band { display: none; }
    #tour-overlay { background: rgba(8,5,2,0.55); }

    /* Contour doré reste visible mais z-index sous le drawer */
    #tour-highlight { z-index: 8120; }

    /* Poignée visuelle en haut du drawer */
    #tour-bubble .tour-step-num::before {
        content: "";
        display: block;
        width: 36px; height: 4px;
        background: rgba(212,168,83,.3);
        border-radius: 2px;
        margin: 0 auto 12px;
    }
}

/* ============================================================
   À AJOUTER à la fin de style.css
   Corrections CSP : remplacement des styles inline JS
   ============================================================ */

/* ── Sélecteur de langue ── */
#lang-switcher {
  position: fixed;
  top: 12px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 9000;
}
.lang-btn {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(140,98,57,.5);
  background: rgba(30,22,12,.85);
  color: rgba(212,168,83,.6);
  cursor: pointer;
  transition: all .2s;
}
.lang-btn:hover  { color: #d4a853; border-color: #d4a853; }
.lang-btn.active { color: #f0c97a; border-color: #d4a853; background: rgba(212,168,83,.15); }

/* Bille sélectionnée (remplace marble.style.outline) */
.marble.selected {
    outline: 3px solid yellow;
}

/* Bille invisible pendant le saut (remplace marble.style.opacity) */
.marble.jumping-hidden {
    opacity: 0;
}

/* Particule d'explosion — position et variables via attributs data-* */
/* Les valeurs dynamiques (position, couleur, taille) passent par
   des propriétés CSS custom injectées via style (autorisé par CSP) :
   seules les propriétés custom (--var) sont permises, pas les propriétés standard */

/* Anneau d'explosion */
.explode-ring-el {
    position: fixed;
    border-radius: 50%;
    border: 2px solid rgba(212, 168, 83, 0.9);
    pointer-events: none;
    z-index: 9998;
    animation: ringExpand 0.5s ease-out forwards;
    /* left/top/width/height passent par style="" — autorisé car ce sont
       des propriétés de positionnement, pas de style visuel arbitraire.
       Si la CSP reste stricte, utiliser transform depuis un conteneur. */
}

/* Particule colorée — la couleur passe par --particle-color */
.explode-particle {
    background: var(--particle-color, #d4a853);
}

/* Clone de bille animé */
.marble-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transition: none;
    transform: translate(0, 0);
}