#cathedrale-jeu {
  --cat-encre: #241c14;
  --cat-rouge: #9e2b20;
  --cat-or: #c8912b;
  --cat-bleu: #2b4a7a;
  --cat-vert: #497549;
  --cat-parchemin: #fdf6e6;
  --cat-pierre: #e8dfca;
  margin: 32px 0 48px;
  color: var(--cat-encre);
  font-family: Georgia, "Times New Roman", serif;
}

#cathedrale-jeu *,
#cathedrale-jeu *::before,
#cathedrale-jeu *::after {
  box-sizing: border-box;
}

#cathedrale-jeu button,
#cathedrale-jeu textarea {
  font: inherit;
}

.cat-cadre {
  border: 4px solid var(--cat-encre);
  background: var(--cat-parchemin);
  padding: clamp(18px, 3vw, 34px);
}

.cat-surtitre {
  margin: 0 0 8px;
  color: var(--cat-rouge);
  font: 800 12px/1.25 Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#cathedrale-jeu .cat-titre {
  margin: 0;
  max-width: 850px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: .96;
  letter-spacing: -.035em;
  text-transform: none;
  border: 0;
  padding: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.cat-devise {
  margin: 20px 0 0;
  padding: 14px 18px;
  border-left: 8px solid var(--cat-or);
  background: #efe6d0;
  font-size: clamp(18px, 2.2vw, 25px);
  font-weight: 700;
}

.cat-regle {
  margin: 12px 0 0;
  color: var(--cat-rouge);
  font-weight: 800;
}

.cat-entree {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 2px solid var(--cat-encre);
}

.cat-entree p {
  margin: 0;
}

.cat-entree-question {
  font: 900 clamp(24px, 3vw, 34px)/1 Arial, sans-serif;
}

.cat-actions,
.cat-reponses,
.cat-sorties {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cat-bouton {
  min-height: 46px;
  border: 3px solid var(--cat-encre);
  border-radius: 0;
  padding: 10px 18px;
  background: var(--cat-parchemin);
  color: var(--cat-encre);
  font-family: Arial, sans-serif;
  font-weight: 800;
  cursor: pointer;
}

.cat-bouton:hover,
.cat-bouton:focus-visible {
  background: var(--cat-or);
  outline: 3px solid var(--cat-bleu);
  outline-offset: 3px;
}

.cat-bouton.cat-principal {
  background: var(--cat-rouge);
  color: #fffaf0;
}

.cat-bouton[disabled] {
  cursor: default;
  opacity: .45;
}

.cat-mode {
  margin: 14px 0 0;
  min-height: 1.5em;
  font-style: italic;
}

.cat-espace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: 24px;
  align-items: start;
}

.cat-scene {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 4px solid var(--cat-encre);
  background: #d9e6ef;
  padding: 22px 18px 0;
}

.cat-scene::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 27%;
  background: #8fbf7a;
  border-top: 3px solid var(--cat-encre);
}

.cat-comete {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 4;
  width: 76px;
  height: 44px;
}

.cat-comete svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cat-facade {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  max-width: 900px;
  margin: 12px auto 0;
  padding-top: 90px;
}

.cat-rosace {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  width: 92px;
  height: 92px;
  transform: translateX(-50%);
  border: 4px solid var(--cat-encre);
  border-radius: 50%;
  background: #d6ccb5;
  color: var(--cat-encre);
  display: grid;
  place-items: center;
}

.cat-rosace svg {
  width: 74px;
  height: 74px;
}

.cat-rosace.est-allumee {
  background: var(--cat-or);
}

.cat-cle {
  position: relative;
  z-index: 2;
  width: 190px;
  margin: 0 auto -4px;
  border: 4px solid var(--cat-encre);
  padding: 10px 12px;
  background: #d6ccb5;
  text-align: center;
  font: 800 13px/1.2 Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.cat-cle.est-posee {
  background: var(--cat-or);
}

.cat-voute {
  position: relative;
  height: 72px;
  margin: 0 55px -4px;
  border: 4px solid var(--cat-encre);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: var(--cat-pierre);
}

.cat-voute::after {
  content: "problématique";
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  color: var(--cat-bleu);
  font: 800 12px/1 Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cat-architecture {
  position: relative;
  padding: 0 clamp(10px, 4vw, 48px);
}

.cat-piliers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 32px);
  align-items: end;
}

.cat-pilier {
  position: relative;
  z-index: 2;
  border: 4px solid var(--cat-encre);
  background: var(--cat-pierre);
}

.cat-pilier h3 {
  margin: 0;
  min-height: 84px;
  padding: clamp(7px, 1.4vw, 12px);
  border-bottom: 4px solid var(--cat-encre);
  background: var(--cat-bleu);
  color: #fffaf0;
  font: 800 clamp(11px, 1.45vw, 15px)/1.25 Arial, sans-serif;
}

.cat-assises {
  display: flex;
  flex-direction: column-reverse;
}

.cat-assise {
  width: 100%;
  min-height: 106px;
  border: 0;
  border-top: 3px solid var(--cat-encre);
  border-radius: 0;
  padding: clamp(7px, 1.4vw, 12px);
  background: var(--cat-parchemin);
  color: var(--cat-encre);
  text-align: left;
  cursor: default;
}

.cat-assise:first-child {
  border-top: 0;
}

