/* ==========================================================================
   LA INSIGNIA DEL NIVEL — css/insignia-nivel.css
   ==========================================================================
   Un hexágono de metal con su corona y sus gemas, dibujado aquí
   (prototipo/css/ideas/nivel.css, specs/099-ideas-una-por-una, research D7):
   la cara, con su número. La usan «Tu progreso» de la portada y los perfiles.
   La grande de la celebración, que gira, con su dorso y su canto, está en
   css/nivel.css.
   ========================================================================== */

@layer rb-piezas {
  /* --- La insignia del nivel: el dibujo, a cualquier tamaño (--rb-insignia-ancho) --- */
  .rb-insignia-nivel {
    --rb-insignia-cara: 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%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%23e%29'/%3E%3Cg clip-path='url%28%23k%29'%3E%3Cpath d='M100 132 L210.0 132.0 L209.1 146.3 ZM100 132 L206.3 160.5 L201.7 174.0 ZM100 132 L195.3 187.0 L187.3 198.9 ZM100 132 L177.8 209.8 L167.0 219.2 ZM100 132 L155.0 227.3 L142.2 233.6 ZM100 132 L128.5 238.3 L114.5 241.0 ZM100 132 L100.0 242.0 L85.7 241.1 ZM100 132 L71.5 238.3 L58.0 233.7 ZM100 132 L45.0 227.3 L33.1 219.3 ZM100 132 L22.2 209.8 L12.8 199.0 ZM100 132 L4.7 187.0 L-1.6 174.2 ZM100 132 L-6.3 160.5 L-9.0 146.5 ZM100 132 L-10.0 132.0 L-9.1 117.7 ZM100 132 L-6.3 103.5 L-1.7 90.0 ZM100 132 L4.7 77.0 L12.7 65.1 ZM100 132 L22.2 54.2 L33.0 44.8 ZM100 132 L45.0 36.7 L57.8 30.4 ZM100 132 L71.5 25.7 L85.5 23.0 ZM100 132 L100.0 22.0 L114.3 22.9 ZM100 132 L128.5 25.7 L142.0 30.3 ZM100 132 L155.0 36.7 L166.9 44.7 ZM100 132 L177.8 54.2 L187.2 65.0 ZM100 132 L195.3 77.0 L201.6 89.8 ZM100 132 L206.3 103.5 L209.0 117.5 Z' fill='%23ffffff' opacity='.06'/%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%3Cpath d='M30 97 L100 56 L170 97 L170 108 C134 97 70 99 30 120 Z' fill='url%28%23v%29'/%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='%2314073f' 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.3' opacity='.5'/%3E%3Cpath d='M52 146 Q52.96 151.04 58 152 Q52.96 152.96 52 158 Q51.04 152.96 46 152 Q51.04 151.04 52 146 Z' fill='%23ffffff' opacity='.85'/%3E%3Cpath d='M150 103 Q150.8 107.2 155 108 Q150.8 108.8 150 113 Q149.2 108.8 145 108 Q149.2 107.2 150 103 Z' fill='%23ffffff' opacity='.8'/%3E%3Cpath d='M66 179.5 Q66.56 182.44 69.5 183 Q66.56 183.56 66 186.5 Q65.44 183.56 62.5 183 Q65.44 182.44 66 179.5 Z' fill='%23e6d4ff' opacity='.75'/%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");
    position: relative;
    display: block;
    width: var(--rb-insignia-ancho, 184px);
    aspect-ratio: 200 / 232;
  }

  .rb-insignia-nivel-cara {
    position: absolute;
    inset: 0;
    background: var(--rb-insignia-cara) center / 100% 100% no-repeat;
  }

  .rb-insignia-nivel-numero {
    position: absolute;
    left: 50%;
    top: 57%;
    display: flex;
    translate: -50% -50%;
    font-family: var(--rb-letra-titulo);
    font-size: calc(var(--rb-insignia-ancho, 184px) * 0.3);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #fff6dc;
    filter: drop-shadow(0 2px 0 #1a0758) drop-shadow(0 0 9px rgb(190 140 255 / 0.7));
  }

  .rb-insignia-nivel-etiqueta {
    position: absolute;
    left: 50%;
    top: 38.5%;
    translate: -50% -50%;
    padding-left: 0.3em;
    font: 700 calc(var(--rb-insignia-ancho, 184px) * 0.062) / 1 var(--rb-letra-titulo);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ffe39a;
    text-shadow: 0 1px 0 #1a0758;
  }

  /* La chica, en el retrato de «Tu progreso»: solo su cara y su número. */
  .rb-insignia-nivel-chica {
    --rb-insignia-ancho: 32px;
  }

  .rb-insignia-nivel-chica .rb-insignia-nivel-numero {
    font-size: 10.5px;
    letter-spacing: -0.04em;
    filter: none;
    text-shadow: 0 1px 0 #12063f, 0 0 3px #12063f;
  }
}
