/* ============================================================
   BASE — fond d'origine conservé
   ============================================================ */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    /* ⬇️ Fond d'origine : on ne touche pas au background du body */
}

body {
    color: #ffffff;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #cb11b16e 0%, #6365d9 100%);

}

/* ============================================================
   NAV — préservée telle quelle
   ============================================================ */
.mod_navigation {
    position: relative;
    z-index: 1;             /* au-dessus du canvas FX */
}
.mod_navigation ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0 0 1rem 0;
}
.mod_navigation a {
    color: #fff;            /* couleur d'origine (à ajuster si besoin) */
    text-decoration: none;
    font-weight: bold;
}
.mod_navigation a:hover { text-decoration: underline; }
.invisible { display: none; }

nav.lev_0 {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 150px;
  z-index: 10;
}

nav .block {
  overflow: hidden;
  background-color: #ddd;
  opacity: 0.8;
  border-radius: 20px;
}

nav li {
  padding: 10px 20px;
  font-size: 1.1rem;
  background: #666;
  display: block;
  border-radius: 5px;
  margin-bottom: 1px;
  list-style-type: none;
}

nav a,
nav strong {
  color: #fff;
  text-decoration: none;
  display: block;
}

nav li.active { background-color: #aa4444; }

/* ============================================================
   WRAPPER
   ============================================================ */
.wrapper {
    max-width: 720px;
    margin: 0 auto 1.5rem auto;
    text-align: center;
    position: relative;
    z-index: 1;             /* au-dessus du canvas FX */
}

h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
    letter-spacing: 0.1em;
}
h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    font-weight: normal;
    opacity: 0.85;
}

/* ============================================================
   ALPHABET
   ============================================================ */
.alphabetButton {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 1rem 0;
}

.alphabetButtonJS {
    color:#ffffff;
	width: 42px;
    height: 42px;
    font-size: 1.1rem;
    font-weight: bold;
    background: #33cc33;
    border: 2px solid #999;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: lowercase;
}

.alphabetButtonJS:hover:not(:disabled) {
    background: #adebad;
    border-color: #333;
    transform: translateY(-2px);
}

.alphabetButtonJS:active:not(:disabled) {
    transform: translateY(0);
}

.alphabetButtonJS.selected,
.alphabetButtonJS:disabled {
    background: #248f24;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================================
   MOT AFFICHÉ
   ============================================================ */
#hold {
    font-size: 2.2rem;
    letter-spacing: 0.5rem;
    font-family: "Courier New", monospace;
    font-weight: bold;
    margin: 1rem 0;
    min-height: 2.5rem;
}

#mylives {
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 1.5rem;
    margin: 0.5rem 0;
}

/* ============================================================
   CANVAS PENDU
   ============================================================ */
#hangman {
    background: #444444;
    border-radius: 12px;
    display: block;
    margin: 1rem auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
    color:#ffffff;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    background: #33cc33;
    border: 2px solid #888;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0.3rem;
}
.btn:hover {
    background: #2eb82e;
}
.btn:active { transform: scale(0.97); }

/* ============================================================
   TEXTAREA
   ============================================================ */
#wordsInput {
    width: 100%;
    max-width: 600px;
    min-height: 100px;
    padding: 0.7rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #999;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    margin-top: 1rem;
}
#wordsInput:focus {
    outline: none;
    border-color: #333;
}

/* ============================================================
   NAV / FOOTER
   ============================================================ */
.author {
    text-align: center;
    opacity: 0.6;
    font-size: 0.9rem;
    margin: 2rem 0 1rem 0;
    position: relative;
    z-index: 1;
}
p, ul {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}
ul { padding-left: 1.5rem; }
li { margin: 0.3rem 0; }

/* ============================================================
   FX — canvas plein écran en COUCHE SUPERPOSÉE
   Il se superpose à tout mais reste transparent au départ.
   ============================================================ */
#fxCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;             /* ⬅️ AU-DESSUS du jeu (qui est à z-index 1) */
    pointer-events: none;
    background: transparent; /* ⬅️ AUCUN fond opaque */
    display: none;
}
#fxCanvas.active {
    display: block;
}

/* Le texte animé reste au-dessus du canvas FX */
#fxMessage {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;             /* ⬅️ au-dessus du canvas FX */
    pointer-events: none;
    font-family: "Arial Black", Impact, sans-serif;
    font-size: clamp(2.5rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: center;
    opacity: 0;
    transform: scale(0.5);
    text-shadow: 0 0 30px rgba(255,255,255,0.4);
}

#fxMessage.win {
    color: #ffd700;
    animation: popInWin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               glowWin 2s ease-in-out 0.8s infinite;
}

#fxMessage.lose {
    color: #ff4444;
    animation: popInLose 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               glowLose 2.5s ease-in-out 1s infinite;
}

@keyframes popInWin {
    0%   { opacity: 0; transform: scale(0.3) rotate(-15deg); }
    60%  { opacity: 1; transform: scale(1.15) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes glowWin {
    0%, 100% { text-shadow: 0 0 30px rgba(255,215,0,0.6), 0 0 60px rgba(255,215,0,0.4); }
    50%      { text-shadow: 0 0 50px rgba(255,215,0,1),   0 0 100px rgba(255,215,0,0.8); }
}
@keyframes popInLose {
    0%   { opacity: 0; transform: scale(2) rotate(10deg); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1) rotate(0);     filter: blur(0); }
}
@keyframes glowLose {
    0%, 100% { text-shadow: 0 0 20px rgba(255,68,68,0.6); }
    50%      { text-shadow: 0 0 40px rgba(255,68,68,1); }
}