.cat-assise.est-courante {
  background: var(--cat-or);
  cursor: pointer;
}

.cat-assise.est-posee {
  background: #c8d7b7;
}

.cat-assise.est-ouverte {
  background: #f2d6cf;
}

.cat-assise-rang {
  display: block;
  margin-bottom: 5px;
  color: var(--cat-rouge);
  font: 900 12px/1 Arial, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.cat-assise-titre {
  display: block;
  font: 800 clamp(10px, 1.35vw, 14px)/1.25 Arial, sans-serif;
}

.cat-arc {
  position: absolute;
  z-index: 1;
  bottom: 26px;
  width: 108px;
  height: 210px;
  border: 4px solid var(--cat-encre);
  border-bottom: 0;
  border-radius: 54px 54px 0 0;
  background: transparent;
}

.cat-arc.un {
  left: 26%;
  transform: rotate(-8deg);
}

.cat-arc.deux {
  right: 26%;
  transform: rotate(8deg);
}

.cat-arc.est-dessine {
  border-color: var(--cat-rouge);
}

.cat-fondations {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: -4px 0 0;
  border: 4px solid var(--cat-encre);
  background: var(--cat-pierre);
}

.cat-fondation {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-right: 3px solid var(--cat-encre);
  text-align: center;
  font: 800 12px/1.2 Arial, sans-serif;
}

.cat-fondation:last-child {
  border-right: 0;
}

.cat-legende {
  position: relative;
  z-index: 3;
  margin: 16px 0 12px;
  text-align: center;
  font-style: italic;
}

.cat-lutrin {
  position: relative;
  display: grid;
  grid-template-columns: minmax(175px, .42fr) minmax(0, 1fr);
  gap: 10px 28px;
  border: 4px solid var(--cat-encre);
  border-left: 12px solid var(--cat-or);
  background:
    linear-gradient(90deg, rgba(200,145,43,.13), transparent 38%),
    var(--cat-parchemin);
  padding: 20px 24px;
  box-shadow: inset 0 0 0 3px rgba(43,74,122,.16);
}

.cat-lutrin::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--cat-bleu);
  opacity: .7;
}

.cat-lutrin h3,
.cat-dialogue h3 {
  margin: 0 0 10px;
  color: var(--cat-rouge);
  font: 900 16px/1.2 Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cat-lutrin p {
  margin: 0 0 12px;
}

.cat-lutrin ol {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lutrin;
}

.cat-lutrin ol li {
  position: relative;
  min-height: 48px;
  margin: 0;
  border-top: 2px solid var(--cat-bleu);
  padding: 9px 8px 5px 34px;
  counter-increment: lutrin;
}

.cat-lutrin ol li::before {
  content: counter(lutrin);
  position: absolute;
  left: 0;
  top: 7px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid var(--cat-encre);
  background: var(--cat-or);
  color: var(--cat-encre);
  font: 900 12px/1 Arial, sans-serif;
}

.cat-lutrin li + li {
  margin-top: 0;
}

.cat-lutrin > p:first-of-type {
  grid-column: 1;
}

.cat-lutrin > p:last-child {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  border-top: 2px solid var(--cat-encre);
  padding-top: 12px;
}

.cat-dialogue {
  grid-column: 1 / -1;
  display: none;
  border: 4px solid var(--cat-encre);
  border-left: 12px solid var(--cat-rouge);
  background: var(--cat-parchemin);
  padding: clamp(16px, 3vw, 28px);
}

.cat-dialogue.est-visible {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
  gap: 22px;
}

.cat-dialogue h3 {
  grid-column: 1 / -1;
  font-size: 20px;
}

.cat-ecriture label {
  display: block;
  margin-bottom: 8px;
  font-family: Arial, sans-serif;
  font-weight: 800;
}

.cat-ecriture textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 3px solid var(--cat-encre);
  border-radius: 0;
  padding: 14px;
  background: #fffdf6;
  color: var(--cat-encre);
  line-height: 1.5;
}

.cat-ecriture small {
  display: block;
  margin-top: 7px;
  font-style: italic;
}

.cat-diagnostic {
  border: 3px solid var(--cat-bleu);
  padding: 16px;
  background: #edf2f6;
}

.cat-compteur {
  margin: 0 0 8px;
  color: var(--cat-bleu);
  font: 800 12px/1 Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cat-question {
  min-height: 74px;
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 700;
}

.cat-retour {
  display: none;
  margin-top: 14px;
  border-top: 2px solid var(--cat-bleu);
  padding-top: 12px;
}

.cat-retour.est-visible {
  display: block;
}

.cat-retour p {
  margin: 0 0 8px;
}

.cat-gargouille {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--cat-bleu);
  font-weight: 700;
}

.cat-gargouille svg {
  flex: 0 0 54px;
  width: 54px;
  height: 45px;
}

.cat-statut-final {
  margin-top: 12px;
  padding: 12px;
  border: 3px solid var(--cat-or);
  background: #fff8df;
  font-weight: 700;
}

.cat-officiel {
  margin-top: 18px;
  border: 3px solid var(--cat-bleu);
  background: #eef3f8;
  padding: 14px 18px;
}

.cat-officiel summary {
  cursor: pointer;
  color: var(--cat-bleu);
  font-family: Arial, sans-serif;
  font-weight: 900;
}

