:root {


  --c1:#1e88e5;   /* blue */
  --c2:#e53935;   /* red */
  --c3:#43a047;   /* green */
  --c4:#fdd835;   /* yellow */
  --c5:#fb8c00;   /* orange */
  --c6:#8e24aa;   /* purple */

  --board-glow:#2196F3;

  --ui-bg:#efe7f0;
  --ui-card:#ffffff;
  --ui-border:#f4de36;

  --ui-primary:#411041;
  --ui-primary-l:#721c72;
  --ui-text:#2c3e50;
  --ui-muted:#7f8c8d;


  --border: 5px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  margin: 0;
  padding: 2px;
  user-select: none;
  margin-inline: auto;
  background: linear-gradient(135deg, var(--ui-primary-l), var(--ui-primary));
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

h1 {
  font-size: 3rem;
  margin: 0px;
  animation: pixelColor 4s linear infinite;
  text-align: center;
}
@keyframes pixelColor{
  0%  { color:#F44336; }
  20% { color:#FF9800; }
  40% { color:#FFEB3B; }
  60% { color:#4CAF50; }
  80% { color:#2196F3; }
  100%{ color:#9C27B0; }
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 8px;
}


fieldset {
  border-radius: 10px;
  text-align: left;
}
legend {
  font-weight: bold;
}


details {
  border-radius: 10px;
}

summary{
  cursor:pointer;
  padding: 5px;
}


/*******************************************************************/
/*                           UTILS                                 */
/*******************************************************************/

.hidden { display:none !important; }

.box {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
/* écran assez large = diptyque */
@media (min-width: 900px) {
  .box {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.wrap {
  margin: 0 auto;
  border-radius:12px;
  padding: 4px;
  background:var(--ui-bg);
  border: 4px solid var(--ui-border);
  text-align: center;

  max-width: min(95vw, 500px);
}

/*******************************************************************/
/*                          Fortune                                */
/*******************************************************************/


.bgColor {
  background: linear-gradient(135deg, var(--ui-primary-l), var(--ui-primary)) !important;
  /*background-color: var(--ui-primary) !important;*/
}
.bdColor {
  border: 2px solid var(--ui-border);
}

.textShadow {
text-shadow:
  0 0 10px #000,
  0 0 20px #fff

}

.pColor1 {
  background: linear-gradient(135deg, #ff0033, #ff6b6b) !important;
}

.pColor2 {
  background: linear-gradient(135deg, #ffb300, #fff176) !important;
}

.pColor3 {
  background: linear-gradient(135deg, #0066ff, #00e5ff) !important;
}

.wideRange {
  min-width: 300px;
}

/*******************************************************************/
/*                          Welcome                                */
/*******************************************************************/

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 99999;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loading-logo {
  object-fit: contain;
  max-width: 95%;
}

.loading-text {
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
    max-width: 350px;
    text-align: center;
}

.themeLoadingImg {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 4px solid var(--ui-border);
}


/*******************************************************************/
/*                          MENU                                   */
/*******************************************************************/

#showMenuBtn,#soundBtn,#gameBtn {
  border: 2px solid var(--ui-border) !important;
  min-width: 40px;
}


.playerBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px 10px;
  border-radius: 10px;
  padding: 5px;
  color: white;
  font-weight: bold;
  text-shadow:
    0 0 4px rgba(0,0,0,.9),
    0 0 10px rgba(255,255,255,.6);
  box-shadow:
    inset 0 0 12px rgba(255,255,255,.45),
    0 0 12px rgba(255,255,255,.35);
  min-width: 80px;
}

#playerBox1 {
  background: linear-gradient(135deg, #ff0033, #ff6b6b) !important;
  box-shadow: 0 0 14px #ff0033;
}

#playerBox2 {
  background: linear-gradient(135deg, #ffb300, #fff176) !important;
  color: white;
  box-shadow: 0 0 14px #ffd700;
}

#playerBox3 {
  background: linear-gradient(135deg, #0066ff, #00e5ff) !important;
  box-shadow: 0 0 14px #00bfff;
}



.btnSmall {
  padding: 0px 8px !important;
  font-weight: normal;
}


.sndConfigFieldset {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/*******************************************************************/
/*                          THEME                                  */
/*******************************************************************/


#choixThemeArea {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
        justify-content: space-evenly;
}


.themeBtn {
  position: relative;
    display: flex;
    align-items: center;
    gap: 0px;
    flex-direction: column;
    max-width: 100px;
}
.themeImg {
  border-radius: 5px;
  width: 100px;
}

.themeSpan {
  position: absolute;
  font-weight: normal;
  font-size: 0.9rem;
   top: 50%;
  transform: translateY(-50%);
  max-width: 100px;
  color: white;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 999px;
  
}

#themeTitle {
  font-weight: bold;
  font-size: 1.2rem;
}

.divThemeTitle {
  color:white;
  padding: 5px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

/*******************************************************************/
/*                          GUESS PHRASE                           */
/*******************************************************************/
#imgGif {
  display: block;
  border-radius: 10px;
  position: fixed;
  width: 150px;
  height: 150px;
  top: 5px;
  left: 5px;
  border: 4px solid var(--ui-border);

  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;

  object-fit: cover;        /* 🔥 crop automatique */
  object-position: center;  /* centre le crop */
}


.guess-area {
  display: flex;
  gap: 2px;
  justify-content: center;
  flex-direction: column;
  /*background-color:var(--ui-primary);*/
  /*border: 5px solid var(--ui-primary);*/
      
}

.guessLine {
  display: flex;
  gap: 2px;
  justify-content: space-evenly;
}
.guessChar {
  
  border-radius: 2px;
  width: 45px;
  height: 32px;
  border-radius: 4px;
  background: #e2ffd4;;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--ui-text);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.empty {
  border-radius: 0px;
  position: relative;
  /*dégradé orange-rouge*/
  /*background: linear-gradient(45deg, #ff9800, #f4de36);*/
  background: linear-gradient(45deg, #11b015, #54be5a);

}
.empty::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #e8e8e8;
  -webkit-mask: url('logo100.png') center / contain no-repeat;
  mask: url('logo100.png') center / contain no-repeat;
  -webkit-mask-size: 70%;
  mask-size: 70%;
}

.angle {
  background: transparent;
}

.guessed {
  border-radius: 4px;
  background-color: white;
}
/*******************************************************************/
/*                          CLAVIER                                */
/*******************************************************************/

.divLetterMeter {
  background: var(--ui-primary);
  display: flex;
  gap: 1px;
    justify-content: center;
    flex-direction: column;
}
.divVoyelleMeterPill, .divConsonneMeterPill {
  background: var(--ui-primary);
  color: white;
  border: none;
    border-radius: 4px;
    height: 4px;
    min-width: 15px;
  font-size: 1.25rem;
}

.pillPresent {
  background: #00c853;
  opacity: .45;
}
.pillAbsent {
  background: #d50000;
  opacity: .45;
}

.pillFound {
  background: #00e676;
  opacity: 1;
  box-shadow: 0 0 10px #00e676;
}

.pillAbsentLost {
  background: #ff0000;
  opacity: 1;
  box-shadow: 0 0 10px #ff0000;
}

#divVoyelles {
  display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: space-evenly;
        align-items: center;
    gap: 5px;
}

#divConsonnes {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: space-evenly;
      align-items: center;
  gap: 5px;
}

.keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px;
}

.voyelle, .consonne {
  appearance: none;
  -webkit-appearance: none;
  background: var(--ui-primary);
  color: white;
  font-weight: normal;
  border: none;
  border-radius: 8px;
  padding-bottom: 10px;
  cursor: pointer;
  transition: .15s;
  font-size: 1.25rem;
  line-height: 1.25;
  width: 40px;
  height: 35px;
  box-shadow: none;

  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-1px); /* ajuste vertical pour compenser les ombres */

}


/*******************************************************************/
/*                          ROUE                                   */
/*******************************************************************/


#divSpeed {
    position: relative;
    left: 150px;
        height: 0px;
}


#divTaquet {
  position: absolute;
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  background-color: var(--ui-primary);
  min-width: 200px;
  border-radius: 10px;
  border: 3px solid var(--ui-primary);
}

/* HTML: <div class="triangle"></div> */
.triangle {
  position: relative;
    top: 35px;
    width: 10px;
    aspect-ratio: 1 / 3;

  clip-path: polygon(50% 100%,100% 0,0 0);
  background-color: var(--ui-primary);
      z-index: 99;
}



#wheelCanvas {
  touch-action: none;
  cursor: grab;
}

#wheelCanvas:active {
  cursor: grabbing;
}
#wheelCanvas.disabled {
  cursor: not-allowed;
  /*  filter: brightness(0.8) contrast(1);*/
  /*box-shadow: 0 0 20px rgba(0,0,0,0.8) inset;*/
}



/*******************************************************************/
/*                          WIN PANEL                              */
/*******************************************************************/
.winPhrase {
      font-size: 1.25rem;
    font-weight: bold;
}
.winImg {
    border-radius: 10px;
}




/*******************************************************************/
/*                          IMPACT                                 */
/*******************************************************************/


#impactMessage {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: bold;
    color:var(--ui-primary);
    /*coutour de lettre en --ui-border*/
    text-shadow:
        -2px -2px 0 var(--ui-border),
        2px -2px 0 var(--ui-border),
        -2px 2px 0 var(--ui-border),
        2px 2px 0 var(--ui-border);
    animation: impactAnim 1s ease-out;
    pointer-events: none;
}
@keyframes impactAnim {
    0% {
        transform: translate(-50%, -50%) scale(.5);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    60% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}


/*******************************************************************/
/*                          MODAL                                  */
/*******************************************************************/

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: 100vw;
  padding: 24px;
  text-align: center;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.7);
  color:white;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:20px;
  z-index:1000;
  margin-inline: auto;
  overflow-y: auto;

}

