@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&display=swap");

html,
body {
  font-family: "Fredoka", sans-serif;
  color: #f8fafc;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  align-items: center;
}

.headbar {
  width: 100%;
  background: #1e293b9c;
  padding: 15px 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  box-sizing: border-box;
  position: fixed;
  z-index: 1;
  gap: 10px;
  flex-wrap: wrap;
}

.headbar a {
  color: #facc15;
  text-decoration: none;
  font-weight: bold;
  margin: 0 10px;
  font-size: clamp(0.8rem, 2.2vw, 1.1rem);
  white-space: nowrap;
}

.headbar a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 2.5rem;
  color: #facc15;
  margin: 60px 0 10px;
  text-align: center;
  flex-shrink: 0;
}

.theme-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 75px;
}

.theme-thumb {
  width: 100px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s;
}

.theme-thumb:hover {
  border: 2px solid #facc15;
}

footer {
  margin-top: auto;
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  background: #1e293b9c;
  color: #94a3b8;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}

.config {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
  padding: 0 20px;
  flex-shrink: 0;
}

.config input,
.config select,
.config button {
  padding: 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #334155b2;
  color: white;
}

.select-lettre {
  background: #334155;
  color: grey !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 30px;
}

.select-lettre option {
  background-color: rgb(59, 75, 102) !important;
  color: #f8fafc;
}

.results {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 30px;
  box-sizing: border-box;
  position: relative;
  padding-bottom: 60px;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
  flex-wrap: wrap;
}

.results-header h2 {
  font-size: 1.6rem;
  margin: 0;
  color: white;
}

.select-tri {
  background: #3341557c;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 1rem;
  max-width: 100%;
}

.results ul {
  list-style: none;
  padding: 0;
}

.results li {
  background: #3341557c;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 6px;
}

* {
  box-sizing: border-box;
  font-family: "Fredoka", sans-serif;
}

.config {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  position: relative;
  padding: 0 20px;
}

.config input {
  padding: 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  width: 100%;
  max-width: 500px;
  text-transform: uppercase;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-width: 500px;
  background: #1e293b9c;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-list div {
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.autocomplete-list div:hover {
  background: #1e293b9c;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-grow: 1;
  padding: 0 20px;
}

.word-display {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scroll-behavior: smooth;
}

.letter-bubble {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background: #334155;
  color: white;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.correct {
  background: #10b981;
  color: white;
}

.wrong {
  background: #ef4444;
  color: white;
}

#input {
  font-size: 1.6rem;
  padding: 16px;
  width: 100%;
  max-width: 500px;
  border: none;
  border-radius: 12px;
  background: #334155e0;
  color: white;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

.timer {
  font-size: 1.3rem;
  color: #10b981;
  min-height: 30px;
}

.history {
  max-height: 400px;
  overflow-y: auto;
  text-align: left;
  font-size: 0.95rem;
  width: 100%;
  max-width: 500px;
  margin-top: 30px;
  border-left: 2px solid #334155;
  padding-left: 15px;
}

.history div {
  margin-bottom: 4px;
  font-family: monospace;
  color: #94a3b8;
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.8rem;
    margin: 20px 0 10px;
  }
}

.tools {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 600px;
  padding: 0 20px 40px;
}

.tool {
  background: #1e293b79;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  color: #f8fafc;
  font-size: 1.2rem;
  font-weight: bold;
  transition: background 0.2s;
}

.tool:hover {
  background: #334155;
}

.back-button {
  margin-bottom: 30px;
}

.back-button a {
  background: #3b82f6;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}

.back-button a:hover {
  background: #2563eb;
}
.config label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-weight: 600;
  color: white;
}
.theme-thumb {
  width: 100px;
  height: 60px;
  object-fit: cover;
  margin: 5px;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: border 0.2s;
}
.theme-thumb:hover {
  border: 2px solid #facc15;
}
div.theme-thumb {
  border: 2px solid #000000;
  background-color: #0000001c;
}
  .theme-thumb-wrapper {
    position: relative;
    display: inline-block;
    margin: 5px;
    animation: appear 0.3s ease-out;
  }
  .theme-thumb-wrapper.remove {
    animation: disappear 0.3s ease-in forwards;
  }
  @keyframes disappear {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.7); }
  }
  @keyframes appear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
  }
  .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    border: none;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.85;
    z-index: 2;
  }
  .delete-btn:hover {
    background: #dc2626;
    opacity: 1;
  }

  .theme-thumb-wrapper {
    position: relative;
    display: inline-block;
  }

  .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    z-index: 5;
  }

  .fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
  }


  
  @media (max-width: 700px) {
    h1 {
      font-size: 2.5rem;
      margin-top: 60px;
    }
  }
  
  .headbar {
    width: 100%;
    background: #1e293b9c;
    padding: 15px 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
  }
  
  .headbar a {
    color: #facc15;
    text-decoration: none;
    font-weight: 600;
    margin: 0 10px;
  }
  
  footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #f8fafc;
    background: #1e293b9c;
    width: 100%;
  }
  #game {
    margin-top: 15px;
    margin-bottom: 0px;
    max-height: 50vh;
    place-items: center;
  }
  
  .grid {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    gap: 2px;
    margin-bottom: 2px;
    opacity: 75%;
  }
  
  .cell {
    width: 50px;
    height: 50px;
    border: 2px solid #334155;
    border-radius: 20%;
    text-align: center;
    font-size: 1.5em;
    text-transform: uppercase;
    background: #1e293b;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
  }
  
  .cell.selected {
    border: 2px solid #3b82f6;
  }
  
  .green {
    background: #22c55e !important;
  }
  
  .yellow {
    background: #facc15 !important;
    color: black;
  }
  
  .gray {
    background: #334155 !important;
  }
  
  .keyboard {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 100px;
    opacity:75%;
  }
  
  .key {
    flex: 1;
    max-width: 10%;
    min-width: 30px;
    padding: 10px;
    text-align: center;
    font-size: 1rem;
  }
  
  
  .keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
  }
  
  .key {
    background: #1e293b;
    color: #f8fafc;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    width: 40px;
    transition: background 0.2s ease;
  }
  
  .key.wide {
    width: 60px;
  }
  
  .key.green {
    background: #22c55e !important;
  }
  
  .key.yellow {
    background: #facc15 !important;
    color: black;
  }
  
  .key.gray {
    background: #b42020 !important;
  }
  
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .modal-content {
    background: #1e293b;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
    text-align: center;
    max-width: 90%;
  }
  
  .modal button {
    background: #facc15;
    color: #1e293b;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
  }
  
  .modal button:hover {
    background: #e0a800;
  }
  .headbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #facc15;
    padding: 0 10px;
  }
  
  .nav-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
  }
  
  @media (max-width: 600px) {
    .nav-toggle {
      display: block;
    }
  
    .nav-links {
      display: none;
      flex-direction: column;
      width: 100%;
      margin-top: 10px;
      gap: 5px;
    }
  
    .nav-links.active {
      display: flex;
    }
  }
  

li.mot {
  cursor: pointer;
  transition: background-color 0.3s ease;
}

li.mot.rouge {
  background-color: rgba(255, 0, 0, 0.3);
}