.cat-officiel p {
  margin: 12px 0 0;
}

/* Habillage architectural : les rectangles deviennent des formes médiévales. */
.cat-cadre {
  position: relative;
  border: 0;
  outline: 3px solid var(--cat-encre);
  outline-offset: -7px;
  box-shadow:
    inset 0 0 0 11px var(--cat-parchemin),
    inset 0 0 0 14px var(--cat-bleu),
    inset 0 0 0 18px var(--cat-parchemin),
    inset 0 0 0 20px var(--cat-or);
}

.cat-cadre::before,
.cat-cadre::after {
  content: "◆";
  position: absolute;
  z-index: 8;
  top: 15px;
  color: var(--cat-or);
  font-size: 17px;
  text-shadow: 1px 1px 0 var(--cat-encre);
}

.cat-cadre::before { left: 17px; }
.cat-cadre::after { right: 17px; }

.cat-devise,
.cat-regle,
.cat-mode {
  clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 13px 100%, 0 50%);
}

.cat-devise {
  border-left: 0;
  padding-inline: 28px;
  box-shadow: inset 0 0 0 2px rgba(36,28,20,.24);
}

.cat-regle {
  display: inline-block;
  padding: 10px 25px;
  background: #f7eed9;
}

.cat-bouton {
  border-radius: 46% 46% 8px 8px / 34% 34% 8px 8px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(36,28,20,.12) 48% 52%, transparent 53%),
    var(--cat-parchemin);
  box-shadow:
    inset 0 -5px 0 rgba(36,28,20,.13),
    2px 3px 0 rgba(36,28,20,.22);
}

.cat-bouton.cat-principal {
  background:
    linear-gradient(90deg, transparent 47%, rgba(255,255,255,.18) 48% 52%, transparent 53%),
    var(--cat-bleu);
}

.cat-scene {
  border-radius: 96px 96px 8px 8px / 42px 42px 8px 8px;
  box-shadow:
    inset 0 0 0 7px rgba(253,246,230,.72),
    inset 0 0 0 10px var(--cat-bleu);
}

.cat-facade {
  filter: drop-shadow(0 7px 0 rgba(36,28,20,.14));
}

.cat-facade::before,
.cat-facade::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 82px;
  bottom: 1px;
  width: clamp(13px, 2.2vw, 22px);
  border: 3px solid var(--cat-encre);
  border-radius: 48% 48% 6px 6px / 16px 16px 6px 6px;
  background:
    linear-gradient(90deg, rgba(36,28,20,.2), transparent 28% 68%, rgba(36,28,20,.22)),
    repeating-linear-gradient(0deg, var(--cat-pierre) 0 42px, var(--cat-or) 42px 48px);
  box-shadow: 0 -8px 0 -2px var(--cat-or), 0 7px 0 -2px var(--cat-or);
}

.cat-facade::before { left: 4px; }
.cat-facade::after { right: 4px; }

.cat-cle {
  width: 172px;
  border: 0;
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
  padding: 13px 20px 17px;
  background:
    linear-gradient(90deg, rgba(43,74,122,.18), transparent 28% 72%, rgba(43,74,122,.18)),
    var(--cat-pierre);
  box-shadow: inset 0 0 0 4px var(--cat-encre);
}

.cat-voute {
  border-radius: 52% 52% 0 0 / 100% 100% 0 0;
  background:
    repeating-radial-gradient(ellipse at 50% 100%, transparent 0 19px, rgba(36,28,20,.12) 20px 22px),
    var(--cat-pierre);
}

.cat-pilier {
  border: 0;
  border-radius: 22px 22px 5px 5px;
  background:
    linear-gradient(90deg, rgba(36,28,20,.16), transparent 14% 86%, rgba(36,28,20,.16)),
    var(--cat-pierre);
  box-shadow:
    inset 0 0 0 4px var(--cat-encre),
    -7px 0 0 -3px var(--cat-or),
    7px 0 0 -3px var(--cat-or);
}

.cat-pilier::before,
.cat-pilier::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: -7px;
  right: -7px;
  height: 11px;
  border: 3px solid var(--cat-encre);
  background: var(--cat-or);
}

.cat-pilier::before {
  top: -8px;
  clip-path: polygon(8% 100%, 0 0, 100% 0, 92% 100%);
}

.cat-pilier::after {
  bottom: -8px;
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}

.cat-pilier h3 {
  min-height: 102px;
  padding-bottom: 25px;
  border-bottom-color: var(--cat-or);
  border-radius: 28px 28px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  background:
    linear-gradient(90deg, rgba(255,255,255,.14), transparent 19% 81%, rgba(0,0,0,.13)),
    var(--cat-bleu);
}

.cat-assise {
  width: calc(100% - 8px);
  margin: 3px 4px 0;
  clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 13px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 13px), 0 13px);
  background:
    linear-gradient(105deg, rgba(255,255,255,.26), transparent 31%),
    var(--cat-pierre);
  box-shadow: inset 0 0 0 3px var(--cat-encre);
}

.cat-assise:nth-child(even) {
  width: calc(100% - 16px);
  margin-inline: 8px;
}

.cat-assise.est-courante {
  background:
    linear-gradient(105deg, rgba(255,255,255,.28), transparent 31%),
    var(--cat-or);
}

