/* =========================================================================
   notif.css — la cloche de la barre du haut et sa pastille (2026-09-13).
   Chargé après style.css (app/layout.tsx). Le panneau lui-même reste dans style.css.
   1. La cloche : bouton rond, s'éclaire quand il y a du non-lu.
   2. La pastille : un vrai compteur, découpé du bord de la cloche par un
      liseré couleur du fond. Elle entre en grossissant (0,6 → 1), le chiffre
      change en fondu flouté (NotifPanel.tsx pose .is-swapping 140 ms), « 99+ » au-delà.
   3. Une arrivée fait tinter la cloche une fois (pivot en haut, 520 ms) : rare, donc permis.
   4. Pastille d'onglet (.tab-badge, NotifPanel.tsx TabBadge) : le même
      compteur dans les onglets du Marché, des Amis, du Portefeuille, de la Guilde.
   5. Mise en lumière (.is-spot, goNotifHref) : l'onglet ou le fil où mène une
      notification s'allume une fois à l'arrivée, 1,2 s, puis plus rien.
   Au repos, rien ne bouge.
   ========================================================================= */

/* 1. La cloche */
.notif-bell{position:relative;width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--surface) 88%,transparent);color:var(--muted);cursor:pointer;transition:color 160ms ease,border-color 160ms ease,transform 140ms var(--ease-out)}
.notif-bell svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}
.notif-bell:hover{color:var(--text);border-color:color-mix(in srgb,var(--mint) 26%,transparent)}
.notif-bell:active{transform:scale(.95)}
.notif-bell.has-unread{color:var(--text)}
.notif-bell[aria-expanded="true"]{color:var(--mint);border-color:color-mix(in srgb,var(--mint) 50%,transparent)}

/* 2. La pastille */
.notif-count{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:var(--mint);color:var(--on-accent);font-size:var(--fs-xs);font-weight:800;font-variant-numeric:tabular-nums;line-height:1;box-shadow:0 0 0 2px var(--bg);transform:scale(.6);opacity:0;pointer-events:none;transition:transform 200ms var(--ease-out),opacity 160ms ease}
.notif-bell.has-unread .notif-count{transform:scale(1);opacity:1}
.notif-count i{display:block;font-style:normal;transition:opacity 140ms ease,filter 140ms ease,transform 180ms var(--ease-out)}
.notif-count.is-swapping i{opacity:0;filter:blur(2px);transform:translateY(-4px)}

/* 3. Le tintement */
.notif-bell.is-ringing svg{transform-origin:50% 12%;animation:bell-ring 520ms var(--ease-out)}
@keyframes bell-ring{0%{rotate:0deg}18%{rotate:13deg}40%{rotate:-10deg}62%{rotate:6deg}82%{rotate:-3deg}100%{rotate:0deg}}

@media (prefers-reduced-motion:reduce){
  .notif-bell.is-ringing svg{animation:none}
  .notif-count{transition:opacity 160ms ease}
}

/* 4. Pastille d'onglet */
.tab-badge{display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:6px;padding:0 5px;border-radius:999px;font-style:normal;font-size:var(--fs-xs);font-weight:800;font-variant-numeric:tabular-nums;line-height:1;color:var(--on-accent);background:var(--mint);animation:badge-in .28s var(--ease-pop)}

/* 5. Mise en lumière de la cible */
.is-spot{animation:spotRing 1.2s var(--ease-out)}
@keyframes spotRing{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--mint) 70%,transparent)}35%{box-shadow:0 0 0 6px color-mix(in srgb,var(--mint) 35%,transparent)}100%{box-shadow:0 0 0 10px transparent}}
@media (prefers-reduced-motion:reduce){.tab-badge{animation:none}.is-spot{animation:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--mint) 60%,transparent)}}

/* Rangée des sections : elle défile en largeur (overflow-x), ce qui la rend compressible dans la
   colonne du panneau ; au doigt, avec des onglets de 44 px, la liste l'écrasait à mi-hauteur
   (relevé Android, 2026-09-26). Elle garde sa hauteur. */
