/* ==========================================================================
   Le Baromerde — coquille de l'app et composant carte
   Les 10 étages (bas de fichier) ne redéfinissent QUE des variables.
   ========================================================================== */

/* Polices locales — SIL Open Font License, voir fonts/OFL-*.txt ----------- */

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jost.woff2") format("woff2");
}

@font-face {
  font-family: "Jost";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/jost-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-black.woff2") format("woff2");
}

/* Réglages globaux ------------------------------------------------------ */

:root {
  color-scheme: dark;
  --app-bg: #07070a;
  --gutter: 16px;
  --rail: 44px;                 /* largeur du rail d'étages = zone tactile */
  --tilt: -12deg;               /* pivot de la carte ; positif = vers la droite */
  --font-text: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;

  /* Palette par défaut (étage 01), surchargée par [data-level] */
  --holo-a: #1f5eff;            /* couleur vive de l'étage : cadre, pastilles */
  --holo-b: #d3e0ff;            /* teinte pâle : panneau texte */
  --deep: #06123a;              /* teinte sombre : encre, anneaux, jointures */
  --bg: #0a36c2;                /* fond de l'étage */
  --glow: rgba(31, 94, 255, .6);

  /* Recadrage de l'illustration dans sa fenêtre */
  --art-pos: center top;
  --art-zoom: 1;
}

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

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--app-bg);
}

body {
  color: #fff;
  font-family: var(--font-text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Sprite SVG : masqué sans display:none, sinon les <use> ne rendent rien */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Deck : c'est lui qui défile, pas le body. Un swipe = un étage. --------- */

.deck {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: none;
  touch-action: pan-y;
  scrollbar-width: none;
}

.deck::-webkit-scrollbar {
  display: none;
}

.level {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  padding:
    calc(env(safe-area-inset-top) + var(--gutter))
    calc(env(safe-area-inset-right) + var(--gutter))
    calc(env(safe-area-inset-bottom) + var(--gutter))
    calc(env(safe-area-inset-left) + var(--rail) + 6px);
  /* Fond coloré de l'étage, assombri aux jointures pour adoucir le passage */
  background:
    radial-gradient(80% 50% at 58% 50%, var(--glow) 0%, transparent 72%),
    linear-gradient(180deg, var(--deep) 0%, var(--bg) 24%, var(--bg) 76%, var(--deep) 100%);
  perspective: 900px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  contain: layout paint;
}

/* Rail d'étages ----------------------------------------------------------- */

.floors {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: env(safe-area-inset-left);
  display: flex;
  flex-direction: column;
  width: var(--rail);
  transform: translateY(-50%);
}

.floors::before {
  content: "";
  position: absolute;
  top: calc(var(--rail) / 2);
  bottom: calc(var(--rail) / 2);
  left: calc(50% - 1px);
  width: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .28);
}

.floors__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--rail);
  height: var(--rail);
  border-radius: 50%;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.floors__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--holo-a);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .45);
  opacity: .8;
  transition: transform .25s ease-out, opacity .25s ease-out;
}

.floors__dot.is-active::before {
  opacity: 1;
  transform: scale(1.6);
  box-shadow: 0 0 0 1.5px #fff, 0 0 10px 2px var(--glow);
}

.floors__dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -6px;
}

/* Carte ----------------------------------------------------------------- */

.card {
  position: relative;
  flex: none;
  /* Plus grande carte 3:4 qui tient dans l'écran, encoches déduites */
  width: min(
    100%,
    calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 2 * var(--gutter)) * 3 / 4)
  );
  aspect-ratio: 3 / 4;
  container-type: inline-size;
  transform: rotateY(var(--tilt));
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.card h2,
.card h3,
.card p {
  margin: 0;
}

.card__frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 2.4cqw;
  padding: 3.2cqw;
  overflow: hidden;
  border-radius: 4cqw;
  background: linear-gradient(170deg, var(--holo-b) 0%, var(--holo-a) 22%, var(--holo-a) 78%, var(--bg) 140%);
  box-shadow:
    inset 0 0 0 .7cqw rgba(255, 255, 255, .55),
    0 0 0 1.1cqw var(--deep),
    0 3cqw 8cqw rgba(0, 0, 0, .5),
    0 0 12cqw var(--glow);
  color: var(--deep);
}