.cat-assise.est-posee {
  background:
    linear-gradient(105deg, rgba(255,255,255,.28), transparent 31%),
    #c8d7b7;
}

.cat-assise.est-ouverte {
  background:
    linear-gradient(105deg, rgba(255,255,255,.28), transparent 31%),
    #f2d6cf;
}

.cat-fondations {
  grid-template-columns: .72fr 1.34fr .76fr 1.08fr 1.36fr;
  gap: 3px;
  border: 0;
  border-radius: 18px 18px 5px 5px;
  padding: 5px;
  background: var(--cat-encre);
  box-shadow: 0 6px 0 rgba(36,28,20,.2);
}

.cat-fondation {
  border: 0;
  clip-path: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%);
  padding-inline: clamp(5px, 1vw, 10px);
  font-size: clamp(9px, 1.1vw, 12px);
  background:
    linear-gradient(110deg, rgba(255,255,255,.32), transparent 32%),
    var(--cat-pierre);
}

.cat-fondation:nth-child(even) {
  background:
    linear-gradient(110deg, rgba(255,255,255,.32), transparent 32%),
    #d8c69d;
}

.cat-lutrin {
  border-radius: 5px 5px 34px 34px / 5px 5px 18px 18px;
  clip-path: polygon(14px 0, calc(50% - 2px) 9px, 50% 0, calc(50% + 2px) 9px, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 12px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 12px), 0 14px);
  background:
    linear-gradient(90deg, transparent 49.3%, rgba(36,28,20,.19) 49.6% 50.4%, transparent 50.7%),
    linear-gradient(90deg, rgba(200,145,43,.13), transparent 38%),
    var(--cat-parchemin);
}

.cat-lutrin h3::before {
  content: "✦";
  margin-right: 7px;
  color: var(--cat-or);
}

.cat-dialogue {
  border-radius: 32px 32px 6px 6px / 18px 18px 6px 6px;
  box-shadow: inset 0 0 0 5px rgba(200,145,43,.16);
}

.cat-ecriture textarea,
.cat-diagnostic,
.cat-statut-final,
.cat-officiel {
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

.cat-officiel {
  background:
    linear-gradient(90deg, rgba(43,74,122,.1), transparent 38%),
    #eef3f8;
}

@media (max-width: 900px) {
  .cat-scene {
    overflow-x: hidden;
  }

  .cat-lutrin {
    order: 2;
  }

  .cat-dialogue.est-visible {
    grid-template-columns: 1fr;
  }

  .cat-dialogue h3 {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .cat-cadre {
    padding: 16px 12px;
  }

  .cat-entree {
    grid-template-columns: 1fr;
  }

  .cat-lutrin {
    grid-template-columns: 1fr;
  }

  .cat-lutrin ol {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .cat-lutrin > p:first-of-type,
  .cat-lutrin > p:last-child {
    grid-column: 1;
  }

  .cat-facade {
    min-width: 640px;
  }

  #cathedrale-jeu .cat-titre {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cathedrale-jeu *,
  #cathedrale-jeu *::before,
  #cathedrale-jeu *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  #cathedrale-jeu .cat-entree,
  #cathedrale-jeu .cat-dialogue {
    display: none !important;
  }
}

/* Façade médiévale raffinée — habillage du jeu, sans changer son parcours. */
#cathedrale-jeu {
  --cat-bleu: #174d88;
  --cat-bleu-nuit: #102f55;
  --cat-bleu-clair: #87a8c3;
  --cat-pierre-claire: #f2ead8;
  --cat-pierre-sombre: #cbbd9f;
  font-family: "Spectral", Georgia, "Times New Roman", serif;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

#cathedrale-jeu .cat-cadre {
  position: relative;
  overflow: hidden;
  border: 7px double var(--cat-bleu-nuit);
  outline: 2px solid var(--cat-or);
  outline-offset: -13px;
  background:
    radial-gradient(circle at 12px 12px, rgba(200,145,43,.18) 0 1.5px, transparent 2px) 0 0/24px 24px,
    linear-gradient(135deg, rgba(255,255,255,.66), rgba(235,225,202,.88)),
    var(--cat-parchemin);
  box-shadow: 0 18px 46px rgba(16,47,85,.22), inset 0 0 42px rgba(113,84,39,.12);
}

#cathedrale-jeu .cat-cadre::before,
#cathedrale-jeu .cat-cadre::after {
  content: "◆";
  position: absolute;
  z-index: 5;
  top: 10px;
  color: var(--cat-or);
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 1px 0 var(--cat-encre);
}

#cathedrale-jeu .cat-cadre::before { left: 15px; }
#cathedrale-jeu .cat-cadre::after { right: 15px; }

#cathedrale-jeu .cat-surtitre {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cat-bleu);
  font-family: "Inter", Arial, sans-serif;
  font-weight: 800;
}

#cathedrale-jeu .cat-surtitre::before,
#cathedrale-jeu .cat-surtitre::after {
  content: "";
  width: 42px;
  height: 3px;
  background: linear-gradient(90deg,var(--cat-or),var(--cat-rouge));
}

#cathedrale-jeu .cat-titre {
  color: var(--cat-bleu-nuit);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  line-height: .93;
  letter-spacing: -.04em;
  text-shadow: 0 2px 0 #fff, 0 5px 0 rgba(200,145,43,.22);
}