.modal p {
  font-size: 18px;
  margin: 0 0 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-actions button {
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  font-size: 16px;
}

#btnOui {
  background: #16a34a;
  color: white;
}

#btnNon {
  background: #dc2626;
  color: white;
}




.modal button{
  font-size:18px;
  padding:14px 24px;
  border-radius:10px;
  border: 2px solid var(--ui-border);
}









































    .top {
      display:flex;
      gap: 14px;
      flex-wrap:wrap;
      align-items:center;
      justify-content:space-between;
    }
    .card { 
      padding: 4px 8px;
      background:var(--ui-card);
      color: var(--ui-text);
      border:1px solid var(--ui-border);
      border-radius:12px;
      min-width: 80%;
      overflow: auto;
    }
    .flex {
      display:flex;
      flex-direction: column;
      align-items: center;
    }
    .row {
      display:flex;
      justify-content: space-evenly;
      /*gap: 10px;*/
      flex-wrap:wrap; 
      align-items:center;
      width: 100%;
    }
    .title span{
      display:inline-block;
      animation: flipPause 4s ease infinite;
    }

    /* delays progressifs */
    .title span:nth-child(1){ animation-delay:0s }
    .title span:nth-child(2){ animation-delay:.1s }
    .title span:nth-child(3){ animation-delay:.2s }
    .title span:nth-child(4){ animation-delay:.3s }
    .title span:nth-child(5){ animation-delay:.4s }
    .title span:nth-child(7){ animation-delay:.5s }
    .title span:nth-child(8){ animation-delay:.6s }
    .title span:nth-child(9){ animation-delay:.7s }
    .title span:nth-child(10){ animation-delay:.8s }

    /* espace */
    .space{
      width:10px;
    }

    @keyframes flipPause{
      0%{
        transform: perspective(400px) rotateY(0);
      }

      20%{
        transform: perspective(400px) rotateY(360deg);
      }

      /* pause */
      100%{
        transform: perspective(400px) rotateY(360deg);
      }
    }


