/* Pages des comptes (sprint 05) : connexion, invitation, choix du personnage, admin. Mêmes
   couleurs que le jeu ; aucune règle en ligne dans le HTML, que la politique de sécurité
   refuserait. */
html,
body {
  margin: 0;
  /* Les champs du navigateur (calendrier, liste déroulante) en couleurs sombres, comme la page. */
  color-scheme: dark;
  background: #0f100e;
  color: #d8d4c8;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

a {
  color: #9fc27a;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.2rem;
}

h3 {
  margin: 1rem 0 0.4rem;
  color: #b8b4a8;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[hidden] {
  display: none !important;
}

/* Petite carte au centre : connexion, invitation. */
.carte {
  max-width: 24rem;
  margin: 10vh auto 2rem;
  padding: 1.5rem;
  border: 1px solid #3a3832;
  border-radius: 6px;
  background: #171814;
}

.large {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

form {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.25rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input:not([type]),
select,
textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid #6b6a60;
  border-radius: 4px;
  background: #0f100e;
  color: inherit;
}

input[readonly] {
  color: #b8b4a8;
  border-style: dashed;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid #d9b44a;
  outline-offset: 1px;
}

button {
  padding: 0.45rem 0.9rem;
  border: 1px solid #6b6a60;
  border-radius: 4px;
  background: #24251f;
  color: inherit;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #a8a597;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

button.principal {
  border-color: #7d9a5a;
  background: #2f3b25;
}

button.danger {
  border-color: #8e3b2e;
}

.message {
  margin: 0;
  color: #9fc27a;
  overflow-wrap: anywhere;
}

.message.erreur {
  color: #e0674f;
}

.message:empty {
  display: none;
}

.aide {
  color: #b8b4a8;
  font-size: 0.9rem;
}

.barre {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

/* Choix du personnage : six cartes, chacune avec le personnage qui marche. */
.personnages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.personnage {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.6rem;
  border: 2px solid #3a3832;
  border-radius: 6px;
  background: #171814;
  cursor: pointer;
}

.personnage:has(input:checked) {
  border-color: #d9b44a;
  background: #24251f;
}

.personnage input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.personnage canvas {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
}

/* Admin. */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #2c2b26;
  text-align: left;
  vertical-align: top;
}

th {
  color: #b8b4a8;
  font-weight: 600;
}

td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

td.actions button {
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.etat-suspendu {
  color: #d7a34d;
}

.lien-invitation {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #d9b44a;
  border-radius: 6px;
  background: #24251f;
}

.lien-invitation code {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.reglages {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(20rem, 1.3fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 52rem) {
  .reglages {
    grid-template-columns: 1fr;
  }
}

/* Onglets des réglages (sprint 11, D-125) : un par thème ; le nombre de réglages modifiés et pas
   encore enregistrés suit le nom de l'onglet. */
.onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #3a3832;
}

.onglets button {
  margin-bottom: -1px;
  padding: 0.4rem 0.7rem;
  border: 1px solid #3a3832;
  border-radius: 6px 6px 0 0;
  background: #1b1c18;
  color: #b8b4a8;
  font: inherit;
  cursor: pointer;
}

.onglets button[aria-selected="true"] {
  border-bottom-color: #0f100e;
  background: #0f100e;
  color: #f0ece0;
  font-weight: 600;
}

.onglets .modifies {
  color: #e6c87a;
}

.panneau-reglages {
  display: grid;
  gap: 0.6rem;
}

.panneau-reglages[hidden] {
  display: none;
}

.curseur {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.5rem;
}

.curseur input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}

.curseur output {
  color: #e6c87a;
  font-variant-numeric: tabular-nums;
}

.case {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.portee {
  color: #b8b4a8;
  font-size: 0.85rem;
}

textarea {
  width: 100%;
  min-height: 4.5rem;
  box-sizing: border-box;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.apercu {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.4rem;
}

.apercu iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #3a3832;
  border-radius: 4px;
  background: #0f100e;
}

.non-enregistre {
  color: #d7a34d;
}

.monde {
  width: auto;
  margin-bottom: 1rem;
}

.monde th {
  padding-right: 1.5rem;
}

.monde td {
  font-variant-numeric: tabular-nums;
}

.reinitialisation {
  max-width: 34rem;
  padding: 0.75rem;
  border: 1px solid #8e3b2e;
  border-radius: 6px;
}

.reinitialisation h3 {
  margin: 0;
}

.journal td:first-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
