:root {
  --bg-warm-creme: #f7f2e9;
  --primary-dark: #08233f;
  --primary-gold: #8f631c;
  --transition-smooth: cubic-bezier(.2, .8, .2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --module-cream: #f7f2e9;
  --module-paper: #fffdf9;
  --module-navy: #08233f;
  --module-ink: #172a3a;
  --module-muted: #62707a;
  --module-gold: #8f631c;
  --module-gold-light: #e5c57e;
  --module-line: rgba(23, 42, 58, .13);
  --module-serif: 'Instrument Serif', Georgia, serif;
  --module-sans: Manrope, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --card-ratio: 816 / 1524;
}

:root[data-theme='nuit'] {
  color-scheme: dark;
  --bg-warm-creme: #080e22;
  --primary-dark: #f4efe5;
  --primary-gold: #ddbd85;
  --module-cream: #080e22;
  --module-paper: #14212a;
  --module-navy: #102029;
  --module-ink: #f4efe5;
  --module-muted: #aebbc0;
  --module-gold: #ddbd85;
  --module-gold-light: #f3d295;
  --module-line: rgba(216, 205, 181, .17);
}

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

html {
  scroll-behavior: smooth;
}

body.module-page {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--module-ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(229, 197, 126, .2), transparent 27rem),
    var(--module-cream);
  font-family: var(--module-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
  transition: color .35s ease, background .35s ease;
}

body.module-page::before {
  position: fixed;
  z-index: -3;
  inset: 0;
  pointer-events: none;
  content: '';
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.module-ambient {
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}

.module-page button,
.module-page input {
  font: inherit;
}

.module-page button {
  cursor: pointer;
}

.module-page :focus-visible,
.calculator-page :focus-visible {
  outline: 3px solid #d29f42;
  outline-offset: 3px;
}

.module-page #app-container {
  width: min(calc(100% - 48px), 1120px);
  max-width: 1120px !important;
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 0 110px !important;
}

.module-page .module-header {
  width: 100%;
  max-width: none;
  margin: 0 0 34px;
  padding: 0;
  color: var(--module-ink);
  text-align: left;
  animation: module-fade-up .6s var(--ease-out-expo) both;
}

.module-header-top {
  position: relative;
  z-index: 90;
  width: 100vw;
  height: 72px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 42px calc(50% - 50vw);
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--module-line);
  background: color-mix(in srgb, var(--module-cream) 68%, transparent);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
}

.module-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.module-header-button,
.module-theme-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--module-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: .73rem;
  font-weight: 650;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.module-theme-button { width: 44px; padding: 0; }

.module-header-button svg,
.module-theme-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.module-theme-button .module-sun { display: none; }
:root[data-theme='nuit'] .module-theme-button .module-moon { display: none; }
:root[data-theme='nuit'] .module-theme-button .module-sun { display: block; }

.module-header-button:hover,
.module-theme-button:hover {
  color: var(--module-ink);
  border-color: var(--module-line);
  background: var(--module-paper);
  transform: translateY(-1px);
}

.module-page .module-back {
  position: static;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 14px;
  color: var(--module-ink);
  background: rgba(255, 253, 249, .7);
  border: 1px solid var(--module-line);
  border-radius: 999px;
  font-family: var(--module-sans);
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}

.module-page .module-back:hover {
  color: var(--module-ink);
  background: white;
  border-color: rgba(185, 135, 47, .55);
  transform: none;
}

.module-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--module-ink);
  font-family: var(--module-serif);
  font-size: 1.22rem;
  text-decoration: none;
}

.module-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--module-gold) 40%, transparent);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  transition: transform .35s var(--ease-spring);
}

.module-brand:hover img {
  transform: scale(1.06) rotate(-4deg);
}

.module-desktop-nav {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--module-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--module-paper) 58%, transparent);
}

.module-desktop-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--module-muted);
  font-size: .68rem;
  font-weight: 650;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.module-desktop-nav a:hover,
.module-desktop-nav a[aria-current='page'] {
  color: var(--module-ink);
  background: var(--module-paper);
}