/* En-tête : nom, catégorie, gravité */

.card__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3cqw;
  padding: .8cqw 1cqw 0;
}

.card__title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2cqw;
}

.card__name {
  font-family: var(--font-text);
  font-style: italic;
  font-weight: 700;
  font-size: var(--name-size, 7cqw);   /* ajustée par js/app.js selon la longueur */
  line-height: 1;
  letter-spacing: -.015em;
  text-transform: uppercase;
  text-wrap: balance;
}

.card__nowrap {
  white-space: nowrap;
}

.card__category {
  display: inline-flex;
  align-items: center;
  gap: 1.4cqw;
  padding: 1.1cqw 2.8cqw;
  border-radius: 99cqw;
  background: var(--deep);
  font-weight: 700;
  font-size: 3.4cqw;
  line-height: 1.1;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--holo-b);
}

.card__category::before {
  content: "";
  width: 1.6cqw;
  height: 1.6cqw;
  border-radius: 50%;
  background: var(--holo-a);
}

.card__level {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.card__level-label {
  font-weight: 700;
  font-size: 3.4cqw;
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.card__level-num {
  font-family: var(--font-display);
  font-size: 15cqw;
  line-height: .95;
  color: #fff;
  -webkit-text-stroke: .9cqw var(--deep);
  paint-order: stroke fill;
  text-shadow: 0 .7cqw 0 var(--deep);
}

/* Fenêtre d'illustration */

.card__art-window {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: 2.4cqw;
  background: var(--deep);
  box-shadow: 0 0 0 .9cqw var(--deep), 0 0 0 1.5cqw rgba(255, 255, 255, .6);
}

.card__placeholder {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 8%, var(--holo-b) 0%, var(--holo-a) 45%, var(--deep) 100%);
}

.card__silhouette {
  position: absolute;
  left: 30%;
  bottom: 0;
  width: 40%;
  height: 90%;
  color: var(--deep);
}

.card__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--art-pos);
  transform: scale(var(--art-zoom));
  transform-origin: var(--art-pos);
  opacity: 0;
  transition: opacity .3s ease-out;
  pointer-events: none;
  -webkit-user-drag: none;
}

.card.has-art .card__art {
  opacity: 1;
}

/* Panneau anecdote */

.card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .8cqw;
  flex: none;
  height: 29cqw;
  padding: 2.8cqw 3.4cqw;
  border-radius: 2.4cqw;
  background: var(--holo-b);
  box-shadow: 0 0 0 .9cqw var(--deep), inset 0 .6cqw 0 rgba(255, 255, 255, .7);
}

/* Carrousel des anecdotes : une par écran, défilement horizontal natif
   (fluide, sans JavaScript pendant le geste) ; le swipe vertical reste au deck. */
.card__slider {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.card__slider::-webkit-scrollbar {
  display: none;
}

.card__slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  margin: 0;
  padding: 0 12cqw 0 0;         /* place pour le + rangé dans le coin */
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  touch-action: pan-x pan-y;
}

.card__slide-head {
  display: flex;
  align-items: center;
  gap: 2cqw;
  min-width: 0;
}

/* Le modèle de gemmes placé dans le panneau ne s'affiche pas */
.card__body > .card__costs {
  display: none;
}

.card__costs {
  flex: none;
  display: flex;
  gap: .8cqw;
}

.card__cost {
  width: 6cqw;
  height: 6cqw;
}

.card__anec-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 4.6cqw;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Début du texte : 2 lignes, la suite se lit dans la liste */
.card__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-weight: 400;
  font-size: 3.8cqw;
  line-height: 1.3;
  opacity: .85;
}

.card__dots {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6cqw;
  height: 2.4cqw;
}

.card__dots:empty {
  display: none;
}

