/* Écrans du duo (appairage, À deux, souvenirs, liste commune, panneau bureau). Jetons « Écran » uniquement, aucune couleur en dur. */
.dv { position: absolute; inset: 0; }
.dv-sv { gap: var(--s-3); }
.dv-stack > * { min-width: 0; }
.dv-stack { display: grid; gap: var(--s-3); align-content: start; }
.dv-stack.tight { gap: var(--s-2); }
.dv-grow { flex: 1; display: grid; gap: 2px; }
.dv-row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.dv-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; width: 100%; }
.dv-actions > * { flex: 1 1 8rem; }
.dv-h2 { font-size: var(--fs-xl); }
.dv-lead { color: var(--c-ink); max-width: 34ch; text-wrap: balance; }
.dv-hint { min-height: 1.3em; text-align: center; color: var(--c-ink-2); font: 600 var(--fs-s) var(--font-ui); }
.dv-view { padding-bottom: var(--s-4); }

/* barre du haut */
.dv-top-l { display: flex; align-items: center; gap: var(--s-1); min-width: 0; flex: 1 1 auto; }
.dv-back {
  appearance: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin-left: -8px; border: 0; border-radius: var(--r-lcd);
  background: transparent; color: inherit; padding: 0; flex: none; min-width: var(--tap); min-height: var(--tap);
}
.dv-back:active { background: color-mix(in srgb, var(--c-screen) 22%, transparent); }

/* signature : deux orbes reliées par un fil (l'orbite de l'appareil, à deux) */
.dv-hero { display: grid; gap: var(--s-3); justify-items: center; text-align: center; padding-top: var(--s-2); }
.dv-hero-art, .dv-orbs { position: relative; width: 168px; height: 76px; }
.dv-orb { position: absolute; top: 14px; width: 48px; height: 48px; border-radius: 50%; border: var(--bw) solid var(--c-ink); background: var(--c-card-2); box-shadow: var(--shadow-key); }
.dv-orb-a { left: 8px; background: var(--c-accent); }
.dv-orb-b { right: 8px; background: var(--c-star); }
.dv-link { position: absolute; left: 54px; right: 54px; top: 37px; height: 0; border-top: var(--bw) dashed var(--c-ink); animation: dv-flow 1.8s linear infinite; }
@keyframes dv-flow { to { transform: translateX(3px); } }
.dv-empty .dv-orbs { height: 76px; }

/* code d'appairage */
.dv-code { display: flex; justify-content: center; gap: var(--s-3); padding: var(--s-4) var(--s-3); background: var(--c-card); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-lcd); box-shadow: inset 0 0 0 4px var(--c-card-2); }
.dv-code-g { font: 700 clamp(1.7rem, 9vw, 2.3rem)/1 var(--font-mono); letter-spacing: .12em; color: var(--c-ink); text-indent: .12em; user-select: all; }
.dv-skel-code { height: 84px; border-radius: var(--r-lcd); }
.dv-count { text-align: center; font: 600 var(--fs-s) var(--font-mono); color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.dv-meter { height: 6px; border-radius: 3px; background: var(--c-card-2); border: 1px solid var(--c-line-strong); overflow: hidden; }
.dv-meter i { display: block; height: 100%; width: calc(var(--p, 1) * 100%); background: var(--c-ink-2); transition: width 1s linear; }
.dv-wait { display: flex; align-items: center; justify-content: center; gap: var(--s-2); color: var(--c-ink-2); font-size: var(--fs-s); }
.dv-dots { display: inline-flex; gap: 4px; }
.dv-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ink-2); animation: dv-dot 1.2s ease-in-out infinite; }
.dv-dots i:nth-child(2) { animation-delay: .15s; } .dv-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dv-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.dv-code-in { width: 100%; min-width: 0; font: 700 var(--fs-xl)/1 var(--font-mono); letter-spacing: .16em; text-align: center; text-transform: uppercase; min-height: 60px; }