.notif-tabs{flex-shrink:0}
/* À la souris, la rangée ne défile pas (pas de molette de côté, pas de barre) : « Guilde » restait
   coupé et « Récompenses » hors d'atteinte dans le volet de 420 px (relevé PC, 2026-10-17). Les
   onglets passent à la ligne ; au doigt, la rangée défile comme avant. */
@media (hover:hover) and (pointer:fine){.notif-tabs{flex-wrap:wrap}}

/* 6. Effacer (NotifPanel.tsx, revue design 2026-10-29) : le ✕ au survol et au
   focus sur BUREAU, le glissé vers la gauche au DOIGT, l'intertitre
   « Lues · N — Effacer » au-dessus des lues, et un toast « Annuler » (pas de
   modale : l'effacement est différé, l'annulation ne renvoie rien au serveur). */

/* Le rang enveloppe l'article : il le clippe quand il glisse et révèle
   dessous l'action rouge « Effacer ». */
/* `flex-shrink:0` est vital : `.notif-list` est une colonne flexible de hauteur
   bornée, et un enfant en `overflow:hidden` perd son plancher de hauteur (son
   `min-height:auto` vaut 0). Sans lui, dès que la liste dépasse le volet, chaque
   ligne s'écrase à quelques pixels et seule la notification épinglée reste
   visible (production, 2026-10-31 : 32 lignes mesurées entre 5 et 8 px). */
.notif-row{position:relative;flex-shrink:0;border-radius:12px;overflow:hidden}
/* L'action rouge est TRANSPARENTE au repos : elle ne se peint que pendant un
   glissé (.is-swiping, posé par le JS). Sinon elle transparaît sous les lignes
   qui montent en opacité à l'ouverture du panneau — le « flash rouge ». */
.notif-row-action{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-end;gap:6px;padding-right:22px;background:var(--danger);color:#fff;font-size:var(--fs-sm);font-weight:600;pointer-events:none;opacity:0}
.notif-row.is-swiping .notif-row-action{opacity:1}
.notif-row-action .line-icon{width:16px;height:16px}
/* L'article couvre l'action au repos (il porte le fond du panneau, opaque même
   au survol) ; `touch-action:pan-y` garde le défilement vertical au doigt. */
.notif-row .notif{background:var(--surface);touch-action:pan-y}
.notif-row .notif:hover,.notif-row .notif:focus-visible{background:color-mix(in srgb,var(--text) 4%,var(--surface))}

/* Le ✕ : dans le coin ; la 3e colonne (.notif-dot, 10px) est vide sur une lue,
   donc il ne couvre la pastille que sur une non-lue au survol — on masque alors
   la pastille pour qu'ils ne se chevauchent pas. */
.notif-del{position:absolute;top:7px;right:7px;width:24px;height:24px;display:grid;place-items:center;border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--surface) 86%,transparent);color:var(--dim);cursor:pointer;opacity:0;transition:opacity 140ms ease,color 140ms ease,border-color 140ms ease}
.notif-del .line-icon{width:14px;height:14px}
.notif:hover .notif-del,.notif:focus-within .notif-del{opacity:1}
.notif:hover .notif-dot,.notif:focus-within .notif-dot{opacity:0}
.notif-del:hover,.notif-del:focus-visible{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,transparent)}
/* Au doigt (pas de survol), c'est le glissé qui efface : on retire le ✕ pour ne
   pas doubler l'affordance ni chevaucher la pastille d'une non-lue. */
@media (hover:none){.notif-del{display:none}}

/* L'intertitre des lues : un libellé discret, un bouton « Effacer » à droite. */
.notif-lues{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 2px 0;padding:6px 4px 6px 10px}
.notif-lues-label{font-size:var(--fs-xs);font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);font-variant-numeric:tabular-nums}
.notif-lues-clear{min-height:32px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:var(--fs-sm);font-weight:600;cursor:pointer;transition:color 140ms ease,background 140ms ease}
.notif-lues-clear:hover,.notif-lues-clear:focus-visible{color:var(--text);background:color-mix(in srgb,var(--text) 6%,transparent)}
