/* Rangs d'explorateur (5/11) : badge en pixel art, barre d'XP perso, fête de montée de rang. */
.rg-badge { display: inline-flex; align-items: flex-end; vertical-align: -0.15em; position: relative; line-height: 0; flex: none; }
.rg-badge svg { width: calc(11 * var(--px, 2px)); height: auto; image-rendering: pixelated; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .45)); }
.rg-badge.rg-5 svg { filter: drop-shadow(0 0 2px rgba(255, 220, 110, .45)) drop-shadow(0 1px 0 rgba(0, 0, 0, .45)); }
/* Le rang final brille : halo qui respire, deux petites étincelles (le reflet est dans le SVG, rangs.js) */
.rg-badge.rg-max svg { animation: rg-halo 2.4s ease-in-out infinite; }
.rg-badge.rg-max::before { content: ''; position: absolute; width: var(--px, 2px); height: var(--px, 2px); background: #fff8d0; right: calc(-1 * var(--px, 2px)); top: 20%;
  box-shadow: calc(-12 * var(--px, 2px)) calc(6 * var(--px, 2px)) 0 #fff8d0; animation: rg-etincelle 1.8s steps(2) infinite; pointer-events: none; }
@keyframes rg-halo { 0%, 100% { filter: drop-shadow(0 0 1px rgba(255, 214, 90, .5)) drop-shadow(0 1px 0 rgba(0, 0, 0, .45)); }
  50% { filter: drop-shadow(0 0 5px rgba(255, 224, 120, .95)) drop-shadow(0 0 2px rgba(190, 140, 255, .8)); } }
@keyframes rg-reflet { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes rg-etincelle { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rg-badge.rg-max svg, .rg-badge.rg-max::before { animation: none; } }

.rg-etiquette { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rg-etiquette .rg-nom { font-weight: bold; }
.rg-e2 .rg-nom { color: #eaa36c; } .rg-e3 .rg-nom { color: #d6e4f2; } .rg-e4 .rg-nom { color: #f3c94a; }
.rg-e5 .rg-nom { color: #7fe2ca; } .rg-e6 .rg-nom { color: #d9c2ff; text-shadow: 0 0 6px rgba(255, 214, 90, .6); }
.rg-barre { height: 8px; border: 2px solid #24160c; background: #3a2a1c; margin: 4px 0 2px; max-width: 320px; image-rendering: pixelated; }
.rg-barre i { display: block; height: 100%; background: linear-gradient(#ffe07a, #e0a020); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); transition: width .6s; }
.rg-barre.max i { background: linear-gradient(90deg, #bb94ff, #ffe07a, #bb94ff); background-size: 200% 100%; animation: rg-reflet 3s linear infinite; }
.rg-xp { font-size: 15px; display: flex; flex-wrap: wrap; gap: 0 6px; }
.gu-rang { margin: 6px 0 2px; }
.gu-rang .rg-aide { font-size: 15px; }
.gu-membre .rg-badge, .gu-present .rg-badge { margin-right: 4px; }
.profil-rang { margin: 6px 0; display: flex; flex-direction: column; gap: 2px; }

/* Fête de montée de rang : l'écusson tombe, tourne, rebondit ; rayons dorés derrière */
.rg-fete .gu-fete-box { text-align: center; }
.rg-fete-badge { display: flex; justify-content: center; margin: 10px 0 4px; position: relative; z-index: 1; }
.rg-fete-badge .rg-badge { animation: rg-tombe 1s cubic-bezier(.25, 1.5, .45, 1) both; }
.rg-fete-badge .rg-badge svg { width: calc(11 * 8px); }
@keyframes rg-tombe { 0% { transform: translateY(-140px) rotateY(0) scale(.4); opacity: 0; } 60% { transform: translateY(8px) rotateY(540deg) scale(1.1); opacity: 1; }
  80% { transform: translateY(-6px) rotateY(720deg) scale(1); } 100% { transform: none; } }
.rg-fete h2 { animation: rg-titre .5s .7s both; }
@keyframes rg-titre { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.rg-fete.rg-fete-max .gu-fete-box { box-shadow: 0 0 0 4px #f0c848, 0 0 40px rgba(187, 148, 255, .7); }
.rg-pluie-etoiles { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.rg-pluie-etoiles i { position: absolute; top: -12px; width: 6px; height: 6px; background: #ffe07a; box-shadow: 0 0 6px #fff3a0;
  animation: rg-chute 2.4s ease-in both; }
@keyframes rg-chute { to { transform: translateY(105vh) rotate(var(--r, 180deg)); opacity: .2; } }
@media (max-width: 600px) { .rg-fete-badge .rg-badge svg { width: calc(11 * 6px); } }

/* Carte « +N XP d'explorateur » en fin d'expédition (7/11) : cadre bois et or, lignes qui arrivent une à une, barre qui se remplit */
.rg-gain { position: fixed; right: 16px; bottom: 16px; z-index: 9000; width: min(380px, calc(100vw - 32px)); padding: 10px 12px 8px;
  background: linear-gradient(#2c1e12, #1d130b); border: 2px solid #f0c848; box-shadow: 0 0 0 2px #24160c, 0 6px 18px rgba(0, 0, 0, .55);
  image-rendering: pixelated; cursor: pointer; animation: rg-gain-entre .38s cubic-bezier(.2, 1.4, .4, 1) both; }
.rg-gain::before, .rg-gain::after { content: ''; position: absolute; width: 4px; height: 4px; background: #ffe07a; top: 3px; }
.rg-gain::before { left: 3px; } .rg-gain::after { right: 3px; }
@keyframes rg-gain-entre { from { transform: translateY(30px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.rg-gain.rg-gain-fin { animation: rg-gain-sort .42s ease-in both; }
@keyframes rg-gain-sort { to { transform: translateX(40px); opacity: 0; } }
.rg-gain-tete { display: flex; align-items: center; gap: 10px; }
.rg-gain-badge { display: inline-flex; min-width: 34px; justify-content: center; }
.rg-gain-titre { font-size: 22px; color: #ffe9a8; text-shadow: 0 2px 0 #000; }
.rg-gain-n { color: #ffe07a; display: inline-block; min-width: 1.5em; }
.rg-gain-nom { font-size: 15px; }
.rg-gain-lignes { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 4px; font-size: 15px; }
.rg-gain-l { display: flex; align-items: center; gap: 6px; opacity: 0; animation: rg-gain-ligne .3s calc(.25s + var(--i) * .18s) ease-out both; }
@keyframes rg-gain-ligne { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.rg-gain-ic { width: 20px; display: inline-flex; justify-content: center; flex: none; }
.rg-gain-barre { max-width: none; height: 10px; }
.rg-gain-barre i { transition: width .9s cubic-bezier(.3, .8, .4, 1); }
.rg-gain-pied { font-size: 14px; }
.rg-gain.rg-gain-eclat { animation: rg-gain-eclat .6s ease-out; }
@keyframes rg-gain-eclat { 0% { box-shadow: 0 0 0 2px #24160c, 0 0 0 rgba(255, 224, 122, 0); } 40% { box-shadow: 0 0 0 2px #24160c, 0 0 36px rgba(255, 224, 122, .95); transform: scale(1.04); } 100% { box-shadow: 0 0 0 2px #24160c, 0 6px 18px rgba(0, 0, 0, .55); } }
.rg-gain-eclat .rg-gain-badge .rg-badge { animation: rg-tombe .8s cubic-bezier(.25, 1.5, .45, 1) both; }
/* (8/11, rang v2) le multiplicateur de difficulté : chiffre qui « tape » en arrivant, plus chaud en N+ */
.rg-gain-mult b { display: inline-block; color: #ffb35c; animation: rg-gain-tape .42s calc(.33s + var(--i) * .18s) cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes rg-gain-tape { from { transform: scale(2.1) rotate(-8deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rg-gain, .rg-gain-l, .rg-gain.rg-gain-eclat, .rg-gain-mult b { animation: none; opacity: 1; } }