/* numéro de sécurité */
.dv-safety { display: flex; justify-content: center; gap: var(--s-3); padding: var(--s-4); background: var(--c-card); border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-lcd); }
.dv-safety-e { display: grid; place-items: center; width: 64px; height: 64px; line-height: 1; border-radius: var(--r-lcd); background: var(--c-card-2); border: var(--bw) solid var(--c-line-strong); animation: dv-pop var(--dur-3) var(--ease-pop) both; }
.dv-safety-e img { image-rendering: pixelated; display: block; }
.dv-safety-e[data-couleur="rose"] { background: #F6C6D0; } .dv-safety-e[data-couleur="vert"] { background: #C8E3B0; } .dv-safety-e[data-couleur="bleu"] { background: #BFD9F2; } .dv-safety-e[data-couleur="jaune"] { background: #FBE7A0; }
.dv-safety-e[data-couleur="violet"] { background: #D6C8F0; } .dv-safety-e[data-couleur="orange"] { background: #F9CFA0; } .dv-safety-e[data-couleur="menthe"] { background: #BFEAD9; } .dv-safety-e[data-couleur="rouge"] { background: #EFA9A0; }
.dv-safety-e[data-i="1"] { animation-delay: 90ms; } .dv-safety-e[data-i="2"] { animation-delay: 180ms; }
@keyframes dv-pop { from { opacity: 0; transform: scale(.7) translateY(6px); } to { opacity: 1; transform: none; } }
.dv-details { border: var(--bw) solid var(--c-line); border-radius: var(--r-lcd); padding: var(--s-2) var(--s-3); }
.dv-details summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 650; font-size: var(--fs-s); cursor: pointer; }
.dv-long { font: 600 var(--fs-m) var(--font-mono); letter-spacing: .06em; word-spacing: .4em; font-variant-numeric: tabular-nums; padding-bottom: var(--s-2); }

/* À deux : scène du compagnon de l'autre */
.dv-stage { position: relative; height: 168px; flex: none; border-radius: var(--r-lcd); background: var(--c-card); border: var(--bw) solid var(--c-line-strong); overflow: hidden; display: grid; place-items: end center; }
.dv-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: var(--c-card-2); border-top: var(--bw) solid var(--c-line); }
.dv-pet { position: relative; z-index: 1; width: 108px; height: 108px; margin-bottom: 10px; }
.dv-pet mm-pet { --pet-size: 108px; width: 108px; height: 108px; }
.dv-bubble { flex: none; width: 100%; max-width: 24rem; margin-inline: auto; font-size: var(--fs-s); }
.dv-hearts { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.dv-heart { position: absolute; left: 50%; bottom: 62px; display: grid; width: 22px; height: 22px; color: var(--c-star); opacity: 0; margin-left: -.6rem; animation: dv-heart 1.1s var(--ease-out) var(--dl, 0ms) both; }
@keyframes dv-heart { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -110px) scale(1.1) rotate(8deg); } }
.dv-who { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.dv-name { font-size: var(--fs-l); }
.dv-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 .8em; border-radius: var(--r-pill); border: var(--bw) solid var(--c-line-strong); background: var(--c-card-2); font: 650 var(--fs-xs) var(--font-ui); white-space: nowrap; }
.dv-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-ink-2); }
.dv-chip[data-state="connecte"]::before { background: var(--c-good); }
.dv-chip[data-state="hors-ligne"]::before { background: var(--c-warn); }
.dv-bubble-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); }
.dv-bubble-row[hidden] { display: none; }
.dv-bubble-row > [hidden] { display: none; }
.dv-bubble-row:has(> [hidden]:first-child) { grid-template-columns: 1fr; }

.dv-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.dv-tile {
  appearance: none; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 76px; padding: var(--s-2); border: var(--bw) solid var(--c-line-strong);
  border-radius: var(--r-lcd); background: var(--c-card); color: var(--c-ink); font: 650 var(--fs-xs)/1.2 var(--font-ui); text-align: center; box-shadow: var(--shadow-key);
  transition: transform var(--dur-1) var(--ease-out);
}
.dv-tile:active { transform: translateY(1px) scale(.98); box-shadow: none; }
.dv-tile-e { display: grid; place-items: center; height: 28px; color: var(--c-ink); }
.dv-heart svg { fill: currentColor; }
.dv-row-e { display: grid; place-items: center; color: var(--c-ink-2); }
.dv-tile.done { border-style: dashed; color: var(--c-ink-2); }
.dv-tile.done .dv-tile-e::after { content: " ✓"; font-size: .9rem; }
.dv-quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }

