.settings-gear {
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  /* Centre verticalement sur la ligne du footer (padding bas du board + moitié de sa hauteur) */
  bottom: calc(clamp(12px, 1.4vh, 22px) + clamp(50px, 6.7vh, 78px) / 2 - clamp(36px, 3.4vw, 48px) / 2);
  width: clamp(36px, 3.4vw, 48px);
  height: clamp(36px, 3.4vw, 48px);
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 12%);
  background: rgb(20 22 20 / 70%);
  color: #9aa09a;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  line-height: 1;
  cursor: pointer;
  z-index: 50;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.settings-gear:hover,
.settings-gear:focus-visible {
  color: #e8e8e0;
  background: rgb(30 32 30 / 85%);
  transform: rotate(25deg);
}

.settings-menu {
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  bottom: calc(clamp(12px, 2vh, 28px) + clamp(44px, 4vw, 58px));
  z-index: 50;
  background: #1a1c1a;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 40%);
  overflow: hidden;
}

.settings-menu__item[hidden] {
  display: none;
}

.settings-menu__item {
  display: block;
  width: 100%;
  padding: 10px 18px;
  background: none;
  border: none;
  color: #d6d8d4;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.settings-menu__item:hover,
.settings-menu__item:focus-visible {
  background: rgb(255 255 255 / 8%);
}

.settings-modal[hidden] {
  display: none;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 60%);
}

.settings-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(380px, 90vw);
  padding: 24px;
  background: #1a1c1a;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 50%);
  color: #d6d8d4;
}

.settings-modal__dialog h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #e8e8e0;
}

.settings-modal__dialog label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #9aa09a;
}

.settings-modal__dialog input {
  padding: 8px 10px;
  background: #101210;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 6px;
  color: #e8e8e0;
  font-size: 0.95rem;
}

.settings-modal__error {
  margin: 0;
  color: #e0665a;
  font-size: 0.85rem;
}

.settings-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.settings-modal__actions button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 15%);
  background: #262826;
  color: #d6d8d4;
  cursor: pointer;
}

.settings-modal__actions button[type="submit"] {
  background: #3a6b3a;
  border-color: #3a6b3a;
  color: #f1f6f1;
}