.module-kicker {
  margin: 0 0 10px;
  color: var(--module-gold);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.module-page .module-header h1 {
  margin: 0 0 10px;
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .92;
  text-transform: none;
}

.module-page .module-header .intro {
  max-width: 580px;
  margin: 0;
  color: var(--module-muted);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.6;
}

.module-bottom-nav { display: none; }

.module-bottom-nav svg {
  width: 1.28rem;
  height: 1.28rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-bottom-nav a:last-child circle {
  fill: currentColor;
  stroke: none;
}

/* Atlas */
.dico-page .grid-container {
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 11px;
  margin: 0 auto 54px;
  padding: 0;
  animation: module-fade-up .7s .08s var(--ease-out-expo) both;
}

.dico-page .grid-item {
  appearance: none;
  aspect-ratio: var(--card-ratio);
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  transition: transform .28s var(--ease-spring), border-color .2s ease, box-shadow .25s ease;
}

.dico-page .grid-item:hover,
.dico-page .grid-item.selected {
  border-color: var(--module-gold);
  box-shadow: 0 14px 32px rgba(8, 35, 63, .2), 0 0 24px rgba(185, 135, 47, .18);
  transform: translateY(-6px) scale(1.03);
}

.dico-page .num-badge,
.rencontre-page .num-badge {
  display: grid;
  min-width: 23px;
  min-height: 23px;
  place-items: center;
  padding: 2px 5px;
  color: white;
  background: var(--module-navy);
  border-radius: 7px 0 0 0;
  font-size: .62rem;
}

.dico-page .result-wrapper {
  width: 100%;
  max-width: 920px;
  margin: 0 auto 45px;
  padding: 0;
  scroll-margin-top: 20px;
}

.dico-page .result-area {
  width: 100%;
  padding: clamp(26px, 5vw, 54px);
  background: var(--module-paper);
  border: 1px solid var(--module-line);
  border-top: 0;
  border-radius: 25px;
  box-shadow: 0 20px 65px rgba(8, 35, 63, .1);
  animation: module-fade-up .55s var(--ease-out-expo) both;
}

.dico-page .result-area:focus {
  outline: none;
}

.dico-page .result-header {
  align-items: center;
  gap: clamp(28px, 5vw, 55px);
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--module-line);
}

.dico-page .result-img-wrapper {
  width: clamp(150px, 24vw, 210px);
}

.dico-page .result-img {
  aspect-ratio: var(--card-ratio);
  object-fit: contain;
  border: 0;
  border-radius: 13px;
  box-shadow: none;
  filter: drop-shadow(14px 20px 26px rgba(8, 35, 63, .18));
  animation: module-card-pop .65s var(--ease-out-expo) both;
}

.dico-page .result-title {
  margin-bottom: 8px;
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .92;
  text-transform: none;
}

.dico-page .result-keywords {
  margin-bottom: 20px;
  color: var(--module-gold);
  font-family: var(--module-serif);
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: 0;
}

.dico-page .result-rep {
  color: var(--module-navy);
  background: rgba(185, 135, 47, .11);
  border-radius: 999px;
  font-size: .67rem;
  letter-spacing: .08em;
}

.dico-page .coaching-header-label {
  color: var(--module-gold);
  border: 0;
  font-size: .67rem;
}

.dico-page .coaching-list li {
  color: var(--module-muted);
  font-size: .82rem;
}

.dico-page .result-text {
  color: var(--module-muted);
  font-size: .94rem;
  line-height: 1.82;
}

.dico-page .result-question-block {
  margin-top: 38px;
  padding: 32px;
  color: white;
  background: var(--module-navy);
  border: 0;
  border-radius: 20px;
  box-shadow: none;
}

.dico-page .result-question-label {
  color: var(--module-gold-light);
  font-size: .65rem;
}

.dico-page .result-question-text {
  color: white;
  font-family: var(--module-serif);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.2;
}

.dico-page .guillemet {
  color: var(--module-gold-light);
}

.dico-page .psycho-block {
  margin-top: 18px;
  padding: 27px;
  background: #fbf8f2;
  border: 1px solid var(--module-line);
  border-radius: 20px;
}

.dico-page .psycho-label {
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.dico-page .psy-group {
  position: relative;
  padding: 23px 19px 17px;
  border: 1px solid var(--module-line);
  border-left-width: 4px;
}

.dico-page .psy-state-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 0 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.dico-page .psy-group-positive {
  background: rgba(56, 107, 135, .075);
  border-color: rgba(56, 107, 135, .2);
  border-left-color: #386b87;
}

.dico-page .psy-group-positive .psy-state-label {
  color: #2f627d;
  background: rgba(56, 107, 135, .12);
}

.dico-page .psy-group-positive strong { color: #2f627d; }

.dico-page .psy-group-excess {
  background: rgba(153, 87, 65, .075);
  border-color: rgba(153, 87, 65, .2);
  border-left-color: #995741;
}

.dico-page .psy-group-excess .psy-state-label {
  color: #8b4c38;
  background: rgba(153, 87, 65, .12);
}

.dico-page .psy-group-excess strong { color: #8b4c38; }

.dico-page .btn-scroll-up,
.rencontre-page .btn-scroll-up {
  min-height: 44px;
  margin-top: 28px;
  padding: 8px 14px;
  color: var(--module-muted);
  font-family: var(--module-sans);
  font-size: .68rem;
  letter-spacing: .07em;
}

/* Rencontre */
.rencontre-page #app-container {
  width: min(calc(100% - 48px), 1180px);
  max-width: 1180px !important;
}

.rencontre-page .duo-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  animation: module-fade-up .68s .08s var(--ease-out-expo) both;
}

.rencontre-page .player-zone {
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  background: rgba(255, 253, 249, .84);
  border: 1px solid var(--module-line);
  border-radius: 23px;
  box-shadow: 0 13px 42px rgba(8, 35, 63, .08);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.rencontre-page .player-zone:focus-within {
  border-color: color-mix(in srgb, var(--module-gold) 50%, var(--module-line));
}

.rencontre-page .player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--module-line);
}

.rencontre-page .mode-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--module-line);
  border-radius: 999px;
  background: rgba(255, 253, 249, .06);
}

