/* Profil et données: Le Mot's settings and the data DSI Games keeps, on the shared
   Encre sobre foundation of site.css. */
.profil {
  --danger: #ffb4a6;
  --on-danger: #2a0a04;
  /* Le Mot's keys, as its two keyboards draw them. */
  --key-light: #ced5e0;
  --on-key-light: #17202f;
  --key-ink: #2e3548;
  --on-key-ink: #f7f8fc;
}

/* The page bar: back link, centred title, empty end. */
.profil .bar-in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
.back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--target);
  margin-left: -6px;
  padding-right: var(--space-2);
  color: var(--text-2);
  font-size: var(--fs-15);
  font-weight: 600;
  text-decoration: none;
}
.back:hover {
  color: var(--text);
}
.bar-title {
  margin: 0;
  font-size: var(--fs-17);
  font-weight: 600;
  white-space: nowrap;
}
.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 0 0;
}
.lead {
  margin: 0;
  font-size: var(--fs-16);
  color: var(--text-2);
}
.warning {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  border-radius: var(--r-md);
  color: var(--danger);
  font-size: var(--fs-15);
}
.section {
  margin-top: var(--space-8);
}
.section h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-18);
  font-weight: 600;
}
.rows {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.data-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
}
.data-row + .data-row {
  border-top: 1px solid var(--line);
}
.data-row > div:first-child {
  flex: 1;
  min-width: 0;
}
.data-row strong {
  display: block;
  font-size: var(--fs-16);
  font-weight: 600;
}
.data-row span {
  display: block;
  font-size: var(--fs-14);
  color: var(--text-2);
}
.data-row:focus {
  outline: none;
}
.data-row:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: -3px;
}
.data-row .btn {
  min-height: var(--target);
  padding: 0 var(--space-4);
  font-size: var(--fs-15);
}
.data-row.confirm {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.data-row.confirm .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}
.note {
  margin: 10px 0 0;
  font-size: var(--fs-14);
  color: var(--text-3);
}
.note span {
  color: var(--text-2);
}

/* Buttons this page adds to site.css's. */
.btn-secondary {
  border-color: var(--line-2);
  background: transparent;
  color: var(--text);
}
.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: transparent;
  color: var(--danger);
}
.btn-danger-solid {
  background: var(--danger);
  color: var(--on-danger);
}
.btn:disabled {
  border-color: var(--line-2);
  color: var(--text-3);
  cursor: default;
  filter: none;
}

/* Two-way choices: native radios, drawn as a segmented control. */
.data-row.setting {
  flex-wrap: wrap;
  row-gap: var(--space-3);
}
.data-row.setting > div:first-child {
  flex: 1 1 160px;
}
.choices {
  display: flex;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.choices label {
  position: relative;
  flex: 1 1 0;
  cursor: pointer;
}
.choices input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choices label span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--text-2);
  font-size: var(--fs-15);
  font-weight: 600;
  white-space: nowrap;
}
.choices label:hover span {
  color: var(--text);
}
.choices input:checked + span {
  border-color: var(--cyan);
  background: var(--raised);
  color: var(--text);
}
.choices input:checked + span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}
.choices input:focus-visible + span {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}
.choices input:disabled + span {
  opacity: 0.5;
  cursor: default;
}

/* The live preview: Le Mot's bottom row, as the chosen settings lay it out. */
.data-row.preview {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: var(--bg);
}
.kb-row {
  display: flex;
  gap: 5px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.kb-row .key {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  font-size: var(--fs-16);
  font-weight: 600;
  line-height: 1;
}
.kb-row .key.enter {
  flex: 1.9 1 0;
  font-size: var(--fs-14);
}
/* Narrow phones: tighter gaps and a wider Valider keep its name inside the key. */
@media (max-width: 379px) {
  .kb-row {
    gap: 4px;
  }
  .kb-row .key.enter {
    flex-grow: 2.5;
    font-size: var(--fs-13);
  }
}
.kb-row .key.erase {
  flex: 1.35 1 0;
}
.kb-row .key .icon {
  width: 20px;
  height: 20px;
}
.kb-clair .key {
  background: var(--key-light);
  color: var(--on-key-light);
}
.kb-encre .key {
  background: var(--key-ink);
  color: var(--on-key-ink);
}
.kb-row .key.enter {
  background: var(--lime);
  color: var(--on-lime);
}
.data-row.preview > span {
  text-align: center;
  font-size: var(--fs-13);
  color: var(--text-3);
}

@media (min-width: 720px) {
  .page {
    padding-top: 48px;
  }
  .data-row {
    padding: 18px var(--space-5);
  }
}