#cathedrale-jeu .cat-devise {
  position: relative;
  border: 1px solid #ae9870;
  border-left: 10px solid var(--cat-or);
  background: linear-gradient(90deg,#f4e6bf,#fff8e8 68%,#ead9ad);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.45), 0 4px 0 rgba(36,28,20,.09);
  font-family: "Spectral", Georgia, serif;
  font-style: italic;
  font-weight: 650;
  letter-spacing: .005em;
}

#cathedrale-jeu .cat-regle {
  display: inline-block;
  padding: 7px 11px;
  border-bottom: 2px solid var(--cat-rouge);
  background: rgba(255,255,255,.58);
  font-family: "Inter", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: .045em;
  text-transform: uppercase;
}

#cathedrale-jeu .cat-entree {
  border: 2px solid var(--cat-bleu-nuit);
  border-top: 7px solid var(--cat-bleu);
  padding: 18px;
  background:
    linear-gradient(90deg,transparent 0 49%,rgba(23,77,136,.08) 49% 51%,transparent 51%),
    #edf3f8;
  box-shadow: inset 0 0 0 4px #fff, 0 6px 14px rgba(16,47,85,.11);
}

#cathedrale-jeu .cat-entree-question {
  color: var(--cat-bleu-nuit);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  letter-spacing: -.025em;
}

#cathedrale-jeu .cat-bouton {
  position: relative;
  border-color: var(--cat-bleu-nuit);
  clip-path: polygon(7px 0,calc(100% - 7px) 0,100% 7px,100% calc(100% - 7px),calc(100% - 7px) 100%,7px 100%,0 calc(100% - 7px),0 7px);
  background: linear-gradient(#fffdf5,#e9dfc9);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45), 0 3px 0 rgba(36,28,20,.25);
  transition: transform .16s ease, background .16s ease, color .16s ease;
  font-family: "Inter", Arial, sans-serif;
  letter-spacing: .02em;
}

#cathedrale-jeu .cat-bouton:hover,
#cathedrale-jeu .cat-bouton:focus-visible { transform: translateY(-2px); }

#cathedrale-jeu .cat-bouton.cat-principal {
  background: linear-gradient(#2869a6,var(--cat-bleu-nuit));
  color: #fff8e8;
  text-shadow: 0 1px 0 #000;
}

#cathedrale-jeu .cat-mode {
  padding-left: 14px;
  border-left: 4px solid var(--cat-or);
  color: #5c4a31;
  font-family: "Spectral", Georgia, serif;
}

#cathedrale-jeu .cat-scene {
  border: 7px double var(--cat-bleu-nuit);
  background:
    radial-gradient(circle at 78% 16%,rgba(255,247,204,.96) 0 30px,rgba(200,145,43,.46) 31px 36px,transparent 37px),
    linear-gradient(#9fc0d5 0,#dbe8ed 58%,#c9d9d6 100%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.38), 0 10px 24px rgba(16,47,85,.18);
}

#cathedrale-jeu .cat-scene::before {
  height: 22%;
  border-top: 4px solid var(--cat-bleu-nuit);
  background:
    linear-gradient(135deg,transparent 0 18px,rgba(23,77,136,.18) 19px 21px,transparent 22px) 0 0/44px 24px,
    #799572;
}

#cathedrale-jeu .cat-scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 4%;
  right: 4%;
  bottom: 20%;
  height: 28px;
  border: 3px solid var(--cat-encre);
  background: repeating-linear-gradient(90deg,#d4c8ae 0 45px,#af9f80 46px 49px);
  opacity: .75;
}

#cathedrale-jeu .cat-comete {
  filter: drop-shadow(0 0 6px rgba(200,145,43,.55));
  animation: cat-comete-respire 8s ease-in-out infinite;
}

@keyframes cat-comete-respire {
  0%,100% { transform: translate(0,0) rotate(-2deg); }
  50% { transform: translate(-11px,6px) rotate(2deg); }
}

#cathedrale-jeu .cat-facade {
  padding: 90px 20px 0;
  border-left: 5px solid var(--cat-encre);
  border-right: 5px solid var(--cat-encre);
  background:
    linear-gradient(90deg,rgba(36,28,20,.16) 1px,transparent 1px) 0 0/54px 28px,
    linear-gradient(rgba(36,28,20,.16) 1px,transparent 1px) 0 0/100% 28px,
    linear-gradient(90deg,var(--cat-pierre-sombre),var(--cat-pierre-claire) 18%,#e7ddc8 50%,var(--cat-pierre-claire) 82%,var(--cat-pierre-sombre));
  box-shadow: 12px 0 0 rgba(16,47,85,.2), -12px 0 0 rgba(16,47,85,.2);
}

#cathedrale-jeu .cat-rosace {
  border: 7px double var(--cat-bleu-nuit);
  background: radial-gradient(circle,#f7edd2 0 24%,#87a8c3 25% 52%,#d8c9a7 53%);
  box-shadow: 0 0 0 8px rgba(200,145,43,.4), 0 7px 14px rgba(36,28,20,.28);
}

#cathedrale-jeu .cat-rosace.est-allumee {
  background: radial-gradient(circle,#fff7bd 0 25%,#e0a93b 26% 53%,#f6df89 54%);
  box-shadow: 0 0 0 8px rgba(200,145,43,.58), 0 0 32px rgba(224,169,59,.85);
}