.rencontre-page .mode-btn {
  min-height: 31px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--module-muted);
  background: transparent;
  font-size: .66rem;
  font-weight: 700;
  transition: color .2s ease, background .2s ease;
}

.rencontre-page .mode-btn.active {
  color: var(--module-ink);
  background: var(--module-paper);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
}

.rencontre-page .player-label {
  color: var(--module-gold);
  font-size: .68rem;
  letter-spacing: .1em;
}

.rencontre-page .input-name {
  min-height: 49px;
  margin-bottom: 10px;
  padding: 11px 14px;
  color: var(--module-ink);
  background: white;
  border: 1px solid var(--module-line);
  border-radius: 13px;
  font-size: .84rem;
  font-weight: 500;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.rencontre-page .input-name:focus {
  border-color: var(--module-gold);
  box-shadow: 0 0 0 3px rgba(185, 135, 47, .12);
}

.quick-draw {
  width: 100%;
  min-height: 50px;
  padding: 11px 18px;
  color: white;
  background: var(--module-navy);
  border: 0;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  transition: transform .2s ease, background .2s ease;
}

.quick-draw:hover {
  background: #143754;
  transform: translateY(-2px);
}

.choice-divider {
  position: relative;
  margin: 14px 0 11px;
  color: var(--module-muted);
  font-size: .62rem;
  text-align: center;
}

.choice-divider::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  content: '';
  background: var(--module-line);
}

.choice-divider span {
  position: relative;
  padding: 0 10px;
  background: var(--module-paper);
}

.rencontre-page .selector-area {
  min-height: 0;
  display: block;
  perspective: 1100px;
}

.rencontre-page .fan-container {
  --fan-card-width: 62px;
  --fan-card-half: -31px;
  --fan-radius: 245px;
  --fan-top: 10px;
  position: relative;
  width: 100%;
  height: 300px;
  display: none;
  overflow: visible;
}

.rencontre-page .fan-container.active { display: block; }

.rencontre-page .card-anchor {
  position: absolute;
  top: var(--fan-top);
  left: 50%;
  width: var(--fan-card-width);
  aspect-ratio: var(--card-ratio);
  margin-left: var(--fan-card-half);
  padding: 0;
  border: 0;
  background: transparent;
  transform: rotate(var(--angle));
  transform-origin: 50% var(--fan-radius);
  transition: z-index 0s, filter .2s ease;
}

.rencontre-page .card-visual {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: -3px 7px 16px rgba(0, 0, 0, .32);
  transition: transform .32s var(--ease-spring), box-shadow .24s ease;
}

.rencontre-page .card-anchor:hover,
.rencontre-page .card-anchor:focus-visible { z-index: 1000 !important; }

.rencontre-page .card-anchor:hover .card-visual,
.rencontre-page .card-anchor:focus-visible .card-visual {
  border-color: var(--module-gold);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .42), 0 0 32px rgba(221, 189, 133, .24);
  transform: translateY(-38px) scale(1.18);
}

.rencontre-page .grid-selector {
  max-height: none;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding: 2px;
  overflow: visible;
}

.rencontre-page .grid-item {
  appearance: none;
  aspect-ratio: var(--card-ratio);
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 7px;
  box-shadow: none;
  transition: transform .22s var(--ease-spring), border-color .2s ease, box-shadow .2s ease;
}

.rencontre-page .grid-item:hover,
.rencontre-page .grid-item.selected {
  border-color: var(--module-gold);
  box-shadow: 0 7px 18px rgba(8, 35, 63, .15);
  transform: translateY(-3px) scale(1.03);
}