.card__dot {
  width: 1.8cqw;
  height: 1.8cqw;
  border-radius: 50%;
  background: var(--deep);
  opacity: .25;
  transition: opacity .2s ease-out, transform .2s ease-out;
}

.card__dot.is-active {
  opacity: 1;
  transform: scale(1.3);
}

.card__dots-count {
  font-weight: 700;
  font-size: 3cqw;
  line-height: 1;
  letter-spacing: .06em;
  opacity: .75;
}

/* Bouton + : occupe tout le panneau tant que l'étage est vide */
.card__add {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--deep);
  touch-action: manipulation;
}

.card__add-icon {
  width: 17cqw;
  height: 17cqw;
  transition: transform .12s ease-out;
}

.card__add:active .card__add-icon {
  transform: scale(.9);
}

.card__add:focus-visible,
.card__slide:focus-visible {
  outline: .7cqw solid var(--deep);
  outline-offset: .6cqw;
}

/* Étage rempli : le + se range dans le coin, zone tactile 44px minimum */
.card.has-anecdote .card__add {
  inset: 0 0 auto auto;
  width: max(44px, 13cqw);
  height: max(44px, 13cqw);
}

.card.has-anecdote .card__add-icon {
  width: 8.5cqw;
  height: 8.5cqw;
}

/* Pied : témoin, date, rareté */

.card__foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  min-height: 7.6cqw;
  padding: .8cqw .9cqw .8cqw 3cqw;
  border-radius: 99cqw;
  background: var(--deep);
  font-weight: 600;
  font-size: 3.4cqw;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--holo-b);
}

.card__meta {
  display: flex;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* Le témoin se coupe (…) avant la date et le numéro */
.card__meta-who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;             /* garde l'espace avant « · » */
}

.card__meta-rest {
  flex: none;
}

.card__rarity {
  flex: none;
  padding: .7cqw 2.4cqw;
  border-radius: 99cqw;
  background: var(--holo-a);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--deep);
}

/* Feuilles : ajout et lecture d'anecdotes -----------------------------------
   Ancrées en haut de l'écran : le clavier iOS ne masque pas les champs.
   data-level, posé par js/app.js, leur donne les couleurs de l'étage. */

.sheet {
  width: min(calc(100% - 2 * var(--gutter)), 30rem);
  max-width: none;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 2 * var(--gutter));
  margin: calc(env(safe-area-inset-top) + var(--gutter)) auto auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 20px;
  background: var(--holo-b);
  box-shadow: 0 0 0 3px var(--deep), 0 24px 60px rgba(0, 0, 0, .6);
  color: var(--deep);
  font-family: var(--font-text);
}

.sheet[open] {
  animation: sheet-in .18s ease-out;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-12px); }
}

.sheet::backdrop {
  background: rgba(4, 4, 6, .65);
}

.sheet__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 20px;
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--holo-a);
}

.sheet__title {
  margin: 0;
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.05;
  text-transform: uppercase;
}

.sheet__subtitle {
  margin: 4px 0 0;
  font-weight: 500;
  font-size: 15px;
  opacity: .8;
}

.sheet__level {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
}

.sheet__level-label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sheet__level-num {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: .95;
  color: var(--holo-a);
  -webkit-text-stroke: 3px var(--deep);
  paint-order: stroke fill;
}

.sheet__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet__label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sheet__hint {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: .7;
}

.sheet__input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 2px solid var(--deep);
  border-radius: 12px;
  background: #fff;
  color: var(--deep);
  font: 400 16px/1.35 var(--font-text);   /* 16px minimum : sinon iOS zoome */
  -webkit-appearance: none;
  appearance: none;
}

textarea.sheet__input {
  min-height: 120px;
  max-height: 45dvh;
  resize: none;
  field-sizing: content;        /* grandit avec le texte (sinon : défilement interne) */
}

.sheet__input:focus {
  outline: 3px solid var(--holo-a);
  outline-offset: 1px;
}

.sheet__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--deep);
  font-size: 15px;
  color: var(--holo-b);
}

.sheet__actions {
  display: flex;
  gap: 10px;
}