.flip {
  animation: flipTV 1000ms ease;
  transform-origin: center;
}

@keyframes flipTV {
  0% {
    transform: rotateY(90deg);
    background: #d4e8ff;

  }
  50% {
    background: #fff;

  }
  100% {
    transform: rotateY(0deg);
    background: #fff;
  
  }
}


    .hithere {
  animation: hithere 1s ease infinite;
}
@keyframes hithere {
  30% { transform: scale(1.2); }
  40%, 60% { transform: rotate(-5deg) scale(1.2); }
  50% { transform: rotate(5deg) scale(1.2); }
  70% { transform: rotate(0deg) scale(1.2); }
  100% { transform: scale(1); }
}

    input, button {
      
      font: inherit; }

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}



    .msg {
      color:white;
      height: 50px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }


    input[type="range"] {
      accent-color:var(--ui-border);
      cursor: pointer;
    }

    .control {
      margin: 6px 0;
      font-weight: 600;
    }


    button{
      background: linear-gradient(135deg, var(--ui-primary-l), var(--ui-primary));
      border: 2px solid var(--ui-border);
      box-shadow: 0 0 0 2px var(--ui-primary);
      font-weight: bold;
      color:white;
      border:none;
      border-radius:8px;
      padding:6px 4px;
      cursor:pointer;
      transition:.15s;
    }

    button:hover:not(:disabled){
      filter:brightness(1.1);
    }

    button:disabled{
      opacity:.45;
      cursor:not-allowed;
    }













