/* ==========================================================================
   SUBIR DE NIVEL SE CELEBRA — css/nivel.css
   ==========================================================================
   Cobrar el premio de nivel en «Tu progreso» se celebra
   (specs/099-ideas-una-por-una, research D7; en la web desde el 24/11/2026).
   Las piezas: la insignia grande, que gira (su cara y su número, en
   css/insignia-nivel.css; aquí, su dorso y su canto), y la celebración:
   un diálogo nativo con su luz, sus rayos, sus ondas, sus estrellas y los
   premios, que son de verdad. El script (js/nivel.js) lo mueve todo con la
   API de animaciones, y desde aquí solo recibe atributos y dos variables:
   --rb-fiesta-x e -y (el centro de la luz, que es el de la insignia).
   ========================================================================== */

@layer rb-piezas {
  /* --- La grande, con su dorso y su canto (la cara y el número, en css/insignia-nivel.css) --- */
  .rb-insignia-nivel-grande {
    --rb-insignia-dorso: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 232'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='.12' y1='0' x2='.88' y2='1'%3E%3Cstop offset='0' stop-color='%23fff8d6'/%3E%3Cstop offset='.26' stop-color='%23ffd862'/%3E%3Cstop offset='.55' stop-color='%23f2a92a'/%3E%3Cstop offset='.8' stop-color='%23b26a10'/%3E%3Cstop offset='1' stop-color='%236a3805'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='.15' y1='0' x2='.85' y2='1'%3E%3Cstop offset='0' stop-color='%235e3004'/%3E%3Cstop offset='.4' stop-color='%23a9640e'/%3E%3Cstop offset='.78' stop-color='%23ffd36a'/%3E%3Cstop offset='1' stop-color='%23fff2bd'/%3E%3C/linearGradient%3E%3CradialGradient id='e' cx='.5' cy='.28' r='.82'%3E%3Cstop offset='0' stop-color='%23a77bff'/%3E%3Cstop offset='.36' stop-color='%236334e0'/%3E%3Cstop offset='.72' stop-color='%232d1494'/%3E%3Cstop offset='1' stop-color='%23160a52'/%3E%3C/radialGradient%3E%3ClinearGradient id='c' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff4c4'/%3E%3Cstop offset='.42' stop-color='%23ffd04f'/%3E%3Cstop offset='.8' stop-color='%23d4890f'/%3E%3Cstop offset='1' stop-color='%238a4f08'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd3e6'/%3E%3Cstop offset='.45' stop-color='%23ff4f9a'/%3E%3Cstop offset='1' stop-color='%2393104f'/%3E%3C/linearGradient%3E%3ClinearGradient id='z' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23eafcff'/%3E%3Cstop offset='.4' stop-color='%236fd6ff'/%3E%3Cstop offset='.75' stop-color='%231b8fd8'/%3E%3Cstop offset='1' stop-color='%230b3f7a'/%3E%3C/linearGradient%3E%3ClinearGradient id='s' x1='0' y1='0' x2='.3' y2='1'%3E%3Cstop offset='0' stop-color='%2305011c' stop-opacity='.75'/%3E%3Cstop offset='.55' stop-color='%2305011c' stop-opacity='.25'/%3E%3Cstop offset='1' stop-color='%2305011c' stop-opacity='.05'/%3E%3C/linearGradient%3E%3ClinearGradient id='v' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='.34'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='.03'/%3E%3C/linearGradient%3E%3CclipPath id='k'%3E%3Cpath d='M100.00 56.50 L165.38 94.25 L165.38 169.75 L100.00 207.50 L34.62 169.75 L34.62 94.25 Z'/%3E%3C/clipPath%3E%3CradialGradient id='o' cx='.5' cy='.35' r='.8'%3E%3Cstop offset='0' stop-color='%239a6518'/%3E%3Cstop offset='.6' stop-color='%234f2d08'/%3E%3Cstop offset='1' stop-color='%232a1604'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M100.00 40.00 L179.67 86.00 L171.45 90.75 L100.00 49.50 Z' fill='%23ffd45e'/%3E%3Cpath d='M179.67 86.00 L179.67 178.00 L171.45 173.25 L171.45 90.75 Z' fill='%23d18a1a'/%3E%3Cpath d='M179.67 178.00 L100.00 224.00 L100.00 214.50 L171.45 173.25 Z' fill='%2393520a'/%3E%3Cpath d='M100.00 224.00 L20.33 178.00 L28.55 173.25 L100.00 214.50 Z' fill='%23c47c14'/%3E%3Cpath d='M20.33 178.00 L20.33 86.00 L28.55 90.75 L28.55 173.25 Z' fill='%23ffcf55'/%3E%3Cpath d='M20.33 86.00 L100.00 40.00 L100.00 49.50 L28.55 90.75 Z' fill='%23fff1b5'/%3E%3Cpath d='M100.00 49.50 L171.45 90.75 L165.38 94.25 L100.00 56.50 Z' fill='%238f5009'/%3E%3Cpath d='M171.45 90.75 L171.45 173.25 L165.38 169.75 L165.38 94.25 Z' fill='%23e9a836'/%3E%3Cpath d='M171.45 173.25 L100.00 214.50 L100.00 207.50 L165.38 169.75 Z' fill='%23ffe08a'/%3E%3Cpath d='M100.00 214.50 L28.55 173.25 L34.62 169.75 L100.00 207.50 Z' fill='%23f0b444'/%3E%3Cpath d='M28.55 173.25 L28.55 90.75 L34.62 94.25 L34.62 169.75 Z' fill='%23a35f0d'/%3E%3Cpath d='M28.55 90.75 L100.00 49.50 L100.00 56.50 L34.62 94.25 Z' fill='%236e3a05'/%3E%3Cpath d='M100.00 40.00 L179.67 86.00 L179.67 178.00 L100.00 224.00 L20.33 178.00 L20.33 86.00 Z' fill='none' stroke='%233a1d02' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M21.6 177 L21.6 86.6 L100 41.4' fill='none' stroke='%23fffbe8' stroke-width='1.4' stroke-linecap='round' opacity='.9'/%3E%3Cpath d='M100.00 49.50 L171.45 90.75 L171.45 173.25 L100.00 214.50 L28.55 173.25 L28.55 90.75 Z' fill='none' stroke='%235a2e04' stroke-width='.8' opacity='.6'/%3E%3Ccircle cx='175.56' cy='88.38' r='2.6' fill='%23fff1b8' stroke='%235a2e04' stroke-width='1'/%3E%3Ccircle cx='175.56' cy='175.63' r='2.6' fill='%23fff1b8' stroke='%235a2e04' stroke-width='1'/%3E%3Ccircle cx='24.44' cy='175.63' r='2.6' fill='%23fff1b8' stroke='%235a2e04' stroke-width='1'/%3E%3Ccircle cx='24.44' cy='88.38' r='2.6' fill='%23fff1b8' stroke='%235a2e04' stroke-width='1'/%3E%3Cpath d='M100.00 56.50 L165.38 94.25 L165.38 169.75 L100.00 207.50 L34.62 169.75 L34.62 94.25 Z' fill='url%28%23o%29'/%3E%3Cg clip-path='url%28%23k%29'%3E%3Cpath d='M100 132 L210.0 132.0 L209.6 140.8 ZM100 132 L207.9 153.5 L205.8 162.0 ZM100 132 L201.6 174.1 L197.9 182.1 ZM100 132 L191.5 193.1 L186.3 200.2 ZM100 132 L177.8 209.8 L171.3 215.7 ZM100 132 L161.1 223.5 L153.6 228.1 ZM100 132 L142.1 233.6 L133.8 236.7 ZM100 132 L121.5 239.9 L112.8 241.3 ZM100 132 L100.0 242.0 L91.2 241.6 ZM100 132 L78.5 239.9 L70.0 237.8 ZM100 132 L57.9 233.6 L49.9 229.9 ZM100 132 L38.9 223.5 L31.8 218.3 ZM100 132 L22.2 209.8 L16.3 203.3 ZM100 132 L8.5 193.1 L3.9 185.6 ZM100 132 L-1.6 174.1 L-4.7 165.8 ZM100 132 L-7.9 153.5 L-9.3 144.8 ZM100 132 L-10.0 132.0 L-9.6 123.2 ZM100 132 L-7.9 110.5 L-5.8 102.0 ZM100 132 L-1.6 89.9 L2.1 81.9 ZM100 132 L8.5 70.9 L13.7 63.8 ZM100 132 L22.2 54.2 L28.7 48.3 ZM100 132 L38.9 40.5 L46.4 35.9 ZM100 132 L57.9 30.4 L66.2 27.3 ZM100 132 L78.5 24.1 L87.2 22.7 ZM100 132 L100.0 22.0 L108.8 22.4 ZM100 132 L121.5 24.1 L130.0 26.2 ZM100 132 L142.1 30.4 L150.1 34.1 ZM100 132 L161.1 40.5 L168.2 45.7 ZM100 132 L177.8 54.2 L183.7 60.7 ZM100 132 L191.5 70.9 L196.1 78.4 ZM100 132 L201.6 89.9 L204.7 98.2 ZM100 132 L207.9 110.5 L209.3 119.2 Z' fill='%23ffd56a' opacity='.08'/%3E%3Cpath d='M100.00 56.50 L165.38 94.25 L165.38 169.75 L100.00 207.50 L34.62 169.75 L34.62 94.25 Z' fill='none' stroke='url%28%23s%29' stroke-width='16'/%3E%3C/g%3E%3Cpath d='M100.00 56.50 L165.38 94.25 L165.38 169.75 L100.00 207.50 L34.62 169.75 L34.62 94.25 Z' fill='none' stroke='%232a1604' stroke-width='1.6'/%3E%3Cpath d='M100.00 65.00 L158.02 98.50 L158.02 165.50 L100.00 199.00 L41.98 165.50 L41.98 98.50 Z' fill='none' stroke='%23ffd56a' stroke-width='1.4' opacity='.45'/%3E%3Ccircle cx='100' cy='132' r='40' fill='none' stroke='%23ffd56a' stroke-width='1.2' opacity='.4'/%3E%3Cpath d='M100 98 Q105.44 126.56 134 132 Q105.44 137.44 100 166 Q94.56 137.44 66 132 Q94.56 126.56 100 98 Z' fill='url%28%23a%29' stroke='%234c2803' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M100 98 Q105 127 134 132 Q105 128 100 132 Z' fill='%23fffbe8' opacity='.5'/%3E%3Cpath d='M67 58 L62 24 L84 39 L100 10 L116 39 L138 24 L133 58 Z' fill='url%28%23c%29' stroke='%234c2803' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M70 54 L67 32 L84 44 L100 20 L104 28 L88 50 Z' fill='%23fffbe8' opacity='.35'/%3E%3Ccircle cx='62' cy='22' r='4.2' fill='url%28%23c%29' stroke='%234c2803' stroke-width='1.5'/%3E%3Ccircle cx='100' cy='8.5' r='5' fill='url%28%23c%29' stroke='%234c2803' stroke-width='1.5'/%3E%3Ccircle cx='138' cy='22' r='4.2' fill='url%28%23c%29' stroke='%234c2803' stroke-width='1.5'/%3E%3Crect x='64' y='47' width='72' height='13' rx='3' fill='url%28%23a%29' stroke='%234c2803' stroke-width='1.8'/%3E%3Cpath d='M100 43.5 L108 53.5 L100 63.5 L92 53.5 Z' fill='url%28%23r%29' stroke='%234a0627' stroke-width='1.3'/%3E%3Cpath d='M100 46.5 L104 53 L100 53 Z' fill='%23ffffff' opacity='.6'/%3E%3Ccircle cx='79' cy='53.5' r='3.4' fill='url%28%23z%29' stroke='%23082a52' stroke-width='1'/%3E%3Ccircle cx='121' cy='53.5' r='3.4' fill='url%28%23z%29' stroke='%23082a52' stroke-width='1'/%3E%3Cpath d='M20.3 115 L29.8 132 L20.3 149 L10.8 132 Z' fill='url%28%23z%29' stroke='%23082a52' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M20.3 118.5 L25.5 131 L20.3 131 Z' fill='%23ffffff' opacity='.55'/%3E%3Cpath d='M179.7 115 L189.2 132 L179.7 149 L170.2 132 Z' fill='url%28%23z%29' stroke='%23082a52' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M179.7 118.5 L184.89999999999998 131 L179.7 131 Z' fill='%23ffffff' opacity='.55'/%3E%3Cpath d='M100 207 L110 219.5 L100 231 L90 219.5 Z' fill='url%28%23r%29' stroke='%234a0627' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M100 210.5 L105 219 L100 219 Z' fill='%23ffffff' opacity='.55'/%3E%3C/svg%3E");
    transform-style: preserve-3d;
  }

  .rb-insignia-nivel-dorso,
  .rb-insignia-nivel-canto,
  .rb-insignia-nivel-brillo {
    position: absolute;
    inset: 0;
  }

  .rb-insignia-nivel-dorso {
    background: var(--rb-insignia-dorso) center / 100% 100% no-repeat;
    backface-visibility: hidden;
    transform: rotateY(180deg) translateZ(5px);
  }

  /* El canto: cuatro hexágonos de metal entre la cara y el dorso, que se ven al girar de perfil. */
  .rb-insignia-nivel-canto {
    clip-path: polygon(50% 17.24%, 89.84% 37.07%, 89.84% 76.72%, 50% 96.55%, 10.16% 76.72%, 10.16% 37.07%);
    background: linear-gradient(90deg, #4f2803, #b8751a 30%, #f6c862 50%, #b8751a 70%, #4f2803);
  }

  .rb-insignia-nivel-canto:nth-child(1) { transform: translateZ(3px); }
  .rb-insignia-nivel-canto:nth-child(2) { transform: translateZ(1px); }
  .rb-insignia-nivel-canto:nth-child(3) { transform: translateZ(-1px); }
  .rb-insignia-nivel-canto:nth-child(4) { transform: translateZ(-3px); }

  /* La grande, con grosor: la cara, un poco adelante. Por dentro, todo se inclina hacia el puntero (--rb-rx y
     --rb-ry) mientras su luz lo sigue (--rb-lx, --rb-ly y --rb-luz). La cara y el dorso, en su propia capa: así el
     dorso nunca sale sin pintar al girar. */
  .rb-insignia-nivel-grande .rb-insignia-nivel-cara {
    backface-visibility: hidden;
    transform: translateZ(5px);
  }

  .rb-insignia-nivel-grande .rb-insignia-nivel-cara,
  .rb-insignia-nivel-grande .rb-insignia-nivel-dorso {
    will-change: transform;
  }

  .rb-insignia-nivel-inclinada {
    position: absolute;
    inset: 0;
    transform: rotateX(var(--rb-rx, 0deg)) rotateY(var(--rb-ry, 0deg));
    transform-style: preserve-3d;
  }

  .rb-insignia-nivel-luz {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 17.24%, 89.84% 37.07%, 89.84% 76.72%, 50% 96.55%, 10.16% 76.72%, 10.16% 37.07%);
    background: radial-gradient(circle at var(--rb-lx, 30%) var(--rb-ly, 25%), rgb(255 250 235 / 0.3), rgb(255 240 210 / 0.06) 32%, transparent 56%);
    mix-blend-mode: screen;
    opacity: var(--rb-luz, 0);
    pointer-events: none;
  }

  /* Cada cifra de la grande es una ventana con su tira: el cuentakilómetros. */
  .rb-odo {
    display: block;
    height: 1em;
    overflow: hidden;
  }

  .rb-odo-tira {
    display: block;
  }

  .rb-odo-tira > span,
  .rb-odo-fija {
    display: block;
    height: 1em;
    background: linear-gradient(180deg, #ffffff 12%, #ffeeb8 46%, #ffc24a 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* El barrido de luz que la cruza una vez al subir. */
  .rb-insignia-nivel-brillo {
    clip-path: polygon(50% 17.24%, 89.84% 37.07%, 89.84% 76.72%, 50% 96.55%, 10.16% 76.72%, 10.16% 37.07%);
    background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.7) 50%, transparent 62%) -100% 0 / 280% 100% no-repeat;
    mix-blend-mode: soft-light;
    opacity: 0;
    pointer-events: none;
  }

  /* Una luz que recorre el marco de metal una sola vez al subir (antes, cuatro destellos de gema que se encendían de a
     uno, cuatro en medio segundo): un degradado cónico que gira, recortado al aro entre el hexágono de fuera y el del
     esmalte. */
  .rb-insignia-nivel-recorrido {
    position: absolute;
    inset: 0;
    clip-path: polygon(evenodd, 50% 17.24%, 89.84% 37.07%, 89.84% 76.72%, 50% 96.55%, 10.16% 76.72%, 10.16% 37.07%, 50% 17.24%,
      50% 24.35%, 17.31% 40.63%, 17.31% 73.17%, 50% 89.44%, 82.69% 73.17%, 82.69% 40.63%, 50% 24.35%);
    opacity: 0;
    pointer-events: none;
  }

  .rb-insignia-nivel-recorrido > span {
    position: absolute;
    left: 50%;
    top: 56.9%;
    width: 170%;
    aspect-ratio: 1;
    translate: -50% -50%;
    background: conic-gradient(from 0deg, transparent 0 76%, rgb(255 236 180 / 0.45) 85%, rgb(255 255 255 / 0.95) 91%, transparent 97%);
  }

  /* Un brillo de metal que cruza el oro del marco cuando el puntero la inclina: se corre con su giro (--rb-brillo-x, del
     script) y se enciende con su luz (--rb-luz). */
  .rb-insignia-nivel-especular {
    position: absolute;
    inset: 0;
    clip-path: polygon(evenodd, 50% 17.24%, 89.84% 37.07%, 89.84% 76.72%, 50% 96.55%, 10.16% 76.72%, 10.16% 37.07%, 50% 17.24%,
      50% 24.35%, 17.31% 40.63%, 17.31% 73.17%, 50% 89.44%, 82.69% 73.17%, 82.69% 40.63%, 50% 24.35%);
    background: linear-gradient(105deg, transparent 41%, rgb(255 250 228 / 0.9) 50%, transparent 59%) var(--rb-brillo-x, 50%) 0 / 300% 100% no-repeat;
    mix-blend-mode: screen;
    opacity: var(--rb-luz, 0);
    pointer-events: none;
  }

  /* --- La barra de la experiencia: mientras se llena, una chispa en su punta y el frente más claro --- */
  .rb-nivel-barra {
    position: relative;
    display: block;
    border-radius: var(--rb-radio-pildora);
    transition: box-shadow 0.35s ease;
  }

  .rb-nivel-chispa {
    position: absolute;
    left: 0;
    top: 50%;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    translate: var(--rb-nivel-x, 0px) 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .rb-nivel-chispa::before,
  .rb-nivel-chispa::after {
    content: "";
    position: absolute;
  }

  .rb-nivel-chispa::before {
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle closest-side, rgb(255 255 255 / 0.95), rgb(226 196 255 / 0.7) 36%, rgb(160 90 255 / 0) 100%);
  }

  .rb-nivel-chispa::after {
    inset: 3px;
    clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
    background: #ffffff;
  }

  .rb-nivel-barra[data-nivel-llenando] .rb-nivel-chispa,
  .rb-nivel-barra[data-nivel-lleno] .rb-nivel-chispa {
    opacity: 1;
    transition-duration: 0.12s;
  }

  .rb-nivel-barra[data-nivel-llenando] .rb-progreso::-webkit-progress-value {
    background:
      linear-gradient(90deg, transparent calc(100% - 28px), rgb(255 255 255 / 0.7)),
      linear-gradient(180deg, rgb(255 255 255 / 0.35), transparent 60%),
      var(--rb-degradado-progreso);
  }

  .rb-nivel-barra[data-nivel-llenando] .rb-progreso::-moz-progress-bar {
    background:
      linear-gradient(90deg, transparent calc(100% - 28px), rgb(255 255 255 / 0.7)),
      linear-gradient(180deg, rgb(255 255 255 / 0.35), transparent 60%),
      var(--rb-degradado-progreso);
  }

  /* Llena: de oro, y brilla; la chispa también. */
  .rb-nivel-barra[data-nivel-lleno] {
    box-shadow: 0 0 0 1px rgb(255 222 140 / 0.85), 0 0 14px rgb(255 196 70 / 0.75), 0 0 34px rgb(255 160 40 / 0.35);
  }

  .rb-nivel-barra[data-nivel-lleno] .rb-progreso::-webkit-progress-value {
    background:
      linear-gradient(180deg, rgb(255 255 255 / 0.5), transparent 60%),
      linear-gradient(90deg, #f29b1d, #ffd56a 62%, #fff4c4);
    box-shadow: 0 0 12px rgb(255 200 80 / 0.8);
  }

  .rb-nivel-barra[data-nivel-lleno] .rb-progreso::-moz-progress-bar {
    background:
      linear-gradient(180deg, rgb(255 255 255 / 0.5), transparent 60%),
      linear-gradient(90deg, #f29b1d, #ffd56a 62%, #fff4c4);
  }

  .rb-nivel-barra[data-nivel-lleno] .rb-nivel-chispa::before {
    background: radial-gradient(circle closest-side, rgb(255 255 255 / 0.95), rgb(255 226 150 / 0.75) 36%, rgb(255 170 40 / 0) 100%);
  }

  /* La luz de la barra llena tiñe de oro todo «Tu progreso». */
  .rb-nivel-aura {
    position: absolute;
    inset: -1px;
    z-index: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgb(255 214 120 / 0.7), 0 0 26px rgb(255 190 60 / 0.4), inset 0 0 40px rgb(255 190 60 / 0.12);
    opacity: 0;
    pointer-events: none;
  }

  /* El brillo que cruza «Cobrar» una vez, cuando la barra termina de llenarse al cargar: hay algo que cobrar. */
  .rb-mision-boton[data-invita]::after {
    animation: rb-nivel-invita 0.9s ease 0.1s both;
  }

  /* Los orbes de luz que van de la misión a la barra. */
  .rb-nivel-orbes {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  /* --- La misión de ejemplo, con su botón «Cobrar» --- */
  .rb-mision-texto {
    display: grid;
    gap: 1px;
    min-width: 0;
  }

  .rb-mision-tipo {
    font-size: var(--rb-t-11);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rb-acento-suave);
  }

  .rb-mision-nombre {
    font-size: var(--rb-t-14);
    line-height: 1.25;
  }

  .rb-mision-premio {
    font-family: var(--rb-letra-titulo);
    font-size: var(--rb-t-13);
    font-weight: 700;
    color: var(--rb-verde);
    font-variant-numeric: tabular-nums;
  }

  .rb-mision-boton {
    min-width: 96px;
    min-height: 44px;
    padding-inline: var(--rb-e-2);
    font-weight: 800;
  }

  .rb-mision-boton[aria-disabled="true"] {
    cursor: default;
  }

  /* En el oro, el foco es crema: el violeta no se lee. */
  .rb-mision-boton.rb-boton-dorado:focus-visible,
  .rb-fiesta-seguir:focus-visible {
    outline-color: #fff4c4;
    outline-offset: 3px;
  }

  .rb-mision-boton .rb-icono {
    width: 18px;
    height: 18px;
  }

  /* Mientras se cobra: verde, con su tilde, y sin el brillo de pasar el ratón. */
  .rb-mision-boton[data-modo="cobrada"] {
    border-color: rgb(140 251 204 / 0.55);
    background: rgb(33 194 107 / 0.16);
    color: var(--rb-verde);
    box-shadow: none;
    filter: none;
  }

  .rb-mision-boton[data-modo="cobrada"]::after {
    display: none;
  }

  .rb-mision-boton[data-modo="cobrada"]::before {
    content: "";
    width: 6px;
    height: 11px;
    margin: -3px 2px 0 0;
    border: solid currentColor;
    border-width: 0 2.5px 2.5px 0;
    rotate: 45deg;
  }

  /* Cobrada: el trofeo, con su sello verde. */
  .rb-mision-icono {
    --rb-sello-cobrada: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10.5' fill='%2321c26b' stroke='%23062a17' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='12' r='8.6' fill='none' stroke='%239dffcf' stroke-width='1' opacity='.6'/%3E%3Cpath d='M7.2 12.4 L10.6 15.6 L16.9 8.6' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    position: relative;
  }

  .rb-mision[data-estado="cobrada"] .rb-mision-icono::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -7px;
    width: 24px;
    height: 24px;
    background: var(--rb-sello-cobrada) center / contain no-repeat;
    filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.5));
    animation: rb-nivel-sello 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  }

  /* «+3.000», junto a la cifra de la barra mientras se llena. */
  .rb-nivel-flotante {
    display: inline-block;
    margin-left: var(--rb-e-2);
    padding: 1px 7px;
    border: 1px solid rgb(140 251 204 / 0.5);
    border-radius: var(--rb-radio-pildora);
    background: rgb(33 194 107 / 0.16);
    font: 700 var(--rb-t-12) / 1.4 var(--rb-letra-titulo);
    white-space: nowrap;
    color: var(--rb-verde);
    text-shadow: 0 0 8px rgb(140 251 204 / 0.6);
    box-shadow: 0 0 12px rgb(140 251 204 / 0.25);
    pointer-events: none;
  }

  /* El golpe de luz donde aterriza la insignia, en el retrato. */
  .rb-nivel-aterrizaje {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    aspect-ratio: 1;
    margin: -23px 0 0 -23px;
    border: 2px solid rgb(255 236 180 / 0.95);
    border-radius: 50%;
    box-shadow: 0 0 16px rgb(255 200 90 / 0.8), inset 0 0 12px rgb(255 200 90 / 0.6);
    opacity: 0;
    pointer-events: none;
  }

  /* --- La celebración: un diálogo nativo a pantalla entera --- */
  .rb-fiesta {
    --rb-insignia-ancho: 212px;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: var(--rb-e-4);
    border: 0;
    overflow: hidden auto;
    overscroll-behavior: contain;
    background: transparent;
    color: var(--rb-texto);
  }

  /* Centrada con márgenes automáticos: si no entra, empieza arriba y se desplaza, sin cortar el principio. */
  .rb-fiesta[open] {
    display: grid;
  }

  /* El precalentado: abierta e inerte, casi transparente (el fondo también), dos cuadros después de la carga, para
     que la primera celebración no pague la primera vez (crear, descifrar los dibujos, pintar sus capas y su fondo). */
  .rb-fiesta[data-fase="preparando"],
  .rb-fiesta[data-fase="preparando"]::backdrop {
    opacity: 0.01;
    pointer-events: none;
  }

  /* Las cartas de los lados, boca abajo: así su dorso también queda pintado antes de la primera vez. */
  .rb-fiesta[data-fase="preparando"] .rb-fiesta-premio:not(:nth-child(2)) .rb-fiesta-premio-carta {
    transform: rotateY(180deg);
  }

  .rb-fiesta::backdrop {
    background:
      radial-gradient(50% 45% at 50% 42%, rgb(98 44 220 / 0.5), transparent 75%),
      radial-gradient(130% 100% at 50% 40%, rgb(10 6 46 / 0.86), rgb(1 3 16 / 0.96));
    backdrop-filter: blur(8px);
  }

  .rb-fiesta[data-entrando]::backdrop {
    animation: rb-fiesta-fondo 0.5s ease both;
  }

  /* Abierta durante el silencio de la barra llena: el fondo espera lo mismo que la coreografía (SILENCIO en
     js/nivel.js). */
  .rb-fiesta[data-entrando="espera"]::backdrop {
    animation-delay: 0.21s;
  }

  /* Al salir, el fondo espera a que se vaya lo de encima: nunca se mezclan los premios con la página. Con su propia
     animación: si fuera la de entrar en reversa, el navegador la tomaría por la misma, ya terminada, y saltaría. */
  .rb-fiesta[data-saliendo]::backdrop {
    animation: rb-fiesta-fondo-sale 0.42s ease 0.12s both;
  }

  /* La luz: los rayos, el halo y el destello, centrados en la insignia. */
  .rb-fiesta-luz {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }

  /* Un cielo de estrellas, como el de Nay, que se acerca un poco al abrir: da profundidad detrás de la luz. */
  .rb-fiesta-cielo {
    --rb-cielo-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='557' height='557'%3E%3Ccircle cx='0.0' cy='512.9' r='0.48' fill='%23fff1cc' opacity='0.43'/%3E%3Ccircle cx='296.7' cy='183.4' r='0.98' fill='%23e3d6ff' opacity='0.75'/%3E%3Ccircle cx='381.3' cy='354.2' r='1.13' fill='%23ffffff' opacity='0.45'/%3E%3Ccircle cx='394.3' cy='388.8' r='0.45' fill='%23e3d6ff' opacity='0.71'/%3E%3Ccircle cx='513.8' cy='449.7' r='0.45' fill='%23cfe9ff' opacity='0.61'/%3E%3Ccircle cx='383.5' cy='358.6' r='0.69' fill='%23cfe9ff' opacity='0.85'/%3E%3Ccircle cx='207.3' cy='186.8' r='1.18' fill='%23ffffff' opacity='0.50'/%3E%3Ccircle cx='165.8' cy='238.7' r='0.48' fill='%23e3d6ff' opacity='0.86'/%3E%3Ccircle cx='406.2' cy='489.0' r='0.45' fill='%23e3d6ff' opacity='0.46'/%3E%3Ccircle cx='283.4' cy='234.7' r='0.46' fill='%23ffffff' opacity='0.85'/%3E%3Ccircle cx='203.6' cy='191.7' r='0.82' fill='%23e3d6ff' opacity='0.85'/%3E%3Ccircle cx='92.2' cy='225.9' r='0.48' fill='%23e3d6ff' opacity='0.52'/%3E%3Ccircle cx='185.2' cy='296.1' r='0.74' fill='%23cfe9ff' opacity='0.44'/%3E%3Ccircle cx='255.0' cy='480.7' r='0.77' fill='%23e3d6ff' opacity='0.68'/%3E%3Ccircle cx='281.3' cy='383.8' r='1.49' fill='%23fff1cc' opacity='0.54'/%3E%3Ccircle cx='139.9' cy='326.9' r='0.50' fill='%23ffffff' opacity='0.50'/%3E%3Ccircle cx='442.7' cy='488.8' r='0.45' fill='%23ffffff' opacity='0.79'/%3E%3Ccircle cx='226.6' cy='85.5' r='0.45' fill='%23ffffff' opacity='0.90'/%3E%3Ccircle cx='352.2' cy='80.3' r='0.57' fill='%23ffffff' opacity='0.66'/%3E%3Ccircle cx='513.5' cy='492.7' r='1.33' fill='%23cfe9ff' opacity='0.83'/%3E%3Ccircle cx='423.9' cy='153.4' r='0.45' fill='%23ffffff' opacity='0.45'/%3E%3Ccircle cx='0.9' cy='343.6' r='0.47' fill='%23e3d6ff' opacity='0.74'/%3E%3Ccircle cx='383.0' cy='132.6' r='1.31' fill='%23ffffff' opacity='0.44'/%3E%3Ccircle cx='498.1' cy='65.9' r='0.60' fill='%23cfe9ff' opacity='0.30'/%3E%3Ccircle cx='354.8' cy='513.6' r='0.45' fill='%23ffffff' opacity='0.84'/%3E%3Ccircle cx='539.6' cy='314.9' r='0.84' fill='%23ffffff' opacity='0.46'/%3E%3Ccircle cx='116.4' cy='314.4' r='0.45' fill='%23fff1cc' opacity='0.76'/%3E%3Ccircle cx='397.7' cy='277.5' r='0.45' fill='%23cfe9ff' opacity='0.37'/%3E%3Ccircle cx='72.8' cy='383.1' r='1.34' fill='%23cfe9ff' opacity='0.32'/%3E%3Ccircle cx='479.8' cy='553.0' r='1.54' fill='%23e3d6ff' opacity='0.76'/%3E%3C/svg%3E");
    --rb-cielo-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='743' height='743'%3E%3Ccircle cx='0.1' cy='370.9' r='0.51' fill='%23ffffff' opacity='0.73'/%3E%3Ccircle cx='119.0' cy='664.1' r='1.36' fill='%23fff1cc' opacity='0.84'/%3E%3Ccircle cx='212.9' cy='645.6' r='1.06' fill='%23ffffff' opacity='0.69'/%3E%3Ccircle cx='47.8' cy='558.6' r='0.45' fill='%23ffffff' opacity='0.47'/%3E%3Ccircle cx='692.6' cy='36.2' r='0.46' fill='%23ffffff' opacity='0.71'/%3E%3Ccircle cx='8.7' cy='555.3' r='0.55' fill='%23ffffff' opacity='0.84'/%3E%3Ccircle cx='220.0' cy='357.9' r='1.65' fill='%23cfe9ff' opacity='0.84'/%3E%3Ccircle cx='175.7' cy='15.0' r='0.51' fill='%23cfe9ff' opacity='0.80'/%3E%3Ccircle cx='515.4' cy='496.7' r='0.94' fill='%23ffffff' opacity='0.49'/%3E%3Ccircle cx='283.1' cy='0.8' r='1.11' fill='%23ffffff' opacity='0.41'/%3E%3Ccircle cx='418.6' cy='57.1' r='0.62' fill='%23cfe9ff' opacity='0.43'/%3E%3Ccircle cx='121.6' cy='181.2' r='0.45' fill='%23ffffff' opacity='0.46'/%3E%3Ccircle cx='140.0' cy='435.3' r='1.11' fill='%23fff1cc' opacity='0.34'/%3E%3Ccircle cx='286.5' cy='42.2' r='0.92' fill='%23e3d6ff' opacity='0.30'/%3E%3Ccircle cx='381.5' cy='221.9' r='0.47' fill='%23ffffff' opacity='0.52'/%3E%3Ccircle cx='612.6' cy='652.8' r='1.53' fill='%23fff1cc' opacity='0.58'/%3E%3Ccircle cx='541.3' cy='283.8' r='0.48' fill='%23e3d6ff' opacity='0.35'/%3E%3Ccircle cx='714.3' cy='734.3' r='1.05' fill='%23cfe9ff' opacity='0.89'/%3E%3Ccircle cx='320.0' cy='609.3' r='0.82' fill='%23ffffff' opacity='0.75'/%3E%3Ccircle cx='54.7' cy='616.3' r='1.66' fill='%23cfe9ff' opacity='0.37'/%3E%3Ccircle cx='155.1' cy='661.6' r='0.57' fill='%23cfe9ff' opacity='0.53'/%3E%3Ccircle cx='640.1' cy='182.6' r='0.76' fill='%23e3d6ff' opacity='0.39'/%3E%3Ccircle cx='112.8' cy='161.6' r='0.64' fill='%23cfe9ff' opacity='0.85'/%3E%3Ccircle cx='742.1' cy='26.4' r='0.45' fill='%23e3d6ff' opacity='0.65'/%3E%3Ccircle cx='541.5' cy='161.4' r='0.45' fill='%23e3d6ff' opacity='0.82'/%3E%3Ccircle cx='361.5' cy='609.3' r='0.67' fill='%23ffffff' opacity='0.56'/%3E%3Ccircle cx='633.6' cy='289.1' r='1.24' fill='%23ffffff' opacity='0.87'/%3E%3Ccircle cx='272.5' cy='367.8' r='1.10' fill='%23ffffff' opacity='0.39'/%3E%3Ccircle cx='157.6' cy='113.5' r='0.68' fill='%23fff1cc' opacity='0.79'/%3E%3Ccircle cx='569.6' cy='516.1' r='0.94' fill='%23ffffff' opacity='0.77'/%3E%3Ccircle cx='606.7' cy='193.8' r='0.53' fill='%23ffffff' opacity='0.78'/%3E%3Ccircle cx='710.4' cy='302.8' r='0.52' fill='%23ffffff' opacity='0.79'/%3E%3Ccircle cx='526.8' cy='38.8' r='0.53' fill='%23e3d6ff' opacity='0.82'/%3E%3Ccircle cx='97.9' cy='76.9' r='0.88' fill='%23fff1cc' opacity='0.30'/%3E%3Ccircle cx='366.0' cy='614.7' r='0.98' fill='%23ffffff' opacity='0.35'/%3E%3Ccircle cx='699.5' cy='600.4' r='0.68' fill='%23fff1cc' opacity='0.83'/%3E%3Ccircle cx='476.2' cy='441.1' r='0.51' fill='%23ffffff' opacity='0.72'/%3E%3Ccircle cx='66.7' cy='677.8' r='0.47' fill='%23ffffff' opacity='0.75'/%3E%3Ccircle cx='708.8' cy='455.6' r='0.53' fill='%23ffffff' opacity='0.62'/%3E%3Ccircle cx='581.5' cy='56.5' r='0.45' fill='%23fff1cc' opacity='0.51'/%3E%3C/svg%3E");
    position: absolute;
    inset: 0;
    transform-origin: var(--rb-fiesta-x, 50%) var(--rb-fiesta-y, 42%);
    background:
      var(--rb-cielo-a) 0 0 / 557px 557px,
      var(--rb-cielo-b) 211px 97px / 743px 743px;
    -webkit-mask-image: radial-gradient(closest-side at var(--rb-fiesta-x, 50%) var(--rb-fiesta-y, 42%), transparent 18%, #000 62%);
    mask-image: radial-gradient(closest-side at var(--rb-fiesta-x, 50%) var(--rb-fiesta-y, 42%), transparent 18%, #000 62%);
    opacity: 0.7;
    /* Lo más lejos: con el puntero, se corre al revés, 8 px (--rb-px y --rb-py, de -1 a 1, del script). */
    translate: calc(var(--rb-px, 0) * -8px) calc(var(--rb-py, 0) * -8px);
    will-change: transform;
  }

  .rb-fiesta-rayos,
  .rb-fiesta-halo,
  .rb-fiesta-destello {
    position: absolute;
    left: var(--rb-fiesta-x, 50%);
    top: var(--rb-fiesta-y, 42%);
    translate: -50% -50%;
    border-radius: 50%;
  }

  /* A la medida de la pantalla (no más grandes de lo que se ve): menos memoria en el teléfono. */
  .rb-fiesta-rayos {
    width: min(1600px, 150vmax);
    aspect-ratio: 1;
    translate: calc(-50% + var(--rb-px, 0) * -4px) calc(-50% + var(--rb-py, 0) * -4px);
    will-change: transform;
    background: repeating-conic-gradient(from 0deg, rgb(255 214 120 / 0) 0deg, rgb(255 214 120 / 0.2) 3.5deg, rgb(255 214 120 / 0) 7deg, transparent 7deg 15deg);
    -webkit-mask-image: radial-gradient(circle closest-side, #000 0 8%, rgb(0 0 0 / 0.5) 30%, transparent 62%);
    mask-image: radial-gradient(circle closest-side, #000 0 8%, rgb(0 0 0 / 0.5) 30%, transparent 62%);
  }

  .rb-fiesta-rayos-violeta {
    background: repeating-conic-gradient(from 7.5deg, rgb(190 120 255 / 0) 0deg, rgb(190 120 255 / 0.16) 2deg, rgb(190 120 255 / 0) 4deg, transparent 4deg 15deg);
  }

  /* Con «reducir movimiento», sin rayos: queda la luz suave del halo. */
  @media (prefers-reduced-motion: reduce) {
    .rb-fiesta-rayos {
      display: none;
    }
  }

  .rb-fiesta-halo {
    width: 560px;
    height: 560px;
    background: radial-gradient(circle closest-side, rgb(255 216 130 / 0.5), rgb(166 85 255 / 0.26) 46%, transparent 76%);
  }

  .rb-fiesta-destello {
    width: min(1200px, 130vmax);
    aspect-ratio: 1;
    background: radial-gradient(circle closest-side, rgb(255 249 228 / 0.92), rgb(255 214 130 / 0.42) 26%, rgb(166 85 255 / 0.14) 52%, transparent 72%);
    opacity: 0;
  }

  .rb-fiesta-confeti {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  .rb-fiesta-contenido {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: var(--rb-e-3);
    width: min(600px, 100%);
    margin: auto;
    text-align: center;
    /* Lo más cerca: con el puntero, se corre a su favor, 3 px. */
    translate: calc(var(--rb-px, 0) * 3px) calc(var(--rb-py, 0) * 3px);
  }

  /* Con ratón, en su propia capa: correrla con el puntero no vuelve a pintar el título y sus sombras. */
  @media (hover: hover) and (pointer: fine) {
    .rb-fiesta-contenido {
      will-change: transform;
    }
  }

  .rb-fiesta-ante {
    font-family: var(--rb-letra-mano);
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: #eadfff;
    text-shadow: 0 0 18px rgb(166 85 255 / 0.75);
    rotate: -3deg;
  }

  .rb-fiesta-escena {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--rb-insignia-ancho);
    aspect-ratio: 200 / 232;
    margin: var(--rb-e-1) 0 var(--rb-e-2);
    perspective: 900px;
  }

  /* Las ondas que se abren desde la insignia: al llegar y al subir. */
  .rb-fiesta-onda {
    position: absolute;
    left: 50%;
    top: 57%;
    width: 118%;
    aspect-ratio: 1;
    translate: -50% -50%;
    border: 3px solid rgb(255 238 190 / 0.95);
    border-radius: 50%;
    box-shadow: 0 0 26px rgb(255 200 90 / 0.75), inset 0 0 26px rgb(255 200 90 / 0.5);
    opacity: 0;
    pointer-events: none;
  }

  .rb-fiesta-onda-violeta {
    border-color: rgb(214 176 255 / 0.9);
    box-shadow: 0 0 26px rgb(166 85 255 / 0.8), inset 0 0 20px rgb(166 85 255 / 0.5);
  }

  /* La carga: chispas que llegan a la insignia antes de que gire su número, con la punta clara delante (el script
     las pone en su ángulo). */
  .rb-fiesta-carga {
    position: absolute;
    left: 50%;
    top: 57%;
    width: 0;
    height: 0;
    pointer-events: none;
  }

  .rb-fiesta-carga > span {
    position: absolute;
    left: -13px;
    top: -2px;
    width: 26px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ffffff, #fff1bf 30%, rgb(255 205 95 / 0.55) 65%, rgb(255 205 95 / 0));
    box-shadow: -4px 0 8px rgb(255 213 106 / 0.7);
    opacity: 0;
  }

  /* Las estrellas de cuatro puntas, como las de Nay, que brillan una vez alrededor. */
  .rb-fiesta-estrellas {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .rb-fiesta-estrellas > span {
    position: absolute;
    width: 24px;
    aspect-ratio: 1;
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
    background: radial-gradient(circle, #ffffff 0 20%, #ffe7a0 45%, #ffb52e);
    opacity: 0;
  }

  .rb-fiesta-estrellas > span:nth-child(1) { left: -26%; top: 14%; }
  .rb-fiesta-estrellas > span:nth-child(2) { right: -30%; top: 26%; width: 30px; }
  .rb-fiesta-estrellas > span:nth-child(3) { left: -18%; top: 74%; width: 16px; }
  .rb-fiesta-estrellas > span:nth-child(4) { right: -20%; top: 80%; width: 20px; }
  .rb-fiesta-estrellas > span:nth-child(5) { left: 8%; top: -8%; width: 14px; background: radial-gradient(circle, #ffffff 0 25%, #e2ccff 55%, #a655ff); }
  .rb-fiesta-estrellas > span:nth-child(6) { right: 4%; top: -4%; width: 18px; background: radial-gradient(circle, #ffffff 0 25%, #c9f1ff 55%, #3fb8ff); }

  /* Mientras la insignia vuela, lo demás espera su momento. */
  .rb-fiesta[data-fase="vuelo"] .rb-fiesta-ante,
  .rb-fiesta[data-fase="vuelo"] .rb-fiesta-titulo,
  .rb-fiesta[data-fase="vuelo"] .rb-fiesta-sub,
  .rb-fiesta[data-fase="vuelo"] .rb-fiesta-premio {
    opacity: 0;
  }

  .rb-fiesta-titulo {
    padding: 0 0.16em;
    font-family: var(--rb-letra-titular);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-style: italic;
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    background:
      linear-gradient(100deg, transparent 42%, rgb(255 255 255 / 0.95) 50%, transparent 58%) -150% 0 / 250% 100% no-repeat,
      linear-gradient(180deg, #fffaf0 8%, #ffe08a 48%, #f4a62a 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 3px 0 #3a1478) drop-shadow(0 0 22px rgb(255 190 70 / 0.4));
  }

  .rb-fiesta-sub {
    font-size: var(--rb-t-14);
    color: var(--rb-texto-suave);
  }

  .rb-fiesta-premios {
    display: flex;
    justify-content: center;
    gap: var(--rb-e-3);
    margin-top: var(--rb-e-1);
    perspective: 700px;
  }

  /* Cada premio es una carta de 132 × 172 que llega boca abajo y se da vuelta (js/nivel.js): su cara, su dorso con la
     estrella de MacroReborn y, entre los dos, su canto, del color de su rareza (de oro, el de la legendaria). El li es
     su sitio; la carta, lo que gira. */
  .rb-fiesta-premio {
    --rb-rareza: var(--rb-rareza-legendaria);
    --rb-premio-dorso: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 172'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='.12' y1='0' x2='.88' y2='1'%3E%3Cstop offset='0' stop-color='%23fff8d6'/%3E%3Cstop offset='.26' stop-color='%23ffd862'/%3E%3Cstop offset='.55' stop-color='%23f2a92a'/%3E%3Cstop offset='.8' stop-color='%23b26a10'/%3E%3Cstop offset='1' stop-color='%236a3805'/%3E%3C/linearGradient%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%23ffd56a' stop-opacity='.5'/%3E%3Cstop offset='1' stop-color='%23ffd56a' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M66 86 L186.0 86.0 L185.7 94.4 ZM66 86 L181.9 117.1 L179.5 125.1 ZM66 86 L169.9 146.0 L165.5 153.1 ZM66 86 L150.9 170.9 L144.7 176.6 ZM66 86 L126.0 189.9 L118.6 193.9 ZM66 86 L97.1 201.9 L88.9 203.8 ZM66 86 L66.0 206.0 L57.6 205.7 ZM66 86 L34.9 201.9 L26.9 199.5 ZM66 86 L6.0 189.9 L-1.1 185.5 ZM66 86 L-18.9 170.9 L-24.6 164.7 ZM66 86 L-37.9 146.0 L-41.9 138.6 ZM66 86 L-49.9 117.1 L-51.8 108.9 ZM66 86 L-54.0 86.0 L-53.7 77.6 ZM66 86 L-49.9 54.9 L-47.5 46.9 ZM66 86 L-37.9 26.0 L-33.5 18.9 ZM66 86 L-18.9 1.1 L-12.7 -4.6 ZM66 86 L6.0 -17.9 L13.4 -21.9 ZM66 86 L34.9 -29.9 L43.1 -31.8 ZM66 86 L66.0 -34.0 L74.4 -33.7 ZM66 86 L97.1 -29.9 L105.1 -27.5 ZM66 86 L126.0 -17.9 L133.1 -13.5 ZM66 86 L150.9 1.1 L156.6 7.3 ZM66 86 L169.9 26.0 L173.9 33.4 ZM66 86 L181.9 54.9 L183.8 63.1 Z' fill='%23ffd56a' opacity='.07'/%3E%3Ccircle cx='66' cy='86' r='17' fill='none' stroke='%23ffd56a' stroke-width='1' opacity='0.36'/%3E%3Ccircle cx='66' cy='86' r='28' fill='none' stroke='%23ffd56a' stroke-width='1' opacity='0.31'/%3E%3Ccircle cx='66' cy='86' r='39' fill='none' stroke='%23ffd56a' stroke-width='1' opacity='0.26'/%3E%3Ccircle cx='66' cy='86' r='50' fill='none' stroke='%23ffd56a' stroke-width='1' opacity='0.21'/%3E%3Ccircle cx='66' cy='86' r='61' fill='none' stroke='%23ffd56a' stroke-width='1' opacity='0.16'/%3E%3Ccircle cx='66' cy='86' r='72' fill='none' stroke='%23ffd56a' stroke-width='1' opacity='0.11'/%3E%3Ccircle cx='66' cy='86' r='44' fill='url%28%23g%29'/%3E%3Cpath d='M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z' transform='translate%2819.2 28.4%29 scale%280.4%29' fill='url%28%23a%29' stroke='%234c2803' stroke-width='3.5' stroke-linejoin='round'/%3E%3Cpath d='M16 16 Q16.64 19.36 20 20 Q16.64 20.64 16 24 Q15.36 20.64 12 20 Q15.36 19.36 16 16 Z' fill='%23ffffff' opacity='.7'/%3E%3Cpath d='M116 16 Q116.64 19.36 120 20 Q116.64 20.64 116 24 Q115.36 20.64 112 20 Q115.36 19.36 116 16 Z' fill='%23ffffff' opacity='.7'/%3E%3Cpath d='M16 148 Q16.64 151.36 20 152 Q16.64 152.64 16 156 Q15.36 152.64 12 152 Q15.36 151.36 16 148 Z' fill='%23ffffff' opacity='.7'/%3E%3Cpath d='M116 148 Q116.64 151.36 120 152 Q116.64 152.64 116 156 Q115.36 152.64 112 152 Q115.36 151.36 116 148 Z' fill='%23ffffff' opacity='.7'/%3E%3C/svg%3E");
    position: relative;
    width: 132px;
    height: 172px;
    perspective: 800px;
  }

  .rb-fiesta-premio-carta {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
  }

  .rb-fiesta-premio-cara,
  .rb-fiesta-premio-dorso,
  .rb-fiesta-premio-canto {
    position: absolute;
    inset: 0;
    border-radius: 14px;
  }

  .rb-fiesta-premio-cara {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 6px;
    padding: var(--rb-e-3) var(--rb-e-2);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--rb-rareza) 70%, transparent);
    background:
      radial-gradient(100% 70% at 50% 0%, color-mix(in srgb, var(--rb-rareza) 40%, transparent), transparent 78%),
      repeating-linear-gradient(135deg, rgb(255 255 255 / 0.025) 0 2px, transparent 2px 9px),
      linear-gradient(180deg, #1d1366, #0b0b3a);
    box-shadow: 0 12px 26px rgb(0 0 0 / 0.45), 0 0 20px color-mix(in srgb, var(--rb-rareza) 34%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.14);
    transform: translateZ(1.5px);
    backface-visibility: hidden;
  }

  /* El dorso: la estrella de oro sobre la noche, con un borde de metal y una línea por dentro. */
  .rb-fiesta-premio-dorso {
    border: 3px solid transparent;
    background:
      var(--rb-premio-dorso) center / cover no-repeat padding-box,
      radial-gradient(80% 60% at 50% 50%, #3b228f, #160c52 62%, #0a0b33) padding-box,
      conic-gradient(from 210deg, #fff1b5, #f0a92e, #8a4f08, #f0a92e, #fff1b5) border-box;
    box-shadow: 0 12px 26px rgb(0 0 0 / 0.45);
    transform: rotateY(180deg) translateZ(1.5px);
    backface-visibility: hidden;
  }

  .rb-fiesta-premio-dorso::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgb(255 214 120 / 0.4);
    border-radius: 9px;
  }

  /* El canto: dos capas entre la cara y el dorso, que se ven al pasar de perfil. */
  .rb-fiesta-premio-canto {
    background: color-mix(in srgb, var(--rb-rareza) 82%, #2a1404);
  }

  .rb-fiesta-premio-canto:nth-child(1) { transform: translateZ(0.5px); }
  .rb-fiesta-premio-canto:nth-child(2) { transform: translateZ(-0.5px); }

  /* El aura de oro de la legendaria, cuando se da vuelta (y se queda a media luz). */
  .rb-fiesta-premio-aura {
    position: absolute;
    inset: -5px;
    border: 2px solid rgb(255 226 150 / 0.95);
    border-radius: 18px;
    box-shadow: 0 0 22px rgb(255 190 70 / 0.75), inset 0 0 14px rgb(255 190 70 / 0.45);
    opacity: 0;
    pointer-events: none;
  }

  /* Con «reducir movimiento», ya en su estado final. */
  @media (prefers-reduced-motion: reduce) {
    .rb-fiesta-premio-aura {
      opacity: 0.55;
    }
  }

  /* La franja de su rareza, arriba, como en las cartas de colección. */
  .rb-fiesta-premio-cara::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--rb-rareza);
    box-shadow: 0 0 12px var(--rb-rareza);
  }

  /* El brillo que la cruza una vez, cuando se asienta. */
  .rb-fiesta-premio-brillo {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 0.28) 50%, transparent 65%) -120% 0 / 260% 100% no-repeat;
    opacity: 0;
    pointer-events: none;
  }

  .rb-fiesta-premio[data-rareza="epica"] { --rb-rareza: var(--rb-rareza-epica); }
  .rb-fiesta-premio[data-rareza="rara"] { --rb-rareza: var(--rb-rareza-rara); }

  .rb-fiesta-premio-icono {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 32%, color-mix(in srgb, var(--rb-rareza) 70%, #ffffff), color-mix(in srgb, var(--rb-rareza) 45%, #120a3c) 72%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--rb-rareza) 55%, transparent), inset 0 -3px 6px rgb(0 0 0 / 0.3);
    color: #ffffff;
  }

  .rb-fiesta-premio-icono .rb-icono {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.4));
  }

  /* El marco «Aurora»: el retrato de quien sube, dentro de su aro nuevo. */
  .rb-fiesta-premio-retrato {
    padding: 3px;
    background: conic-gradient(from 200deg, #6fd6ff, #a655ff, #ff6fa8, #ffd56a, #8cfbcc, #6fd6ff);
  }

  .rb-fiesta-premio-retrato img {
    width: 100%;
    height: 100%;
    border: 2px solid #120a3c;
    border-radius: 50%;
    object-fit: cover;
  }

  /* El nombre, en una caja de dos líneas: con una o con dos, «DE EJEMPLO» queda a la misma altura en las tres. */
  .rb-fiesta-premio strong {
    display: grid;
    align-items: center;
    min-height: 2.4em;
    font-size: var(--rb-t-13);
    line-height: 1.2;
  }

  /* La del centro, encima: las de los lados salen de detrás de ella. */
  .rb-fiesta-premio {
    z-index: 1;
  }

  .rb-fiesta-premio:nth-child(2) {
    z-index: 2;
  }

  /* Las monedas: un dibujo propio, de oro, sobre la noche (el icono blanco sobre oro parecía una pastilla). */
  .rb-fiesta-premio-monedas {
    --rb-premio-monedas: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='ca' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%238a4f08'/%3E%3Cstop offset='.35' stop-color='%23f0a92a'/%3E%3Cstop offset='.6' stop-color='%23ffd25a'/%3E%3Cstop offset='1' stop-color='%238a4f08'/%3E%3C/linearGradient%3E%3CradialGradient id='cb' cx='.4' cy='.35' r='.8'%3E%3Cstop offset='0' stop-color='%23fff6cf'/%3E%3Cstop offset='.5' stop-color='%23ffd04f'/%3E%3Cstop offset='1' stop-color='%23d4890f'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M13 43 v6 a20 7 0 0 0 40 0 v-6 Z' fill='url%28%23ca%29' stroke='%235a3204' stroke-width='1.2'/%3E%3Cpath d='M16 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M20 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M24 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M28 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M32 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M36 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M40 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M44 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M48 44.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cellipse cx='33' cy='43' rx='20' ry='7' fill='url%28%23cb%29' stroke='%237a4206' stroke-width='1.2'/%3E%3Cellipse cx='33' cy='43' rx='15' ry='4.8' fill='none' stroke='%23fff4c4' stroke-width='1' opacity='.55'/%3E%3Cpath d='M10 33 v6 a20 7 0 0 0 40 0 v-6 Z' fill='url%28%23ca%29' stroke='%235a3204' stroke-width='1.2'/%3E%3Cpath d='M13 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M17 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M21 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M25 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M29 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M33 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M37 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M41 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M45 34.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cellipse cx='30' cy='33' rx='20' ry='7' fill='url%28%23cb%29' stroke='%237a4206' stroke-width='1.2'/%3E%3Cellipse cx='30' cy='33' rx='15' ry='4.8' fill='none' stroke='%23fff4c4' stroke-width='1' opacity='.55'/%3E%3Cpath d='M13 23 v6 a20 7 0 0 0 40 0 v-6 Z' fill='url%28%23ca%29' stroke='%235a3204' stroke-width='1.2'/%3E%3Cpath d='M16 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M20 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M24 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M28 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M32 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M36 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M40 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M44 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cpath d='M48 24.6 v5.2' stroke='%237a4206' stroke-width='1' opacity='.5'/%3E%3Cellipse cx='33' cy='23' rx='20' ry='7' fill='url%28%23cb%29' stroke='%237a4206' stroke-width='1.2'/%3E%3Cellipse cx='33' cy='23' rx='15' ry='4.8' fill='none' stroke='%23fff4c4' stroke-width='1' opacity='.55'/%3E%3Cpath d='M33 16.5 Q34.04 21.96 39.5 23 Q34.04 24.04 33 29.5 Q31.96 24.04 26.5 23 Q31.96 21.96 33 16.5 Z' fill='%23b8700f' transform='translate%2833 23%29 scale%281 .38%29 translate%28-33 -23%29'/%3E%3Cpath d='M14 18 l2 -1 l1 -2 l1 2 l2 1 l-2 1 l-1 2 l-1 -2 Z' fill='%23ffffff' opacity='.9'/%3E%3C/svg%3E");
    background:
      var(--rb-premio-monedas) center 54% / 76% no-repeat,
      radial-gradient(circle at 40% 32%, #2b1b6c, #120a3c 72%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--rb-rareza) 55%, transparent), inset 0 0 0 2px rgb(255 214 120 / 0.55);
  }

  .rb-fiesta-premio-ejemplo {
    font-size: var(--rb-t-11);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rb-texto-apagado);
  }

  .rb-fiesta-seguir {
    min-width: 200px;
    margin-top: var(--rb-e-2);
  }

  /* En el teléfono, todo un poco más chico. */
  @media (max-width: 480px) {
    .rb-fiesta {
      --rb-insignia-ancho: 150px;
    }

    .rb-fiesta-ante {
      font-size: 26px;
    }

    .rb-fiesta-premios {
      gap: var(--rb-e-2);
    }

    .rb-fiesta-premio {
      width: 100px;
      height: 140px;
    }

    .rb-fiesta-premio-cara {
      padding: var(--rb-e-2) var(--rb-e-1);
    }

    .rb-fiesta-premio-icono {
      width: 42px;
      height: 42px;
    }
  }

  /* Y en pantallas bajas, más junto, para que entre entero. */
  @media (max-height: 680px) {
    .rb-fiesta {
      --rb-insignia-ancho: 124px;
    }

    .rb-fiesta-contenido {
      gap: var(--rb-e-2);
    }

    .rb-fiesta-ante {
      font-size: 22px;
    }

    .rb-fiesta-titulo {
      font-size: clamp(1.4rem, 3.4vw, 2.2rem);
    }

    .rb-fiesta-premio {
      width: 100px;
      height: 132px;
    }

    .rb-fiesta-premio-cara {
      gap: 3px;
      padding: var(--rb-e-2) var(--rb-e-1);
    }

    .rb-fiesta-premio-icono {
      width: 36px;
      height: 36px;
    }

    .rb-fiesta-seguir {
      min-height: 44px;
      margin-top: 0;
    }
  }

  /* En un teléfono de costado: la insignia a la izquierda y lo demás a su derecha, el grupo centrado (antes, la
     insignia quedaba pegada al borde, con un hueco hasta el texto, y la luz alumbraba solo ese lado). */
  @media (max-height: 480px) and (min-width: 600px) {
    .rb-fiesta {
      --rb-insignia-ancho: 150px;
    }

    .rb-fiesta-contenido {
      grid-template-columns: auto auto;
      justify-content: center;
      align-items: center;
      gap: var(--rb-e-2) var(--rb-e-5);
      width: auto;
      max-width: 100%;
    }

    .rb-fiesta-escena {
      grid-column: 1;
      grid-row: 1 / span 5;
      margin: 0;
    }

    .rb-fiesta-contenido > :not(.rb-fiesta-escena) {
      grid-column: 2;
    }

    .rb-fiesta-ante {
      font-size: 22px;
    }

    .rb-fiesta-titulo {
      font-size: 1.6rem;
    }

    .rb-fiesta-premio {
      width: 100px;
      height: 132px;
    }
  }

  @keyframes rb-fiesta-fondo {
    from {
      opacity: 0;
    }
  }

  @keyframes rb-fiesta-fondo-sale {
    to {
      opacity: 0;
    }
  }

  @keyframes rb-nivel-invita {
    from {
      transform: translateX(-160%) skewX(-20deg);
    }
    to {
      transform: translateX(320%) skewX(-20deg);
    }
  }

  @keyframes rb-nivel-sello {
    from {
      opacity: 0;
      transform: scale(2.2) rotate(-25deg);
    }
    60% {
      opacity: 1;
      transform: scale(0.88) rotate(4deg);
    }
    to {
      transform: none;
    }
  }
}

@layer rb-pantallas {
  /* --- En la portada: la insignia chica, abajo a la izquierda del retrato de «Tu progreso» --- */
  .rb-progreso-panel .rb-insignia-nivel-chica {
    position: absolute;
    left: -7px;
    bottom: -6px;
    z-index: 1;
  }

  .rb-progreso-panel .rb-insignia-nivel-chica[data-nivel-fuera] {
    visibility: hidden;
  }

  .rb-progreso-panel .rb-nivel-numero {
    display: inline-block;
  }

  /* «+3.000» flota a la derecha de la línea del nivel, sobre la punta de la barra: no empuja nada. */
  .rb-progreso-panel .rb-nivel-linea {
    position: relative;
  }

  .rb-progreso-panel .rb-nivel-linea .rb-nivel-flotante {
    position: absolute;
    right: 0;
    top: 50%;
    margin: -11px 0 0;
  }

  .rb-progreso-panel .rb-nivel-barra {
    margin: var(--rb-e-2) 0 2px;
  }

  .rb-progreso-panel .rb-nivel-barra .rb-progreso {
    margin: 0;
  }

  /* La misión: el trofeo, sus datos y «Cobrar» en una fila; si la tarjeta es muy estrecha (de 768 a 1199, con la
     lateral en tres columnas), el botón baja a su propia línea, a lo ancho. Su ancho es el mismo en sus tres estados:
     la tarjeta no salta al cobrar. */
  .rb-progreso-panel .rb-mision {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--rb-e-2) 10px;
    padding: var(--rb-e-2);
  }

  .rb-progreso-panel .rb-mision-icono {
    width: 44px;
    height: 44px;
  }

  .rb-progreso-panel .rb-mision-texto {
    flex: 100 1 112px;
  }

  .rb-progreso-panel .rb-mision-boton {
    flex: 1 0 96px;
  }

  /* Sin JavaScript no se cobra: el botón no se ofrece. */
  @media (scripting: none) {
    .rb-progreso-panel .rb-mision-boton {
      display: none;
    }
  }
}