#cathedrale-jeu .cat-cle {
  border: 6px double var(--cat-bleu-nuit);
  background: linear-gradient(#e9dfc8,#c9b995);
  box-shadow: 0 5px 0 rgba(36,28,20,.2);
}

#cathedrale-jeu .cat-voute {
  border-width: 7px;
  border-color: var(--cat-bleu-nuit);
  background:
    repeating-radial-gradient(ellipse at 50% 100%,#e8dfca 0 17px,#b9aa8d 18px 20px,#efe6d0 21px 37px);
  box-shadow: inset 0 10px 18px rgba(36,28,20,.12);
}

#cathedrale-jeu .cat-voute::after {
  bottom: 9px;
  padding: 4px 9px;
  border: 1px solid var(--cat-bleu);
  background: #f9f2df;
}

#cathedrale-jeu .cat-pilier {
  border: 6px double var(--cat-bleu-nuit);
  background:
    linear-gradient(90deg,rgba(36,28,20,.12) 1px,transparent 1px) 0 0/42px 100%,
    var(--cat-pierre);
  box-shadow: 8px 7px 0 rgba(16,47,85,.16);
}

#cathedrale-jeu .cat-pilier h3 {
  border-bottom: 4px solid var(--cat-or);
  background: linear-gradient(135deg,var(--cat-bleu),var(--cat-bleu-nuit));
  color: #fff7df;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  letter-spacing: -.005em;
  text-shadow: 0 1px 0 #000;
}

#cathedrale-jeu .cat-assise {
  background:
    linear-gradient(90deg,rgba(36,28,20,.08) 1px,transparent 1px) 0 0/34px 100%,
    linear-gradient(#fffaf0,#e9dfca);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

#cathedrale-jeu .cat-assise-rang {
  font-family: "Inter", Arial, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
}

#cathedrale-jeu .cat-assise-titre {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  line-height: 1.2;
}

#cathedrale-jeu .cat-assise.est-courante {
  background: linear-gradient(135deg,#f7e5a3,var(--cat-or));
  box-shadow: inset 0 0 0 4px #fff4c8;
  transform: translateY(-3px);
}

#cathedrale-jeu .cat-assise.est-posee {
  background: linear-gradient(135deg,#d7e5ef,#8fb4cf);
}

#cathedrale-jeu .cat-assise.est-ouverte {
  background: linear-gradient(135deg,#f5e2dd,#d9a79d);
}

#cathedrale-jeu .cat-arc {
  border-width: 7px;
  border-color: #7f725b;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.38);
}

#cathedrale-jeu .cat-arc.est-dessine {
  border-color: var(--cat-bleu);
  filter: drop-shadow(0 0 5px rgba(23,77,136,.45));
}

#cathedrale-jeu .cat-fondations {
  border: 7px double var(--cat-bleu-nuit);
  background: linear-gradient(#d7c9aa,#b8a582);
}

#cathedrale-jeu .cat-fondation {
  background: linear-gradient(135deg,rgba(255,255,255,.32),transparent 65%);
  font-family: "Inter", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: .02em;
}

#cathedrale-jeu .cat-legende {
  margin: 18px 20px 14px;
  padding: 8px 12px;
  background: rgba(255,250,238,.8);
  border: 1px solid #ad9972;
  font-family: "Spectral", Georgia, serif;
}

#cathedrale-jeu .cat-lutrin {
  position: relative;
  border: 7px double var(--cat-bleu-nuit);
  background:
    linear-gradient(90deg,transparent 48%,rgba(122,74,42,.16) 49% 51%,transparent 52%),
    linear-gradient(#fffaf0,#e9dfca);
  box-shadow: 8px 10px 0 rgba(16,47,85,.15);
}

#cathedrale-jeu .cat-lutrin::before {
  content: "✦";
  position: absolute;
  right: 13px;
  top: 10px;
  color: var(--cat-or);
  font-size: 26px;
}

#cathedrale-jeu .cat-lutrin h3,
#cathedrale-jeu .cat-dialogue h3 {
  color: var(--cat-bleu);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  letter-spacing: .015em;
}

#cathedrale-jeu .cat-dialogue {
  border: 7px double var(--cat-bleu-nuit);
  border-left: 14px solid var(--cat-bleu);
  background:
    linear-gradient(90deg,rgba(23,77,136,.045) 1px,transparent 1px) 0 0/28px 100%,
    #fffaf0;
  box-shadow: 0 12px 26px rgba(16,47,85,.15);
}

#cathedrale-jeu .cat-ecriture textarea {
  border: 5px double var(--cat-bleu-nuit);
  background:
    repeating-linear-gradient(#fffdf6 0 31px,#d9e2e8 32px,#fffdf6 33px);
  box-shadow: inset 9px 0 0 rgba(158,43,32,.1);
  font-family: "Spectral", Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
}

#cathedrale-jeu .cat-diagnostic {
  border: 6px double var(--cat-bleu);
  background: linear-gradient(135deg,#edf3f8,#dce8f1);
  box-shadow: inset 0 0 0 3px #fff;
}

#cathedrale-jeu .cat-question {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.28;
}

#cathedrale-jeu .cat-compteur,
#cathedrale-jeu .cat-ecriture label,
#cathedrale-jeu .cat-officiel summary {
  font-family: "Inter", Arial, sans-serif;
}