.dv-recent { gap: var(--s-2); }
.dv-row { min-height: 48px; }
.dv-row.unseen { border-color: var(--c-accent); box-shadow: inset 4px 0 0 var(--c-accent); }
.dv-row-e { font-size: 1.2rem; }
.dv-none { color: var(--c-ink-2); font-size: var(--fs-s); padding: var(--s-2) 0; list-style: none; }

/* feuilles */
.dv-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--r-lcd); border: var(--bw) solid var(--c-line-strong); background: var(--c-card); }
.dv-count-n[data-near="true"] { color: var(--c-accent); font-weight: 650; }
.dv-grid { padding: 2px; }
.dv-art { display: block; }
.dv-art svg { width: 72px; height: 62px; }
.dv-gift { position: relative; display: grid; justify-items: center; gap: var(--s-2); text-align: center; padding: var(--s-4) 0; overflow: hidden; }
.dv-gift .dv-art svg { width: 112px; height: 96px; animation: dv-gift .7s var(--ease-pop) both; }
@keyframes dv-gift { from { opacity: 0; transform: scale(.5) rotate(-8deg); } to { opacity: 1; transform: none; } }
.dv-quote { font-style: italic; max-width: 28ch; }
.dv-confetti { position: absolute; inset: 0; pointer-events: none; }
.dv-confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 12px; border-radius: 2px; background: var(--c-accent); transform: rotate(var(--r)); animation: dv-fall 1.6s ease-in var(--d) both; }
.dv-confetti i[data-k="1"] { background: var(--c-star); } .dv-confetti i[data-k="2"] { background: var(--c-good); } .dv-confetti i[data-k="3"] { background: var(--c-ink); }
@keyframes dv-fall { to { transform: translateY(260px) rotate(calc(var(--r) + 220deg)); opacity: 0; } }

/* souvenirs */
.dv-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.dv-thumb { position: relative; appearance: none; padding: 0; aspect-ratio: 1; border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-s); background: var(--c-card); overflow: hidden; }
.dv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dv-thumb-who { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-card-2); color: var(--c-ink); font: 700 var(--fs-xs) var(--font-ui); border: 1px solid var(--c-line-strong); }
.dv-day, .dv-year { display: grid; gap: var(--s-2); }
.dv-year { padding: var(--s-3); border: var(--bw) solid var(--c-accent); border-radius: var(--r-lcd); background: var(--c-card); }
.dv-year-t { font-size: var(--fs-m); }
.dv-fig { margin: 0; display: grid; gap: var(--s-2); }
.dv-fig img { width: 100%; max-height: 52vh; object-fit: contain; border-radius: var(--r-lcd); background: var(--c-card); }
.dv-polaroids { position: relative; width: 120px; height: 84px; }
.dv-polaroids i { position: absolute; top: 6px; width: 54px; height: 66px; background: var(--c-card-2); border: var(--bw) solid var(--c-line-strong); border-bottom-width: 14px; border-radius: 4px; }
.dv-polaroids i:nth-child(1) { left: 6px; transform: rotate(-9deg); } .dv-polaroids i:nth-child(2) { left: 32px; transform: rotate(2deg); background: var(--c-card); } .dv-polaroids i:nth-child(3) { right: 6px; transform: rotate(9deg); }

/* liste commune */
.dv-add { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); align-items: end; }
.dv-add-field input { width: 100%; }
.dv-sync { flex: 1; }
.dv-item { display: flex; align-items: stretch; border: var(--bw) solid var(--c-line-strong); border-radius: var(--r-lcd); background: var(--c-card); overflow: hidden; }
.dv-check { appearance: none; flex: 1; display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: var(--s-2) var(--s-3); border: 0; background: transparent; color: var(--c-ink); text-align: left; font: 500 var(--fs-m)/1.3 var(--font-ui); }
.dv-box { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: var(--bw) solid var(--c-ink); border-radius: 8px; background: var(--c-card-2); font-weight: 800; color: var(--c-accent-ink); }
.dv-check[aria-checked="true"] .dv-box { background: var(--c-accent); border-color: var(--c-accent); animation: dv-pop var(--dur-2) var(--ease-pop); }
.dv-text { overflow-wrap: anywhere; }
.is-done .dv-text { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--c-ink-2); }
.dv-del { appearance: none; flex: none; width: var(--tap); border: 0; border-left: var(--bw) solid var(--c-line); background: transparent; color: var(--c-ink-2); font: 400 1.6rem/1 var(--font-ui); }
.dv-del:active { background: color-mix(in srgb, var(--c-ink) 12%, transparent); }
.dv-check:focus-visible, .dv-del:focus-visible, .dv-tile:focus-visible, .dv-thumb:focus-visible, .dv-back:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; box-shadow: none; }

