:root {
  --pierre: #f3efe6;
  --encre: #1c1915;
  --accent: #1f4d3a;
  --ivoire: #fffdf8;
  --trait: #d8d0bf;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--pierre);
  color: var(--encre);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

.carte {
  width: 100%;
  max-width: 40rem;
  background: var(--ivoire);
  border: 1px solid var(--trait);
  border-top: 4px solid var(--accent);
  border-radius: 6px;
  padding: clamp(1.5rem, 5vw, 3rem);
  box-shadow: 0 1px 2px rgba(28, 25, 21, .06), 0 8px 24px rgba(28, 25, 21, .06);
}

h1, h2 {
  margin: 0 0 .75rem;
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.25rem); }

.mention, .progression {
  margin: 0 0 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.chapo { margin: 0 0 2rem; font-size: 1.125rem; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

legend {
  padding: 0;
  margin-bottom: 1.25rem;
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
  line-height: 1.3;
}

.choix { display: grid; gap: .75rem; }

.choix label {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 52px;
  padding: .75rem 1rem;
  border: 1px solid var(--trait);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}
.choix label:hover { border-color: var(--accent); }
.choix label:has(input:checked) {
  border-color: var(--accent);
  background: #eef3ef;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choix input {
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

button {
  min-height: 48px;
  min-width: 44px;
  padding: .75rem 1.5rem;
  border-radius: 6px;
  border: 2px solid var(--accent);
  font: 600 1rem system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
}
.principal { background: var(--accent); color: var(--ivoire); }
.secondaire { background: transparent; color: var(--accent); }
.principal:hover:not(:disabled) { background: #173b2c; }
.secondaire:hover { background: #eef3ef; }
button:disabled {
  background: #cfc8b8;
  border-color: #cfc8b8;
  color: #5a5348;
  cursor: not-allowed;
}

:focus-visible,
.choix input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.choix label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.score {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 4rem);
  line-height: 1.1;
}
#score { color: var(--accent); }

@media (max-width: 30rem) {
  body { padding: .75rem; align-items: flex-start; }
  .actions button { flex: 1 1 100%; }
}

@media (orientation: landscape) and (max-height: 40rem) {
  body { align-items: flex-start; }
  .choix { grid-template-columns: 1fr 1fr; }
  .actions { margin-top: 1.25rem; }
}
