@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;
}

.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;
}

.headbar a {
  color: #facc15;
  text-decoration: none;
  font-weight: bold;
  margin: 0 10px;
}

.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: 1000;
}

.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 {
  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;
    }
  }