.sheet__btn {
  flex: 1;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 2px solid var(--deep);
  border-radius: 999px;
  font: 700 16px/1 var(--font-text);
  letter-spacing: .06em;
  text-transform: uppercase;
  touch-action: manipulation;
}

.sheet__btn--ghost {
  background: transparent;
  color: var(--deep);
}

.sheet__btn--primary {
  background: var(--deep);
  color: var(--holo-b);
}

.sheet__btn:disabled {
  opacity: .5;
}

.sheet__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet__item {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--deep);
}

.sheet__item-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.sheet__item-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sheet__item-meta {
  margin: 8px 0 0;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .7;
}

/* Intro -------------------------------------------------------------------
   Écran d'accueil animé (transform et opacity uniquement), retiré par
   js/app.js au toucher sur « Entrer ». Tout est blanc : seul le fond est
   coloré. */

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding:
    calc(env(safe-area-inset-top) + 24px)
    calc(env(safe-area-inset-right) + 24px)
    calc(env(safe-area-inset-bottom) + 24px)
    calc(env(safe-area-inset-left) + 24px);
  overflow: hidden;
  background: var(--app-bg);
  color: #fff;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

.intro[hidden] {
  display: none;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 45% at 85% 10%, rgba(255, 10, 69, .35), transparent 70%),
    radial-gradient(70% 45% at 15% 90%, rgba(31, 94, 255, .4), transparent 70%),
    radial-gradient(60% 35% at 50% 45%, rgba(255, 213, 0, .18), transparent 70%);
  animation: intro-glow 4s ease-in-out infinite alternate;
}

.intro.is-leaving {
  animation: intro-out .6s cubic-bezier(.7, 0, .3, 1) forwards;
  pointer-events: none;
}

.intro__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 26rem;
}

.intro__kicker,
.intro__tagline {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  animation: intro-fade .6s ease-out both;
}

.intro__kicker {
  animation-delay: .1s;
}

.intro__tagline {
  animation-delay: 1.15s;
}

.intro__gauge {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: min(100%, 300px);
  height: 22dvh;
}

.intro__bar {
  flex: 1;
  height: calc((var(--i) + 1) * 10%);
  border-radius: 6px 6px 3px 3px;
  background: #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, .35);
  transform-origin: bottom;
  animation: intro-bar .7s cubic-bezier(.2, 1.5, .4, 1) both;
  animation-delay: calc(.25s + var(--i) * 70ms);
}

.intro__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: .9;
  text-transform: uppercase;
  animation: intro-rise .8s cubic-bezier(.2, .8, .2, 1) .75s both;
}

.intro__title-line {
  display: block;
}

.intro__title-line--small {
  margin-bottom: 8px;
  padding-left: .3em;           /* compense l'espacement après la dernière lettre */
  font-size: min(7vw, 34px);
  letter-spacing: .3em;
}

.intro__title-line--big {
  font-size: min(12vw, 68px);
}

.intro__enter {
  min-width: 220px;
  min-height: 56px;
  margin: 8px 0 0;
  padding: 0 40px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(255, 255, 255, .2);
  color: var(--app-bg);
  font: 700 18px/1 var(--font-text);
  letter-spacing: .18em;
  text-transform: uppercase;
  touch-action: manipulation;
  /* L'apparition anime `scale`, le toucher anime `transform` : ils se cumulent */
  animation: intro-pop .5s cubic-bezier(.2, 1.4, .4, 1) 1.35s both;
}

.intro__enter:active {
  transform: scale(.96);
}

.intro__enter:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.intro__group {
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .8);
  font: 600 14px/1 var(--font-text);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  touch-action: manipulation;
  animation: intro-fade .6s ease-out 1.6s both;
}

.intro__group.is-connected {
  text-decoration: none;
}

.intro__group:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Les cartes arrivent pendant que l'intro s'efface */
.deck {
  transition: opacity .6s ease-out .15s, transform .8s cubic-bezier(.2, .8, .2, 1) .1s;
}

.floors {
  transition: opacity .6s ease-out .3s;
}