#cathedrale-jeu .cat-officiel {
  border: 6px double var(--cat-bleu);
  background: linear-gradient(90deg,#dfe8f1,#f5f8fb);
}

#cathedrale-jeu .cat-definition {
  max-width: 760px;
  margin: 16px auto 12px;
  padding: 12px 15px;
  border: 1px solid #ad9972;
  border-left: 6px solid var(--cat-or);
  background: rgba(255,250,238,.88);
  color: var(--cat-encre);
  font-family: "Spectral", Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
}

#cathedrale-jeu .cat-son-ligne {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}

#cathedrale-jeu .cat-son-bt {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  padding: .48rem .82rem;
  border: 2px solid var(--cat-bleu-nuit);
  background: #f6f1e4;
  color: var(--cat-bleu-nuit);
  font: 800 .9rem/1.2 "Inter", Arial, sans-serif;
}

#cathedrale-jeu .cat-son-bt svg {
  width: 26px;
  height: 20px;
  flex: 0 0 auto;
}

#cathedrale-jeu .cat-son-bt .cat-son-ondes { opacity: 0; }

#cathedrale-jeu .cat-son-bt[aria-pressed="true"] {
  background: var(--cat-bleu);
  color: #fff;
}

#cathedrale-jeu .cat-son-bt[aria-pressed="true"] .cat-son-ondes { opacity: 1; }
#cathedrale-jeu .cat-son-bt[aria-pressed="true"] .cat-son-barre { opacity: 0; }

#cathedrale-jeu .cat-son-dit {
  max-width: 430px;
  color: #66573f;
  font-family: "Spectral", Georgia, serif;
  font-size: .9rem;
  font-style: italic;
}

@media (max-width: 620px) {
  #cathedrale-jeu .cat-cadre { outline-offset: -10px; }
  #cathedrale-jeu .cat-surtitre::before,
  #cathedrale-jeu .cat-surtitre::after { width: 20px; }
  #cathedrale-jeu .cat-entree { padding: 14px; }
}

/* Peau finale du jeu : formes architecturales, après les règles historiques. */
#cathedrale-jeu .cat-devise {
  border-left: 0;
  padding-inline: 30px;
  clip-path: polygon(14px 0,calc(100% - 14px) 0,100% 50%,calc(100% - 14px) 100%,14px 100%,0 50%);
}

#cathedrale-jeu .cat-regle,
#cathedrale-jeu .cat-mode {
  clip-path: polygon(12px 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,12px 100%,0 50%);
}

#cathedrale-jeu .cat-bouton {
  clip-path: none;
  border-radius: 48% 48% 8px 8px / 35% 35% 8px 8px;
}

#cathedrale-jeu .cat-son-bt {
  border: 3px double var(--cat-bleu-nuit);
  border-radius: 26px 26px 7px 7px / 15px 15px 7px 7px;
  background: linear-gradient(#fffdf5,#e4d6ba);
  box-shadow: 0 3px 0 rgba(36,28,20,.2);
}

#cathedrale-jeu .cat-scene {
  border-radius: 92px 92px 8px 8px / 42px 42px 8px 8px;
}

#cathedrale-jeu .cat-facade {
  border-left: 0;
  border-right: 0;
  padding-inline: clamp(24px,5vw,48px);
}

#cathedrale-jeu .cat-cle {
  width: 172px;
  border: 0;
  clip-path: polygon(22% 0,78% 0,100% 100%,0 100%);
  background: linear-gradient(90deg,#b9a987,#eee4ce 28% 72%,#b9a987);
  box-shadow: inset 0 0 0 5px var(--cat-bleu-nuit),0 6px 0 rgba(36,28,20,.2);
}

#cathedrale-jeu .cat-pilier {
  border: 0;
  border-radius: 27px 27px 5px 5px;
  background:
    linear-gradient(90deg,rgba(36,28,20,.18),transparent 16% 84%,rgba(36,28,20,.18)),
    var(--cat-pierre);
  box-shadow:
    inset 0 0 0 5px var(--cat-bleu-nuit),
    -7px 0 0 -3px var(--cat-or),
    7px 0 0 -3px var(--cat-or),
    8px 7px 0 rgba(16,47,85,.12);
}

#cathedrale-jeu .cat-pilier h3 {
  min-height: 102px;
  padding-bottom: 25px;
  border-radius: 24px 24px 0 0;
  clip-path: polygon(0 0,100% 0,100% 82%,50% 100%,0 82%);
}

#cathedrale-jeu .cat-assise {
  width: calc(100% - 8px);
  margin: 3px 4px 0;
  clip-path: polygon(13px 0,calc(100% - 13px) 0,100% 13px,100% calc(100% - 13px),calc(100% - 13px) 100%,13px 100%,0 calc(100% - 13px),0 13px);
  background:
    linear-gradient(105deg,rgba(255,255,255,.32),transparent 31%),
    linear-gradient(#fffaf0,#e5dac2);
  box-shadow: inset 0 0 0 3px var(--cat-encre);
}

#cathedrale-jeu .cat-assise:nth-child(even) {
  width: calc(100% - 16px);
  margin-inline: 8px;
}