/* panneau bureau : le petit marcheur */
.dv-walkway { position: relative; width: 100%; height: 44px; border-bottom: var(--bw) solid var(--c-line-strong); overflow: hidden; }
.dv-walker { position: absolute; bottom: -2px; left: 0; width: 28px; height: 28px; border-radius: 50% 50% 40% 40%; background: var(--c-accent); animation: dv-walk 7s ease-in-out infinite alternate; }
.dv-walker::after { content: ""; position: absolute; top: 9px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--c-accent-ink); }
@keyframes dv-walk { from { transform: translateX(0); } to { transform: translateX(calc(min(100vw, 340px) - 84px)); } }

/* mouvement réduit : tout reste posé */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .dv-link, :root:not([data-motion="full"]) .dv-dots i, :root:not([data-motion="full"]) .dv-walker,
  :root:not([data-motion="full"]) .dv-heart, :root:not([data-motion="full"]) .dv-confetti { animation: none; }
  :root:not([data-motion="full"]) .dv-heart, :root:not([data-motion="full"]) .dv-confetti { display: none; }
}
:root[data-motion="reduce"] .dv-link, :root[data-motion="reduce"] .dv-dots i, :root[data-motion="reduce"] .dv-walker { animation: none; }
:root[data-motion="reduce"] .dv-heart, :root[data-motion="reduce"] .dv-confetti { display: none; }
.dv-inline-ico { display: flex; align-items: center; gap: var(--s-2); }

/* ---------- Jeux à deux (screens/jeux-duo.js) : cases sobres, mêmes bordures que .dv-tile ---------- */
.dv-jeu-ligne { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.dv-jeu-nom { display: grid; gap: 2px; min-width: 0; }
.dv-jeu-nom small { color: var(--c-ink-soft, inherit); opacity: .8; }
.dv-morpion { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1, 4px); max-width: 260px; margin: 0 auto var(--s-3, 16px); }
.dv-case { aspect-ratio: 1; font: inherit; font-size: 28px; border: 2px solid currentColor; border-radius: var(--r-2, 10px); background: transparent; color: inherit; cursor: pointer; }
.dv-case:disabled { cursor: default; opacity: .85; }
.dv-case-gagne { opacity: 1; border-width: 4px; font-weight: 700; }
.dv-case:focus-visible, .dv-px:focus-visible { outline: 3px solid var(--c-focus, #B8402A); outline-offset: 1px; }
.dv-px-grille { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; width: min(100%, 320px); margin-inline: auto; }
.dv-px-palette { display: flex; flex-wrap: wrap; gap: var(--s-1, 4px); justify-content: center; }
.dv-px { aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid rgba(0, 0, 0, .25); border-radius: 3px; background: transparent; cursor: pointer; }
.dv-px-palette .dv-px { width: 32px; border-radius: 8px; }
.dv-px-palette .dv-px[aria-pressed="true"] { outline: 3px solid currentColor; outline-offset: 1px; }
.dv-px:disabled { cursor: default; }
.dv-px[data-c="1"] { background: #8FC7E8; }
.dv-px[data-c="2"] { background: #F6B94A; }
.dv-px[data-c="3"] { background: #F7A1A8; }
.dv-px[data-c="4"] { background: #FFF3DC; }
.dv-px[data-c="5"] { background: #35506B; }
.dv-px[data-c="6"] { background: #33734A; }
.dv-px[data-c="7"] { background: #A52A3B; }
.dv-px[data-c="8"] { background: #2F45B5; }