.rencontre-page .has-card .quick-draw,
.rencontre-page .has-card .choice-divider {
  display: none;
}

.rencontre-page .selected-display {
  padding: 11px 0 5px;
  animation: module-card-pop .5s var(--ease-out-expo) both;
}

.rencontre-page .selected-display img {
  width: 128px;
  aspect-ratio: var(--card-ratio);
  object-fit: contain;
  margin-bottom: 14px;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  filter: drop-shadow(10px 15px 20px rgba(8, 35, 63, .16));
}

.rencontre-page .card-name-big {
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.rencontre-page .change-btn {
  min-height: 40px;
  padding: 7px 11px;
  color: var(--module-gold);
  font-family: var(--module-sans);
  font-size: .68rem;
  font-weight: 700;
}

.rencontre-page .action-area {
  position: sticky;
  bottom: 18px;
  z-index: 30;
  display: flex;
  justify-content: center;
  margin: 18px 0 0;
  padding: 0;
  pointer-events: none;
}

.rencontre-page .btn-analyze {
  min-height: 54px;
  padding: 12px 25px;
  color: white;
  background: var(--module-gold);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 15px 35px rgba(8, 35, 63, .22);
  font-size: .8rem;
  font-weight: 700;
  transition: opacity .2s ease, transform .25s var(--ease-spring);
}

.rencontre-page .btn-analyze.visible {
  transform: translateY(0);
}

.rencontre-page #result-area {
  padding: 50px 0 30px;
  animation: module-fade-up .6s var(--ease-out-expo) both;
  scroll-margin-top: 15px;
}

.rencontre-page .individual-summaries {
  gap: 14px;
  margin-bottom: 18px;
}

.rencontre-page .summary-card {
  padding: 22px;
  background: var(--module-paper);
  border: 1px solid var(--module-line);
  border-top: 3px solid var(--module-gold);
  border-radius: 19px;
  box-shadow: 0 10px 34px rgba(8, 35, 63, .07);
}

.rencontre-page .summary-card.A,
.rencontre-page .summary-card.B {
  border-color: var(--module-line);
  border-top-color: var(--module-gold);
}

.rencontre-page .summary-header {
  border-bottom-color: var(--module-line);
}

.rencontre-page .mini-thumb {
  width: 55px;
  aspect-ratio: var(--card-ratio);
  object-fit: contain;
  border-radius: 6px;
}

.rencontre-page .summary-title {
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.rencontre-page .summary-text {
  color: var(--module-muted);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.72;
}

.summary-represents {
  margin-bottom: 10px;
  color: var(--module-gold);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rencontre-page .synergy-block {
  margin-bottom: 25px;
  padding: clamp(28px, 5vw, 50px);
  background: var(--module-navy);
  border: 0;
  border-radius: 25px;
  box-shadow: 0 20px 55px rgba(8, 35, 63, .18);
}

.rencontre-page .magie-label {
  margin-bottom: 10px;
  color: var(--module-gold-light);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .13em;
}

.rencontre-page .synergy-name {
  margin-bottom: 25px;
  color: white;
  font-family: var(--module-serif);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: .95;
  text-transform: none;
}

.rencontre-page .synergy-main-img {
  width: 165px;
  aspect-ratio: var(--card-ratio);
  object-fit: contain;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .26));
  animation: module-card-pop .75s var(--ease-out-expo) both;
}

.rencontre-page .synergy-content-box {
  padding: clamp(22px, 4vw, 38px);
  background: #fffdf9;
  border-radius: 18px;
}

.rencontre-page .syn-formula {
  color: var(--module-gold);
  border-color: var(--module-line);
  font-family: var(--module-serif);
  font-size: 1.75rem;
  font-weight: 400;
}

.rencontre-page .syn-subtitle {
  color: var(--module-muted);
  font-size: .83rem;
}

.rencontre-page .syn-section {
  color: var(--module-navy);
  font-size: .72rem;
}

.rencontre-page .syn-text {
  color: var(--module-muted);
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.75;
}

.rencontre-page .restart-area {
  max-width: 360px;
  gap: 9px;
}

.rencontre-page .btn-elegant {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  color: var(--module-navy);
  background: transparent;
  border: 1px solid var(--module-line);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  transition: transform .2s ease, border-color .2s ease;
}

.rencontre-page .btn-elegant:hover {
  transform: translateY(-2px);
}

.rencontre-page .btn-elegant.primary {
  color: white;
  background: var(--module-navy);
}