#cathedrale-jeu .cat-assise.est-courante {
  background: linear-gradient(135deg,#f7e5a3,var(--cat-or));
}

#cathedrale-jeu .cat-assise.est-posee {
  background: linear-gradient(135deg,#d7e5ef,#8fb4cf);
}

#cathedrale-jeu .cat-assise.est-ouverte {
  background: linear-gradient(135deg,#f5e2dd,#d9a79d);
}

#cathedrale-jeu .cat-fondations {
  grid-template-columns: .72fr 1.34fr .76fr 1.08fr 1.36fr;
  gap: 3px;
  border: 0;
  border-radius: 18px 18px 5px 5px;
  padding: 5px;
  background: var(--cat-encre);
  box-shadow: 0 7px 0 rgba(36,28,20,.2);
}

#cathedrale-jeu .cat-fondation {
  padding-inline: clamp(5px,1vw,10px);
  border: 0;
  clip-path: polygon(14% 0,86% 0,100% 50%,86% 100%,14% 100%,0 50%);
  background: linear-gradient(110deg,#f2e8cf,#c4b18c);
  font-size: clamp(9px,1.1vw,12px);
}

#cathedrale-jeu .cat-fondation:nth-child(even) {
  background: linear-gradient(110deg,#e8d9b9,#ad956a);
}

#cathedrale-jeu .cat-lutrin {
  clip-path: polygon(14px 0,calc(50% - 3px) 9px,50% 0,calc(50% + 3px) 9px,calc(100% - 14px) 0,100% 14px,100% calc(100% - 12px),calc(100% - 14px) 100%,14px 100%,0 calc(100% - 12px),0 14px);
  border-radius: 5px 5px 34px 34px / 5px 5px 18px 18px;
}

#cathedrale-jeu .cat-dialogue,
#cathedrale-jeu .cat-ecriture textarea,
#cathedrale-jeu .cat-diagnostic,
#cathedrale-jeu .cat-statut-final,
#cathedrale-jeu .cat-officiel {
  clip-path: polygon(11px 0,calc(100% - 11px) 0,100% 11px,100% calc(100% - 11px),calc(100% - 11px) 100%,11px 100%,0 calc(100% - 11px),0 11px);
}

/*
 * Écriture du jeu : inspiration romane, contemporaine de Chrétien.
 * On évoque l'inscription lapidaire et les capitales onciales sans employer
 * une gothique tardive. Les textes longs gardent une lecture scolaire nette.
 */
#cathedrale-jeu {
  --cat-ecriture-monumentale: "Fraunces", Georgia, serif;
  --cat-ecriture-livre: "Spectral", Georgia, serif;
  --cat-ecriture-service: "Inter", Arial, sans-serif;
}

#cathedrale-jeu .cat-titre,
#cathedrale-jeu .cat-pilier h3,
#cathedrale-jeu .cat-lutrin h3,
#cathedrale-jeu .cat-dialogue h3,
#cathedrale-jeu .cat-entree-question {
  font-family: var(--cat-ecriture-monumentale);
  font-variant-caps: small-caps;
  font-feature-settings: "smcp" 1, "c2sc" 0;
  font-weight: 700;
}

#cathedrale-jeu .cat-titre {
  letter-spacing: .018em;
}

#cathedrale-jeu .cat-titre::first-letter {
  color: var(--cat-rouge);
  font-size: 1.18em;
  line-height: .8;
  text-shadow: 1px 1px 0 var(--cat-or);
}

#cathedrale-jeu .cat-surtitre,
#cathedrale-jeu .cat-regle,
#cathedrale-jeu .cat-cle,
#cathedrale-jeu .cat-assise-rang,
#cathedrale-jeu .cat-compteur,
#cathedrale-jeu .cat-fondation {
  font-family: var(--cat-ecriture-monumentale);
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp" 1, "c2sc" 1;
  letter-spacing: .065em;
  font-weight: 700;
}

#cathedrale-jeu .cat-pilier h3 {
  letter-spacing: .025em;
  line-height: 1.08;
}

#cathedrale-jeu .cat-devise,
#cathedrale-jeu .cat-mode,
#cathedrale-jeu .cat-assise-titre,
#cathedrale-jeu .cat-question,
#cathedrale-jeu .cat-definition,
#cathedrale-jeu .cat-lutrin,
#cathedrale-jeu .cat-dialogue,
#cathedrale-jeu .cat-officiel p,
#cathedrale-jeu .cat-son-dit,
#cathedrale-jeu .cat-ecriture textarea {
  font-family: var(--cat-ecriture-livre);
}

#cathedrale-jeu .cat-bouton,
#cathedrale-jeu .cat-son-bt,
#cathedrale-jeu .cat-ecriture label,
#cathedrale-jeu .cat-officiel summary {
  font-family: var(--cat-ecriture-monumentale);
  font-variant-caps: small-caps;
  font-feature-settings: "smcp" 1, "c2sc" 0;
  letter-spacing: .035em;
  font-weight: 700;
}

@media (max-width: 620px) {
  #cathedrale-jeu .cat-surtitre,
  #cathedrale-jeu .cat-regle,
  #cathedrale-jeu .cat-cle,
  #cathedrale-jeu .cat-assise-rang,
  #cathedrale-jeu .cat-compteur,
  #cathedrale-jeu .cat-fondation {
    letter-spacing: .035em;
  }
}
