/* Parti pris : une carte de nuit plein écran, un seul thème, sombre. Les personnes sont des médaillons sur une frise
   des générations, chaque nom de famille porte sa couleur, et la lignée de la personne survolée s'allume. */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/instrument-serif.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/static/fonts/instrument-serif-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/instrument-sans.woff2") format("woff2"); }

:root {
  --night: #0b1412; --night-2: #101d1a; --glass: rgb(23 37 33 / .72); --glass-strong: rgb(16 28 25 / .93);
  --ink: #f1f3ec; --soft: #a9b8b0; --faint: #6d807a; --hair: rgb(214 228 220 / .14); --hair-strong: rgb(214 228 220 / .3);
  --gold: #e0b56c; --on-gold: #1c1508; --warn: #f0a35e; --ok: #8fe0b0; --danger: #f2998c;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif; --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; min-height: 100%; color: var(--ink); font: 400 15px/1.5 var(--sans);
  background: radial-gradient(90rem 50rem at 15% -10%, #1b3a31 0%, transparent 60%), radial-gradient(70rem 50rem at 100% 110%, #2c2413 0%, transparent 55%), var(--night); background-attachment: fixed; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }

body.app { height: 100%; overflow: hidden; overscroll-behavior: none; }
#stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
#stage.drag { cursor: grabbing; }
#canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#canvas svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }

.band { position: absolute; left: 0; right: 0; border-top: 1px solid var(--hair); }
.band b { position: absolute; left: 0; top: 14px; width: 120px; font: italic 400 26px/1.05 var(--serif); color: var(--soft); }
.band span { position: absolute; left: 0; top: 46px; width: 120px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

.ln { fill: none; stroke: var(--fam, var(--hair-strong)); stroke-width: 1.6; stroke-opacity: .55; transition: stroke-opacity .25s, stroke-width .25s; }
.ln.ghost { stroke: var(--hair-strong); stroke-opacity: .7; stroke-dasharray: 3 6; stroke-linecap: round; }
.ln.tie { stroke: var(--gold); stroke-opacity: .65; }
.tie-mark { position: absolute; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--gold); background: var(--night-2); border: 1px solid var(--hair-strong); font-size: 13px; line-height: 1; transition: opacity .25s; }

.card { position: absolute; box-sizing: border-box; width: 240px; height: 124px; padding: 12px 14px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; cursor: pointer;
  background: var(--glass); border: 1px solid var(--hair); border-radius: 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgb(0 0 0 / .28); transition: opacity .25s, border-color .2s, transform .2s, box-shadow .2s; }
@media (hover: hover) { .card:hover { border-color: var(--fam, var(--hair-strong)); transform: translateY(-2px); } }
.card.on { border-color: var(--fam, var(--gold)); box-shadow: 0 0 0 1px var(--fam, var(--gold)), 0 14px 40px rgb(0 0 0 / .4); }
.mono { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: italic 400 22px/1 var(--serif); color: var(--fam); border: 1px solid var(--fam); background: color-mix(in srgb, var(--fam) 13%, transparent); }
.seal { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #0b1f15; font: 700 11px/1 var(--sans); }
.txt { min-width: 0; display: flex; flex-direction: column; }
.txt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prenom { font: italic 400 23px/1.1 var(--serif); }
.nom { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--fam); margin-top: 1px; }
.vie { font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; margin-top: 4px; }
.lieu { font-size: 12.5px; color: var(--faint); }
.rel { font-size: 12px; font-weight: 500; color: var(--gold); margin-top: 3px; }
.card.moi { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 30px rgb(0 0 0 / .28); }
.flag { position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgb(240 163 94 / .18); }

.card.vide { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px dashed var(--hair-strong); color: var(--soft); }
@media (hover: hover) { .card.vide:hover { border-color: var(--gold); color: var(--ink); transform: none; } }
.card.vide .mono { --fam: var(--faint); border-style: dashed; background: none; font: 400 22px/1 var(--sans); }
.card.vide .prenom { font-size: 19px; color: inherit; white-space: normal; }
.card.vide .txt small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }

#stage.focus .card:not(.kin), #stage.focus .tie-mark:not(.kin) { opacity: .22; }
#stage.focus .ln { stroke-opacity: .1; }
#stage.focus .ln.kin { stroke-opacity: 1; stroke-width: 2.4; }
.intro .card, .intro .tie-mark { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
.intro .ln:not(.ghost) { stroke-dasharray: 1; animation: draw 1.1s ease-out both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; translate: 0 12px; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .intro .card, .intro .tie-mark, .intro .ln:not(.ghost) { animation: none; } .card, .ln { transition: none; } }

.hud-top, .hud-bottom { position: fixed; z-index: 2; left: 0; right: 0; display: flex; justify-content: space-between; gap: 12px 20px; pointer-events: none;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.hud-top > *, .hud-bottom > * { pointer-events: auto; }
.hud-top { top: 0; padding-top: calc(16px + env(safe-area-inset-top, 0px)); align-items: flex-start; padding-bottom: 18px; background: linear-gradient(to bottom, rgb(11 20 18 / .92) 70%, transparent); }
.hud-bottom { bottom: 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); align-items: flex-end; flex-wrap: wrap; padding-top: 26px; background: linear-gradient(to top, var(--night) 62%, transparent); }
.brand { pointer-events: none; }
.brand h1 { font-style: italic; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.01em; }
.brand p { margin: 6px 0 0; color: var(--soft); font-size: 13px; }
.who { display: flex; align-items: center; gap: 12px; color: var(--soft); font-size: 13px; }
.families { display: flex; gap: 6px; min-width: 0; flex: 1 1 18rem; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; overscroll-behavior: contain; padding: 2px; }
.families::-webkit-scrollbar { display: none; }
.filtre { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 12.5px; color: var(--soft); cursor: pointer; white-space: nowrap; background: var(--glass); border: 1px solid var(--hair); border-radius: 999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.filtre i { width: 8px; height: 8px; border-radius: 50%; background: var(--fam); }
.filtre small { font-size: 11px; color: var(--faint); }
.filtre[aria-pressed="true"] { color: var(--ink); border-color: var(--gold); background: rgb(224 181 108 / .14); }
@media (hover: hover) { .filtre:hover { color: var(--ink); border-color: var(--hair-strong); } }
.tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 10px; margin-left: auto; }
.ghost-btn, .zoom { background: var(--glass); border: 1px solid var(--hair); border-radius: 999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ghost-btn { padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.ghost-btn:hover { border-color: var(--hair-strong); }
.ghost-btn b { color: var(--warn); font-weight: 600; margin-left: 2px; }
.vue { flex-direction: row; align-items: center; gap: 8px; font-size: 11px; color: var(--soft); }
.vue select { width: auto; max-width: 14rem; padding: 6px 10px; font-size: 13px; border-radius: 999px; background: var(--glass); }
#pRel { margin: 0; color: var(--gold); font-size: 14px; }
#pVue { align-self: flex-start; }
.zoom { display: flex; align-items: center; overflow: hidden; }
.zoom button { background: none; border: 0; padding: 7px 13px; cursor: pointer; font-size: 13px; }
.zoom button:hover { background: var(--hair); }

.sheet { position: fixed; z-index: 5; top: 12px; right: 12px; bottom: 12px; width: min(400px, calc(100% - 24px)); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px; border: 1px solid var(--hair); border-radius: 20px; background: var(--glass-strong); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: 0 30px 80px rgb(0 0 0 / .5); animation: slide .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
@media (max-width: 1280px) {
  .hud-bottom { flex-direction: column; align-items: stretch; gap: 8px; }
  .families { flex: none; order: -1; }
  .tools { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 84dvh; border-radius: 20px 20px 0 0; border-width: 1px 0 0;
    padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .who span { display: none; }
  .hud-bottom, .hud-top { padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
  .tools { flex-wrap: nowrap; gap: 6px; }
  .vue { font-size: 0; gap: 0; flex: 1 1 0; width: 0; min-width: 0; }
  .vue select { width: 100%; min-width: 0; max-width: none; }
  .ghost-btn, .zoom { flex: none; }
  #zoomIn, #zoomOut { display: none; }
}
@media (pointer: coarse) {
  .ghost-btn { padding: 10px 14px; }
  .zoom button { padding: 10px 14px; }
  .filtre { padding: 9px 13px; font-size: 13px; }
  .vue select { padding: 9px 12px; }
  .btn { padding: 10px 16px; }
}
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top h2 { min-width: 0; font-style: italic; font-size: 30px; line-height: 1.05; overflow-wrap: anywhere; }
#form { display: flex; flex-direction: column; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
label.check { flex-direction: row; align-items: center; gap: 9px; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); }
input[type=checkbox] { accent-color: var(--ok); width: 16px; height: 16px; }
input[type=text], input[type=password], select, textarea { font: 400 16px/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); width: 100%; box-sizing: border-box; padding: 8px 10px;
  background: rgb(255 255 255 / .05); border: 1px solid var(--hair); border-radius: 9px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background: rgb(255 255 255 / .08); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select option { background: var(--night-2); }
textarea { min-height: 66px; resize: vertical; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hair-strong); background: transparent; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--gold); }
.btn.main { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 600; padding-inline: 20px; }
.btn.bad { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }
.group { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--hair); padding-top: 14px; margin-top: 4px; }
.group p { margin: 0; color: var(--soft); font-size: 13px; }
#msg { margin: 0; color: var(--danger); font-size: 14px; }

#todoList { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.link { width: 100%; background: none; border: 0; border-radius: 10px; padding: 10px; text-align: left; cursor: pointer; color: var(--soft); font-size: 14px; }
.link:hover { background: var(--hair); }
.link b { display: block; font: italic 400 20px/1.2 var(--serif); color: var(--ink); }
.hint { margin: 0; color: var(--soft); font-size: 13px; }
.hint strong { color: var(--ink); font-weight: 600; }

.auth { box-sizing: border-box; max-width: 26rem; margin: 0 auto; padding-block: clamp(32px, 9vh, 88px) 40px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 20px; }
.auth h1 { font-style: italic; font-size: clamp(3rem, 14vw, 4.4rem); line-height: 1; letter-spacing: -.01em; }
.auth .sub { margin: -12px 0 0; color: var(--soft); }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth p { margin: 0; }
.auth .btn.main { align-self: flex-start; padding: 10px 24px; font-size: 15px; }
.legend { color: var(--soft); font-size: 13px; }
.qr { width: 220px; height: 220px; max-width: 100%; align-self: center; background: #fff; border-radius: 14px; padding: 6px; box-sizing: border-box; }
code { overflow-wrap: anywhere; font-size: .95em; color: var(--ink); }
.lecture .card.vide { cursor: default; }
input:disabled, select:disabled, textarea:disabled { opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); background: transparent; }