/* Calculette intégrée */
body.calculator-page {
  min-width: 320px;
  min-height: 100svh;
  height: 100svh;
  margin: 0;
  padding: 12px;
  color: var(--module-ink);
  background: var(--module-cream);
  font-family: var(--module-sans);
  overflow: hidden;
}

.calculator-page .display-area,
.calculator-page .keypad-container {
  max-width: 720px;
}

.calculator-page .display-area {
  padding: 17px;
  background: var(--module-paper);
  border: 1px solid var(--module-line);
  border-radius: 20px;
  box-shadow: 0 10px 35px rgba(8, 35, 63, .07);
}

.calculator-page .top-bar {
  min-height: 37px;
  color: var(--module-navy);
  border-color: var(--module-line);
  font-family: var(--module-serif);
  font-size: 1.3rem;
  font-weight: 400;
}

.calculator-page .mode-switch {
  min-height: 34px;
  padding: 6px 11px;
  color: var(--module-navy);
  background: var(--module-cream);
  border: 1px solid var(--module-line);
  border-radius: 999px;
  font-family: var(--module-sans);
  font-size: .62rem;
}

.calculator-page .mode-switch:hover,
.calculator-page .mode-switch.active {
  color: white;
  background: var(--module-navy);
  border-color: var(--module-navy);
}

.calculator-page .input-container {
  min-height: 66px;
  background: #f8f4ed;
  border-color: var(--module-line);
  border-radius: 13px;
}

.calculator-page .numeric-display {
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: 2.5rem;
  font-weight: 400;
}

.calculator-page .result-zone {
  min-height: 100px;
}

.calculator-page .placeholder-text {
  color: var(--module-muted);
  font-size: .7rem;
}

.calculator-page .result-card {
  aspect-ratio: var(--card-ratio);
  object-fit: contain;
  border-color: transparent;
  border-radius: 8px;
  filter: drop-shadow(0 6px 10px rgba(8, 35, 63, .2));
  animation: module-card-pop .48s var(--ease-out-expo) both;
}

.calculator-page #resultLabel {
  max-width: 260px;
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.15;
  text-transform: none;
}

.calculator-page .controls {
  gap: 8px;
  margin-bottom: 8px;
}

.calculator-page .action-btn {
  min-height: 48px;
  padding: 10px;
  border-radius: 999px;
  box-shadow: none;
  font-size: .68rem;
  transition: transform .2s ease, opacity .2s ease;
}

.calculator-page .action-btn:hover {
  transform: translateY(-1px);
}

.calculator-page .btn-calc {
  color: white;
  background: var(--module-navy);
}

.calculator-page .btn-reset {
  color: var(--module-ink);
  background: #e9e2d6;
}

.calculator-page .numeric-pad {
  gap: 8px;
  padding: 0;
}

.calculator-page .num-key {
  color: var(--module-ink);
  background: var(--module-paper);
  border-color: var(--module-line);
  border-radius: 13px;
  box-shadow: none;
  font-family: var(--module-serif);
  font-size: 1.55rem;
  font-weight: 400;
  transition: transform .15s ease, border-color .2s ease;
}

.calculator-page .num-key:hover {
  border-color: var(--module-gold);
}

.calculator-page .key-op {
  color: var(--module-gold);
  background: #eee7da;
}

.calculator-page .card-grid {
  gap: 7px;
}

.calculator-page .card-key {
  aspect-ratio: var(--card-ratio);
  overflow: hidden;
  border-color: var(--module-line);
  border-radius: 7px;
  transition: transform .2s var(--ease-spring);
}

.calculator-page .card-key:hover {
  transform: translateY(-3px) scale(1.04);
}

.calc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 18, 31, .78);
  font-family: var(--module-sans);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.calc-modal {
  width: min(100%, 650px);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  color: var(--module-ink);
  background: var(--module-paper);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
  animation: module-fade-up .35s var(--ease-out-expo) both;
}

.calc-modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px 9px 21px;
  background: rgba(255, 253, 249, .96);
  border-bottom: 1px solid var(--module-line);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.calc-modal-header > span {
  color: var(--module-gold);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.calc-modal-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--module-navy);
  background: var(--module-cream);
  border: 1px solid var(--module-line);
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
}

.calc-modal-body {
  padding: 27px;
}

.calc-modal-hero {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  align-items: start;
  gap: 25px;
  margin-bottom: 27px;
}

.calc-modal-hero > img {
  width: 125px;
  aspect-ratio: var(--card-ratio);
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(10px 16px 20px rgba(8, 35, 63, .17));
}

.calc-modal-heading h3 {
  margin: 0 0 7px;
  color: var(--module-navy);
  font-family: var(--module-serif);
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: .92;
}