body.intro-active .deck {
  opacity: 0;
  transform: translateY(8dvh) scale(.94);
}

body.intro-active .floors,
body.intro-active .group-toggle {
  opacity: 0;
}

@keyframes intro-glow {
  from { opacity: .55; }
  to   { opacity: 1; }
}

@keyframes intro-fade {
  from { opacity: 0; }
}

@keyframes intro-bar {
  from { transform: scaleY(0); }
}

@keyframes intro-rise {
  from { opacity: 0; transform: translateY(24px); }
}

@keyframes intro-pop {
  from { opacity: 0; scale: .8; }
}

@keyframes intro-out {
  to { transform: translateY(-100%); }
}

/* Partage : choix privé / public, code de groupe, suppression ------------- */

.sheet__choices {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sheet__choices .sheet__label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
}

.sheet__choices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sheet__choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 56px;
  padding: 10px 12px;
  border: 2px solid var(--deep);
  border-radius: 12px;
  background: #fff;
  color: var(--deep);
  touch-action: manipulation;
}

.sheet__choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sheet__choice:has(input:checked) {
  background: var(--deep);
  color: var(--holo-b);
}

.sheet__choice:has(input:focus-visible) {
  outline: 3px solid var(--holo-a);
  outline-offset: 2px;
}

.sheet__choice-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sheet__choice-hint {
  font-size: 14px;
  opacity: .8;
}

.sheet__notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--holo-a);
  font-size: 15px;
  line-height: 1.4;
}

.sheet__status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--deep);
  font-weight: 600;
  font-size: 15px;
  color: var(--holo-b);
}

.sheet__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: none;
  color: inherit;
  font: 700 15px/1.2 var(--font-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  touch-action: manipulation;
}

.sheet__inner > .sheet__link {
  align-self: center;
}

/* Ces éléments ont un display propre : [hidden] doit rester le plus fort */
.sheet__notice[hidden],
.sheet__status[hidden],
.sheet__link[hidden] {
  display: none;
}

.sheet__item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.sheet__item-foot .sheet__item-meta {
  margin: 0;
}

.sheet__badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--holo-b);
  box-shadow: inset 0 0 0 2px var(--deep);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sheet__badge--public {
  background: var(--holo-a);
}

.sheet__badge--attente {
  background: #fff;
}

.sheet__item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.sheet__action {
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 2px solid var(--deep);
  border-radius: 999px;
  background: transparent;
  color: var(--deep);
  font: 700 14px/1 var(--font-text);
  letter-spacing: .06em;
  text-transform: uppercase;
  touch-action: manipulation;
}

.sheet__delete.is-confirming {
  border-color: #c8102e;
  background: #c8102e;
  color: #fff;
}

.sheet__action:disabled {
  opacity: .5;
}

.sheet__choices[hidden] {
  display: none;
}

/* Bouton de groupe (en haut à gauche) et message bref ------------------------ */

.group-toggle {
  position: fixed;
  z-index: 10;
  top: calc(env(safe-area-inset-top) + 8px);
  left: env(safe-area-inset-left);
  display: grid;
  place-items: center;
  width: var(--rail);
  height: var(--rail);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  touch-action: manipulation;
  transition: opacity .6s ease-out .3s;
}

.group-toggle svg {
  width: 24px;
  height: 24px;
  opacity: .9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

/* Pastille verte : ce téléphone a le code de groupe */
.group-toggle::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2bd46a;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .55);
  opacity: 0;
}

.group-toggle.is-connected::after {
  opacity: 1;
}

.group-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -6px;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  width: min(calc(100% - 2 * var(--gutter)), 26rem);
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: #07070a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .18);
  color: #fff;
  font: 500 15px/1.35 var(--font-text);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .25s ease-out, transform .25s ease-out;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[hidden] {
  display: none;
}

/* Administration et changement d'étage ------------------------------------- */

.sheet__field[hidden] {
  display: none;
}

.sheet__select {
  padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2307070a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px;
}

.sheet__admin-tag {
  align-self: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--deep);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--holo-b);
}

/* Pastille orange : mode administrateur actif */
.group-toggle.is-admin::after {
  background: #ffb400;
  opacity: 1;
}

/* Classement par l'administrateur : ▲ / ▼ dans la liste -------------------- */

.sheet__item-order {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.sheet__order-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--deep);
  border-radius: 50%;
  background: transparent;
  color: var(--deep);
  touch-action: manipulation;
}

.sheet__order-btn:disabled {
  opacity: .3;
}

.sheet__order-icon {
  width: 22px;
  height: 22px;
}

.sheet__order-btn--bas .sheet__order-icon {
  transform: rotate(180deg);
}

.sheet__order-label {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .7;
}

@media (prefers-reduced-motion: reduce) {
  .card__art,
  .card__add-icon,
  .card__dot,
  .floors__dot::before,
  .deck,
  .floors,
  .group-toggle,
  .toast {
    transition: none;
  }

  .sheet[open],
  .intro::before,
  .intro__kicker,
  .intro__tagline,
  .intro__bar,
  .intro__title,
  .intro__enter,
  .intro__group {
    animation: none;
  }
}

/* ==========================================================================
   Étages — progression bleu → vert → jaune → rouge
   Uniquement des variables. La même règle colore l'étage, sa carte et son
   point dans le rail.
   --art-pos : cadrage vertical/horizontal (ex. "center 40%")
   --art-zoom : agrandissement autour de --art-pos (1 = aucun)
   ========================================================================== */

[data-level="01"] {
  --holo-a: #1f5eff;
  --holo-b: #d3e0ff;
  --deep: #06123a;
  --bg: #0a36c2;
  --glow: rgba(31, 94, 255, .6);
  --art-pos: center 35%;
  --art-zoom: 1.3
}

[data-level="02"] {
  --holo-a: #00aaff;
  --holo-b: #cdeeff;
  --deep: #032038;
  --bg: #0073b8;
  --glow: rgba(0, 170, 255, .6);
  --art-pos: center 35%;
 --art-zoom: 1
}

[data-level="03"] {
  --holo-a: #00d9b5;
  --holo-b: #c8f7ee;
  --deep: #022620;
  --bg: #00846e;
  --glow: rgba(0, 217, 181, .55);
  --art-pos: 48% 70%;
  --art-zoom: 1.15;
}

[data-level="04"] {
  --holo-a: #27d94f;
  --holo-b: #cff7d7;
  --deep: #05260c;
  --bg: #0f8a2c;
  --glow: rgba(39, 217, 79, .55);
  --art-pos: center 10%;
}

[data-level="05"] {
  --holo-a: #a6e800;
  --holo-b: #ebfac4;
  --deep: #1a2402;
  --bg: #5e8f00;
  --glow: rgba(166, 232, 0, .55);
  --art-pos: center 50%;
}

[data-level="06"] {
  --holo-a: #ffd500;
  --holo-b: #fff3b0;
  --deep: #2a2002;
  --bg: #c99a00;
  --glow: rgba(255, 213, 0, .5);
  --art-pos: center 50%;
   --art-zoom: 2
}

[data-level="07"] {
  --holo-a: #ffa000;
  --holo-b: #ffe3b3;
  --deep: #2b1702;
  --bg: #cc6f00;
  --glow: rgba(255, 160, 0, .55);
  --art-pos: center 65%;
}

[data-level="08"] {
  --holo-a: #ff6600;
  --holo-b: #ffd6bd;
  --deep: #2c0e02;
  --bg: #c94100;
  --glow: rgba(255, 102, 0, .55);
  --art-pos: center 45%;
}

[data-level="09"] {
  --holo-a: #ff3a1a;
  --holo-b: #ffcfc6;
  --deep: #2e0804;
  --bg: #bf1f0c;
  --glow: rgba(255, 58, 26, .55);
  --art-pos: center 80%;
}

[data-level="10"] {
  --holo-a: #ff0a45;
  --holo-b: #ffc7d3;
  --deep: #30030d;
  --bg: #ad0330;
  --glow: rgba(255, 10, 69, .6);
  --art-pos: center 20%;
}