.calc-modal-keywords {
  margin: 0 0 12px;
  color: var(--module-gold);
  font-family: var(--module-serif);
  font-size: 1.15rem;
  line-height: 1.2;
}

.calc-modal-represents {
  display: inline-flex;
  margin-bottom: 13px;
  padding: 5px 9px;
  color: var(--module-navy);
  background: rgba(185, 135, 47, .11);
  border-radius: 999px;
  font-size: .59rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calc-modal-heading blockquote {
  margin: 0;
  padding: 14px;
  color: white;
  background: var(--module-navy);
  border-radius: 13px;
  font-family: var(--module-serif);
  font-size: 1.15rem;
  line-height: 1.2;
}

.calc-modal-coaching {
  margin-bottom: 23px;
  padding: 20px;
  background: #f7f2e9;
  border-radius: 16px;
}

.calc-modal-coaching h4,
.calc-modal-profile h4 {
  margin: 0 0 10px;
  color: var(--module-gold);
  font-size: .65rem;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.calc-modal-coaching ul {
  margin: 0;
  padding-left: 19px;
  color: var(--module-muted);
  font-size: .78rem;
  line-height: 1.6;
}

.calc-modal-coaching li + li {
  margin-top: 5px;
}

.calc-modal-text {
  color: var(--module-muted);
  font-size: .85rem;
  line-height: 1.75;
}

.calc-modal-text p {
  margin: 0 0 13px;
}

.calc-modal-profile {
  margin-top: 24px;
  padding: 20px;
  background: #fbf8f2;
  border: 1px solid var(--module-line);
  border-radius: 16px;
}

.calc-modal-profile > div {
  padding: 13px;
  background: white;
  border-left: 3px solid var(--module-gold);
  border-radius: 9px;
}

.calc-modal-profile > div + div {
  margin-top: 9px;
}

.calc-modal-profile p {
  margin: 0;
  color: var(--module-muted);
  font-size: .76rem;
  line-height: 1.55;
}

.calc-modal-profile p + p {
  margin-top: 4px;
}

.calc-modal-profile strong {
  color: var(--module-navy);
}

/* Ambiance nuit : mêmes gestes, davantage de profondeur. */
:root[data-theme='nuit'] body.module-page {
  background:
    radial-gradient(circle at 78% 4%, rgba(221, 189, 133, .12), transparent 31rem),
    radial-gradient(circle at 10% 82%, rgba(145, 187, 208, .08), transparent 29rem),
    linear-gradient(145deg, #080e22, #050817);
}

:root[data-theme='nuit'] .module-page .module-back,
:root[data-theme='nuit'] .rencontre-page .player-zone,
:root[data-theme='nuit'] .dico-page .result-area,
:root[data-theme='nuit'] .rencontre-page .summary-card {
  background: rgba(20, 33, 42, .74);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

:root[data-theme='nuit'] .module-brand,
:root[data-theme='nuit'] .module-page .module-header h1,
:root[data-theme='nuit'] .dico-page .result-title,
:root[data-theme='nuit'] .dico-page .psycho-label,
:root[data-theme='nuit'] .dico-page .psy-group strong,
:root[data-theme='nuit'] .rencontre-page .card-name-big,
:root[data-theme='nuit'] .rencontre-page .summary-title,
:root[data-theme='nuit'] .rencontre-page .syn-section,
:root[data-theme='nuit'] .calculator-page .top-bar,
:root[data-theme='nuit'] .calculator-page .numeric-display,
:root[data-theme='nuit'] .calculator-page #resultLabel,
:root[data-theme='nuit'] .calc-modal-heading h3,
:root[data-theme='nuit'] .calc-modal-profile strong {
  color: var(--module-ink);
}

:root[data-theme='nuit'] .dico-page .grid-item,
:root[data-theme='nuit'] .rencontre-page .grid-item {
  background: #223640;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

:root[data-theme='nuit'] .dico-page .result-question-block,
:root[data-theme='nuit'] .rencontre-page .synergy-block,
:root[data-theme='nuit'] .quick-draw,
:root[data-theme='nuit'] .rencontre-page .btn-elegant.primary,
:root[data-theme='nuit'] .calculator-page .btn-calc,
:root[data-theme='nuit'] .calc-modal-heading blockquote {
  color: #f8f3e8;
  background: #102029;
}

:root[data-theme='nuit'] .dico-page .psycho-block,
:root[data-theme='nuit'] .dico-page .psy-group,
:root[data-theme='nuit'] .rencontre-page .synergy-content-box,
:root[data-theme='nuit'] .rencontre-page .input-name,
:root[data-theme='nuit'] .calculator-page .display-area,
:root[data-theme='nuit'] .calculator-page .num-key,
:root[data-theme='nuit'] .calc-modal,
:root[data-theme='nuit'] .calc-modal-profile,
:root[data-theme='nuit'] .calc-modal-profile > div {
  color: var(--module-ink);
  background: #14212a;
}

:root[data-theme='nuit'] .choice-divider span,
:root[data-theme='nuit'] .calc-modal-header {
  background: #14212a;
}

:root[data-theme='nuit'] .dico-page .result-text,
:root[data-theme='nuit'] .dico-page .coaching-list li,
:root[data-theme='nuit'] .dico-page .psycho-item,
:root[data-theme='nuit'] .rencontre-page .summary-text,
:root[data-theme='nuit'] .rencontre-page .syn-text,
:root[data-theme='nuit'] .calc-modal-text,
:root[data-theme='nuit'] .calc-modal-profile p {
  color: var(--module-muted);
}

:root[data-theme='nuit'] body.calculator-page {
  color: var(--module-ink);
  background: #080e22;
}

:root[data-theme='nuit'] .calculator-page .input-container,
:root[data-theme='nuit'] .calculator-page .key-op,
:root[data-theme='nuit'] .calculator-page .btn-reset,
:root[data-theme='nuit'] .calc-modal-coaching {
  color: var(--module-ink);
  background: #223640;
}

:root[data-theme='nuit'] .dico-page .grid-item,
:root[data-theme='nuit'] .rencontre-page .grid-item {
  background: transparent;
  box-shadow: none;
}

:root[data-theme='nuit'] .dico-page .psy-group-positive {
  background: rgba(80, 139, 164, .14);
  border-color: rgba(145, 187, 208, .25);
  border-left-color: #91bbd0;
}

:root[data-theme='nuit'] .dico-page .psy-group-positive .psy-state-label,
:root[data-theme='nuit'] .dico-page .psy-group-positive strong {
  color: #b8dceb;
}

:root[data-theme='nuit'] .dico-page .psy-group-positive .psy-state-label {
  background: rgba(145, 187, 208, .14);
}

:root[data-theme='nuit'] .dico-page .psy-group-excess {
  background: rgba(160, 91, 69, .15);
  border-color: rgba(222, 178, 155, .25);
  border-left-color: #deb29b;
}

:root[data-theme='nuit'] .dico-page .psy-group-excess .psy-state-label,
:root[data-theme='nuit'] .dico-page .psy-group-excess strong {
  color: #f0c6af;
}

:root[data-theme='nuit'] .dico-page .psy-group-excess .psy-state-label {
  background: rgba(222, 178, 155, .14);
}

:root[data-theme='nuit'] .dico-page .result-rep,
:root[data-theme='nuit'] .rencontre-page .btn-elegant.secondary,
:root[data-theme='nuit'] .calculator-page .mode-switch,
:root[data-theme='nuit'] .calc-modal-close,
:root[data-theme='nuit'] .calc-modal-represents {
  color: var(--module-ink);
}

@keyframes module-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes module-card-pop {
  0% { opacity: 0; transform: translateY(18px) scale(.9) rotateY(-20deg); }
  100% { opacity: 1; transform: none; }
}

@media (min-width: 761px) and (max-width: 1140px) {
  .rencontre-page .duo-container { grid-template-columns: 1fr; }

  .rencontre-page .fan-container {
    --fan-card-width: clamp(72px, 8vw, 82px);
    --fan-card-half: clamp(-41px, -4vw, -36px);
    --fan-radius: clamp(304px, 40vw, 400px);
    --fan-top: 8px;
    height: clamp(360px, 45vw, 470px);
  }
}

@media (max-width: 760px) {
  .module-page { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }

  .module-page #app-container,
  .rencontre-page #app-container {
    width: calc(100% - 28px);
    padding-bottom: 44px !important;
  }

  .module-page .module-header {
    margin-bottom: 25px;
    padding-top: 0;
  }

  .module-header-top {
    width: 100vw;
    height: 64px;
    min-height: 64px;
    margin: 0 0 27px calc(50% - 50vw);
    padding: 0 14px;
  }

  .module-page .module-back {
    min-height: 40px;
    padding-inline: 12px;
  }

  .module-brand {
    margin-right: 0;
    font-size: 1.08rem;
  }

  .module-journal {
    width: 44px;
    padding: 0;
  }

  .module-journal span { display: none; }

  .module-desktop-nav { display: none; }

  .module-brand img {
    width: 38px;
    height: 38px;
  }

  .module-page .module-header h1 {
    font-size: clamp(3.25rem, 14.7vw, 4.65rem);
  }

  .module-page .module-header .intro {
    max-width: 330px;
    font-size: .78rem;
  }

  .module-bottom-nav {
    position: fixed;
    z-index: 120;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: calc(64px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 5px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--module-line);
    background: color-mix(in srgb, var(--module-paper) 90%, transparent);
    box-shadow: 0 -12px 38px rgba(0, 0, 0, .08);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
  }

  .module-bottom-nav a {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    color: var(--module-muted);
    border-radius: 13px;
    font-size: .61rem;
    font-weight: 700;
    text-decoration: none;
  }

  .module-bottom-nav a[aria-current='page'] {
    color: var(--module-gold);
    background: color-mix(in srgb, var(--module-gold) 12%, transparent);
  }

  .dico-page .grid-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 30px;
  }

  .dico-page .result-area {
    padding: 22px 17px;
    border-radius: 20px;
  }

  .dico-page .result-header {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    align-items: start;
    gap: 17px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    text-align: left;
  }

  .dico-page .result-img-wrapper {
    width: 105px;
  }

  .dico-page .result-title {
    font-size: clamp(2.35rem, 11vw, 3.4rem);
  }

  .dico-page .result-keywords {
    font-size: 1rem;
  }

  .dico-page .result-rep {
    font-size: .57rem;
  }

  .dico-page .coaching-header-label {
    font-size: .58rem;
  }

  .dico-page .coaching-list li {
    font-size: .72rem;
  }

  .dico-page .result-text {
    font-size: .84rem;
  }

  .dico-page .result-question-block,
  .dico-page .psycho-block {
    padding: 21px 17px;
    border-radius: 17px;
  }

  .dico-page .result-question-text {
    font-size: 1.55rem;
  }

  .rencontre-page .duo-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rencontre-page .player-zone {
    padding: 18px 15px;
    border-radius: 19px;
  }

  .rencontre-page .player-header { align-items: flex-start; }
  .rencontre-page .mode-btn { padding-inline: 8px; font-size: .63rem; }
  .rencontre-page .fan-container {
    --fan-card-width: clamp(42px, 12vw, 72px);
    --fan-card-half: clamp(-36px, -6vw, -21px);
    --fan-radius: clamp(128px, 40vw, 304px);
    --fan-top: 8px;
    height: clamp(190px, 48vw, 360px);
  }
  .rencontre-page .card-anchor {
    top: var(--fan-top);
    width: var(--fan-card-width);
    margin-left: var(--fan-card-half);
    transform-origin: 50% var(--fan-radius);
  }

  .rencontre-page .grid-selector {
    max-height: none;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .rencontre-page .action-area {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .rencontre-page #result-area {
    padding-top: 32px;
  }

  .rencontre-page .individual-summaries {
    flex-direction: column;
    gap: 9px;
  }

  .rencontre-page .summary-card {
    padding: 17px;
    border-radius: 16px;
  }

  .rencontre-page .synergy-block {
    padding: 27px 14px;
    border-radius: 20px;
  }

  .rencontre-page .synergy-name {
    font-size: 3.25rem;
  }

  .rencontre-page .synergy-main-img {
    width: 140px;
  }

  .rencontre-page .synergy-content-box {
    padding: 20px 16px;
  }

  .rencontre-page .syn-formula {
    font-size: 1.45rem;
  }

  body.calculator-page {
    padding: 8px;
  }

  .calculator-page .display-area {
    padding: 12px;
    border-radius: 16px;
  }

  .calculator-page .top-bar {
    font-size: 1.12rem;
  }

  .calculator-page .mode-switch {
    font-size: .56rem;
  }

  .calculator-page .result-zone {
    min-height: 78px;
  }

  .calculator-page .result-card {
    max-height: 108px;
  }

  .calculator-page #resultLabel {
    max-width: 190px;
    font-size: 1.05rem;
  }

  .calculator-page .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .calc-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .calc-modal {
    max-height: 94svh;
    border-radius: 24px 24px 0 0;
  }

  .calc-modal-body {
    padding: 21px 17px 30px;
  }

  .calc-modal-hero {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 15px;
  }

  .calc-modal-hero > img {
    width: 96px;
  }

  .calc-modal-heading h3 {
    font-size: clamp(2.25rem, 10vw, 3.2rem);
  }

  .calc-modal-heading blockquote {
    padding: 11px;
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .module-page #app-container,
  .rencontre-page #app-container {
    width: calc(100% - 20px);
  }

  .module-brand span {
    display: none;
  }

  .rencontre-page .grid-selector {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}